[LAU] Solution for jackd2 and dbus without X session

From: Mark Kendrick <aeetos@email-addr-hidden>
Date: Tue Oct 23 2012 - 08:46:51 EEST

Apologies for not appending this to the original thread correctly - I
just joined the list.

This is in reference to this thread about jackd2 and X11/dbus:
http://linuxaudio.org/mailarchive/lau/2012/9/16/192998

I had essentially the the same problem as Len when I tried to run jackd:
Failed to connect to session bus for device reservation Unable to
autolaunch a dbus-daemon without a $DISPLAY for X11

This was in Archlinux on a Raspberry Pi, but I had identical problems
under Debian Wheezy on the Raspberry Pi and a "normal" piece of
hardware. I tried setting DISPLAY=:0 but it still didn't solve it.
Incredibly frustrating.

I finally read the man page for dbus-launch and noted that apps which
it started expected to have DBUS_SESSION_BUS_ADDRESS set correctly in
their session, which it happily provided for them. I also noticed I
already had a dbus-daemon running in the base distro.

The solution was to set the session bus address variable to the path
to that dbus-daemon's socket, like so:
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket

When I did that and tried running jackd again, I got a very specific
permission error that I was able to resolve by granting my user access
to the audio hardware. I added these lines to the other policy
settings in /etc/dbus-1/system.conf :
<policy user="root">
     <allow own="org.freedesktop.ReserveDevice1.Audio0"/>
</policy>

I restarted my system-level dbus-daemon, and jackd started right up.
It shouldn't be too tough now to script that so it's always running
when the device starts.

I have no idea if that will work for you but perhaps it will put you
on the right path.

--Mark
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Tue Oct 23 12:15:01 2012

This archive was generated by hypermail 2.1.8 : Tue Oct 23 2012 - 12:15:02 EEST