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
Run the command (in the terminal)
aplay -lThe 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 #0The device for this is plughw:0,0. The two zeros come from the device 0 and Subdevice #0.
3Generally, 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.nameExample 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"Often, audio devices like the USB microphone (listed last in the previous output) have shorter nicknames; Running
pw-cli list-objects | grep node.nickproduces the nickname of the USB mic:
node.nick = "USB Audio Device"This can make for shorter commands when, for example, recording 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.nameproduces 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"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 using ALSA's command-line tools:
aplay --list-devicesSample 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 #0For recording devices, use
arecord --list-devicesSample 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 #0See also the --list-pcms option from the man page to list all PCM devices.