feat(libSceAudioOut): apply the host volume where AudioOut2 hands PCM to the device

DeviceCallback applies the context's ramp to the stereo float it just filled, which is the only place the AudioOut2 main mix reaches the speakers; the title's own volumes and the mastering stay before it. At the default volume the ramp is at unity and the call returns without touching the stream. The controller sound card keeps its own path and is not touched.
This commit is contained in:
MarcZX10 authored and Adrià committed 2026-10-30 16:29:55 +01:00
1 parent 1e82fc5a7e
commit c255f112db
1 file changed
+2
@@ -17,6 +17,7 @@
#include "prx/libc/include/PreciseWait.hpp"
#include "prx/libc/include/Shutdown.hpp"
#include "AudioOut2Internal.hpp"
#include "prx/libSceAudioOut/include/HostVolumeControl.hpp"
#include "AudioOutShutdown.hpp"
#include "prx/libSceAudioOut/include/AudioOutSdl.hpp"
#include "prx/libScePad/include/PadState.hpp"
@@ -263,6 +264,7 @@ static void DeviceCallback(void* userdata, Uint8* stream, int length) {
std::copy_n(context.output.begin(), count, out);
context.output.erase(context.output.begin(), context.output.begin() + static_cast<std::ptrdiff_t>(count));
std::fill(out + count, out + samples, 0.0f);
context.hostGain.Apply(out, samples / AUDIO_OUT2_OUTPUT_CHANNELS, AUDIO_OUT2_OUTPUT_CHANNELS, HostVolumeGain_nid_no_patch());
if (count < samples && !context.priming) {
context.priming = true;
context.primes++;