Pulseaudioサウンドカードで設定ファイルの優先順位値を変更する方法

Pulseaudioサウンドカードで設定ファイルの優先順位値を変更する方法

pactl list cardsこれが Debian システムで実行したときに得られる結果です。

Card #0
    Name: alsa_card.pci-0000_00_0e.0
    Driver: module-alsa-card.c
    Owner Module: 1
    Properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x82510000 irq 130"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:0e.0"
        sysfs.path = "/devices/pci0000:00/0000:00:0e.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        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 (sinks: 0, sources: 1, priority: 60, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6060, available: yes)
        output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5400, available: yes)
        output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5460, available: yes)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5200, available: no)
        output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5260, available: yes)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5200, available: no)
        output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5260, available: yes)
        output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (sinks: 1, sources: 0, priority: 100, available: no)
        output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 160, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: output:hdmi-stereo
    Ports:
        analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec)
            Properties:
                device.icon_name = "audio-input-microphone"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo
        analog-input-headphone-mic: Microphone (priority: 8700, latency offset: 0 usec)
            Properties:
                device.icon_name = "audio-input-microphone"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2+input:analog-stereo
        analog-output: Analog Output (priority: 9900, latency offset: 0 usec)
            Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
        hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, available)
            Properties:
                device.icon_name = "video-display"
                device.product.name = "MSI MP243"
            Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo
        hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "video-display"
            Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1, output:hdmi-surround71-extra1+input:analog-stereo
        hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "video-display"
            Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2, output:hdmi-surround71-extra2+input:analog-stereo

プロファイルの下にはoutput:analog-stereo優先順位6000output:hdmi-stereo優先順位があります5400

次のコマンドを実行して、オーディオが機能していることを確認しようとしました。

~のためoutput:hdmi-stereo

aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Right.wav
  • 音声なし

~のためoutput:analog-stereo

aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Right.wav
  • オーディオが存在します

これは私のものです。pactl list short sinks

0 alsa_output.pci-0000_00_0e.0.analog-stereo    module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED

したがって、デフォルトはシミュレートされたステレオであることがわかります。だから、次のように変更しました。

pactl set-card-profile 0 output:hdmi-stereo
pactl set-default-sink alsa_output.pci-0000_00_0e.0.hdmi-stereo

pactl list short sinksそれは

1   alsa_output.pci-0000_00_0e.0.hdmi-stereo    module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED

次のコマンドを実行すると、両方にオーディオがあります

aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Right.wavoutput:hdmi-stereo- オーディオが存在します

aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Right.wavoutput:analog-stereo- オーディオが存在します

output:analog-stereoこの設定でプレイする理由は優先順位が高いからではないかと思います。理想的には、どちらも同じ優先順位で実行したいと思います。これは、私がプレイするために行ったステップに従う必要がないことを意味しますoutput:hdmi-stereo。とにかく両方をプレイする必要があります。一致するように優先順位を変更する必要がありますかoutput:analog-stereo?両方6000か。これをどのように実行しますか?

関連情報