我正在处理一个pulseaudio
我无法弄清楚的小不便。我有一台运行 Arch Linux 的 ThinkPadT460s 以及一个扩展坞。连接到该底座的是屏幕和我的电视通过接收器。
的输出xrandr
是
Screen 0: minimum 8 x 8, current 5760 x 2160, maximum 32767 x 32767
eDP1 connected (normal left inverted right x axis y axis)
2560x1440 60.00 + 48.00 59.95
1920x1440 60.00
1856x1392 60.01
1792x1344 60.01
2048x1152 60.00 59.90 59.91
1920x1200 59.88 59.95
1920x1080 59.96 60.00 59.93
1600x1200 60.00
1680x1050 59.95 59.88
1400x1050 59.98
1600x900 60.00 59.95 59.82
1280x1024 60.02
1400x900 59.96 59.88
1280x960 60.00
1368x768 60.00 59.88 59.85
1280x800 59.81 59.91
1280x720 59.86 60.00 59.74
1024x768 60.00
1024x576 60.00 59.90 59.82
960x540 60.00 59.63 59.82
800x600 60.32 56.25
864x486 60.00 59.92 59.57
640x480 59.94
720x405 59.51 60.00 58.99
640x360 59.84 59.32 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP2-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 1220mm x 680mm
1920x1080 60.00*+ 50.00 59.94 30.00 24.00 29.97 23.98
4096x2160 24.00 23.98
3840x2160 30.00 25.00 24.00 29.97 23.98
1680x1050 59.88
1600x900 60.00
1280x1024 60.02
1152x864 75.00
1280x720 60.00 50.00 30.00 59.94 29.97 24.00 23.98
1024x768 60.00
800x600 60.32
720x576 50.00
720x480 60.00 59.94
640x480 60.00 59.94
DP2-2 connected primary 3840x2160+1920+0 (normal left inverted right x axis y axis) 620mm x 340mm
3840x2160 60.00*+ 30.00 25.00 24.00 29.97 23.98
1920x2160 59.99
2560x1440 59.95
1920x1080 60.00 60.00 50.00 50.00 59.94
1680x1050 59.95
1280x1024 60.02
1440x900 59.89
1280x960 60.00
1280x720 60.00 50.00 59.94
1024x768 60.00
800x600 60.32 56.25
720x576 50.00
720x480 60.00 59.94
640x480 60.00 59.94
DP2-3 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
现在,如果我连接电视,我还想将声音切换到 HDMI。在一个在屏幕配置之间切换的脚本中,我还添加了一行来更改声音, fe 切换回我拥有的内部声音
pactl set-card-profile 0 output:analog-stereo
。
然而,电视(这里是DP2-1)似乎在pulseaudio中切换了ID。有时我需要使用pactl set-card-profile 0 output:hdmi-stereo-extra1
(内部称为 HDMI 2),有时pactl set-card-profile 0 output:hdmi-stereo-extra3
(内部称为 HDMI 4),但我还没有真正弄清楚原因。我也看不到任何具体的触发器,有时在重新启动配置文件名称开关后。
有谁知道要测试什么来弄清楚这里发生了什么?
答案1
在尝试了一些事情之后,我可以给出一个不满意但有效的答案。
pactl list cards
当我的电视打开时,仔细查看输出,该条目显示了实际的设备名称:
[...]
hdmi-output-3: HDMI / DisplayPort 4 (priority: 5600, latency offset: 0 usec, available)
Eigenschaften:
device.icon_name = "video-display"
device.product.name = "VSX-330"
Teil der/des Profil(s): output:hdmi-stereo-extra3, output:hdmi-stereo-extra3+input:analog-stereo, output:hdmi-surround-extra3, output:hdmi-surround-extra3+input:analog-stereo, output:hdmi-surround71-extra3, output:hdmi-surround71-extra3+input:analog-stereo
[...]
由于我正在寻找简单的立体配置文件,因此我可以使用以下命令获取此特定条目
pactl set-card-profile 0 $(pactl list cards | grep -A1 'VSX-330' | awk '{print substr($4, 1, length($4)-1)}' | tail -1)
这不太漂亮,但到目前为止似乎已经成功了。这似乎与我的屏幕在对接设备时注册pulseaudio 的速度不是特别快有关。
希望这可以解决问题并帮助其他有类似问题的人!