页次: 1
安装好 i3-wm 后,原装的配置文件
~/.config/i3/config
中有音量控制相关的快捷键设定:
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
但是实际使用时没有半点效果,尝试输入命令来控制,结果报错:
$ pactl set-sink-volume @DEFAULT_SINK@ +10% && killall -SIGUSR1 i3status
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
其实在论坛上找到了和我情况一样的用户,但是不是很看得懂,有没有朋友帮忙翻译一下?到底发生了什么?我该怎么做?
https://bbs.archlinux.org/viewtopic.php?id=276790
最近编辑记录 hellowliu (2023-06-11 19:29:38)
离线
ls -l ~/.pulse/
ls /run/user/$UID/pulse
env | grep PULSE
systemctl --user status pulseaudio
离线
ls -l ~/.pulse/
ls: cannot access '~/.pulse': No such file or directory
ls /run/user/$UID/pulse
dbus-socket native pid
env | grep PULSE
systemctl --user status pulseaudio
* pulseaudio.service - Sound Service
Lodaed: lodaed (/usr/lib/systemd/user/pulseaudio.service; disabled; preset: enabled)
Active: active (running) since Sun 2023-6-11 18:25:30 CST; 14min ago
TriggeredBy: * pulseaudio.socket
Main PID: 2753 (pulseaudio)
Tasks: 8 (limit: 9232)
Memory: 16.0M
CPU: 12.394s
Cgroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pulseaudio.service
2753 /usr/bin/pulseaudio --daemonize=no --log-target=journal
2762 /usr/lib/pulse/gsettings-helper
Jun 11 18:25:29 myarch systemd[776]: Starting Sound Service. . .
Jun 11 18:25:30 myarch pulseaudio[2753]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 11 18:25:30 myarch systemd[776]: Starting Sound Service. . .
Jun 11 18:25:30 myarch pulseaudio[2753]: Could not find org.bluez.BatteryProviderManager1.RegisterBattery>
Jun 11 18:26:55 myarch pulseaudio[2753]: org.freedesktop.DBus.Properties.Get /org/bluez/hci0/dev_8C_8B_62>
离线
都没啥问题。再看看:
echo $XDG_RUNTIME_DIR
如果这个也没有异常的话(应该是 /run/user/1000),那就只好上 strace 了。
strace -o log -s 512 -f pactl info
然后把生成的 log 文件找个地方(比如 https://fars.ee )发出来。
离线
感谢帮助,但是我一气之下重新安装了音频驱动,发现问题已经得到解决了。
回想起来怀疑是 pulseaudio 文件损坏。
如果后来有人遇到同样的问题,建议
pacman -Qk pulseaudio
查看一下文件完整性。
离线
怀疑是文件损坏的话,可以 -Qkk。不过文件不太会自己损坏的,一般是断电、强行关机,或者硬盘寿命到了之类的。
离线
页次: 1