PulseAudio

更換輸出

GUI:

$ pavucontrol

CLI:

$ pacmd list | rg "active port"
    active port: <analog-output-speaker>
    active port: <analog-output-headphones>
    active port: <analog-input-internal-mic>

$ pacmd set-sink-port 0 analog-output-speaker
$ pacmd set-sink-port 0 analog-output-headphones

$ pacmd list | rg "Default sink"
Default sink name: alsa_output.pci-0000_00_1f.3.analog-stereo
$ pacmd set-sink-port "alsa_output.pci-0000_00_1f.3.analog-stereo" analog-output-speaker

重啟

檢查是否已經有在跑:

$ pulseaudio --check

kill 掉已經在跑得程式:

$ pulseaudio -k

如果沒有 Daemon 就開一個:

$ pulseaudio --start

設定檔

/etc/pulse/default.pa

Echo Cancellation

在設定檔裡加上:

load-module module-echo-cancel

GUI

  • pavucontrol

常用指令

pacmd list-sources
pacmd list-sinks
pactl load-module module-echo-cancel

PulseAudio with Rust

PulseAudio binding

PulseAudio plugin

參考