当排查 Linux 声卡问题时,可以通过以下步骤依次执行命令,快速确认硬件和驱动的运行状态。
首先,使用 lspci 命令查看系统中所有 PCI 设备,从中找到声卡对应的硬件信息。
#/sbin/lspci
接着,通过 /proc/asound/cards 文件检查 ALSA(高级 Linux 声音架构)所识别到的声卡设备情况。
#cat /proc/asound/cards
然后,运行 aplay -l 命令列出 ALSA 播放设备,确认可用的录音或播放接口是否正常。
#aplay -l
最后,通过 cat /proc/modules | grep snd 查看已加载的内核模块,确认声卡驱动(如 snd、snd_hda_intel)是否加载成功,并检查对应的设备节点是否存在。
#cat /proc/modules | grep snd
#ls -L -l /dev/dsp*
