Using udev to launch JACK as specific user?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using udev to launch JACK as specific user?

Mario Lang
Hi.

After 2 hours of "edit, reboot, fail" I am giving up and ask here.
I feel like what I want should be relatively simple, but it isn't.

I'd like to launch JACK via Systemd whenever a certain
card is present.  I have a udev rule in /etc/udev/rules.d/10-8A.rules
that looks like this:

ACTION=="add", SUBSYSTEMS=="sound", ATTRS{id}=="D8A", TAG+="systemd",
SYMLINK+="MOTU-8A"

This works, I get a /dev/MOTU-8A symlink.  The idea was to declare

[Install]
WantedBy=dev-MOTU-8A.device

in my systemd user service for JACK.  However, contrary to
what the web seems to document, the symlinked device does not
show up in systemctl.  So apparently, I can't depend on it either.

I am guessing anyone here must have a similar setup.
In its purest form, I am looking for a way to launch
a systemd user service once a certain ALSA hw device is available.

I see references to ENV{SYSTEMD_USER_WANTS}="jack.service", however,
I totally fail how this should work.  Udev has no idea which user
should launch this service.

Any hints to untangle this sort of messy situation?

--
CYa,
  ⡍⠁⠗⠊⠕
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user