Raspberry pi 4 setup - getting crazy with jack

Trying to setup latest mod software on a raspberry pi 4 on raspberry OS 64 bit. And really need some help :neutral_face:

If I keep the jack.service mod-host.service in this way all is ok , can use mod and enjoy the wonderful plugins built with plugin builder for modduox.

[Unit]
Description=JACK2 Audio Server
#After=sound.target

[Service]
Environment=LV2_PATH=/home/sound/.lv2
Environment=JACK_NO_AUDIO_RESERVATION=1
Environment=JACK_PROMISCUOUS_SERVER=jack
LimitRTPRIO=99
LimitMEMLOCK=infinity
ExecStart=/usr/bin/jackd -t 2000 -R -P 99 -d alsa -d hw:pisound -r 48000 -p 128 -n default -X seq -s -S
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target

The problem comes when I want to run this services as my regular user, in order to add other software to the equation . Puredata , Carla and patchage for instance , to route audio/midi here and there to and from mod etc.

When I do add this modifications to the .service’s files

User=sound
Group=audio

mod-ui fails , complaining about jack

jack server is not running or cannot be started JackShmReadWritePtr

then I tried to remove the user and group from mod-ui and it works , but I get mod without inputs and outputs , and the jack servers tells me there it was an error adding clients.

If I run the services as root it works well , but I cant use other software at the same time and every software I run cant seem to access the jack server , even with Environment=JACK_PROMISCUOUS_SERVER=jack

I’m quite sure I had this working in the past and would love to play with mod routing audio/midi from other apps for sequencing etc .
Its very clear that I don’t know what I’m doing, but I would suspect that jack and mod services should run as a separated user and not as root maybe ?

other modifications Ive made include adding JACK_PROMISCUOUS_SERVER=jack to /etc/environment. Adding my current USER to an audio group in /etc/security/limits.d/audio.conf following guides on jack realtime setup and so on

@audio   -  rtprio     99
@audio   -  memlock    unlimited

thanks for any hints, Im aware that this is not officially supported but Im sure someone here was in a similar situation or knows where the problem could be .

Its so much fun to run mod along other apps like Giada or pd

3 Likes

If you rely on jackd from debian repositiories to work on a scenario like this, yeah you are going to have a bad time.
Unless you get your hands dirty, compiling stuff on your own, expect pain :scream:

The same setup we use for jack and other tools wont work on generic distributions.
As you likely already saw, dealing with DBus on such a service is a pain, and I guess debian jack2 builds are also missing the systemd integration, not to mention being quite outdated by now.
Oh, and running as root can be a problem, the metadata fix required for it was made a few releases ago, debian is still on a version before that.

A lot of tinkering is needed to get things working just right, and stuff will break when you eventually update as newer kernel or systemd versions tend to change little details here and there.

and to be honest, I feel a bit dirty trying to guide such efforts… :roll_eyes:

3 Likes

No worries , you just gave me a good hint to go and try to build jack from sources. Thanks

1 Like

I compiled jack2 from git and went all smooth .
Everything looks quite similar . When adding the User and Group to mod-host & mod-ui, mod-host is ok with it , mod-ui isnt.
If I run manually mod-ui I get :

=/usr/local/bin/mod-ui
ERROR: Failed to open HMI serial port, error was:
__init__() got an unexpected keyword argument 'writeTimeout'
Using FakeHMI => <mod.development.FakeHMI object at 0x7f918fdd60>
cc start socket missing
PermissionError: [Errno 13] Permission denied
jack client deactivated NOT

pretty much like before I guess.

Then I changed just mod-ui service to run as before without the user and group. Got it without input and output port BUT voilá , somehow I got what I wanted , sacrificing some functionality

Can somehow live with this . Thanks a lot Falk for suggesting to compile the jackd2 even tho it might not be related its good to know to keep apt to date.
Will continue from here and try to enjoy the toy now

3 Likes

thanks to my friend DatanoiseTV , he found out about mod-ui service needing

AmbientCapabilities=CAP_NET_BIND_SERVICE 

in order to get the web UI going as the regular user .
Im updating the repository in case someone wants to experiment

Finally have mod latest with in and outs working !

3 Likes

So after asking the mod mods I’ve reconsidered my position. Since this post had a happy ending and I wrongly assumed I should delete the instructions for others to try.

Install scripts for latest Mod software

And for building plugings on your own here the notes I took when doing so using a VM. Handy for mod hardware users too given the plugin store situation. My notes are for the mod plugin builder for raspberrypi4 64 bit target but you can replace and build for any mod device. I’ve tried adding a few plugins from github like bolliedelay xt and worked but with others I’ve failed.

Btw the microtonal autotune is so much fun!

6 Likes