Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sound problems with SDL Audio
#1
Hi,

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:

Code:
$ 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): https://aur.archlinux.org/cgit/aur.git/t...=pcsx2-git
Reply

Sponsored links

#2
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.
Reply
#3
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 ?

Code:
$ ldd /usr/lib32/pcsx2/libspu2x-2.0.0.so | grep -i sdl
    libSDL2-2.0.so.0 => /usr/lib32/libSDL2-2.0.so.0 (0xf6ce5000)
Reply
#4
Hum,

Code:
ldd bin/PCSX2 | grep libwx

Then foreach library could you do a SDL grep
Code:
/usr/lib/i386-linux-gnu/libwx_baseu-3.0.so.0 | grep -i sdl
/usr/lib/i386-linux-gnu/libwx_gtk2u_core-3.0.so.0 | grep -i sdl
...

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

I hate the audio mess.
Reply
#5
Code:
$ ldd /usr/bin/PCSX2 | awk '/libwx/{print $3}'
/usr/lib32/libwx_baseu-3.0.so.0
/usr/lib32/libwx_gtk2u_core-3.0.so.0
/usr/lib32/libwx_gtk2u_adv-3.0.so.0

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

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

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 @ https://projects.archlinux.org/svntogit/...ib32-wxgtk ). But well I'm not a programmer so don't really know what I'm looking at here.

Code:
$ yaourt -Q | grep -i wx
multilib/lib32-wxgtk 3.0.2-6
extra/wxgtk 3.0.2-5
Reply
#6
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;
Reply
#7
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.
Reply
#8
For reference the spu2x change
Quote:https://github.com/PCSX2/pcsx2/commit/22...4b6990bab5
https://github.com/PCSX2/pcsx2/commit/df...f49f1a9f49
Reply
#9
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.
Reply
#10
If you're motived, you can open an SDL bug report.
Reply




Users browsing this thread: 1 Guest(s)