- What is my sound card linux
- What are my audio devices?
- 2 Answers 2
- With PipeWire tools
- With PulseAudio tools
- With ALSA tools
- How to view your sound card information using the terminal in Ubuntu 18.04
- What is a sound card?
- How to find the sound card using the terminal ?
- How to obtain the sound card manufacturer details?
- How to check the devices which are connected to the sound card (speakers, microphone ..)?
- How can I get the details of the kernel module or sound driver for my sound card?
- Nikolaus Oosterhof
What is my sound card linux
С помощью команды aplay -l можно посмотреть список всех потенциально работающих карт в системе:
**** List of PLAYBACK Hardware Devices ****
card 1 : USB [E-MU Tracker Pre | USB], device 0 : USB Audio [USB Audio]
Чтобы обратиться к такой карте, надо использовать символьное имя «USB» (такое обозначение часто используется в конфигах ALSA), или имя устройства, составленное из номера карты (в данном случае card 1) и номера устройства (в данном случае device 0):
Команда cat /proc/asound/cards
Данная команда показывает, как ядро видит звуковые карты в системе. Вывод команды следующий:
1 [USB ]: USB-Audio — E-MU Tracker Pre | USB
E-MU Systems, Inc. E-MU Tracker Pre | USB at usb-0000:00:1d.0-2, full speed
Более подробную информацию о возможных аудио-устройствах, которые предоставляет звуковая карточка, можно получить из команды arecord -L :
Discard all samples (playback) or generate zero samples (capture)
2.1 Surround output to Front and Subwoofer speakers
4.0 Surround output to Front and Rear speakers
4.1 Surround output to Front, Rear and Subwoofer speakers
5.0 Surround output to Front, Center and Rear speakers
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
IEC958 (S/PDIF) Digital Audio Output
Direct sample mixing device
Direct sample snooping device
Direct hardware device without any conversions
Hardware device with all software conversions
Здесь интересны строки hw: и plughw:. Очень часто стоит задача указать правильное устройство. Из этих данных можно получить обозначение устройства. Для этого надо с помощью команды aplay -l узнать номер устройства, и вместо символьного имени написать номер, отбросив CARD= и DEV= . Вот так:
Узнали что карта с именем USB имеет номер 1, отбросили CARD= и DEV= :
Команда cat /sys/class/sound/card*/id
Данная команда выведет список идентификаторов для всех присутствующих звуковых карт в системе.
Пример для внешней USB-карты:
Команда amixer и ее варианты
Данная команда выводит информацию о контроллерах системных миксеров, через которые выводится и вводится звук.
Simple mixer control ‘Master’,0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left — Front Right
Front Left: Playback 49140 [75%] [on]
Front Right: Playback 49140 [75%] [on]
Simple mixer control ‘Capture’,0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left — Front Right
Front Left: Capture 65536 [100%] [on]
Front Right: Capture 65536 [100%] [on]
Данную команду можно запустить с ключем -c , где индентификатор карты можно задать двумя путями:
- Указать идентификатор из вывода команды cat /sys/class/sound/card*/id (эта команда описана чуть выше). Данное поведение не описано в документации, но работает.
- Указать номер устройства. Если устройство обозначается как hw:1,0 то номер будет 1
Ключ -c используется для выполнения команд над конкретным устройством. Но если после символов -c XXX ничего не указывать, то будет выдана информация о контроллерах, которые используются для управления данной звуковой карточкой:
Simple mixer control ‘PCM’,0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left — Front Right
Front Left: Playback 185 [92%] [-7.50dB] [on]
Front Right: Playback 185 [92%] [-7.50dB] [on]
Simple mixer control ‘Clock rate Selector’,0
Capabilities: volume volume-joined
Simple mixer control ‘Main’,0
Playback channels: Front Left — Front Right
Capture channels: Front Left — Front Right
Здесь названия контроллеров ‘PCM’ , ‘Clock rate Selector’ , ‘Main’ — это так называемые control name , которые используются в файлах /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf и /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common в качестве составной части в названиях секций.
- Как преобразовать RAW набор байт в WAV файл
- Программы для работы со звуком под Linux
- Программы для работы со звуком под Linux — список 2
- Программы для работы со звуком
- Настройки для лучшей работы аудио-устройств в Linux
- Какие бывают семплеры
- Работа с ExEf (Extreme Effect)
- Как изменить громкость звука через консоль
- MP3split: Аудиоредактор MP3 в Linux, без перекодирования mp3-потока
- Визуализаторы музыки в Linux
- Какие диагностические данные можно узнать о звуковой карте в Linux
- Как в Ardour подавить фоновый шум на дорожке
- Как заставить работать утилиту beep в linux
- Настройка звука в PulseAudio на примере Manjaro Linux
- Какие программы используются для управления звуком через PipeWire
- Установка PipeWire на Debian Linux 11
What are my audio devices?
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
Run the command (in the terminal)
**** 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.
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
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
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:
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:
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
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.
How to view your sound card information using the terminal in Ubuntu 18.04
In this short tutorial , you will learn how to find your sound card information in a simple way in case your Ubuntu distribution cannot automatically detect it.
What is a sound card?
The sound card is a hardware device that enables your machine to play audio. In this tutorial, you will see how to get details about the sound card hardware and the sound card driver in your Ubuntu distribution.
How to find the sound card using the terminal ?
You just need to type in the command below :
To see the number of cards available, type in the command below :
How to obtain the sound card manufacturer details?
In order to view some details about the manufacturer of the sound card as well as the sound card driver, you would simply need to use the lspci command as follows :
or using alsamixer tool as shown below :
Which will bring out the screen below :
How to check the devices which are connected to the sound card (speakers, microphone ..)?
This can be easily done using the command below :
From the above output, we can see that there is one audio playback device (Speaker) and two audio capture devices (microphones). The remaining details are information related to the sound card.
You can also use the aplay command to get device details:
How can I get the details of the kernel module or sound driver for my sound card?
The module related to the sound card is represented by the snd string in its name. So, if you can look up the /proc/asound/modules file or the output of the lsmod command , you will be able to find out which sound card driver is being used, as shown below :
If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.
Nikolaus Oosterhof
Nikolaus holds a degree in software development and has a strong passion for all things tech-related, especially gadgets with screens. Though he is nostalgic for older phone models, he’s a retired gamer and continues to enjoy programming in open-source environments. Additionally, Nikolaus enjoys writing about Linux, macOS and Windows and has experience designing web pages.