This is an attempt at replacing sound with Duckstation's SPU. It is a non-ABI breaking change and can be turned off and on using options.cmake value AUDIO_SPU_EMULATION.
I have not hooked up FMV audio to the SPU emulator, but it should be trivial. I'll wait to see if this PR is even something that would be wanted.
MidiPlayer defines the SPU/SND functions.
Sequencer is the modified duckstation SPU
oddio defines fixes for vag attributes (which I'll mention more below)
The SPU runs at 44100hz which is executing in the SDL callback. The emulator should probably run in its own thread as running calculations in the SDL callback is probably bad practice. Unsure if this will cause clipping on slower CPU's. CPU usage seems comparable to master branch, however if many sounds are playing (slig constantly shooting), my CPU usage is slightly higher than master.
Interestingly the PC vag attributes differ from PSX. This can be seen by disabling the vag attribute fixes by commenting out mSoundSampleParser.applyFix(...) in MidiPlayer. With it commented it will sound like pc, with it uncommented it will sound like psx. One obvious example is Abe's "Hello". He has a deeper voice in pc, whereas psx is slightly higher pitch.
R6 is even more messed up and fixes can not be applied without more inspection, right now it uses all pc sounds, so Abe will have pc's lower pitch voice.
Further, I believe a lot of the volumes are incorrect in the sound definitions within things like slig.cpp.
When a slig stops shooting it plays eHitBottomOfDDeathPit at full volume. This should almost certainly be played at a lower volume. SND_SEQ_SetVol()
The sequence played for doves in, for example, paramonia, play at full volume, and should have SND_SEQ_SetVol()
And; Leaves shooting out of wells seem to have too low of volume
Probably others...
I have not applied fixes for AE, so that could probably be improved. However, I know greeters wheeling around make no noise, but it's because their volume is too low, increasing it the sound will play.
In short; I'm pretty sure the pc port introduced more sound issues than just the player, most likely to cover for the incorrect player.
This is an attempt at replacing sound with Duckstation's SPU. It is a non-ABI breaking change and can be turned off and on using
options.cmake
valueAUDIO_SPU_EMULATION
.I have not hooked up FMV audio to the SPU emulator, but it should be trivial. I'll wait to see if this PR is even something that would be wanted.
MidiPlayer
defines the SPU/SND functions.Sequencer
is the modified duckstation SPUoddio
defines fixes for vag attributes (which I'll mention more below)The SPU runs at 44100hz which is executing in the SDL callback. The emulator should probably run in its own thread as running calculations in the SDL callback is probably bad practice. Unsure if this will cause clipping on slower CPU's. CPU usage seems comparable to master branch, however if many sounds are playing (slig constantly shooting), my CPU usage is slightly higher than master.
Interestingly the PC vag attributes differ from PSX. This can be seen by disabling the vag attribute fixes by commenting out
mSoundSampleParser.applyFix(...)
inMidiPlayer
. With it commented it will sound like pc, with it uncommented it will sound like psx. One obvious example is Abe's "Hello". He has a deeper voice in pc, whereas psx is slightly higher pitch.R6 is even more messed up and fixes can not be applied without more inspection, right now it uses all pc sounds, so Abe will have pc's lower pitch voice.
Further, I believe a lot of the volumes are incorrect in the sound definitions within things like
slig.cpp
.eHitBottomOfDDeathPit
at full volume. This should almost certainly be played at a lower volume.SND_SEQ_SetVol()
SND_SEQ_SetVol()
I have not applied fixes for AE, so that could probably be improved. However, I know greeters wheeling around make no noise, but it's because their volume is too low, increasing it the sound will play.
In short; I'm pretty sure the pc port introduced more sound issues than just the player, most likely to cover for the incorrect player.