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.
Get BIOS, Firmware, Hardware And Drivers Details in Linux/Unix
What is dmesg command and how to use it in Linux/Unix?
Find hardware info with lshw, hardinfo, sysinfo Linux/Unix commands
Find PCI hardware details using lspci command in Linux
Find USB device details in Linux/Unix using lsusb command
Find RAM details(size, make, speed, sa lots etc) in Linux/Unix
Find Optical devices(CD/DVD ROM’s) details in Linux/Unix
Example 1 : Find number of sound cards present in your machine
cat /proc/asound/cards
Output:
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.
or
/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
ls -ld /proc/asound/card* | grep ^d
Output:
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.
lspci -v | grep -i audio
Output:
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
or
alsamixer
Output:
Example 3: How can I check how many number of devices attached to sound card like speakers, mic, woofers etc
cat /proc/asound/devices
Output:
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
Output:
**** 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
Output:
0 snd_hda_intel
or
lsmod | grep snd
Output:
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
In our next post we will see how to find details about network card like network card manufacture, MAC address, drivers etc. Stay tuned.
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