Alsa & JACK - card and device names (different naming conventions)
Solution 1
Each card has a number (also called "index"). Typically, a driver grabs the first free number, but it's possible to force drivers to use another number. It's also possible for numbers to remain free because they were used previously by an unplugged device.
Each card has name (such as "HDA NVidia"), and a unique ID (such as "NVidia").
Each PCM device has a number/index (which is fixed, and determined by the driver), a name, and an ID (typcially, ID and name are identical).
In a device name like hw:0,0
, the first parameter is the card (either the card number, or the card ID), and defaults to 0.
The second parameter is the device number (using the ID is not possible), and defaults to 0.
In ALSA device names, hw
specifies a hardware device, while plughw
adds plugins to automatically convert sample formats and rates if the capabilities of the hardware and the application do not match. (Jack typcially does not need this.)
Jack does not have a list of devices. That window is the QJackCtl tool, which is commonly used to start Jack.
The /dev/audio
and /dev/dsp
devices are OSS devices; this interface is obsolete in Linux, and showing them in this list does not make sense (these devices are actually the same as hw:0
).
The default list in QJackCtl does not show other cards than the first one; you have to click the button next to the list.
Solution 2
from your aplay -l The Scarlett interface is card 3, device 0 = hw:3,0
QjackCtl uses alias name rather than card number (hw:USB,0 = hw:3,0) to avoid any possible problem if card numbers change.
to get list of cards with alias names:
cat /proc/asound/cards
QjkackCtl used to use ~/.jackdrc settings but now ignores it and uses it's own settings. I have one recent Linux OS installed that does not have a ~./jackdrc file
you may want to have QjackCtl save settings to ~/.jackdrc in case another application uses JACK without QjackCtl
your ~/.jackdrc has '-dhw:0' which is onboard audio card 0, can change it to -dhw:USB,0 to match qjackctl and use the USB device
Related videos on Youtube
71GA
Updated on September 18, 2022Comments
-
71GA over 1 year
I am a bit confused about audio device names. If I use command
aplay -l
I get the list of all audio devices on my system:**** List of PLAYBACK Hardware Devices **** card 0: NVidia [HDA NVidia], device 0: VT1708S Analog [VT1708S Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: NVidia [HDA NVidia], device 2: VT1708S Alt Analog [VT1708S Alt Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: NVidia [HDA NVidia], device 3: VT1708S Digital [VT1708S Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: USB [Scarlett 2i4 USB], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0
Notice that the order is
card 0
,card 1
,card 3
wherecard 2
is not listed. This confuses me.I know that every entry here is a single device (not card) so if I am correct (and please confirm or correct me if I am wrong) I would name my soundcard "Scarlet 2i4" like
hd:3,0
? Or is ithd:2,0
becausecard 2
is missing?Now when I open a JACK and want to tweak audio settings, I have different names than the ones above. The names are:
hw:USB,0
hw:USB
hw:0
plughw:0
/dev/audio
/dev/dsp
Where does a JACK get this device table? What kind of naming convention is this and how can I figure out which device is which (I want JACK to primarily use my "Scarlet 2i4")? Is there any terminal command which will let me know this?
At the moment my
~/.jackrc
settings are like this:/usr/bin/jackd -nziga-scarlet-2i4 -t2000 -dalsa -dhw:0 -r48000 -p128 -n2
-
landroni almost 9 yearsDo I understand correctly that for Alsa the following two notations for the USB DAC are equivalent:
hw:3,0
andhw:USB,0
(using the OP's example)? And that both are equivalent to simply:hw:3
andhw:USB
? -
CL. almost 9 yearsYes. (And you could have simply tested this.)
-
landroni almost 9 yearsThank you for confirming this. (I believe there is value in keeping exact examples for future readers, as it can take quite a bit of time reading and rereading the (excellent) explanations to figure it all out...)