Querying Your Sound Card

How do you know what abilities your sound card has, what bit depths and sample rates it supports, and how many channels? If you have no manual, you can query the /proc filesystem to find out. Audio devices are in /proc/asound. You can browse this directory in any file manager or from the command line. For example, on my system /proc/asound/card0 is the onboard ATI chipset. Reading /proc/asound/card0/codec#0 spits out a lot of information, and this snippet shows that this chipset supports high sampling rates and bit depths:

$ less /proc/asound/card0/codec#0
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24

The MobilePre looks like this:

$ less /proc/asound/card1/stream0 M Audio MobilePre at usb-0000:00:12.1-1, ...

Get The Book of Audacity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.