Linux下没有音频设备

Linux下没有音频设备

我正在使用 Fedora 32,但问题从版本 31 开始:我在“设置”->“声音”下根本看不到任何声音设备。1

这些是我在处理声音问题时在互联网上看到的命令的输出:

ls -l /dev/snd

drwxr-xr-x. 2 root root       60 jun  9 20:29 by-path
crw-rw----+ 1 root audio 116, 11 jun  9 20:29 controlC0
crw-rw----+ 1 root audio 116,  9 jun  9 20:29 hwC0D0
crw-rw----+ 1 root audio 116, 10 jun  9 20:29 hwC0D2
crw-rw----+ 1 root audio 116,  3 jun  9 20:46 pcmC0D0c
crw-rw----+ 1 root audio 116,  2 jun  9 20:46 pcmC0D0p
crw-rw----+ 1 root audio 116,  8 jun  9 20:46 pcmC0D10p
crw-rw----+ 1 root audio 116,  4 jun  9 20:46 pcmC0D3p
crw-rw----+ 1 root audio 116,  5 jun  9 20:46 pcmC0D7p
crw-rw----+ 1 root audio 116,  6 jun  9 20:46 pcmC0D8p
crw-rw----+ 1 root audio 116,  7 jun  9 20:46 pcmC0D9p
crw-rw----+ 1 root audio 116,  1 jun  9 20:29 seq
crw-rw----+ 1 root audio 116, 33 jun  9 20:29 timer

groups

eric wheel audio

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC3271 Analog [ALC3271 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

aplay /usr/share/sounds/alsa/Noise.wav

ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

aplay: main:830: audio open error: Connection refused

ls .config/pulse

0e07bbc7e383453fa4827474edd6cfb7-card-database.tdb  0e07bbc7e383453fa4827474edd6cfb7-device-volumes.tdb
0e07bbc7e383453fa4827474edd6cfb7-default-sink       0e07bbc7e383453fa4827474edd6cfb7-stream-volumes.tdb
0e07bbc7e383453fa4827474edd6cfb7-default-source

pulseaudio -v

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
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 13.99.1-rebootstrapped
I: [pulseaudio] main.c: Page size is 4096 bytes
I: [pulseaudio] main.c: Machine ID is 0e07bbc7e383453fa4827474edd6cfb7.
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
I: [pulseaudio] main.c: Using state directory /home/eric/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib64/pulse-13.99/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.

如果有帮助的话,我使用的是戴尔 XPS-13 9370

答案1

找到解决方案:不知何故,配置文件中的/etc/pulse/default.pa一些行被注释了。重新启动后,取消注释这些行即可解决问题。下面是我必须取消注释的行:

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

相关内容