How to determine the type of sound card using bash?

In bash, how to determine which sound card is installed? I am trying to create a plugin for Rhythmbox and I would like to test it in a script configuration.

Edit: On my machine, I needed to use sudo to use lspci and lsmod . @ Quassnoi using cat worked without additional privileges.

+4
source share
3 answers
 cat /proc/asound/cards 
+6
source
 lspci | grep -i audio 
+7
source

I have a list of known sounds that you will check in your script setup. So you can use grep and lsmod to check which one is loaded.

# lsmod | grep -q snd_hda_intel

# echo $?

0

# lsmod | grep -q snd_foo

# echo $?

1

+4
source

All Articles