jack-netbridge: Send Your JACK Audio/MIDI as Multicast Network Streams

jack-netbridge is a tool to send and receive Jack audio and MIDI data using multicast network streams. This guide provides a brief guidance into setting up and using jack-netbridge and offers potential solutions to some common challenges.

Initial considerations

  • Development Status: jack-netbridge is currently early under development. Users should be aware that features and functionalities might undergo changes.
  • Optimal Environment: The tool is optimized for local networks where latency issues are least likely to occur.

Installation

The easiest way to install jack-netbridge is using pip:

pip install jack-netbridge

Configuring jack-netbridge

jack_netbridge provides four components to receive / transmit audio and MIDI:

  • AudioTrasmitter
  • AudioReceiver
  • MidiTransmitter
  • MidiReceiver

They can be combined and configured in a single configuration file, which would look something like this:

["audio_recv_L:out"]
type = "AudioReceiver"
multicast_group = "239.0.0.1"
multicast_port = 4023
multicast_ttl = 2
interface_name = "eth1"

["audio_recv_R:out"]
type = "AudioReceiver"
multicast_group = "239.0.0.1"
multicast_port = 4024
multicast_ttl = 2
interface_name = "eth1"

["midi_recv_R:in"]
type = "MidiTransmitter"
multicast_group = "239.0.0.1"
multicast_port = 4025
multicast_ttl = 2
interface_name = "eth1"

Each section represents a Jack client and a port, which can have arbitrary names. If you have many transmitters/receivers on multiple machines, ports and clients should be given descriptive names to make it easier to understand where audio/MIDI is going or coming from.

By default jack_netbridge is using configuration file ~/.jack_netbridge.toml.

Note that jack-netbridge does not establish any JACK connections itself, so you will need to do it afterwards using standard tools like jack_connect or Carla. Another alternative can be jackmesh, which saves/loads Jack port connections using configuration files in a similar TOML format.

Running jack-netbridge

Once you’ve created a configuration file, start jack-netbridge:

jack_netbridge -c <path to your config file>  

Running jack-netbridge as a user systemd service

If you’re using jack-netbridge frequently, setting it up as a user systemd service can greatly enhance its convenience. By doing so, jack-netbridge can automatically start upon boot or login, ensuring it’s always ready to operate without manual intervention. Here’s how to do it:

1. Creating the service file

Start by crafting a systemd service file for jack-netbridge. You’ll use a .service extension for the file. For this example, we’ll name it jack-netbridge.service.

nano ~/.config/systemd/user/jack-netbridge.service

Within this file, input the following configuration:

[Unit]
Description=jack-netbridge service

[Service]
ExecStart=/path/to/jack_netbridge --mode your_mode --jack-client YourClient --jack-port YourPort --multicast-group YourMulticastIP --interface-ip YourInterfaceIP
Restart=always

[Install]
WantedBy=default.target

Replace /path/to/jack_netbridge with the full path to your jack_netbridge executable. Also, replace placeholders like your_mode, YourClient, YourPort, YourMulticastIP, and YourInterfaceIP with appropriate values depending on your setup.

2. Enabling the service

Once the service file is in place, you’ll need to reload systemd so it recognizes your new service:

systemctl --user daemon-reload

Now, you can enable the service to ensure it starts up with your user session:

systemctl --user enable jack-netbridge.service

If you wish to start the service immediately without rebooting or logging out:

systemctl --user start jack-netbridge.service

3. Monitoring the service

You can monitor the status of your jack-netbridge service with:

systemctl --user status jack-netbridge.service

For stopping the service:

systemctl --user stop jack-netbridge.service

To restart:

systemctl --user restart jack-netbridge.service

Troubleshooting

No Audio/MIDI sent/received

If jack-netbridge does not appear to be transmitting or receiving streams, multicast routes might be a potential area to review. Ensure multicast configurations are set correctly, and there are no obstacles in the transmission path.

Audio playback issues on the receiver side

It’s essential that both the transmitting and receiving ends operate at the same sample rate and have identical buffer size (e. g. 1024 on both ends). Make sure they match.

Similar Posts