How should I set up ffado-dbus-server to start at boot?

Unofficial support for the KXStudio Linux distribution and applications.
More info at http://kxstudio.linuxaudio.org/

Moderators: MattKingUSA, khz

Post Reply
altie
Established Member
Posts: 6
Joined: Sat Jul 26, 2014 2:36 am

How should I set up ffado-dbus-server to start at boot?

Post by altie »

I've got a PreSonus Firebox and I'm happy to report that it's working great for both recording and playback, provided that I start everything up in the right order. The process I can follow after boot now to get everything working:
  • Kill any running jack and pulseaudio processes.
  • Start ffado-dbus-server and wait a few seconds for it to detect attached devices.
  • Start jack from the command line with `jackd -d firewire`.
  • Start pulseaudio with `pulseaudio -D`.
  • Open up youtube, start something playing, go into Volume Control and flip the "ALSA plug-in [plugin-container]" output over to "Jack sink (PulseAudio JACK Sink)". This last step makes it so that the next time I decide I need a break and want to listen to some music in my browser, it comes out of the same set of speakers I'm monitoring on.
Surely there's a more automated way to do this. Which init scripts (or something similar) should I be looking at so that most or all of this process happens at startup without my intervention? Thanks for any help.
tangerine
Established Member
Posts: 66
Joined: Tue Jul 29, 2014 12:08 pm

Re: How should I set up ffado-dbus-server to start at boot?

Post by tangerine »

My use for audio in Linux is very different, so I can hardly comment on your specific questions. However there are some general considerations that might or might not relieve some of them.
- Controlling jack with "jackd" should be avoided on a system where jackdbus is installed. These are in fact two conflicting frameworks and mixing them may cause trouble.
- falkTX mentioned once that jack1 may work better with FireWire devices, so one easy fix to attempt is to switch the jack version and look what comes out. jack2 is a fork of jack1, not necessarily a successor, as afaik the development of jack1 continues. Install jack1 with
sudo apt-get install jackd1
Or jackd2.
- afaik there's been a recent switch from init.d system to upstart, but I might be wrong.
- in case you want to manually create start scripts, take into account that there are at least 2 places where they might live: root or userland. You need to clearly realize what command is going to be called from what space, otherwise expect some trouble. Userland scripts live in your home directory, look at them for some hints. Root scripts lived in /etc/init.d if I remember correctly, not sure where they are now. In case you want to mingle with them, I recommend reading how they work in Ubuntu first, and for the starters determining at which runlevel you would like the script to run.
- as a rule, drivers are supposed to be loaded automatically on boot, and if this is not happening on your system, then i'd suggest as the very first step attempt to understand what's going wrong and fixing it. That would be a proper fix. It might be, for example, that the wrong (old/alternative etc.) driver is automatically loaded during boot, blocking the "correct" one. The proper fix in that case would be to blacklist the wrong driver. You might want to look for some hints in the kernel log. One common way to fix troubles of this kind is to google your FireWire chipset and/or your device and Linux. Beware though that the kernel changes very quickly, along with the drivers, so 2-years information might be too old.
Otherwise, you might want to google ffado support forum and ask there.
tangerine
Established Member
Posts: 66
Joined: Tue Jul 29, 2014 12:08 pm

Re: How should I set up ffado-dbus-server to start at boot?

Post by tangerine »

Regarding killing and then starting jack, seems like jack is automatically started on your machine, but with the wrong settings, so perhaps the proper way to fix is permanently change the settings. You can do this by choosing the firewire driver in Cadence. Or from the command line with jack_control. Maybe review your ~/.config/jack/conf.xml
Also I strongly suggest you to not use qjackctl, which doesn't work well with jackdbus, use Cadence or jack_control to set up and control jack, and some patchbay app, for example Catia, to arrange connections.
skavar
Established Member
Posts: 97
Joined: Sat Sep 15, 2012 9:21 am

Re: How should I set up ffado-dbus-server to start at boot?

Post by skavar »

hi altie,

I have both presonus and focusrite gear. Both run fine with the jack2 ffado-driver.

As far as I know ffado-dbus-server should already run at boot, or maybe login, anyway it is started by the time my desktop appears.

I start jack2 via Cadence manually each boot, and find that browser audio does not need pulseaudio, so it is not installed at all.
altie
Established Member
Posts: 6
Joined: Sat Jul 26, 2014 2:36 am

Re: How should I set up ffado-dbus-server to start at boot?

Post by altie »

That's helpful info. I did not realize that jackd is not the preferred approach to keeping jack running. As for v1 vs v2, I was under the impression v2 was supposed to be a major improvement on the features of v1. I'm going to try to avoid going back to v1 unless I can't do what I need any other way.

It looks to me like upstart still uses scripts in /etc/rc* so maybe I can try starting things in the right order in /etc/rc2.d.

Thanks!
altie
Established Member
Posts: 6
Joined: Sat Jul 26, 2014 2:36 am

Re: How should I set up ffado-dbus-server to start at boot?

Post by altie »

It seems like there might be a combination of two problems here:

1) ffado-dbus-server is not registered with dbus.

I assume from the name that ffado-dbus-server is supposed to be started automatically by dbus if some other app requests firewire audio. That doesn't happen. If I try to start jack from the command line with jackd or `jackdbus auto`, or with the Start button in Qjackctl, and I don't have ffado-dbus-server manually started in another shell window, jack will fail.

I can't remember if I installed ffado from an Ubuntu or KXStudio package or compiled from source. Maybe that has something to do with it. In any case, it's installed system-wide:
altie@altiemain:/etc$ which ffado-dbus-server
/usr/bin/ffado-dbus-server
2) Once jack has failed to start with firewire once, it will continue to fail until a reboot or plug/unplugging the firewire device.

Not sure what's going on here. The jack log:
Wed Sep 3 23:29:08 2014: Starting jack server...
Wed Sep 3 23:29:08 2014: JACK server starting in realtime mode with priority 10
Wed Sep 3 23:29:08 2014: self-connect-mode is "Don't restrict self connect requests"
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
(qjackctl:3358): Gtk-CRITICAL **: IA__gtk_widget_get_direction: assertion 'GTK_IS_WIDGET (widget)' failed
(qjackctl:3358): Gtk-CRITICAL **: IA__gtk_widget_get_direction: assertion 'GTK_IS_WIDGET (widget)' failed
Wed Sep 3 23:29:10 2014: ERROR: firewire ERR: Could not start streaming threads
Wed Sep 3 23:29:10 2014: ERROR: Cannot start driver
Wed Sep 3 23:29:10 2014: ERROR: JackServer::Start() failed with -1
Wed Sep 3 23:29:10 2014: ERROR: Failed to start server
Wed Sep 3 23:29:10 2014: Saving settings to "/home/altie/.config/jack/conf.xml" ...
23:29:12.682 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Googling that leads to ffado's wiki (http://www.ffado.org/?q=node/516), which is not yet fleshed out enough to be very helpful:
firewire ERR: Could not start streaming threads
DRIVER NT: could not start driver
cannot start driver

Reason: This could be happening if jackd has crashed. For instance if jackd is started with a to low setting for frames/period or periods
Solution: Start gscanbus and select "Force Bus Reset" under "Control"
I had to install gscanbus (`sudo apt-get install gscanbus`). Running it also throws an error, whether or not ffado-dbus-server is running:
altie@altiemain:/etc$ gscanbus
Error while reading from IEEE1394: : Resource temporarily unavailable
something is wrong here
Error while reading from IEEE1394: : Resource temporarily unavailable
Could not read topologyMap
Error while reading from IEEE1394: : Resource temporarily unavailable
Could not read topologyMap
Error while reading from IEEE1394: : Resource temporarily unavailable
Error while reading from IEEE1394: : Resource temporarily unavailable
Error while reading from IEEE1394: : Resource temporarily unavailable
altie
Established Member
Posts: 6
Joined: Sat Jul 26, 2014 2:36 am

Re: How should I set up ffado-dbus-server to start at boot?

Post by altie »

ffado-diag hints at some missing packages or paths that might be relevant:

Code: Select all

   jackd ............. sh: 1: jackd: not found
     path ............ 
     flags ........... Package jack was not found in the pkg-config search path.
   libraw1394 ........ 2.1.0
     flags ...........  -lraw1394  
   libavc1394 ........ Package libavc1394 was not found in the pkg-config search path.
     flags ........... Package libavc1394 was not found in the pkg-config search path.
I'll see if I can figure out how to get pkg-config to see jack (jackd? jackdbus? who knows?).
skavar
Established Member
Posts: 97
Joined: Sat Sep 15, 2012 9:21 am

Re: How should I set up ffado-dbus-server to start at boot?

Post by skavar »

here is my ffado-diag output, jack2 running:

Code: Select all

FFADO diagnostic utility 2.2.1
============================
(C) 2008 Pieter Palmers
    2009-2010 Arnold Krille


=== CHECK ===
 Base system...
  kernel version............ 3.16-1.dmz.1-liquorix-amd64
    Preempt (low latency)... True
    RT patched.............. False
  old 1394 stack present.... False
  old 1394 stack loaded..... False
  old 1394 stack active..... False
  new 1394 stack present.... True
  new 1394 stack loaded..... True
  new 1394 stack active..... True
  /dev/raw1394 node present. False
  /dev/fw* permissions:
crw-------  1 root root  250, 0 Sep  4 18:31 /dev/fw0
crw-rw----+ 1 root audio 250, 1 Sep  4 18:31 /dev/fw1
  User IDs:
uid=1000(skavar) gid=1000(skavar) groups=1000(skavar),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),103(fuse),104(scanner),107(bluetooth),108(netdev),900(cbnetwork),1001(storage)
 Prerequisites (dynamic at run-time)...
   gcc ............... gcc (Debian 4.9.1-11) 4.9.1
   g++ ............... g++ (Debian 4.9.1-11) 4.9.1
   PyQt4 (by pyuic4) . sh: 1: pyuic4: not found
   jackd ............. no message buffer overruns
     path ............ /usr/bin/jackd
     flags ........... Package jack was not found in the pkg-config search path.
Perhaps you should add the directory containing `jack.pc'
to the PKG_CONFIG_PATH environment variable
No package 'jack' found
   libraw1394 ........ Package libraw1394 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libraw1394.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libraw1394' found
     flags ........... Package libraw1394 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libraw1394.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libraw1394' found
   libavc1394 ........ Package libavc1394 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavc1394.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavc1394' found
     flags ........... Package libavc1394 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavc1394.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavc1394' found
   libiec61883 ....... Package libiec61883 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libiec61883.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libiec61883' found
     flags ........... Package libiec61883 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libiec61883.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libiec61883' found
   libxml++-2.6 ...... Package libxml++-2.6 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml++-2.6.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml++-2.6' found
     flags ........... Package libxml++-2.6 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml++-2.6.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml++-2.6' found
   dbus-1 ............ Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found
     flags ........... Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found
 Prerequisites (static at compile-time)...
   gcc ............... gcc (Debian 4.9.0-10) 4.9.0
   g++ ............... g++ (Debian 4.9.0-10) 4.9.0
   PyQt4 (by pyuic4) . Python User Interface Compiler 4.11.1 for Qt version 4.8.6
   jackd ............. sh: 1: jackd: not found
     path ............ 
     flags ........... Package jack was not found in the pkg-config search path.
   libraw1394 ........ 2.1.0
     flags ........... -lraw1394 
   libavc1394 ........ Package libavc1394 was not found in the pkg-config search path.
     flags ........... Package libavc1394 was not found in the pkg-config search path.
   libiec61883 ....... 1.2.0
     flags ........... -liec61883 -lraw1394 
   libxml++-2.6 ...... 2.36.0
     flags ........... -I/usr/include/libxml2 -I/usr/include/glibmm-2.4 -I/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/libxml++-2.6 -I/usr/lib/libxml++-2.6/include -lxml++-2.6 -lxml2 -lglibmm-2.4 -lgobject-2.0 -lglib-2.0 -lsigc-2.0 
   dbus-1 ............ 1.8.6
     flags ........... -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -ldbus-1 
 uname -a...
   Linux crunchbang 3.16-1.dmz.1-liquorix-amd64 #1 ZEN SMP PREEMPT Sun Aug 24 21:56:49 UTC 2014 x86_64 GNU/Linux
 Hardware...
   Host controllers:
05:0e.0 FireWire (IEEE 1394) [0c00]: VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller [1106:3044] (rev c0) (prog-if 10 [OHCI])
	Subsystem: Gigabyte Technology Co., Ltd GA-7VT600-1394 Motherboard [1458:1000]
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 32 (8000ns max), Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 22
	Region 0: Memory at fe700000 (32-bit, non-prefetchable) [size=2K]
	Region 1: I/O ports at c000 [size=128]
	Capabilities: <access denied>
	Kernel driver in use: firewire_ohci
altie
Established Member
Posts: 6
Joined: Sat Jul 26, 2014 2:36 am

Re: How should I set up ffado-dbus-server to start at boot?

Post by altie »

Oh, awesome, thanks! Do you happen to know how ffado-dbus-server gets started on your system?
skavar
Established Member
Posts: 97
Joined: Sat Sep 15, 2012 9:21 am

Re: How should I set up ffado-dbus-server to start at boot?

Post by skavar »

It is not started, I have just checked. But my interface does not require it to be started for recording or playback, nor does jack require it to be started. ffado-dbus-server does start if I start the ffado-mixer, or of course if I start it manually in the terminal.
Post Reply