arecord: Linux Command to List all Soundcards and Digital Audio Devices

last updated in Categories Hardware, Howto, Linux, Linux desktop

Here is a quick way to list all detected and working soundcards on a Linux based system. Just use the arecord command line sound recorder and player for ALSA soundcard driver. The -l option List all soundcards and digital audio devices. The -L option list all PCMs defined. The information obtained from following command can be used to play various media files or digital stream such as radio, tv and more.

Display all soundcards and digital audio devices

Type the following command:
$ arecord -l

**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
card 1: SAA7134 [SAA7134], device 0: SAA7134 PCM [SAA7134 PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

You need to use card number and device number while playing various media. For example, to play a radiostation (FM freq # 98.3) from card #1 and device 0 (hw=.), enter:
$ mplayer radio://98.3 -radio driver=v4l2:device=/dev/radio0:adevice=hw=1.0

Display all PCMs defined

Type the following command:
$ record -L

    HDA Intel, STAC92xx Analog
    Default Audio Device
    HDA Intel, STAC92xx Analog
    Front speakers
    HDA Intel, STAC92xx Analog
    4.0 Surround output to Front and Rear speakers
    HDA Intel, STAC92xx Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
    HDA Intel, STAC92xx Analog
    5.0 Surround output to Front, Center and Rear speakers
    HDA Intel, STAC92xx Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
    HDA Intel, STAC92xx Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
    HDA Intel
    IEC958 (S/PDIF) Digital Audio Output
    Discard all samples (playback) or generate zero samples (capture)

Here is another output from my Ubuntu Linux based laptop:

How to use /proc file system to find out sound devices on a Linux?

You can obtained same information from /proc/asound directory. For example, to list all cards, enter:
$ cat /proc/asound/cards

0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0x93300000 irq 22
 1 [SAA7134        ]: SAA7134 - SAA7134
                      saa7133[0] at 0x9300c800 irq 21

You can use gui tools to configure mixer and other settings:
$ alsamixergui

How do I select soundcard from GUI?

Ubuntu Linux and most other distro allows you to select and control soundcard properties from the GUI. The GNOME Volume Control application is an audio mixer that enables you to mix audio for two-channel sound cards. Just double click Volume Control to open mixer. Click on File > Change Device:

Linux GUI to List all Soundcards and Digital Audio Devices

You can also start GNOME Volume Control in the following ways:
a) Click on Applications menu > Choose Multimedia > Volume Control.

b) Or open the terminal / command line and enter:
$ gnome-volume-control &

Say hello to lspci command

You can list all PCI devices including sound card as follows:
lspci | grep -i audio
Sample outputs:

00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
01:00.1 Audio device: NVIDIA Corporation GK104 HDMI Audio Controller (rev a1)

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

1 comment

    Have a question? Post it on our forum!