Sound problems with SDL Audio
#21
I m using manjaro ( archlinux based distribution )
Reply

Sponsored links

#22
Ok now we're getting somewhere Smile Sorry for delay. I've rebuilt with latest git, one Release version and one Debug version. Results are promising.

The assert does trigger in Debug version with 2.0.4 !

Code:
PCSX2: /home/x/build/pcsx2-git/src/pcsx2/plugins/spu2-x/src/SndOut_SDL.cpp:49: void {anonymous}::callback_fillBuffer(void*, Uint8*, int): Assertion `len / sizeof(StereoOut_SDL) == samples' failed.
Aborted (core dumped)

Downgrade to lib32-sdl2-2.0.3 and no core dump.
Reply
#23
Interesting.

Would you be able to run it inside gdb? When you hit the assertion. Use "up" to go up on the stack and then when you're at the level of the callback. Could you print the content of the parameters. I.e.
Code:
p len
p samples
Otherwise tell me, and I will add some prints.
Reply
#24
I try to do something on git. Tell me if it is working on release build? I also add a printf on the sample setup.

Quote:printf(stderr, "SPU2-X: SDL failed to get desired samples (%d) got %d samples instead\n", desiredSamples, samples);
Tell me if you see this kind of message.
Reply
#25
Great, the fix from git works Smile

I don't see your printf though. I will try to gdb.
Reply
#26
Yes please. I would like to know what does SDL. If the number of sample is too slow, I'm afraid of buffer under/over run.
Reply
#27
gdb output:

Code:
Request SDL audio driver: pulseaudio
[New Thread 0xdcd3eb40 (LWP 22143)]
[New Thread 0xd43fdb40 (LWP 22144)]
Opened SDL audio driver: pulseaudio
PCSX2: /home/x/build/pcsx2-git/src/pcsx2/plugins/spu2-x/src/SndOut_SDL.cpp:51: void {anonymous}::callback_fillBuffer(void*, Uint8*, int): Assertion `len / sizeof(StereoOut_SDL) == samples' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xd43fdb40 (LWP 22144)]
0xf7fd9bf0 in __kernel_vsyscall ()
(gdb) up
#1  0xf6c0de66 in raise () from /usr/lib32/libc.so.6
(gdb) up
#2  0xf6c0f4e7 in abort () from /usr/lib32/libc.so.6
(gdb) up
#3  0xf6c06e47 in __assert_fail_base () from /usr/lib32/libc.so.6
(gdb) up
#4  0xf6c06ecb in __assert_fail () from /usr/lib32/libc.so.6
(gdb) up
#5  0xede67dbe in (anonymous namespace)::callback_fillBuffer (userdata=0x0, stream=0xed7b2fb0 "", len=2048)
   at /home/x/build/pcsx2-git/src/pcsx2/plugins/spu2-x/src/SndOut_SDL.cpp:51
51            assert(len / sizeof(StereoOut_SDL) == samples);
(gdb) p len
$1 = 2048
(gdb) p samples
$2 = 1024
Reply
#28
Could you ask SDL guy if it is expected that

User request a 1024 samples of 16 bits on 2 channel. Therefore a sample frame is sizeof(u16) * 2 = 4.

But the len of callback buffer is only 2048. And therefore it could only contains 2048/4=512 samples instead of the 1024 requested.

I just want to know if it is done on purpose or if is a not-expected side effect of other change.
Reply
#29
The sound is ok with the latest git version.
Reply
#30
@gregory: Sure, no problem, I added the question.

I also tried to debug a build with "const Uint16 desiredSamples = 2048" (the patch you suggested on page 1) but result is the same:

Code:
(gdb) p len
$1 = 2048
(gdb) p samples
$2 = 1024

Edit: Uh no wait, I forgot to install the patched version. Here are actual results (I had to set a breakpoint because the assert didn't trigger anymore):

Code:
(gdb) p len
$1 = 4096
(gdb) p samples
$2 = 2048
(gdb) p sdl_samples
$3 = 1024
Reply




Users browsing this thread: 1 Guest(s)