Linux

升級到 Debian 測試後,PulseAudio 無法辨識 Intel HDA (Buster)

  • December 12, 2021

從 Debian 9 stable 升級到 Debian 10 測試後,我在夏天發現了一個問題:PulseAudio 不再辨識我的 Intel HDA 音頻設備。當時我能夠切換到通過 nVidia HDMI 連接的顯示器音頻,所以我迴避了這個問題,希望未來的更新能夠解決它。他們沒有。快進幾個月,我重新安排了我的工作空間,現在需要讓英特爾 HDA 再次工作。

這是我到目前為止所看到的……

Debian 10 測試

核心看到它:

# dmesg | grep HDA
[  +0.005509] input: HDA Intel PCH Front Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input17
[  +0.000073] input: HDA Intel PCH Rear Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input18
[  +0.000057] input: HDA Intel PCH Line as /devices/pci0000:00/0000:00:1b.0/sound/card0/input19
[  +0.000054] input: HDA Intel PCH Line Out Front as /devices/pci0000:00/0000:00:1b.0/sound/card0/input20
[  +0.000052] input: HDA Intel PCH Line Out Surround as /devices/pci0000:00/0000:00:1b.0/sound/card0/input21
[  +0.000051] input: HDA Intel PCH Line Out CLFE as /devices/pci0000:00/0000:00:1b.0/sound/card0/input22
[  +0.000053] input: HDA Intel PCH Line Out Side as /devices/pci0000:00/0000:00:1b.0/sound/card0/input23
[  +0.000058] input: HDA Intel PCH Front Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input24
[followed by NVidia HDMI audio devices that are recognized]

# lspci -nnk | grep -A2 Audio
00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)
   Subsystem: Gigabyte Technology Co., Ltd 7 Series/C216 Chipset Family High Definition Audio Controller [1458:a002]
   Kernel driver in use: snd_hda_intel
   Kernel modules: snd_hda_intel
[followed by NVidia HDMI audio devices that are recognized]

ALSA 看到它:

# aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: Generic Analog [Generic Analog]
 Subdevices: 0/1
 Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: Generic Digital [Generic Digital]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
[followed by NVidia HDMI audio devices that are recognized]

# aplay -L | grep PCH
default:CARD=PCH
   HDA Intel PCH, Generic Analog
sysdefault:CARD=PCH
   HDA Intel PCH, Generic Analog
front:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
surround21:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
surround40:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
surround41:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
surround50:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
surround51:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
surround71:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
iec958:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Digital
dmix:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
dmix:CARD=PCH,DEV=1
   HDA Intel PCH, Generic Digital
dsnoop:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
dsnoop:CARD=PCH,DEV=1
   HDA Intel PCH, Generic Digital
hw:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
hw:CARD=PCH,DEV=1
   HDA Intel PCH, Generic Digital
plughw:CARD=PCH,DEV=0
   HDA Intel PCH, Generic Analog
plughw:CARD=PCH,DEV=1
   HDA Intel PCH, Generic Digital

揚聲器測試正常播放音頻 aplay -D default:CARD=PCH /usr/share/sounds/alsa/Front_Left.wav

但是 PulseAudio 根本看不到該設備:

$ pacmd list-sinks
1 sink(s) available.
 * index: 0
   name: <auto_null>
   driver: <module-null-sink.c>
   flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
   state: SUSPENDED
   suspend cause: IDLE
   priority: 1000
   volume: front-left: 55705 /  85% / -4.24 dB,   front-right: 55705 /  85% / -4.24 dB
           balance 0.00
   base volume: 65536 / 100% / 0.00 dB
   volume steps: 65537
   muted: no
   current latency: 0.00 ms
   max request: 344 KiB
   max rewind: 344 KiB
   monitor source: 0
   sample spec: s16le 2ch 44100Hz
   channel map: front-left,front-right
                Stereo
   used by: 0
   linked by: 0
   configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
   module: 16
   properties:
       device.description = "Dummy Output"
       device.class = "abstract"
       device.icon_name = "audio-card"

當我進入聲音設置時,我看到的只是虛擬輸出設備。(此處不再列出 nVidia 設備,因為在重新排列時,我使用的是不同的顯示器,沒有音頻,因此目前沒有連接 HDMI 音頻設備。)

我試圖清除 PulseAudio 配置,認為我可能有一些遺留問題:

rm ~/.pulse/* ~/.config/pulse/*

Debian 9 穩定版

我在這台機器上有另一個分區,它仍在執行 Debian 9 stable,英特爾 HDA 在 PulseAudio 下工作,ALSA 驅動程序與 Debian 10 似乎確實存在差異,所以下面是我注意到的差異……

# aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC887-VD Analog [ALC887-VD Analog]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC887-VD Digital [ALC887-VD Digital]
 Subdevices: 0/1
 Subdevice #0: subdevice #0

# aplay -L | grep PCH

sysdefault:CARD=PCH
   HDA Intel PCH, ALC887-VD Analog
front:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
surround21:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
surround40:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
surround41:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
surround50:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
surround51:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
surround71:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
iec958:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Digital
dmix:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
dmix:CARD=PCH,DEV=1
   HDA Intel PCH, ALC887-VD Digital
dsnoop:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
dsnoop:CARD=PCH,DEV=1
   HDA Intel PCH, ALC887-VD Digital
hw:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
hw:CARD=PCH,DEV=1
   HDA Intel PCH, ALC887-VD Digital
plughw:CARD=PCH,DEV=0
   HDA Intel PCH, ALC887-VD Analog
plughw:CARD=PCH,DEV=1
   HDA Intel PCH, ALC887-VD Digital

當然,Debian 9 在 PulseAudio 中看到了 Intel HDA:

$ pacmd list-sinks
1 sink(s) available.
 * index: 2
   name: <alsa_output.pci-0000_00_1b.0.iec958-stereo>
   driver: <module-alsa-card.c>
   flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
   state: RUNNING
   suspend cause: 
   priority: 9958
   volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
           balance 0.00
   base volume: 65536 / 100% / 0.00 dB
   volume steps: 65537
   muted: no
   current latency: 24.26 ms
   max request: 4 KiB
   max rewind: 344 KiB
   monitor source: 3
   sample spec: s16le 2ch 48000Hz
   channel map: front-left,front-right
                Stereo
   used by: 1
   linked by: 1
   configured latency: 25.00 ms; range is 0.50 .. 1837.50 ms
   card: 1 <alsa_card.pci-0000_00_1b.0>
   module: 7
   properties:
       alsa.resolution_bits = "16"
       device.api = "alsa"
       device.class = "sound"
       alsa.class = "generic"
       alsa.subclass = "generic-mix"
       alsa.name = "ALC887-VD Digital"
       alsa.id = "ALC887-VD Digital"
       alsa.subdevice = "0"
       alsa.subdevice_name = "subdevice #0"
       alsa.device = "1"
       alsa.card = "0"
       alsa.card_name = "HDA Intel PCH"
       alsa.long_card_name = "HDA Intel PCH at 0xf5130000 irq 30"
       alsa.driver_name = "snd_hda_intel"
       device.bus_path = "pci-0000:00:1b.0"
       sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
       device.bus = "pci"
       device.vendor.id = "8086"
       device.vendor.name = "Intel Corporation"
       device.product.id = "1e20"
       device.product.name = "7 Series/C216 Chipset Family High Definition Audio Controller"
       device.form_factor = "internal"
       device.string = "iec958:0"
       device.buffering.buffer_size = "352800"
       device.buffering.fragment_size = "176400"
       device.access_mode = "mmap+timer"
       device.profile.name = "iec958-stereo"
       device.profile.description = "Digital Stereo (IEC958)"
       device.description = "Built-in Audio Digital Stereo (IEC958)"
       alsa.mixer_name = "Realtek ALC887-VD"
       alsa.components = "HDA:10ec0887,1458a002,00100302"
       module-udev-detect.discovered = "1"
       device.icon_name = "audio-card-pci"
   ports:
       iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
           properties:

   active port: <iec958-stereo-output>

所以問題很明顯:我如何讓英特爾 HDA 音頻在 Debian 10 的 PulseAudio 中再次工作?這是我可以從配置的角度解決的問題,還是需要由 ALSA 或 PulseAudio 維護人員解決的驅動程序問題?

由於同樣的問題,我最終來到這裡,從 Stretch 升級後,音頻消失了。類似的症狀和輸出(Nvidia 卡和 Intel HDA 聲音)。但是,在按照說明進行操作時,我發現我無法執行此步驟:

root@desk:~# aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav
aplay: main:828: audio open error: Device or resource busy

我發現罪魁禍首是膽怯:

root@desk:~# fuser -v /dev/snd/*
                    USER        PID ACCESS COMMAND
/dev/snd/pcmC0D0p:   timidity   1274 F...m timidity
/dev/snd/seq:        timidity   1274 F.... timidity

一旦我殺了它,我就可以繼續編輯/etc/pulse/default.pa,一切都到位了。我仍然不確定問題是缺少 PA 接收器還是膽怯接管。

我也考慮過送出錯誤報告,但我不確定哪裡更合適。如果您有任何建議,我將很樂意聽從您的建議,並在報告中加入我的支持。

感謝您分享解決方案!

我剛剛遇到了這個確切的問題,解除安裝 Timidity 解決了它。從字面上看,由於 apt 刪除了軟體包,我看到一條通知顯示我有一張音效卡(解釋為音量變化)。

引用自:https://unix.stackexchange.com/questions/473694