From 350d3ad386fca7cb3dae994603f487c392f05820 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 1 Jun 2022 19:49:26 +0200 Subject: [PATCH] cellAudioOut: fix AC3/DTS mixup --- rpcs3/Emu/Cell/Modules/cellAudioOut.cpp | 28 ++++++++++++------------- rpcs3/Emu/system_config_types.cpp | 2 +- rpcs3/Emu/system_config_types.h | 2 +- rpcs3/rpcs3qt/emu_settings.cpp | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp b/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp index a118ff62aa..41d43c6a3a 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp @@ -47,14 +47,14 @@ audio_out_configuration::audio_out_configuration() const bool supports_lpcm_2 = (sound_format & (1 << 0)); // Linear PCM 2 Ch. const bool supports_lpcm_5_1 = (sound_format & (1 << 2)); // Linear PCM 5.1 Ch. const bool supports_lpcm_7_1 = (sound_format & (1 << 4)); // Linear PCM 7.1 Ch. - const bool supports_dts = (sound_format & (1 << 8)); // DTS 5.1 Ch. - const bool supports_ac3 = (sound_format & (1 << 9)); // Dolby Digital 5.1 Ch. + const bool supports_ac3 = (sound_format & (1 << 8)); // Dolby Digital 5.1 Ch. + const bool supports_dts = (sound_format & (1 << 9)); // DTS 5.1 Ch. if (supports_lpcm_2) cellSysutil.notice("cellAudioOut: found support for Linear PCM 2 Ch."); if (supports_lpcm_5_1) cellSysutil.notice("cellAudioOut: found support for Linear PCM 5.1 Ch."); if (supports_lpcm_7_1) cellSysutil.notice("cellAudioOut: found support for Linear PCM 7.1 Ch."); - if (supports_dts) cellSysutil.notice("cellAudioOut: found support for DTS 5.1 Ch."); if (supports_ac3) cellSysutil.notice("cellAudioOut: found support for Dolby Digital 5.1 Ch."); + if (supports_dts) cellSysutil.notice("cellAudioOut: found support for DTS 5.1 Ch."); const auto add_sound_mode = [](std::vector& sound_modes, u8 type, u8 channel, u8 fs, u32 layout) { @@ -102,16 +102,16 @@ audio_out_configuration::audio_out_configuration() add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_LPCM, CELL_AUDIO_OUT_CHNUM_8, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy); } - if (supports_dts) // DTS 5.1 Ch. - { - add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr); - } - if (supports_ac3) // Dolby Digital 5.1 Ch. { add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_AC3, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr); } + if (supports_dts) // DTS 5.1 Ch. + { + add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr); + } + break; } case audio_format::lpcm_2_48khz: // Linear PCM 2 Ch. 48 kHz @@ -131,18 +131,18 @@ audio_out_configuration::audio_out_configuration() add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_LPCM, CELL_AUDIO_OUT_CHNUM_8, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy); break; } - case audio_format::dts: // DTS 5.1 Ch. - { - add_fallback = !supports_dts; - add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr); - break; - } case audio_format::ac3: // Dolby Digital 5.1 Ch. { add_fallback = !supports_ac3; add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_AC3, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr); break; } + case audio_format::dts: // DTS 5.1 Ch. + { + add_fallback = !supports_dts; + add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr); + break; + } } // Fallback to default sound mode if none was found diff --git a/rpcs3/Emu/system_config_types.cpp b/rpcs3/Emu/system_config_types.cpp index 9f93ad820f..14efc82c5b 100644 --- a/rpcs3/Emu/system_config_types.cpp +++ b/rpcs3/Emu/system_config_types.cpp @@ -542,8 +542,8 @@ void fmt_class_string::format(std::string& out, u64 arg) case audio_format::lpcm_2_48khz: return "Linear PCM 2 Ch. 48 kHz"; case audio_format::lpcm_5_1_48khz: return "Linear PCM 5.1 Ch. 48 kHz"; case audio_format::lpcm_7_1_48khz: return "Linear PCM 7.1 Ch. 48 kHz"; - case audio_format::dts: return "DTS 5.1 Ch."; case audio_format::ac3: return "Dolby Digital 5.1 Ch."; + case audio_format::dts: return "DTS 5.1 Ch."; } return unknown; diff --git a/rpcs3/Emu/system_config_types.h b/rpcs3/Emu/system_config_types.h index bb2d20bd14..6a4eff238d 100644 --- a/rpcs3/Emu/system_config_types.h +++ b/rpcs3/Emu/system_config_types.h @@ -81,8 +81,8 @@ enum class audio_format lpcm_2_48khz, lpcm_5_1_48khz, lpcm_7_1_48khz, - dts, ac3, + dts, automatic, }; diff --git a/rpcs3/rpcs3qt/emu_settings.cpp b/rpcs3/rpcs3qt/emu_settings.cpp index 64365c15bd..2520eb1b44 100644 --- a/rpcs3/rpcs3qt/emu_settings.cpp +++ b/rpcs3/rpcs3qt/emu_settings.cpp @@ -1147,8 +1147,8 @@ QString emu_settings::GetLocalizedSetting(const QString& original, emu_settings_ case audio_format::lpcm_2_48khz: return tr("Linear PCM 2 Ch. 48 kHz", "Audio format"); case audio_format::lpcm_5_1_48khz: return tr("Linear PCM 5.1 Ch. 48 kHz", "Audio format"); case audio_format::lpcm_7_1_48khz: return tr("Linear PCM 7.1 Ch. 48 kHz", "Audio format"); - case audio_format::dts: return tr("DTS 5.1 Ch.", "Audio format"); case audio_format::ac3: return tr("Dolby Digital 5.1 Ch.", "Audio format"); + case audio_format::dts: return tr("DTS 5.1 Ch.", "Audio format"); } break; case emu_settings_type::LicenseArea: