pipewire-jack hangs when used in the SDL3 tests
Hello,
When using the jack
audio driver in the SDL3 tests, the tests frequently hang and need to be killed using SIGQUIT (CTRL+\
).
It does not happen every time, but often.
This is the SDL issue, where we determined this got to be an issue with pipewire-jack.
Reproducer
git clone https://github.com/libsdl-org/SDL /tmp/SDL -b main --depth 1
cmake -S /tmp/SDL -B /tmp/sdl_build -DSDL_TESTS=ON
cmake --build /tmp/sdl_build
SDL_AUDIO_DRIVER=jack /tmp/sdl_build/test/testaudio
- Create a logical device by dragging a device with the right mouse button
- If the app does not hang, close the app and goto step 4
(the testaudio test application is introduced in this video)
Backtrace
#0 0x00007ff754eab219 in __futex_abstimed_wait_common64
(private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x13e109c) at futex-internal.c:57
#1 __futex_abstimed_wait_common
(futex_word=futex_word@entry=0x13e109c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
#2 0x00007ff754eab29f in __GI___futex_abstimed_wait_cancelable64
(futex_word=futex_word@entry=0x13e109c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
#3 0x00007ff754eadbb9 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x13e1098, cond=0x13e1070)
at pthread_cond_wait.c:503
#4 ___pthread_cond_wait (cond=cond@entry=0x13e1070, mutex=mutex@entry=0x13e1048) at pthread_cond_wait.c:618
#5 0x00007ff74bfb115b in pw_thread_loop_wait (loop=0x13e1020) at ../src/pipewire/thread-loop.c:429
#6 0x00007ff75069432a in do_sync (client=0x13d9380) at ../pipewire-jack/src/pipewire-jack.c:1235
#7 0x00007ff7506a0a56 in jack_connect
(client=0x13d9380, source_port=0x7ff72c008c30 "Built-in Audio Analog Stereo:capture_FR", destination_port=0x7ff73000ed28 "SDL Application-59:sdl_jack_input_1") at ../pipewire-jack/src/pipewire-jack.c:5725
#8 0x00007ff75516659d in JACK_OpenDevice (device=0x1367610)
at /home/maarten/projects/SDL/src/audio/jack/SDL_jackaudio.c:392
#9 0x00007ff755032962 in OpenPhysicalAudioDevice (device=0x1367610, inspec=0x0)
at /home/maarten/projects/SDL/src/audio/SDL_audio.c:1463
#10 0x00007ff755032c7d in SDL_OpenAudioDevice_REAL (devid=18, spec=0x0)
at /home/maarten/projects/SDL/src/audio/SDL_audio.c:1546
#11 0x00007ff755052b8c in SDL_OpenAudioDevice (a=4294967294, b=0x0)
at /home/maarten/projects/SDL/src/dynapi/SDL_dynapi_procs.h:913
#12 0x0000000000406eaf in DeviceThing_ondrag (thing=0x135ac90, button=3, x=215.398438, y=231.898438)
at /home/maarten/projects/SDL/test/testaudio.c:771
#13 0x00000000004080ef in Loop () at /home/maarten/projects/SDL/test/testaudio.c:1110
#14 0x0000000000408688 in main (argc=1, argv=0x7ffff64d0bc8) at /home/maarten/projects/SDL/test/testaudio.c:1269
Using pipewire 0.3.82, packaged by Fedora 38
Thanks!