Closed Awakened0 closed 4 years ago
Thanks for the recording!
So it turns out the problem really was the fact that I was using blargg's blip_buf library for the audio resampling. The DSP isn't really the type of audio chip blip_buf is meant to help resample, so that might be why it distorted the sound a fair bit.
I've replaced it entirely with another resampling method based on hermite interpolation, and that seems to give much better results - I can't tell the difference between the raw 32040Hz DSP output (which has gaussian interpolation applied to it since that's what blargg's DSP core uses) and the resampled (e.g 48khz) audio.
For the libretro core, the new hermite interpolation resampling should be skipped entirely - the core now defaults to 32040hz output (which is the DSP's native output rate in Mesen-S/bsnes/snes9x) and leaves it up to retroarch to resample the audio as needed.
If you could give a try to both the latest standalone & libretro builds and confirm that this is fixed, that'd be great.
Standalone seems about the same as bsnes now. But libretro (26-51s) sounds more veiled than standalone (0-25s):
Technically, if libretro sounds more veiled, that would be caused by retroarch's own audio resampling - the core is just passing the least processed audio data it can to the frontend.
There are a number of different resampling algorithms in retroarch, maybe one of them will sound better than the others? (In Drivers -> Audio Resampler Driver.) There's also an option to pick the resampling quality in Audio -> Audio Resampler Quality.
Setting the resampler quality to highest does the trick. Now it sounds on par with stand alone.
As for the drivers, the default sinc sounds the best to me. CC is more muffled and nearest has more distortion.
Thanks for the help and fix!
No problem! Thanks for the report - I would never have noticed this myself. My ears can't really tell the difference unless I hear both versions one after the other :p
Yeah, I only had sort of an inkling that the overall quality was a little nicer in bsnes before I did some A B testing to see if there was actually a difference.
Using the latest Windows nightlies of both Mesen-S and bsnes, I recorded some fights at the beginning of CT in Guardia Forest. I found the audio in Mesen-S sounds slightly more "veiled" while bsnes is a bit cleaner. I left cubic interpolation off in bsnes' audio options, so they both should be using gaussian. I think this is the "quality difference" I mentioned hearing on libretro's Discord. snes9x sounds identical to Mesen-S.
Here is a clip with Mesen-S first (0-25s) and bsnes second (26-52s):
ctmesenvbsnes.zip
The cymbal in the right channel and the sword unsheathe sound at the beginning of the battle are probably the easiest things to listen to to notice a difference when jumping between each recording.
Someone else noticed this difference and reported it in this bsnes issue. I haven't tested higan, but if it sounds the same as snes9x and Mesen-S I'm surprised byuu/near couldn't notice the difference. Even if it is subtle.