Bug 2343887

Summary: occasional deadlock opening pipewire audio
Product: [Fedora] Fedora Reporter: Stas Sergeev <stsp2>
Component: sdl2-compatAssignee: Neal Gompa <ngompa13>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 41CC: icculus, ngompa13, slouken
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: sdl2-compat-2.32.56-1.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-05-11 01:16:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stas Sergeev 2025-02-05 08:10:39 UTC
Got this hang on opening audio device:

#0  futex_wait (futex_word=0x555557083ee8, expected=2, private=0)
    at ../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait (futex=futex@entry=0x555557083ee8, private=0)
    at lowlevellock.c:49
#2  0x00007ffff7680a02 in __pthread_mutex_cond_lock
    (mutex=mutex@entry=0x555557083ee8) at ../nptl/pthread_mutex_lock.c:128
#3  0x00007ffff767d110 in __pthread_cond_wait_common
    (cond=0x555557083f10, mutex=0x555557083f28, clockid=0, abstime=0x0)
    at pthread_cond_wait.c:607
#4  ___pthread_cond_wait
    (cond=cond@entry=0x555557083f10, mutex=mutex@entry=0x555557083ee8)
    at pthread_cond_wait.c:618
#5  0x00007fff4ad40e88 in pw_thread_loop_wait (loop=0x555557083ed0)
    at ../src/pipewire/thread-loop.c:428
#6  0x00007fffe5f34c76 in PIPEWIRE_OpenDevice (device=0x555557083ad0)
    at /usr/src/debug/SDL3-3.2.2-1.fc41.x86_64/src/audio/pipewire/SDL_pipewire.c:1222
#7  0x00007fffe5e0c541 in OpenPhysicalAudioDevice
    (device=device@entry=0x555557083ad0, inspec=inspec@entry=0x7fffffffd0a0)
    at /usr/src/debug/SDL3-3.2.2-1.fc41.x86_64/src/audio/SDL_audio.c:1710
#8  0x00007fffe5e0d8e7 in SDL_OpenAudioDevice_REAL
    (devid=<optimized out>, spec=0x7fffffffd0a0)
    at /usr/src/debug/SDL3-3.2.2-1.fc41.x86_64/src/audio/SDL_audio.c:1777
#9  0x00007fffe8e607ef in OpenAudioDeviceLocked
    (allowed_changes=0, devicename=<optimized out>, iscapture=0, desired2=0x7fffffffd140, obtained2=0x7fffffffd120, min_id=<optimized out>)
    at /usr/src/debug/sdl2-compat-2.30.52-1.fc41.x86_64/src/sdl2_compat.c:6016
#10 OpenAudioDevice.isra.0
    (devicename=<optimized out>, iscapture=0, desired2=0x7fffffffd140, obtained2=0x7fffffffd120, min_id=<optimized out>, allowed_changes=<optimized out>)
    at /usr/src/debug/sdl2-compat-2.30.52-1.fc41.x86_64/src/sdl2_compat.c:6107
#11 0x00007fffe8ed3264 in sdlsnd_open (arg=<optimized out>) at snd_o_SDL.c:84


Reproducible: Sometimes

Steps to Reproduce:
1. run sdl2 app over sdl2-compat
2. sometimes it hangs opening pipewire
Actual Results:  
sometimes hangs

Expected Results:  
never hangs

I don't think SDL2 used pipewire,
I think it used pulseaudio, so the
pipewire was involved via the wrapper
(if at all).
Direct pipewire code is certainly new,
and I don't know if this is an sdl2-compat
problem or sdl3 problem or pipewire problem.

Comment 1 Fedora Update System 2025-05-10 07:21:10 UTC
FEDORA-2025-e9f23d2848 (mingw-sdl2-compat-2.32.56-1.fc42, mingw-SDL3-3.2.12-1.fc42, and 2 more) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-e9f23d2848

Comment 2 Fedora Update System 2025-05-11 01:16:28 UTC
FEDORA-2025-e9f23d2848 (mingw-sdl2-compat-2.32.56-1.fc42, mingw-SDL3-3.2.12-1.fc42, and 2 more) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.