openbor icon indicating copy to clipboard operation
openbor copied to clipboard

Sound effects keep popping and scratching on ppsspp and linux.

Open amano-kenji opened this issue 2 years ago • 20 comments

Description

When sound effects start and end, I hear popping. I have to minimize popping by reducing system volume. Reducing OpenBOR volume doesn't decrease popping noise.

Debugging

Reproduce

  1. Launch any game
  2. All sound effects pop and scratch. Reducing OpenBOR sound volume makes pops more conspicuous.

Expected behavior

Audio should be smooth.

Version

  • Platform: PSP(ppsspp-libretro on retroarch) and Linux
  • Engine Build: https://github.com/DCurrent/openbor/releases/tag/v6391

Additional context

I use ALSA dmix.

ALSA sampling rate: 48000hz rate converter: samplerate ALSA sampling format: S32_LE channels: 2

amano-kenji avatar Mar 22 '23 12:03 amano-kenji

PSP support is dropped, upcoming versions won't compile a PSP build at all. @msmalik681 can you reproduce this issue on Linux?

DCurrent avatar Mar 24 '23 11:03 DCurrent

Is linux supported? Yesterday, I tried and failed to build it on gentoo linux. Lots of compiler errors.

I want to make a gentoo linux package for OpenBOR, but there is no the build instruction apart from build.sh.

I wish the build was done by meson. Meson has a lot of inflexible assumptions, but it is easy for package maintainers to use.

amano-kenji avatar Mar 24 '23 12:03 amano-kenji

By the way, I'm going to configure pipewire which emulates ALSA and pulseaudio.

amano-kenji avatar Mar 24 '23 12:03 amano-kenji

@amano-kenji I have tested both platforms and they work as expected is there a particular game this is happening with or does it happen with all games ?

msmalik681 avatar Mar 24 '23 17:03 msmalik681

So far, I have tested

  • Rhythm of Destruction 2 - Street Fighter Edition
  • World Heroes Supreme Justice Extra

amano-kenji avatar Mar 24 '23 22:03 amano-kenji

I just tested Streets of Rage 2X. It doesn't give me pops and scratches. It's weird.

amano-kenji avatar Mar 24 '23 22:03 amano-kenji

Just tested "Rhythm of Destruction 2 - Street Fighter Edition" using latest stable appimage on linux mint 21 and no sound issues this could be a problem with your audio drivers.

If you have a sound card and a gpu that supports audio over hdmi maybe test both.

msmalik681 avatar Mar 25 '23 11:03 msmalik681

The system sound volume should be 100%. Reduce SFX volume and music volume to 0, and then increase them gradually.

When SFX volume and music volume are near 0, I hear pops before and after sound effects occur.

Test World Heroes Supreme Justice Extra, too.

amano-kenji avatar Mar 25 '23 11:03 amano-kenji

I tested onboard sound card and USB DAC with ALSA. With or without ALSA dmix, I hear pops.

Pops become louder if in-game SFX volume is near 0.

I haven't tested pulseaudio or pipewire, yet.

amano-kenji avatar Mar 25 '23 11:03 amano-kenji

I guess the root cause is internal audio mixing is broken.

amano-kenji avatar Mar 26 '23 03:03 amano-kenji

I tried Golden Axe Returns with the Windows version run with Wine, and it looks to be a regression. With the bundled GAME.exe, it works fine. If you use the included alpha 4.0 GAME.exe, the issue appears. I also compiled the git Linux version (after disabling some fatal warnings) and the issue persists.

aqxa1 avatar Apr 10 '23 03:04 aqxa1

@aqxa1 what distro are you using ?

msmalik681 avatar Apr 10 '23 03:04 msmalik681

Gentoo as well. I needed to add to CFLAGS:

-Wno-address -Wno-stringop-overflow -Wno-stringop-truncation -Wno-format-overflow

Something like this as a full command:

  CFLAGS="-march=native -O2 pipe -Wno-address -Wno-stringop-overflow -Wno-stringop-truncation -Wno-format-overflow" ./build.sh 4

aqxa1 avatar Apr 10 '23 03:04 aqxa1

I think i need to test a linux distro running alsa audio as mine uses pulseaudio i will test and get back to you.

msmalik681 avatar Apr 10 '23 03:04 msmalik681

I'm using Pipewire (through pipewire-pulse emulation). The issue will be reproduced with native Pulseaudio as well I suspect.

aqxa1 avatar Apr 10 '23 03:04 aqxa1

I just tested openbor with pipewire-pulse. The issue still persists with pipewire-pulse.

Even disabling USB device suspend in wireplumber doesn't fix this issue.

I think it's internal mixing issue.

amano-kenji avatar Aug 05 '23 12:08 amano-kenji

Hello. I have the same problem with OPENBOR using WINDOWS 7 32 bit. I have tested many versions. In most games even putting BGM and sound effect at ZERO theres still a clicking-pops-noise that is extremely annoying. Sadly i havent found any solution or workaround.

dobbs68 avatar Sep 08 '23 03:09 dobbs68

Can confirm the popping sound effects occur on the most recent Linux AppImage build, on steam deck. Interestingly, I have run into popping sound effects much like this on various Doom source ports on Linux and I'm not sure how or if they got fixed

nickxcom avatar Feb 29 '24 15:02 nickxcom

If mp3 files are used as sound effects, then libmad decoder can be a culprit. I don't know whether openbor uses libmad decoder.

libmad has been unmaintained for a long time.

mpg123 decoder is better maintained, and its pop noises are far quieter. It is quiet enough that I can't hear pops in most cases unless I wear headphones and focus.

amano-kenji avatar Feb 29 '24 23:02 amano-kenji

Sound effects are wav files.

msmalik681 avatar Mar 01 '24 07:03 msmalik681