我使用 i3-gaps 安装 Arch Linux。我试过了speaker-test -t wav -c 2
,耳机和扬声器都可以。当我使用sudo -u user pulseaudio -D --start
和 时,声音偶尔会开始工作start-pulseaudio-x11
。该pulseaudio
命令仅适用于但如果我运行相同的命令sudo -u user
则失败。su user
后者(有时)在使用 root 或 运行时无法连接sudo -u user
,导致pa_context_connect() failed: Connection refused
.使用 和 切换到用户su
会导致
E: [autospawn] core-util.c: XDG_RUNTIME_DIR (/run/user/0) is not owned by us (uid 1000), but by uid 0! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
W: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
E: [pulseaudio] main.c: Failed to acquire autospawn lock
套餐:
Alsa packages:
~ alsa-lib 1.2.2-1
~ alsa-plugins 1.2.2-1
~ alsa-topology-conf 1.2.2-2
~ alsa-ucm-conf 1.2.2-1
- alsa-utils 1.2.2-1
Pulseaudio packages
~ libpulse 13.0-3
~ pulseaudio 13.0-3
~ pulseaudio-alsa 2-5
答案1
我已经找到了我自己问题的答案。如果我要运行pulseaudio -D --start
它会导致错误,但pulseaudio -D
只会发出警告,并且可以正常运行