2 interfaces, 2 jackd, couple them

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

User avatar
bluebell
Established Member
Posts: 746
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

2 interfaces, 2 jackd, couple them

Postby bluebell » Sun Jul 22, 2018 7:02 pm

As I wrote Ihave 2 interfaces and need all of their outputs.

My first attempt with alsa_out on the 2nd interface worked but when it ran with 48000 then starting Audacity broke it.

So I am using another setup now:

jackd (on interface 1)
jackd -n monitor (on interface 2)

They can be coupled:

Code: Select all

jack-stdout -q -e float "Calf Studio Gear:Equalizer 12 Band Out #1" "Calf Studio Gear:Equalizer 12 Band Out #2" | JACK_DEFAULT_SERVER=monitor jack-stdin -q -e float system:playback_1 system:playback_2


Advantage: seems to be very stable
Disadvantage: additional latency on the signal that goes to the 2nd jackd

User avatar
bluebell
Established Member
Posts: 746
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: 2 interfaces, 2 jackd, couple them

Postby bluebell » Sun Jul 22, 2018 8:08 pm

I found zita-njbridge as well. Latency is much lower than using jack-stdout/in for coupling 2 jackd.

User avatar
khz
Established Member
Posts: 785
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: 2 interfaces, 2 jackd, couple them

Postby khz » Mon Jul 23, 2018 7:37 am


I did it with the "audioadapter" (4.), all in one qjackctl (Jack2) instance:
The boot sequence of the (PCI/PCIe) sound cards is important so that the same prerequisite (sound card sequence) is always given when the computer is started.

1. Define first sound card. What's in the computer:

Code: Select all

cat /proc/asound/cards

edit:

Code: Select all

/etc/modprobe.d/alsa.conf

Example, take what "/proc/asound/cards" says!

- same drivers :

Code: Select all

    options snd-ymfpci index=0
    options snd-hda-intel index=1,2

- different drivers:

Code: Select all

    options snd-emu10k1 index=0
    options snd-via82xx index=1



2. Save settings in alsamixer (as root), make settings for each sound card separately and save them:

Code: Select all

alsactl store



3. Programs take certain soundkate:

Code: Select all

~/.asoundrc

Code: Select all

    defaults.ctl.card 0
    defaults.pcm.card 0
    defaults.timer.card 0

# https://wiki.linuxaudio.org/faq/start#qhow_to_order_the_numbering_of_soundcards_if_using_alsa_drivers


4. Merge multiple sound cards into qjackctl:

A)
Setup > Advanced: "Server Prefix" select "jackdmp", "H/W Monitor", "H/W Meter", "Soft Mode", (RT) "Priority (0 - 99)" (https://linux.die.net/man/1/jackd)
Setup >> Options >> [X] Run script at startup

Code: Select all

jack_load -i "-d hw:1 -i16 -o16" 9632 audioadapter && jack_bufsize 128 &

hw <-- you want to merge (sound card) (hw:1/hw:0/...)
-i <-- your number of sound card inputs
-o <-- your number of sound card outputs
9632 <-- as you want to call them (jackport name)
jack_bufsize <-- set the JACK buffer size

# https://github.com/jackaudio/jackaudio.github.com/wiki/WalkThrough_User_NetJack2


B)
Alsa2jack (MIDI):
install:

Code: Select all

a2jmidid

Setup >> Options >> [X] Run script after startup

Code: Select all

sleep 5 && a2jmidid -e &

# sleep - delay a specified time period

Setup >> Settings >> Parameters >> MIDI Drivers [none]
Setup >> Miscellaneous >> [ ] ([none]) Provide support for ALSA sequencer
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.

User avatar
bluebell
Established Member
Posts: 746
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: 2 interfaces, 2 jackd, couple them

Postby bluebell » Mon Jul 23, 2018 8:49 am

khz wrote:>> http://jackaudio.org/faq/multiple_devices.html
I did it with the "audioadapter"


Interesting but I can't find the word "audioadapter" there. Where did you find docs about the audioadapter feature?

User avatar
khz
Established Member
Posts: 785
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: 2 interfaces, 2 jackd, couple them

Postby khz » Mon Jul 23, 2018 9:06 am

No idea anymore. I was desperate and had searched the Internet for a solution. There were not much contributions/documentation and if then very different to it.
After several failed attempts of the different possibilities, the "audioadapter" worked. I documented it right away in the net because I and also other users maybe later want to have it easier.

1.) On the fast even that found: https://github.com/jackaudio/jackaudio.github.com/wiki/WalkThrough_User_NetJack2
2.) jack with multiple cards?: https://linuxmusicians.com/viewtopic.php?t=16062
3.) That's my original post: https://www.sequencer.de/synthesizer/threads/alsa-soundkartenreihenfolge.93441/page-3#post-1156186
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.

User avatar
bluebell
Established Member
Posts: 746
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: 2 interfaces, 2 jackd, couple them

Postby bluebell » Mon Jul 23, 2018 10:24 am

khz wrote:No idea anymore. I was desperate and had searched the Internet for a solution. There were not much contributions/documentation and if then very different to it.
After several failed attempts of the different possibilities, the "audioadapter" worked. I documented it right away in the net because I and also other users maybe later want to have it easier.

1.) On the fast even that found: https://github.com/jackaudio/jackaudio.github.com/wiki/WalkThrough_User_NetJack2
2.) jack with multiple cards?: https://linuxmusicians.com/viewtopic.php?t=16062
3.) That's my original post: https://www.sequencer.de/synthesizer/threads/alsa-soundkartenreihenfolge.93441/page-3#post-1156186



Very interesting. I'll play around with it.

The solution "coupling 2 jackd with zita-j2n and zita-n2j" has the disadvantage that zita-j2n crashes when I change the bufsize of the jackd where it's connected to. Else it would be nearly perfect (low latency).

User avatar
khz
Established Member
Posts: 785
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: 2 interfaces, 2 jackd, couple them

Postby khz » Mon Jul 23, 2018 11:47 am

I'm not sure right now if the "audioadapter" command is important. "audioadapter" may be superfluous.
The "jack_load" command is important!

Once you have found the working setting, please document it comprehensibly for other users.
Good documentation is so helpful! :-D
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.

User avatar
bluebell
Established Member
Posts: 746
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: 2 interfaces, 2 jackd, couple them

Postby bluebell » Mon Jul 23, 2018 6:31 pm

khz wrote:I'm not sure right now if the "audioadapter" command is important. "audioadapter" may be superfluous.
The "jack_load" command is important!

Once you have found the working setting, please document it comprehensibly for other users.
Good documentation is so helpful! :-D


Code: Select all

jack_load -i "-d hw:2 " onboard audioadapter


onboard: the name as seen in qjackctl, can be chosen freely
audioadapter: the resampling module, name has to be exactly like this

That does the job on one of my machines. Changing bufsize seems to work. This is the most promising attempt.

In a few days I can test it on the other machine with 2 usb-interfaces.

User avatar
bluebell
Established Member
Posts: 746
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: 2 interfaces, 2 jackd, couple them

Postby bluebell » Wed Jul 25, 2018 5:56 pm

The audioadapter internal client is the best solution for me. I can't believe that it is so badly documented, especially the internal clients audioadapter and netadapter.

Scarlett 2i4:
jackd -p512 -t2000 -dalsa -r48000 -p128 -n2 -Xseq -dhw:1

Add Scarlett 2i2:
jack_load -i "-dhw:2 -p64 -r48000" 2i2 audioadapter

User avatar
khz
Established Member
Posts: 785
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Re: 2 interfaces, 2 jackd, couple them

Postby khz » Wed Jul 25, 2018 6:28 pm

:-)
Now also included in the grandiose GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info. ;-)


Wish/Request/: @qjackctl @Cadence/Cadence-JackSettings
Offer audio and net adapters under "Settings >> Parameters"?
Would make sense IMHO :freedom: and so
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.


Return to “System Tuning and Configuration”

Who is online

Users browsing this forum: No registered users and 1 guest