36

I'm attempting to use easycap to record from my camcorder but I'm having a slight problem. Using their test script I'm able to get audio and video. I've noticed that in the script on line 159 it makes a call to "DEV_ADUIO", which is reported as being "plughw:2,0".

Exactly what is this device? Is it located in /dev/ somewhere?

I've done ls /dev/ and I can't find anything that would suggest an audio device

2 Answers 2

42

Run the command (in the terminal)

aplay -l

The output looks like

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC262 Analog [ALC262 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The device for this is plughw:0,0. The two zeros come from the device 0 and Subdevice #0.

3
  • 1
    The problem with that is when I try to put plughw:2,0 (my audio device) into something like ffmpeg. I just get an error Jan 17, 2011 at 23:20
  • 5
    Oh, these are in /dev/snd/
    – user4124
    Jan 18, 2011 at 14:44
  • 13
    doesn't the 0:0 come from card 0 and device 0 ?
    – rewolf
    Nov 9, 2013 at 21:44
7

Generally, there are a few ways to get audio playback and recording devices on Linux. I'm focusing on command-line tools in this answer.

With PipeWire tools

If you are running PipeWire as your sound server, you can use pw-cli to get the names of all your inputs and outputs (recording and playback devices):

pw-cli list-objects | grep node.name

Example output:

node.name = "Dummy-Driver"
node.name = "Freewheel-Driver"
node.name = "Midi-Bridge"
node.name = "v4l2_input.pci-0000_00_1a.0-usb-0_1.6_1.0"
node.name = "alsa_output.pci-0000_00_1b.0.analog-stereo"
node.name = "alsa_input.pci-0000_00_1b.0.analog-stereo"
node.name = "alsa_input.usb-UC_Mic_USB_Audio_Device-00.mono-fallback"

These node names can be used to record audio from the command line.

See also pw-link which can list input and output PipeWire ports.

With PulseAudio tools

Alternatively, you can use command-line tools that come with PulseAudio (another sound server) to do the same:

pactl list | grep node.name

This produces similar output to pw-cli list-objects on my machine:

node.name = "alsa_output.pci-0000_00_1b.0.analog-stereo"
node.name = "alsa_output.pci-0000_00_1b.0.analog-stereo"
node.name = "alsa_input.pci-0000_00_1b.0.analog-stereo"
node.name = "alsa_input.usb-UC_Mic_USB_Audio_Device-00.mono-fallback"

I found it useful to only display audio sinks, like loudspeakers and headphones:

pactl list short sinks

Example output:

43  alsa_output.pci-0000_00_1b.0.analog-stereo  PipeWire    s32le 2ch 48000Hz   IDLE
1076    alsa_output.usb-Logitech_Logitech_Wireless_Headset_4473D63ED97A-00.analog-stereo    PipeWire    s16le 2ch 48000Hz   IDLE

Mind that even if you use PipeWire as your audio server, pactl will probably still work since PipeWire aims to be a drop-in replacement for PulseAudio.

With ALSA tools

As shown in user4124's answer, you can list playback devices (e.g., headphones, loudspeakers) using ALSA's command-line tools:

aplay --list-devices

Sample output for playback devices on my machine:

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CX20590 Analog [CX20590 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

For recording devices, use

arecord --list-devices

Sample output for recording devices on my machine:

**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CX20590 Analog [CX20590 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

See also the --list-pcms option from the man page to list all PCM devices.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .