ps2dev / ps2sdk

Homebrew PS2 SDK
Other
953 stars 133 forks source link

shortcomings in audsrv and upsampling #528

Open irixxxx opened 8 months ago

irixxxx commented 8 months ago

While working on PicoDrive I found the audsrv implementation a bit lacking:

AKuHAK commented 8 months ago

nice, I also noticed something similar, do you know the solution?

irixxxx commented 8 months ago

If I had one I would've made a PR ;-)

Most of it should be easy to fix, but it potentially breaks stuff relying on those bugs. I guess it's up to the maintainer (if there is one at all).

As for the bugs:

irixxxx commented 8 months ago

The upsamplers used to upsample to 48 KHz are also flawed:

irixxxx commented 8 months ago

That upsampling stuff really bothers me. I don't think using lookup tables is a good solution to handle this.

I had a similar problem with resampling the 44.1 KHz CD audio tracks to the target sample rate. I'd suggest whoever is going to address this might want to look up my solution in the function mix_16h_to_32_resample_stereo in pico/sound/mix.c. It's also relatively independent of the source and target sample rates, so the restriction to certain rates might potentially also be lifted.