由于我插入了损坏的 HDD 驱动器,因此我的脉冲音频无法工作。启动时,ubuntu 一直在检查它是否工作,并且启动时间很长(启动了几个启动作业)。
\n\n如果我尝试从控制台启动它,我会得到以下输出。
\n\nW: [pulseaudio] alsa-mixer.c: Your kernel driver is broken: it reports a volume range from 0 to 0 which makes no sense.\nW: [pulseaudio] alsa-mixer.c: Your kernel driver is broken: it reports a \nvolume range from 0 to 0 which makes no sense.\nW: [pulseaudio] authkey.c: Failed to open cookie file \'/root/.config/pulse/cookie\': No such file or directory\nW: [pulseaudio] authkey.c: Failed to load authentication key \'/root/.config/pulse/cookie\': No such file or directory\nW: [pulseaudio] authkey.c: Failed to open cookie file \'/root/.pulse-cookie\': No such file or directory\nW: [pulseaudio] authkey.c: Failed to load authentication key \'/root/.pulse-cookie\': No such file or directory\n
Run Code Online (Sandbox Code Playgroud)\n\n如果我尝试 vlc 我会得到以下输出:
\n\n[000055b30db07200] alsa audio output error: cannot open ALSA device "default": No such file or directory\n
Run Code Online (Sandbox Code Playgroud)\n\n我看到很多人都有同样的问题,但他们的解决方案不知何故对我不起作用。pulseaudio -D
其中有很多,但对我来说,这个输出守护进程启动失败。
由于这些教程,我确实删除了.pulse
,因为它不是在重新引导或启动pulseaudio时创建的,我不知道这是否是一个问题。
我对 ubuntu 还很陌生,所以请毫不犹豫地解释一下它是守护进程的作用以及我的 HDD 如何影响我的内核。
\n\n我不害怕使用终端,因为这就是我切换到 ubuntu 的原因。
\n\n系统是Ubuntu 19.10(Eoan Ermine)
\n\n内核是 5.3.0-29-generic x86_64
\n\n我还将我的主目录更改为另一个硬盘驱动器,但这应该不是问题,因为路径将保持不变。
\n\n不管怎么说,还是要谢谢你。
\n\n我确实以root权限运行pulseaudio,因为如果我只是写pulseaudio,它会说
\n\nHome directory not accessible: permission denied.\n
Run Code Online (Sandbox Code Playgroud)\n\n如果我运行 systemctl --user restartpulseaudio 我得到:
\n\nJob for pulseaudio.service failed because the control process exited with error code.\nSee "systemctl --user status pulseaudio.service" and "journalctl --user -xe" for details.\n
Run Code Online (Sandbox Code Playgroud)\n\n如果我运行 systemctl --user statuspulseaudio.service 我得到:运行 systemctl 获取更多信息
\n\nM\xc3\xa4r 02 16:40:41 tom-X570-AORUS-ELITE systemd[1320]: Failed to start Sound Service.\nM\xc3\xa4r 02 16:40:41 tom-X570-AORUS-ELITE systemd[1320]: pulseaudio.service: Service RestartSec=100ms expired, scheduling restart.\nM\xc3\xa4r 02 16:40:41 tom-X570-AORUS-ELITE systemd[1320]: pulseaudio.service: Scheduled restart job, restart counter is at 5.\nM\xc3\xa4r 02 16:40:41 tom-X570-AORUS-ELITE systemd[1320]: Stopped Sound Service.\nM\xc3\xa4r 02 16:40:41 tom-X570-AORUS-ELITE systemd[1320]: pulseaudio.service: Start request repeated too quickly.\nM\xc3\xa4r 02 16:40:41 tom-X570-AORUS-ELITE systemd[1320]: pulseaudio.service: Failed with result \'exit-code\'.\nM\xc3\xa4r 02 16:40:41 tom-X570-AORUS-ELITE systemd[1320]: Failed to start Sound Service.\n
Run Code Online (Sandbox Code Playgroud)\n\n如果您需要journalctl的输出,请告诉我。
\n对于某些人来说,删除并重新安装pulseaudio似乎可以解决这个问题。然而,我见过的唯一方法具有相当大的破坏性,因为许多包都依赖于pulseaudio。为了避免依赖性问题,我们可以使用dpkg
而不是清除pulseaudio apt
。
首先,运行以下命令:
sudo apt update
sudo apt upgrade
sudo dpkg -P --force-all pulseaudio
sudo rm -r ~/.pulse ~/.asound* ~/.pulse-cookie ~/.config/pulse
Run Code Online (Sandbox Code Playgroud)
如果在最后一步出现错误,请忽略该错误。
接下来,重新安装并重新启动 ALSA 和pulseaudio:
sudo apt install --reinstall -o Dpkg::Options::="--force-confmiss" pulseaudio
sudo alsa force-reload
systemctl --user restart pulseaudio
Run Code Online (Sandbox Code Playgroud)
最后,您可以使用以下命令检查pulseaudio的状态:
systemctl --user status pulseaudio
Run Code Online (Sandbox Code Playgroud)
它应该返回为“已加载”和“活动”。如果没有,请重新启动并再次检查状态。