Определить звуковую карту linux

Определить звуковую карту 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 , где индентификатор карты можно задать двумя путями:

  1. Указать идентификатор из вывода команды cat /sys/class/sound/card*/id (эта команда описана чуть выше). Данное поведение не описано в документации, но работает.
  2. Указать номер устройства. Если устройство обозначается как hw:1,0 то номер будет 1
Читайте также:  Hp scanjet 4370 linux

Ключ -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

Источник

Find Sound card details in Linux/Unix

The Linux Juggernaut

Sound card is a hardware device which will give a machine the capability to play audio files and audio in video file for us. In this post we will see how to get sound card hardware and sound card driver details. We already covered following stuff in this «Know your hardware in Linux» series.

Example 1 : F ind number of sound cards present in your machine

0 [PCH ]: HDA-Intel - HDA Intel PCH 
HDA Intel PCH at 0xc2600000 irq 45

If you see there is only one sound card which is HDA-Intel sound card which is an inbuilt one.

/proc/asound/cardX 

Where X indicate no of cards, if you see card0, card1 then indicates you have two sound cards.

to see number of cards available

 
dr-xr-xr-x 5 root root 0 Jun 9 12:08 /proc/asound/card0

Example 2 : How to get card manufacture details using lspci command.

00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04) 

Example 3: How can I check how many number of devices attached to sound card like speakers, mic, woofers etc

cat /proc/asound/devices 
1: : sequencer 
2: [ 0- 3]: digital audio playback
3: [ 0- 0]: digital audio playback
4: [ 0- 0]: digital audio capture
5: [ 0- 3]: hardware dependent
6: [ 0- 0]: hardware dependent
7: [ 0] : control
33: : timer

From the above output we can see that there are two audio playback devices(Speakers) and an audio capture device(A mic) to this machine. And remaining details are sound card related information. Or we can use aplay command as well to get device details

aplay --list-devices 
 
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC270 Analog [ALC270 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

Example 4 : How can I get which Kernel module or sound driver details for my sound card. The module related to sound card is represented snd string in it’s name. So if we can search /proc/asound/modules file or lsmod command output we can easily find which sound card driver is in use as shown below

grep snd /proc/asound/modules 
0 snd_hda_intel 
lsmod | grep snd 
 
snd_hda_codec_hdmi 32049 1
snd_hda_codec_realtek 78147 1
snd_hda_intel 33492 3
snd_hda_codec 134213 3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
snd_hwdep 17699 1 snd_hda_codec
snd_pcm 96668 3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
snd_seq_midi 13325 0
snd_rawmidi 30513 1 snd_seq_midi
snd_seq_midi_event 14900 1 snd_seq_midi
snd_seq 61555 2 snd_seq_midi_event,snd_seq_midi
snd_timer 29426 2 snd_pcm,snd_seq
snd_seq_device 14498 3 snd_seq,snd_rawmidi,snd_seq_midi
snd 78921 16 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device
soundcore 15048 1 snd
snd_page_alloc 18485 2 snd_pcm,snd_hda_intel

Example 5: How can I find sound card software version in Linux?

cat /proc/asound/version 
Output: 
Advanced Linux Sound Architecture Driver Version 1.0.25.

A good documentation about /proc/asound folder can be found at http://alsa.opensrc.org/Proc_asound_documentation

Читайте также:  Vmware for suse linux enterprise

In our next post we will see how to find details about network card like network card manufacture, MAC address, drivers etc. Stay tuned.

Surendra Anne

Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.

Latest posts by Surendra Anne (see all)

  • Docker: How to copy files to/from docker container — June 30, 2020
  • Anisble: ERROR! unexpected parameter type in action: Fix — June 29, 2020
  • FREE: JOIN OUR DEVOPS TELEGRAM GROUPS — August 2, 2019
  • Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) — August 27, 2018
  • How to use ohai/chef-shell to get node attributes — July 19, 2018

Источник

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.

Читайте также:  Find non recursive linux

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.

Источник

Оцените статью
Adblock
detector