DCurrent / openbor

OpenBOR is the ultimate 2D side scrolling engine for beat em' ups, shooters, and more!
http://www.chronocrash.com
BSD 3-Clause "New" or "Revised" License
887 stars 119 forks source link

Sound effects keep popping and scratching on ppsspp and linux. #275

Open amano-kenji opened 1 year ago

amano-kenji commented 1 year ago

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

Additional context

I use ALSA dmix.

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

DCurrent commented 1 year ago

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

amano-kenji commented 1 year ago

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 commented 1 year ago

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

msmalik681 commented 1 year ago

@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 ?

amano-kenji commented 1 year ago

So far, I have tested

amano-kenji commented 1 year ago

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

msmalik681 commented 1 year ago

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.

amano-kenji commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

aqxa1 commented 1 year ago

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.

msmalik681 commented 1 year ago

@aqxa1 what distro are you using ?

aqxa1 commented 1 year ago

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
msmalik681 commented 1 year ago

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

aqxa1 commented 1 year ago

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

amano-kenji commented 11 months ago

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.

dobbs68 commented 10 months ago

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.

nickxcom commented 4 months ago

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

amano-kenji commented 4 months ago

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.

msmalik681 commented 4 months ago

Sound effects are wav files.