![在 pulseaudio 中更改默认音频端口](https://linux22.com/image/1016780/%E5%9C%A8%20pulseaudio%20%E4%B8%AD%E6%9B%B4%E6%94%B9%E9%BB%98%E8%AE%A4%E9%9F%B3%E9%A2%91%E7%AB%AF%E5%8F%A3.png)
您好,经过几个小时的谷歌搜索后,我还是一无所获。
我已在 18.04 中成功配置了音频,但需要帮助来更改端口设备的优先级。扬声器应优先!它们目前如下:
"$ pactl list sinks
Sink #0
State: RUNNING
Name: alsa_output.pci-0000_00_1f.3.analog-stereo
Description: Built-in Audio Analogue Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 8
Mute: no
Volume: front-left: 35388 / 54% / -16.06 dB, front-right: 35388 / 54% / -16.06 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor Source: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
Latency: 39638 usec, configured 40000 usec
Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC299 Analog"
alsa.id = "ALC299 Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0x404a100000 irq 142"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "a348"
device.form_factor = "internal"
device.string = "front:0"
device.buffering.buffer_size = "65536"
device.buffering.fragment_size = "32768"
device.access_mode = "mmap+timer"
device.profile.name = "analog-stereo"
device.profile.description = "Analogue Stereo"
device.description = "Built-in Audio Analogue Stereo"
alsa.mixer_name = "Realtek ALC299"
alsa.components = "HDA:10ec0299,10251243,00100002"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Ports:
analog-output-speaker: Speakers (priority: 10000, not available)
analog-output-headphones: Headphones (priority: 9000, available)
Active Port: analog-output-speaker
Formats:
pcm
"
耳机输出工作正常,但插孔检测存在问题(我认为 ubuntu 认为已经插入了一个耳机)
所以,问题是:有没有办法改变 pulseaudio 中输出模式的优先级和/或修复 18.04 中的插孔检测?
每次启动时更改输出端口都让我发疯(与 Windows 10 双启动 - 单独分区)
答案1
通过手动更改 GUI,您可以安装 Pulse Audio Volume Control
sudo apt install pavucontrol
打开应用程序并选择要设置的音频流。
为了在启动时设置某个输出,您可以将代码写入启动项或 ~/.bashrc 或 ~/.profile,甚至注册一些快捷方式来在输出之间切换也很有用。
设置快捷键Settings > Keyboard > Shortcuts > Custom Shortcuts
Alt+ L。
pactl set-sink-port 0 analog-output-speaker
设置Alt+H
pactl set-sink-port 0 analog-output-headphones
您还可以使扬声器的优先级高于耳机。