<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Closing PulseAudio freezes SDL audio"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103498#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Closing PulseAudio freezes SDL audio"
href="https://bugs.freedesktop.org/show_bug.cgi?id=103498">bug 103498</a>
from <span class="vcard"><a class="email" href="mailto:jpakkane@gmail.com" title="Jussi Pakkanen <jpakkane@gmail.com>"> <span class="fn">Jussi Pakkanen</span></a>
</span></b>
<pre>This bug is nasty because it most likely boils down to a race condition that
happens very rarely. This is what we came up with:
- machine is booted
- pulseaudio starts up in system mode
- in some circumstances PA's startup is delayed, and the program using SDL
audio starts up and grabs the sound card before PA is fully running
- PA is now running, and the first application is using SDL audio, but it is
using Alsa directly
- programs started after PA starts try to connect to PA, succeed, and send
their sound data there but PA can't play it because the sound card is held by
the first launched application
- when closing one of the applications that are started afterwards, they get
hung in the method described above
We tried delaying the startup with systemd rules so that the application is
only started after PA's control socket appears. This did not work. The only
thing that did work was creating a startup application that tries to open SDL
audio, forcing it to use PA and delay starting any other program until it has
successfully opened a PA audio connection.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>