Systemd Alsa/Jack and time to start things up

I looking to add a systemd item in /etc/systemd/system/
zynthian-midi-network.service which runs the multimidicast process as a daemon.

The jack/alsa bridge needs to be run after the alsa ports have been built by the item above.

There then needs to be a jack connection made to establish the link between the ‘appropriate’ network interfaces for In & OUt and the zynthian jack MIDI IN & OUT.
The last function would seem to be be best served by a MIDI mapping run from the webconf Interface.

But that implies a structure that might be at odds with your vision.

Which ‘order’ would you prefer these services started . . .?

Hi @wyleu!

Don’t worry about creating the MIDI connections in jackd. The “autoconnector” will do it, after i tweak it a little bit :wink:

You only create and test the service file for the MIDI-network service. Please, as it’s a non-zynthian-specific software, don’t use the word zynthian in the service filename. Take a look to the current service files:

zynthian-sys/etc/systemd

to get inspiration about the filename :rofl::rofl:

Regards!

Just discovered systemd-analyze plot > something.svg

and

systemd-analyze dot --to-pattern=’.target’ --from-pattern=’.target’ | dot -Tsvg > targets.svg

1 Like

A bit of analysis and movement.

So we are starting up zynthian using systemd.

Now that has been an area of considerable ‘robust’ debate from my searchings.
After looking into it I like it.

It does parallel start by separating out the dependences into individual start ups.

I grasp some of the implications ( it seems to make a set of binary (machine specific) files that run the startup. This has an element of magic and it’s probably better to be explicit on implicit but.)
The config files .service etc are pretty simple and there is a nod to windows at several stages in the write up. (That really will really offend the die hard unixists … )

It’s driven from it’s command line tool

systemctl

Which of course does EVERYTHING you can imagine but nothing that exactly matches your own mental image of what the system is doing … :smiley:

One glaring absence is a ‘decent’ xfce based gui config tool, (unless you know better)

if Multimidicast is started directly after jack2 the service won’t start under a systemd unit

failing with a access to the udp network.

As a solution I’ve moved it after the networking.service.

Do we need these ports to start up under jack or do we simply want the in and out ports that are selected from the Env ZYNTHIAN_MIDI_NETWORK_IN_CHANNEL & ZYNTHIAN_MIDI_NETWORK_OUT_CHANNEL? to be presented and would this be done in the ‘autoconnector’ ?

I’m not sure if making it reliant on Jack2 & networking would stop the start up of a zynthian if no networking is enabled.