Jackdbus and pulse

Len Ovens len at ovenwerks.net
Thu Jan 10 21:48:36 UTC 2013

On Thu, January 10, 2013 12:14 am, David Henningsson wrote:
> On 01/10/2013 07:54 AM, Len Ovens wrote:
>> On Wed, January 9, 2013 7:28 pm, David Henningsson wrote:
>>> On 01/10/2013 12:46 AM, Len Ovens wrote:
>>>> I have played around with this and there is a hack that will work.
>>>> This
>>>> is
>>>> not a fix. When setting up qjackctl, there is a tab called "Options".
>>>> On
>>>> that panel there is a line with "Execute script on Startup". If this
>>>> is
>>>> enabled and the line:
>>>> pasuspender sleep 5 &
>>> Interesting; I didn't think this would work, it probably shouldn't -
>>> pasuspender should suspend all sinks, including the JACK sink.
>>> It must be because the JACK sink is created *after* pasuspender starts,
>>> would be the reason why it is not suspended properly.
>> That is the pre-start script in qjackctl.
> Which should be removed/changed, I talked to Kaj about this on IRC a few
> days ago.

Sorry I may not have been clear. I put it there for testing. I do not
think it is there by default. There are two startup script places
available in qjackctl. One just before the server starts and one after it
is running (for things like a2j or zita-a2j).

>>> To fix it in the right way you need to figure out why this happens in
>>> the first place - I mean, it could be either one of these three:
>>> 1) PulseAudio does not release the device before answering on dbus
>>> 2) Jackd2 does not wait for dbus answer before opening the device
>>> 3) The kernel (or alsa-lib) does not release the device properly before
>>> returning from snd_pcm_close.
>> It looks like ... 4)
> Thanks for looking into it.

Sorry I didn't add anything useful. At least I learned something.

As another note, once jack fails, even using pasuspender will not allow
jack to start, I have to do a jack_control exit first... Let me check if a
stop will work...No has to be exit. So jack continues to communicate with
dbus even though it is (semi) crashed.

> It would be interesting to know "sudo fuser -v /dev/snd/pcm*" at exactly
> this point in time, because it should be unused.

I can't do it at exactly any time. As fast as my fingers move, it shows
pulse owns it till jack tries to start, then no-one. It stays as no-one
till I try to start jack again, or jack exit. I don't know if a bash loop
(time, fuser, loop) would be fast enough to catch something. Or if it
would change things with more cpu/disk/whatever use.

Len Ovens

More information about the Ubuntu-Studio-devel mailing list