如何透過 PulseAudio 存取音效卡上的其他頻道而不會出現混亂?

如何透過 PulseAudio 存取音效卡上的其他頻道而不會出現混亂?

Pulseaudio 常見問題解答顯示如何使用通道對應明確載入 ALSA 接收器模組。這可行,但也涉及禁用設備自動檢測模組,這是我不想做的。

在「聲音」設定中,每個輸出裝置都有一個「模式」選項,用於配置 PulseAudio 用於該裝置的通道對應。它具有“模擬立體聲輸出”和“模擬環繞 5.1 輸出”等選項。如果目標是不破壞預設配置,這似乎是一種可行的方法,而預設配置在大多數情況下效果很好。

問題是我的揚聲器實際上只是立體聲,但我還有 6 個輸出,我想以某種方式使用。我想它們可能會作為額外的水槽暴露出來。或者,如果我可以將這些附加通道公開為“aux0,aux1,...”,我可以使用模組重映射接收器使它們看起來像額外的水槽。

我還有 8 個類比輸入和 2 個數位輸入,並且沒有“模式”設定似乎將它們全部公開。

那麼問題來了:這些「模式」是在哪裡配置的呢?或者說,對於這個問題還有其他好的解決方法嗎?

答案1

這裡的例子對我有幫助:

https://wiki.archlinux.org/index.php/PulseAudio/Examples#Simultaneous_HDMI_and_Analog_Output

我最終得到以下結果~/.config/pulse/default.pa

# http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index12h3
# https://wiki.archlinux.org/index.php/PulseAudio/Examples#Simultaneous_HDMI_and_Analog_Output
# remix=no is required, otherwise it will turn 2-channel sound into 4-channel sound and send it to all master channels
load-module module-remap-sink sink_name=headphones remix=no master=alsa_output.pci-0000_00_1b.0.analog-surround-40 channels=2 master_channel_map=front-left,front-right channel_map=front-left,front-right sink_properties=device.description=Headphones
load-module module-remap-sink sink_name=speakers remix=no master=alsa_output.pci-0000_00_1b.0.analog-surround-40 channels=2 master_channel_map=rear-left,rear-right   channel_map=front-left,front-right sink_properties=device.description=Speakers

# sending output to this goes to both
# replacing "0" with "alsa_output.pci-0000_00_1b.0.analog-surround-40" might work, but this also does
update-sink-proplist 0 device.description="Both"

# this renames the virtual streams, which show up in KMix.  It's handy, since KMix can't show more than one sink for master volume in the popup
update-sink-input-proplist 0 media.name="Headphones"
update-sink-input-proplist 1 media.name="Speakers"

master=...根據需要替換您的設備名稱( )。

筆記:您必須先複製/etc/pulse/default.pa然後~/.config/pulse/default.pa編輯它,因為如果使用者的檔案存在,pulseaudio 根本不會從系統範圍的檔案中讀取。從今以後,您必須將系統範圍文件中的任何變更合併到您的個人文件中。或者,您可以只編輯系統範圍的文件,但隨後它可能會被更新覆蓋,這會失去您的所有工作! (或者也許 dpkg 會提示您手動合併它們,但是如果您沒有註意到怎麼辦?(在etckeeper此處插入建議。))

這裡還有一個例子:

http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index12h3

但它使用了輔助通道,這更令人困惑。使用remix=no使這變得不必要。

現在我不知道你對拼湊的定義是什麼,但你應該能夠使用這些範例加上 PA Wiki 或一些谷歌搜尋來完成剩下的工作。對於您的額外頻道,維基百科列出了以下內容:

頻道地圖。以逗號分隔的頻道名稱清單。目前定義的通道名稱為:left、right、mono、center、front-left、front-right、front-center、rear-center、rear-left、rear-right、lfe、subwoofer、front-left-of-center 、右前中心、左側、右側、aux0、aux1 至aux15、頂部中心、頂部左前、頂部右前、頂部前中心、頂部左後,右上右後,上後中央,(預設值取決於通道數和驅動程式)

順便說一下,該pacmd工具採用與文件完全相同的命令default.pa,因此您可以交互式地進行更改,然後將工作命令貼到 中default.pa,只是pacmd每個命令中都沒有。請注意,與在 中執行相比,您可能需要做一些稍微不同的事情,例如先卸載一些模組,default.pa因為pulseaudio 已經在運行。我花了一些時間在這件事上胡思亂想。 (:v)

相關內容