Sound problems with SDL Audio

I only recently rebuilt from git (1.3.1-20160105063026) but noticed the sound is really bad with SDL Audio now on this new build, lots of crackling. If I set to PortAudio, audio is fine. But I prefer to be able to use pulseaudio via SDL since I have different audio sinks and I want to be able to switch to the HDMI out Smile

I tried a clean PCSX2 config but doesn't seem to help.

I use Arch Linux, and build via AUR using pcsx2-git.

Though now I'm confused to whether or not it's built with SDL or not:

$ ldd $(which PCSX2) | grep -i sdl

Is SDL2 enabled by default when you build? Should the binary be linked to sdl libs ? Or is it only the plugins that are linked...

PKGBUILD is here (code which builds it in AUR):

Sponsored links

Sdl is for the spu2x plugin. And I'm afraid it will be limited to sdl1.2

However the issue annoys me. There were a couple of changes in spu2x recently. You can try to play with the latency parameter.
Thanks for reply! Latency doesn't change much... no "good" changes at least. Played a bit with advanced settings too, but no luck.

Sound is fine with PortAudio/ALSA or SDL/alsa. Just not with pulseaudio.

I found the plugin and did an ldd, now I'm more confused with your remark because it seems to be SDL2 ?

$ ldd /usr/lib32/pcsx2/ | grep -i sdl => /usr/lib32/ (0xf6ce5000)

ldd bin/PCSX2 | grep libwx

Then foreach library could you do a SDL grep
/usr/lib/i386-linux-gnu/ | grep -i sdl
/usr/lib/i386-linux-gnu/ | grep -i sdl

I want to be sure they fix the package on arch.

I hate the audio mess.
$ ldd /usr/bin/PCSX2 | awk '/libwx/{print $3}'

Second output is empty... i.e. it's not linked to any sdl libs.

$ for i in $(ldd /usr/bin/PCSX2 | awk '/libwx/{print $3}'); do ldd $i | grep -ic sdl; done

These files are part of lib32-wxgtk package (3.0.2-6). The package was lastly updated by Arch maintainers for a "C++ 11 ABI rebuild". I don't see huge changes ( commits @ ). But well I'm not a programmer so don't really know what I'm looking at here.

$ yaourt -Q | grep -i wx
multilib/lib32-wxgtk 3.0.2-6
extra/wxgtk 3.0.2-5
Great ^^

Arch used to link wx against SDL1.2. It was killer when PCSX2 plugin was linked against SDL2 in the same time.

However I don't know how to fix your audio issue. I'm sorry.

Hum could try a build with this patch
Quote:diff --git a/plugins/spu2-x/src/SndOut_SDL.cpp b/plugins/spu2-x/src/SndOut_SDL.cpp
index 246d192..b318061 100644
--- a/plugins/spu2-x/src/SndOut_SDL.cpp
+++ b/plugins/spu2-x/src/SndOut_SDL.cpp
@@ -37,7 +37,7 @@ namespace {
/* Samples should vary from [512,8192] according to SDL spec. Take note this is the desired
* sample count and SDL may provide otherwise. Pulseaudio will cut this value in half if
* PA_STREAM_ADJUST_LATENCY is set in the backened, for example. */
- const Uint16 desiredSamples = 1024;
+ const Uint16 desiredSamples = 2048;
const Uint16 format = AUDIO_S16SYS;

Uint16 samples = desiredSamples;
Aha ok makes more sense to me now Smile No problem, I will look some more and see what I can find and report back.

But one thing that also happened as well as my rebuild of pcsx2, is I just noticed sdl2 also got updated (2 days ago, but before rebuild of pcsx2) from version 2.0.3 to 2.0.4. This will be rather easy to check if it's related.

But of course it could also be from the recent changes in spu2x as you say.
For reference the spu2x change
I tried your patch first, that didn't work. But now I reverted back to SDL 2.0.3 and guess what, looks like we found the culprit. It works again like it used to Tongue2

So (perhaps once again), it's a problem upstream and not with pcsx2 codebase Smile

Maybe someone else can try to build against 2.0.4 to confirm.
If you're motived, you can open an SDL bug report.

Users browsing this thread: 1 Guest(s)