[Jackaudio] Jack & systemd on RPI4

pfl pfl at messofts.be
Tue May 12 20:37:40 CEST 2020


Hi David,

in the mean time, I ended up running it as 'pi' user

with an extra Environement="XDG_RUNTIME_DIR=/run/user/1000"

but I never achieved to make it run in -R mode

I use ExecStart=/usr/bin/jackd -r -d alsa -r 44100 -P

Phil


On 12/05/2020 19:36, David Runge wrote:
> Hi Phil,
>
> On 2020-05-08 18:10:16 (+0200), pfl wrote:
>> I want jack to start at bood via systemd on a RPI4
>>
>> but when I run qjackctl it does not see jack running (while it is)
> This is because you run jackd as root.
>
>> if I start jack from the command line , qjackctl sees jack running
> This is because you start jackd as your unprivileged user.
>
>> I tried sudo qjackctl, it crashed the RPI4
> This may have several reasons, but also it is absolutely not recommended
> to do that.
>
>> any help appreciated
>>
>> Phil
> It seems (but I'm not sure), that you are starting jackd in a
> systemd **system** service. This means, that you run jackd as root
> (which is not recommended) and naturally an instance of qjackctl, run by
> your unprivileged user can not interact with it.
> To read up on the differences, please refer to upstream documentation
> [1].
>
>> [Unit]
>> Description=Jack audio server
>> After=sound.target
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>> [Service]
>> Type=simple
>> PrivateTmp=true
>> Environment="JACK_NO_AUDIO_RESERVATION=1"
>> #ExecStart=/usr/bin/jackd -T -ndefault -dalsa -dhw:0 -r48000 -p1024 -n2
>> ExecStart=/usr/bin/jackd -R -P20 -dalsa -dhw:0,1 -r49000 -p1024 -n2
> You can have a look at the default systemd **user** service [1], that is
> available in the jack2 repository (and depending on your distro is
> installed with jack2 or not).
> When installed (or copied to a user service location and modified to
> cope with the templating strings), you are able to start it with
> settings provided in one of the configuration files mentioned in
> `EnvironmentFile`.  So, if you have `~/.config/jack/something.conf` with
> whatever configuration you want to use, you can start the service with
>
> systemctl --user start jack at something
>
> If you want to have this service start with your user session, enable
> it:
>
> systemctl --user enable jack at something
>
> If you want to automatically start the session of your user, on boot of
> the machine (might require elevated privileges to activate):
>
> loginctl enable-linger <your-username-or-uid>
>
> After reboot your user service (this is a **system** service running as
> your user) `user@<your-username>` should be started automatically (even
> **before** you log in with a graphical session).
> Below your `user at .service`, you should see a jack at something **user**
> service.
>
> If you want to have a look at this in the cgroups available on your
> system:
>
> systemd-cgls
>
> If you want to see jackd's stdout/stderr, you can use the user journal:
>
> journalctl --user -b0 -u jack at something
>
> or just the plain status of the service:
>
> systemctl --user status jack at something
>
> I hope this was of help.
>
> Best,
> David
>
> [1] https://www.freedesktop.org/software/systemd/man/systemd.unit.html
> [2] https://github.com/jackaudio/jack2/blob/develop/systemd/jack%40.service.in
> [3] https://github.com/jackaudio/jack2/blob/develop/systemd/example.conf
>

-- 
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus


More information about the JackAudio mailing list