新安装的pulseaudio出现错误:守护进程已在运行

新安装的pulseaudio出现错误:守护进程已在运行

操作系统信息:

uname -a
Linux debian 5.10.0-11-amd64 #1 SMP Debian 5.10.92-2 (2022-02-28) x86_64 GNU/Linux

安装它:

sudo apt install pulseaudio
pulseaudio 
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.

检查pid:

ps aux |grep  puls[e]
debian      2003  1.4  0.5 1355060 32676 ?       S<sl 14:45   0:13 /usr/bin/pulseaudio --daemonize=no --log-target=journal

杀死进程:

killall  pulseaudio

重新开始:

pulseaudio
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.

再检查一遍:

ps aux |grep  puls[e]
debian      4408  1.5  0.5 565988 30580 ?        S<sl 15:02   0:00 /usr/bin/pulseaudio --daemonize=no --log-target=journal

显示更多信息:

pulseaudio -vv
I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
D: [pulseaudio] core-util.c: RealtimeKit worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 14.2
D: [pulseaudio] main.c: Compilation CFLAGS: -g -O2 -ffile-prefix-map=/build/pulseaudio-eJtUKc/pulseaudio-14.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -fno-common -fdiagnostics-show-option -fdiagnostics-color=auto
D: [pulseaudio] main.c: Running on host: Linux x86_64 5.10.0-11-amd64 #1 SMP Debian 5.10.92-2 (2022-02-28)
D: [pulseaudio] main.c: Found 4 CPUs.
I: [pulseaudio] main.c: Page size is 4096 bytes
D: [pulseaudio] main.c: Compiled with Valgrind support: no
D: [pulseaudio] main.c: Running in valgrind mode: no
D: [pulseaudio] main.c: Running in VM: no
D: [pulseaudio] main.c: Running from build tree: no
D: [pulseaudio] main.c: Optimized build: yes
D: [pulseaudio] main.c: FASTPATH defined, only fast path asserts disabled.
I: [pulseaudio] main.c: Machine ID is 1d6cdb224b624ef0b5f3a69d0f9c448c.
I: [pulseaudio] main.c: Session ID is 3.
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
I: [pulseaudio] main.c: Using state directory /home/debian/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-14.2/modules.
I: [pulseaudio] main.c: Running in system mode: no
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.

如何开始呢pulseaudio

答案1

要停止pulseaudio,您需要停止用户pulseaudio.service并且pulseaudio.socket

pulseaudio -k
systemctl --user stop pulseaudio.{socket,service} 

核实:

ps -e | grep pulse

要重新启动它:

systemctl --user start pulseaudio.{socket,service}

检查正在运行的服务的状态:

systemctl --user status pulseaudio.{socket,service}

答案2

我有同样的问题+我可以以 root 用户身份启动 PulseAudio,但不能以普通用户身份启动

所以这些命令对我有用:确保在普通用户帐户上以普通用户身份运行这些命令:

pulseaudio -k
systemctl --user stop pulseaudio.{socket,service}
ps -e | grep pulse
kill <id> 
systemctl --user start pulseaudio.{socket,service} (as normal user)

这应该有效。记住杀死需要 root 访问权限的服务。

相关内容