On Tue, 5 Jun 2018, Mac wrote:
Ok, so I modified my script to:
...
This produces exactly what I'd expect and, so far, appears well behaved and
reproducable.
Good.
But, some questions:
1.) The pulse in/out are labelled front-left, front-right.
The script does not mention these labels, so where did they come from.
The script does use these labels:
jack_connect system:capture_1 PulseIn:front-left
jack_connect system:capture_2 PulseIn:front-right
jack_connect PulseOut:front-left system:playback_1
jack_connect PulseOut:front-right system:playback_2
We told pulse to create two jack clients: PulseIn and PulseOut. Pulse named the ports front-left and front-right. You can see these ports by looking at qjackctl's Connections window or by typing jack_lsp in a terminal.
(There nothing in the output of aplay -l or -L with these either.)
(And, where does playback_1/_2 come from?)
playback-1/-2 are again jack ports, but in this case they are created by the jack backend or master device rather than a client. So they are called "system:*" However, aside from that, they can be treated like the ports from any other client.
aplay is an alsa utility and so does not show jack ports, jack_lsp will show jack ports (both audio and midi).
2.) Aplay -l or -L lists a bunch of devices. For example PCH is actually capable
of surround sound and there are 2 hdmi devices, and there is spdif as well.
How do I get system:xxxx to show more of the on board outputs?
system will show only one device. If you are sure they are all in sync, it may be possible to create an alsa multi virtual card... see:
https://alsa.opensrc.org/TwoCardsAsOne
http://www.jrigg.co.uk/linuxaudio/ice1712multi.html
and others.
The second link above gives some of the troubles that may be encountered with this method. However, this is the only way to get them all to be "system:" ports.
There is another way to do the same thing that seems to be (in my experience) more robust. I use zita-ajbridge in the form of zita-a2j for inputs and zita-j2a for outputs. Zita-ajbridge does not care if the devices are synced or not. However, in this case the port client will have a different name besides system. I normally choose the name of the device:
zita-j2a -j PCH,1-out -d hw:PCH,1 -r 44100 -p 128 -n 2 &
this gives me a port like:
PCH,1-out:playback_1
Now, when you mention using suround, I also realize you would want your pulse-jack bridge to have more than 2 ports. So you would change the channels=value to 4,5 or 6 depending on how many channels you need in the:
pactl load-module module-jack-sink client_name=PulseOut channels=2 connect=no
line. Pulse will conveniently label them in suround like terms. (jack and zita will assume a multi channel audio card meant for mutitrack recording where channels are used as a number of mono sources)
zita-j2a will also allow more than two channels with the -c parameter. It is ok to use a large number here as zita-j2a will only use as many ports as there are actual DACs.
The whole thing is really very much like connecting a group of stereo componants together. each program or utility is like a box. Jack shows the plugs on each box and you use a (virtual) wire to connect the boxes as you wish. The maker of each box decides what to label their plugs and the owner is expected to figure out what they want to do with them.