mgba-emu / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
5.63k stars 770 forks source link

[Request] Sound Interpolation Options #1114

Open Tatsuya79 opened 6 years ago

Tatsuya79 commented 6 years ago

I feel Mgba could benefit from some sound interpolation filtering as the GBA sound can be a bit harsh.

Some recent filters added into snes9x libretro.

Also emulators like genesis plus gx and vbam use a low pass filter that would be great to reduce the ear piercing high notes present here too.

Thank you!

endrift commented 6 years ago

I've actually started work on something like this, but I'm not good with audio code so it may be a while.

ipatix commented 5 years ago

Did you make any progress on that? I was about to open up a new issue about mGBA's terrible sound quality. There seem to be some heavy aliasing artifacts on all sound channel types.

endrift commented 5 years ago

I made a little bit but it's on the back burner. My hearing is not very good so I can barely notice it, nor would I have any idea if it's fixed. PRs welcome (sorry).

ipatix commented 5 years ago

Not a big deal, I know things are actually some work to do. I'll see if I can come up with something. I'm somewhat diving into mGBA's and don't really know where things are (yet).

Extrems commented 5 years ago

If you think mGBA sounds aliased, you'd be shocked by real hardware. The RLC circuit used to filter the PWM output introduces aliasing! It arguably sounds better though, and I've gone through the trouble to simulate it from the digital PWM on the Game Boy Player for Game Boy Interface.

ipatix commented 5 years ago

Originally I was just surprised about mGBA's sound which seems really inferior compared to VBA-M's. I'm not quite sure what they're doing different though.

To be honest, I don't know how accurate mGBA currently is. Plugging headphones into my DS sounds better though. For "better over accurate" sound one would probably have to ignore the SOUNDBIAS register and resample all channels individually (for example with BLEP synthesis). I'd guess the hardware would just do a zero order hold.

Extrems commented 5 years ago

It's not accurate to GBA ever since GB emulation was introduced. You can compare with samples from Game Boy Interface.

Tatsuya79 commented 5 years ago

VBA-M has sound interpolation/filtering.

ipatix commented 5 years ago

@Extrems Why would GB emulation change the sound of GBA emulation? Don't the GB sound channels behave exactly the same on GBA?

endrift commented 5 years ago

I think it changed some of the timing characteristics, but I'm not entirely sure what Extrems is talking about.