我在 HP Pavilion g6-1d80nr 笔记本电脑上运行全新安装的 Ubuntu13.04,但没有声音。系统设置的声音面板中没有列出声音设备,音量小程序存在,但实际上不起作用。
最初的问题是注册了多个声卡,并将错误的声卡设置为默认值;我可以使用、等来查看它们。lspci
我aplay
通过注释掉中的几个选项解决了这个问题/etc/modprobe.d/alsa-base.conf
,现在登录屏幕上会播放鼓声,并且那里音量小程序功能齐全;我还可以使用test-speakers
和播放声音aplay
。但是,系统设置下仍然没有列出声音设备(甚至没有虚拟输出,并且搜索 Google 只会返回明确显示该设备的结果),并且任何应用程序都无法播放声音。
现在问题似乎出在 PulseAudio 上,它在启动时失败,并出现一些有关我的主文件夹权限的垃圾信息:
~$ pulseaudio -vv
I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) 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 3.0
D: [pulseaudio] main.c: Compilation host: x86_64-pc-linux-gnu
D: [pulseaudio] main.c: Compilation CFLAGS: -g -O2 -fstack-protector --param=ssp-buffer-size=4 -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 -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option
D: [pulseaudio] main.c: Running on host: Linux x86_64 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:35:23 UTC 2013
D: [pulseaudio] main.c: Found 2 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: Optimized build: yes
D: [pulseaudio] main.c: FASTPATH defined, only fast path asserts disabled.
I: [pulseaudio] main.c: Machine ID is e8ba9b2a4a942dc8a48d4b2352273fc1.
I: [pulseaudio] main.c: Using runtime directory /run/user/skye/pulse.
E: [pulseaudio] core-util.c: Home directory not accessible: Permission denied
然后我尝试了所有可用的解决方案那无效,包括清除/重新安装。在系统模式下以 root 身份运行时,PA 返回以下内容:
~$ sudo pulseaudio --system
W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set!
W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set!
N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode!
N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time!
W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that.
W: [pulseaudio] main.c: If you do it nonetheless then it's your own fault if things don't work as expected.
W: [pulseaudio] main.c: Please read http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode for an explanation why system mode is usually a bad idea.
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="pci-0000_00_01.1" card_name="alsa_card.pci-0000_00_01.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
W: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authorization key '/var/run/pulse/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.pulse-cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authorization key '/var/run/pulse/.pulse-cookie': No such file or directory
我不确定这是否真的是问题所在(我不认为这可以解释缺少虚拟输出的原因),任何帮助都将不胜感激;我并不关心我是否有 PulseAudio,我只想要声音。有人有什么建议吗?
答案1
我遇到了类似的问题,这是因为我的主目录由 root 拥有。通过执行以下操作可修复此问题:
sudo chown -R {user} /home/{user}
我的用户帐户是 daz,因此我发出了以下命令:
sudo chown -R daz /home/daz/