Difference between revisions of "Audio Through USB"

From MOD Wiki
Jump to navigation Jump to search
m (→‎Using netJACK2: link to ssh paage)
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Using JACK2 net ==
+
== Using netJACK2 ==
  
first connect the mod via usb cable to the PC.
+
'''NOTE: This requires v1.4 or later.'''
start JACK2 on your PC.
+
 
 +
First, connect the MOD Duo to your PC via usb cable. Make sure to open port 19000 on your firewall. If you use Linux with ufw, you can use:
  
note down the IP assigned to your PC by the MOD.
 
on linux this can be done by using:
 
 
<source lang="bash">
 
<source lang="bash">
ifconfig -a | grep "192.168.51." | awk 'sub("addr:","")' | awk '{print $2}'
+
sudo ufw allow 19000
 
</source>
 
</source>
  
note this value, we'll be referencing it as 'XYZ'.
+
Then, [[Access_MOD_using_SSH|ssh into the Duo]], and run:
  
make sure to open port 19000 on your linux firewall. if you have ufw you can use:
 
 
<source lang="bash">
 
<source lang="bash">
sudo ufw allow 19000
+
touch /data/enable-netmanager
 +
systemctl start jack-netmanager
 
</source>
 
</source>
 +
NOTE: You only need to run this command once. The next the Duo boots, <tt>jack-netmanager</tt> will be loaded by default. Delete the <tt>/data/enable-netmanager</tt> file inside the Duo to remove this auto-start feature.
  
With that setup, load jack2 netmanager client, by running on your PC:
+
Now run <tt>jackd</tt> on your own computer (connected to the Duo via USB), like this:
 
<source lang="bash">
 
<source lang="bash">
jack_load netmanager -i "-a 192.168.51.XYZ"
+
jackd -R -P 80 -d net -a 192.168.51.1 -C 2 -P 2 -i 1 -o 1 -l 4 -n mod-slave -s
 
</source>
 
</source>
 +
Adjust the parameters as needed, but keep <tt>mod-slave</tt> as the client name.
  
then ssh into the mod, and run:
+
=== Parameters explained ===
 +
 
 +
{| class="wikitable"
 +
|-
 +
| <tt>-R</tt>
 +
| Use realtime scheduling, enabled by default.
 +
|-
 +
| <tt>-P</tt>
 +
| Set the realtime scheduling priority, in this case 80.
 +
|-
 +
| <tt>-d</tt>
 +
| JACK backend, in this case the "net" driver.
 +
|-
 +
| <tt>-a</tt>
 +
| Multicast address, in this case the IP address of the MOD Duo.
 +
|-
 +
| <tt>-C</tt>
 +
| Number of audio input ports on the slave. This determines the number of audio output ports on the MOD Duo, marked as "Hardware Audio To Slave" ports in the web interface.
 +
|-
 +
| <tt>-P</tt>
 +
| Number of audio output ports on the slave. This determines the number of audio input ports on the MOD Duo, marked as "Hardware Audio From Slave" ports in the web interface.
 +
|-
 +
| <tt>-i</tt>
 +
| Number of MIDI input ports on the slave. This determines the number of MIDI output ports on the MOD Duo, marked as "Hardware Midi To Slave" ports in the web interface.
 +
|-
 +
| <tt>-o</tt>
 +
| Number of MIDI output ports on the slave. This determines the number of MIDI input ports on the MOD Duo, marked as "Hardware Midi From Slave" ports in the web interface.
 +
|-
 +
| <tt>-l</tt>
 +
| Number of cycles, determines the network latency.
 +
|-
 +
| <tt>-s</tt>
 +
| Setting this option makes the JACK slave memorize the ports that are connected to the JACK master. In case the master disappears and reappears the JACK slave will try to reconnect those ports automatically.
 +
|}
 +
 
 +
or if you prefer to use jackdbus:
 
<source lang="bash">
 
<source lang="bash">
systemctl stop jack2 mod-host mod-peakmeter ttymidi mod-ui
+
jack_control eps realtime true eps realtime-priority 80
jackd -R -P 80 -d net -a 192.168.51.XYZ -C 2 -P 2 -i 0 -o 0 -l 9 -n mod-duo
+
jack_control ds net dps multicast-ip 192.168.51.1 dps client-name mod-slave
 +
jack_control dps input-ports 2
 +
jack_control dps dps ouput-ports 2
 +
jack_control dps dps midi-in-ports 1
 +
jack_control dps dps midi-out-ports 1
 +
jack_control dps latency 4
 +
jack_control dps auto-save true
 +
jack_control start
 
</source>
 
</source>
  
open another ssh window, and run:
+
[[Category:netJACK]]
<source lang="bash">
+
[[Category:Networking]]
jack_load mod-host
 
jack_load mod-peakmeter
 
jack_load ttymidi -i "/dev/ttyS2"
 
mod-ui.run
 
</source>
 

Revision as of 22:28, 9 November 2018

Using netJACK2

NOTE: This requires v1.4 or later.

First, connect the MOD Duo to your PC via usb cable. Make sure to open port 19000 on your firewall. If you use Linux with ufw, you can use:

sudo ufw allow 19000

Then, ssh into the Duo, and run:

touch /data/enable-netmanager
systemctl start jack-netmanager

NOTE: You only need to run this command once. The next the Duo boots, jack-netmanager will be loaded by default. Delete the /data/enable-netmanager file inside the Duo to remove this auto-start feature.

Now run jackd on your own computer (connected to the Duo via USB), like this:

jackd -R -P 80 -d net -a 192.168.51.1 -C 2 -P 2 -i 1 -o 1 -l 4 -n mod-slave -s

Adjust the parameters as needed, but keep mod-slave as the client name.

Parameters explained

-R Use realtime scheduling, enabled by default.
-P Set the realtime scheduling priority, in this case 80.
-d JACK backend, in this case the "net" driver.
-a Multicast address, in this case the IP address of the MOD Duo.
-C Number of audio input ports on the slave. This determines the number of audio output ports on the MOD Duo, marked as "Hardware Audio To Slave" ports in the web interface.
-P Number of audio output ports on the slave. This determines the number of audio input ports on the MOD Duo, marked as "Hardware Audio From Slave" ports in the web interface.
-i Number of MIDI input ports on the slave. This determines the number of MIDI output ports on the MOD Duo, marked as "Hardware Midi To Slave" ports in the web interface.
-o Number of MIDI output ports on the slave. This determines the number of MIDI input ports on the MOD Duo, marked as "Hardware Midi From Slave" ports in the web interface.
-l Number of cycles, determines the network latency.
-s Setting this option makes the JACK slave memorize the ports that are connected to the JACK master. In case the master disappears and reappears the JACK slave will try to reconnect those ports automatically.

or if you prefer to use jackdbus:

jack_control eps realtime true eps realtime-priority 80
jack_control ds net dps multicast-ip 192.168.51.1 dps client-name mod-slave
jack_control dps input-ports 2
jack_control dps dps ouput-ports 2
jack_control dps dps midi-in-ports 1
jack_control dps dps midi-out-ports 1
jack_control dps latency 4
jack_control dps auto-save true
jack_control start