Bounding Unicorns

USB Audio Device Identification in Linux

I have a computer with the following audio devices attached:

  • The "built-in sound". This isn't a "sound card" as the functionality is integrated into, probably, the PCH (platform controller hub). Technical name for it is "Intel high definition audio".
  • What is commonly called "a USB sound card". This is a USB device that has digital output jacks (optical/Toslink & coaxial) that I use for connecting the computer to an A/V receiver (Yamaha RX-V3800 in my case). This device also has a DAC and analog RCA outputs which I am not using.
  • A pro audio USB interface, PreSonus AudioBox USB.
  • A mini amplifer that has USB input from a computer, Nobsound NS-01G.

ALSA shows the following in /proc/asound/cards:

% cat /proc/asound/cards 
 0 [CODEC          ]: USB-Audio - USB AUDIO  CODEC
                      BurrBrown from Texas Instruments USB AUDIO  CODEC at usb-0000:00:14.0-4, full s
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xd1044000 irq 126
 2 [USB            ]: USB-Audio - AudioBox USB
                      PreSonus Audio AudioBox USB at usb-0000:00:14.0-8, full speed
 3 [Device         ]: USB-Audio - USB2.0 Device
                      Generic USB2.0 Device at usb-0000:00:14.0-9, full speed

Out of all of these devices, only AudioBox identifies itself with its product name. The remaining devices offer no help to figure out which one is which.

% arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: CODEC [USB AUDIO  CODEC], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC221 Analog [ALC221 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 2: ALC221 Alt Analog [ALC221 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: USB [AudioBox USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: Device [USB2.0 Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

arecord -L output, which is needed for example to get the name of plughw device, is quite confusing to separate by card:

% arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
    Default Audio Device
sysdefault
    Default Audio Device
ameter
hw:CARD=CODEC,DEV=0
    USB AUDIO  CODEC, USB Audio
    Direct hardware device without any conversions
plughw:CARD=CODEC,DEV=0
    USB AUDIO  CODEC, USB Audio
    Hardware device with all software conversions
default:CARD=CODEC
    USB AUDIO  CODEC, USB Audio
    Default Audio Device
sysdefault:CARD=CODEC
    USB AUDIO  CODEC, USB Audio
    Default Audio Device
front:CARD=CODEC,DEV=0
    USB AUDIO  CODEC, USB Audio
    Front output / input
dsnoop:CARD=CODEC,DEV=0
    USB AUDIO  CODEC, USB Audio
    Direct sample snooping device
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC221 Analog
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=2
    HDA Intel PCH, ALC221 Alt Analog
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC221 Analog
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=2
    HDA Intel PCH, ALC221 Alt Analog
    Hardware device with all software conversions
default:CARD=PCH
    HDA Intel PCH, ALC221 Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, ALC221 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC221 Analog
    Front output / input
dsnoop:CARD=PCH,DEV=0
    HDA Intel PCH, ALC221 Analog
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=2
    HDA Intel PCH, ALC221 Alt Analog
    Direct sample snooping device
hw:CARD=USB,DEV=0
    AudioBox USB, USB Audio
    Direct hardware device without any conversions
plughw:CARD=USB,DEV=0
    AudioBox USB, USB Audio
    Hardware device with all software conversions
default:CARD=USB
    AudioBox USB, USB Audio
    Default Audio Device
sysdefault:CARD=USB
    AudioBox USB, USB Audio
    Default Audio Device
front:CARD=USB,DEV=0
    AudioBox USB, USB Audio
    Front output / input
dsnoop:CARD=USB,DEV=0
    AudioBox USB, USB Audio
    Direct sample snooping device
hw:CARD=Device,DEV=0
    USB2.0 Device, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Device,DEV=0
    USB2.0 Device, USB Audio
    Hardware device with all software conversions
default:CARD=Device
    USB2.0 Device, USB Audio
    Default Audio Device
sysdefault:CARD=Device
    USB2.0 Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB2.0 Device, USB Audio
    Front output / input
dsnoop:CARD=Device,DEV=0
    USB2.0 Device, USB Audio
    Direct sample snooping device

Filtering this by plughw I get:

% arecord -L|grep plughw
plughw:CARD=CODEC,DEV=0
plughw:CARD=PCH,DEV=0
plughw:CARD=PCH,DEV=2
plughw:CARD=USB,DEV=0
plughw:CARD=Device,DEV=0

I understand that PCH one is the built-in audio, but the remaining devices are called "CODEC", "USB" and "Device". Great.