LIJI32 / SameBoy

Game Boy and Game Boy Color emulator written in C
https://sameboy.github.io/
Other
1.64k stars 207 forks source link

libretro core volume issues [Linux] #21

Open nadiaholmquist opened 6 years ago

nadiaholmquist commented 6 years ago

It seems like the libretro port is constantly playing at 100% volume even when the sound in the game is supposed to be silent.

This causes other sound in the background to be distorted/clipping as well.

Tested on Arch Linux with PulseAudio 11.1, RetroArch 1.6.9 and the latest master of SameBoy.

LIJI32 commented 6 years ago

I need a few more details as I'm not very familiar with PulseAudio. Does PulseAudio expects audio clients to play audio in lower amplitudes? How do other libretro cores handle this issue? Does RetroArch have any built-in volume control?

Meanwhile, this can temporarily be solved by redefining MAX_CH_AMP in apu.h to a lower value.

Shoegzer commented 6 years ago

I can confirm this too, running the libretro core on Linux Mint 18.3 x64 with kernel 4.13, compiled against this (https://github.com/libretro/SameBoy/commit/e9b2d1e2eb112881e7649f40298dce72df3c4805) commit. Cannon Fodder in particular is very distorted. Not sure if it's PulseAudio related though. I was hoping the recent sound fixes would take care of this one but it didn't seem to.

LIJI32 commented 6 years ago

Cannon Fodder audio is definitely broken, I'll have to fix that. As for the volume issues, I need more info. Do they happen in the SDL version of SameBoy as well? Do they happen with Gambatte on RetroArch with PulseAudio as well? Is SameBoy on RetroArch significantly louder than Gambatte?

Shoegzer commented 6 years ago

Thanks for the fix. As for the other audio issues, I'll leave that to others as my observations were based solely on Cannon Fodder audio.