Audio

如何強制 pulseaudio 埠可用

  • August 30, 2020

我最近更新了我的系統,pulseaudio 現在拒絕使用我的音效卡。它確實知道它的存在,如下pacmd list-cards所示:

   index: 2
   name: <alsa_card.pci-0000_00_1b.0>
   driver: <module-alsa-card.c>
   owner module: 8
   properties:
       alsa.card = "0"
       alsa.card_name = "HDA Intel PCH"
       alsa.long_card_name = "HDA Intel PCH at 0xf7210000 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 = "0"
       device.description = "Built-in Audio"
       module-udev-detect.discovered = "1"
       device.icon_name = "audio-card-pci"
   profiles:
       input:analog-stereo: Analog Stereo Input (priority 60, available: no)
       output:analog-stereo: Analog Stereo Output (priority 6000, available: no)
       output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: no)
       off: Off (priority 0, available: unknown)
   active profile: <off>
   ports:
       analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
           properties:
               device.icon_name = "audio-input-microphone"
       analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
           properties:
               device.icon_name = "audio-input-microphone"
       analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
           properties:

       analog-output-lineout: Line Out (priority 9900, latency offset 0 usec, available: no)
           properties:

       analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
           properties:
               device.icon_name = "audio-headphones"

但是,對於卡上的每個埠,它都會顯示available: no. 我相信這是它自動檢測是否有任何東西插入插孔。這很好,除非已知此音效卡的插孔自動檢測已損壞。

在過去,它只會顯示為“未插入”,我可以選擇輸出到它。現在,pulseaudio 甚至不會為它設置接收器。pacmd list-sinks僅顯示影片卡 HDMI/DP 輸出的接收器。

如何關閉插孔自動檢測,或者強制這些埠可用?

許多卡都有配置文件,其中包括確定哪些輸入和輸出可用。您的卡有以下內容:

profiles:
   input:analog-stereo: Analog Stereo Input (priority 60, available: no)
   output:analog-stereo: Analog Stereo Output (priority 6000, available: no)
   output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: no)
   off: Off (priority 0, available: unknown)

目前活動的配置文件是

active profile: <off>

您可以pavucontrol配置選項卡中選擇配置文件,或使用pacmd set-card-profile。選擇名稱中帶有輸出的兩個配置文件之一應啟用模擬立體聲輸出。

我找到了解決這個問題的方法:在 hda 驅動程序中有一個選項可以禁用 Jack 檢測。我制定了一個 udev 規則來在啟動前強制執行此操作:

/etc/udev/rules.d/jackdetect.rules:

ACTION=="add", SUBSYSTEM=="sound", ATTRS{chip_name}=="ALC898", ATTR{hints}="jack_detect=false"
ACTION=="add", SUBSYSTEM=="sound", ATTRS{chip_name}=="ALC898", ATTR{reconfig}="1"

您可以在 /sys/class/sound/hwC?D?/chip_name 中找到您的晶片名稱,或者使用其他東西作為選擇器…

有關更多資訊,請參閱此頁面:https ://www.kernel.org/doc/html/latest/sound/hd-audio/notes.html#hd-audio-reconfiguration

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