Re: [Jack-Devel] How do I replicate the -P parameter when using dbus

PrevNext  Index
DateTue, 22 Nov 2011 19:37:37 +0200
From Nedko Arnaudov <[hidden] at arnaudov dot name>
ToRoger James <[hidden] at beardandsandals dot co dot uk>
Cc[hidden] at lists dot jackaudio dot org
In-Reply-ToRoger James [Jack-Devel] How do I replicate the -P parameter when using dbus
Follow-UpRoger James Re: [Jack-Devel] How do I replicate the -P parameter when using dbus
Hi Roger,

Roger James <[hidden]> writes:

> My hardware setup requires the -P command line option to successfully
> start a jack server. This works fine when set in qjackctrl (Audio
> mode: Playback) as long as the dbus option is not selected. However
> when the dbus option is selected the server hangs on startup. Looking
> at the qjackctl code and the contents of conf.xml shows that when
> Playback mode is selected the only affect on the conf.xml parameters
> is that duplex is set to false, this is exactly the same when the
> Capture mode is selected so there is no differentiation between
> Playback and Capture modes in the parameters. This looks like a
> qjackctl bug, but putting that to one side for the moment as well as
> presumption that my server hangs because it is not getting clock/data
> from one of the digital capture ports.
>
> I have experimented to see what should be set in the dbus parameters
> to replicate the -P option. Using jack_control I have tried various
> combinations of settings for the duplex, playback, capture, inchannels
> and outchannels parameters, but I have not found one combination that
> successfully starts the server.
>
> My question is, is the replication of the -P parameter possible using
> the dbus server, and if so what is the magic combination?

What is the full jackd commandline that works for you?

Are you using the JACK driver for ALSA, right? If so, the driver
parameter name that matches the jackd`s '-P' is 'playback'. Make sure
that 'device' parameter is not set. Note that jack_control has no
command for resetting parameters to their defaults, only for setting
them. ladiconf can do this though. If you want to reset all parameters,
delete the conf.xml file and reactivate jackdbus.

jackdbus (and control api) parameters are ordered and the alsa driver
puts the device parameter after the capture and playback parameters. So
if you set the device parameter, it will override the playback
parameter. Quick look into jackd (jack2) code suggests that jackd has
the same behaviour. so specifying both -P and -d (regardless of the
order) will cause -P to be ignored.

Here is the relevant code of the alsa driver:

            case 'C':
                capture = TRUE;
                if (strcmp (param->value.str, "none") != 0) {
                    capture_pcm_name = strdup (param->value.str);
                    jack_log("capture device %s", capture_pcm_name);
                }
                break;

            case 'P':
                playback = TRUE;
                if (strcmp (param->value.str, "none") != 0) {
                    playback_pcm_name = strdup (param->value.str);
                    jack_log("playback device %s", playback_pcm_name);
                }
                break;

            case 'D':
                playback = TRUE;
                capture = TRUE;
                break;

            case 'd':
                playback_pcm_name = strdup (param->value.str);
                capture_pcm_name = strdup (param->value.str);
                jack_log("playback device %s", playback_pcm_name);
                jack_log("capture device %s", capture_pcm_name);
                break;


The the internal order of these parameters is:
 * "capture", 'C'
 * "playback", 'P'
 * "device", 'd'
 * "duplex", 'D'

-- 
Nedko Arnaudov <GnuPG KeyID: 5D1B58ED>
PrevNext  Index

1321983621.26535_0.ltw:2,a <87zkfoawim.fsf at arnaudov dot name>