diff --git a/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp b/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp index a9cd0cbb32..8964230a30 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAudioOut.cpp @@ -78,6 +78,15 @@ audio_out_configuration::audio_out_configuration() primary_output.encoder = primary_modes.front().type; secondary_output.channels = secondary_modes.front().channel; secondary_output.encoder = secondary_modes.front().type; + + // Set the initially selected configuration + primary_output.config.channel = primary_output.channels; + primary_output.config.encoder = primary_output.encoder; + primary_output.config.downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE; + secondary_output.config.channel = secondary_output.channels; + secondary_output.config.encoder = secondary_output.encoder; + secondary_output.config.downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE; + initial_mode_selected = true; } }; @@ -344,6 +353,9 @@ error_code cellAudioOutConfigure(u32 audioOut, vm::ptrget(); std::lock_guard lock(cfg.mtx); - CellAudioOutConfiguration _config{}; - const audio_out_configuration::audio_out& out = cfg.out.at(audioOut); - _config.channel = out.channels; - _config.encoder = out.encoder; - _config.downMixer = out.downmixer; - *config = _config; + // Return the set config, which might not necessarily be the active config. + *config = out.config; + return CELL_OK; } diff --git a/rpcs3/Emu/Cell/Modules/cellAudioOut.h b/rpcs3/Emu/Cell/Modules/cellAudioOut.h index 1c8fd642ed..6d94a3746a 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudioOut.h +++ b/rpcs3/Emu/Cell/Modules/cellAudioOut.h @@ -202,6 +202,7 @@ struct audio_out_configuration u32 downmixer = CELL_AUDIO_OUT_DOWNMIXER_NONE; u32 copy_control = CELL_AUDIO_OUT_COPY_CONTROL_COPY_FREE; std::vector sound_modes; + CellAudioOutConfiguration config{}; // Selected by the game. Does not necessarily mean the active config. }; std::array out;