更新后 Pulseaudio 在 Fedora 35 上停止工作

更新后 Pulseaudio 在 Fedora 35 上停止工作

我刚刚在 Fedora 35 上运行了更新dnf update,完成所有操作后,我重新启动。

第一个症状:

我尝试观看 YouTube 视频,但无法播放。 YouTube 一直在缓冲,如果它没有很快开始播放,建议我“尝试重新启动你的设备”。

然后我在桌面上尝试了一个视频,它确实产生了声音,并且有用、我能听到声音等。

我注意到,当pavucontrol我不运行任何输入设备(麦克风)时,显示任何输入。

我还注意到,当使用 播放视频或音频时mpv,它不会显示在 的“播放”选项卡中pavucontrol,但我确实听到了声音,并且 `mpv 报告了这一点:

mpv bad\ apple\ instrumental.flac 
   cplayer:  (+) Audio --aid=1 (flac 2ch 44100Hz)
  ao/pulse: The stream is suspended. Bailing out.
   cplayer: AO: [alsa] 44100Hz stereo 2ch s32

这么看来是直接使用ALSA设备?

显然我无法用我的pulsaudio音量插件等控制音量。

我尝试纠正该问题:

我尝试使用以下命令重新启动pulseaudio守护进程:

systemctl --user stop pulseaudio
systemctl --yser start pulseaudio

现在,pavucontrol只显示“虚拟输出”,它看不到我的任何输入设备或输出设备!

现在可以在 YouTube 上播放视频,但没有声音,但我可以看到我的浏览器显示在“播放”选项卡中,甚至还有一个显示输出的电平表。

使用以下命令播放的文件也会发生同样的情况mpv

mpv bad\ apple\ instrumental.flac
   cplayer:  (+) Audio --aid=1 (flac 2ch 44100Hz)
   cplayer: AO: [pulse] 44100Hz stereo 2ch s32

然而这一次,我听不到任何声音,这似乎合乎逻辑,因为只识别了输出设备。我还可以看到显示输出的电平,但没有音频。

然后我尝试systemctl --user stop pulseaudio再次停止守护进程,并杀死剩下的任何东西pulseaudio -k。现在的问题是,每次我运行mpv或尝试使用浏览器时,守护进程都会重新启动。任何数量都pulseaudio -k不会阻止pulseaudio仅使用虚拟输出而没有输入设备启动自身。

运行sudo fuser -v /dev/snd/*显示:

                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  root       1104 f.... alsactl
                     polemon    2544 F.... wireplumber
/dev/snd/controlC1:  root       1104 f.... alsactl
                     polemon    2544 F.... wireplumber
/dev/snd/controlC2:  root       1104 f.... alsactl
                     polemon    2544 F.... wireplumber
/dev/snd/controlC3:  root       1104 f.... alsactl
                     polemon    2544 F.... wireplumber
/dev/snd/seq:        polemon    2543 F.... pipewire

这就是我所取得的进展。由于某种原因,pulseaudio 或 ALSA 似乎存在问题,我不确定从这里开始如何解决该问题。

pactl info显示这个:

Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 1
Tile Size: 65472
User Name: polemon
Host Name: desk
Server Name: pulseaudio
Server Version: 15.0
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: auto_null
Default Source: auto_null.monitor
Cookie: e6fd:9850

进一步的调查:

journalctl --user -ef我在发布时进行监视systemctl --user restart pulseaudio,发现了这一点:

Dec 28 20:40:37 desk systemd[1770]: Stopping Sound Service...
Dec 28 20:40:37 desk panel-8-pulseau[2027]: Disconected from the PulseAudio server. Attempting to reconnect in 5 seconds.
Dec 28 20:40:37 desk systemd[1770]: Stopped Sound Service.
Dec 28 20:40:37 desk systemd[1770]: Starting Sound Service...
Dec 28 20:40:37 desk pulseaudio[7299]: Failed to load module "module-alsa-card" (argument: "device_id="2" name="pci-0000_03_00.1" card_name="alsa_card.pci-0000_03_00.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
Dec 28 20:40:37 desk pulseaudio[7299]: Failed to load module "module-alsa-card" (argument: "device_id="1" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
Dec 28 20:40:37 desk pulseaudio[7299]: Failed to load module "module-alsa-card" (argument: "device_id="0" name="usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00" card_name="alsa_card.usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
Dec 28 20:40:37 desk pulseaudio[7299]: stat('/etc/pulse/default.pa.d'): No such file or directory
Dec 28 20:40:37 desk systemd[1770]: Started Sound Service.
Dec 28 20:41:02 desk pulseaudio[7299]: GetManagedObjects() failed: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

我可以看到初始化失败,但我不知道从这里去哪里。

该目录/etc/pulse/default.pa.d确实不存在。

然后,我尝试pulseaudio -vvv在停止守护进程后运行systemctl,然后运行pulseaudio -k。经过几次尝试(pulseaudio 不断重新启动),我成功运行,这就是我所看到的:

I: [pulseaudio] module.c: Loaded "module-stream-restore" (index: #1; argument: "").
D: [pulseaudio] database-tdb.c: Opened TDB database '/home/polemon/.config/pulse/c65f61a4c3e84f299be315ace0144549-card-database.tdb'
I: [pulseaudio] database.c: Successfully opened 'card-database' database file '/home/polemon/.config/pulse/c65f61a4c3e84f299be315ace0144549-card-database.tdb'.
I: [pulseaudio] module.c: Loaded "module-card-restore" (index: #2; argument: "").
I: [pulseaudio] module.c: Loaded "module-augment-properties" (index: #3; argument: "").
I: [pulseaudio] module.c: Loaded "module-switch-on-port-available" (index: #4; argument: "").
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-udev-detect.so': success
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC2 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/pci0000:00/0000:00:03.0/0000:03:00.1/sound/card2 is busy: no
D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="2" name="pci-0000_03_00.1" card_name="alsa_card.pci-0000_03_00.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"'
D: [pulseaudio] dbus-util.c: Successfully connected to D-Bus session bus c50f3068e569b911e3dd80c9a958124a as :1.255
D: [pulseaudio] reserve-wrap.c: Device 'Audio2' already locked.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="2" name="pci-0000_03_00.1" card_name="alsa_card.pci-0000_03_00.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/pci0000:00/0000:00:03.0/0000:03:00.1/sound/card2 (alsa_card.pci-0000_03_00.1) failed to load module.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC1 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/pci0000:00/0000:00:1b.0/sound/card1 is busy: no
D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="1" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"'
D: [pulseaudio] dbus-util.c: Successfully connected to D-Bus session bus c50f3068e569b911e3dd80c9a958124a as :1.256
D: [pulseaudio] reserve-wrap.c: Device 'Audio1' already locked.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/pci0000:00/0000:00:1b.0/sound/card1 (alsa_card.pci-0000_00_1b.0) failed to load module.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC0 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/sound/card0 is busy: no
D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="0" name="usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00" card_name="alsa_card.usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"'
D: [pulseaudio] dbus-util.c: Successfully connected to D-Bus session bus c50f3068e569b911e3dd80c9a958124a as :1.257
D: [pulseaudio] reserve-wrap.c: Device 'Audio0' already locked.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00" card_name="alsa_card.usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/sound/card0 (alsa_card.usb-MICE_MICROPHONE_USB_MICROPHONE_201308-00) failed to load module.
I: [pulseaudio] module-udev-detect.c: Found 3 cards.
I: [pulseaudio] module.c: Loaded "module-udev-detect" (index: #5; argument: "").
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-jackdbus-detect.so': failure
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-bluetooth-policy.so': success
I: [pulseaudio] module.c: Loaded "module-bluetooth-policy" (index: #9; argument: "").
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-bluetooth-discover.so': success
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-bluez5-discover.so': success
D: [pulseaudio] dbus-util.c: Successfully connected to D-Bus system bus 1e8b84c239532ac8ec203f444f9e5c24 as :1.207
I: [pulseaudio] module.c: Loaded "module-bluez5-discover" (index: #11; argument: "").
I: [pulseaudio] module.c: Loaded "module-bluetooth-discover" (index: #10; argument: "").
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-esound-protocol-unix.so': failure
E: [pulseaudio] socket-server.c: bind(): Address already in use
E: [pulseaudio] module.c: Failed to load module "module-native-protocol-unix" (argument: ""): initialization failed.
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-gsettings.so': failure
I: [pulseaudio] module-default-device-restore.c: Restoring default sink 'auto_null'.
I: [pulseaudio] core.c: configured_default_sink: (unset) -> auto_null
I: [pulseaudio] module-default-device-restore.c: Restoring default source 'auto_null.monitor'.
I: [pulseaudio] core.c: configured_default_source: (unset) -> auto_null.monitor
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
I: [pulseaudio] module.c: Loaded "module-default-device-restore" (index: #13; argument: "").
D: [pulseaudio] module-always-sink.c: Autoloading null-sink as no other sinks detected.
I: [pulseaudio] module-device-restore.c: Restoring volume for sink auto_null: front-left: 65536 / 100%,   front-right: 65536 / 100%
I: [pulseaudio] module-device-restore.c: Restoring mute state for sink auto_null: unmuted
I: [pulseaudio] sink.c: Created sink 0 "auto_null" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] sink.c:     device.description = "Dummy Output"
I: [pulseaudio] sink.c:     device.class = "abstract"
I: [pulseaudio] sink.c:     device.icon_name = "audio-card"
I: [pulseaudio] source.c: Created source 0 "auto_null.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] source.c:     device.description = "Monitor of Dummy Output"
I: [pulseaudio] source.c:     device.class = "monitor"
I: [pulseaudio] source.c:     device.icon_name = "audio-input-microphone"
D: [null-sink] module-null-sink.c: Thread starting up
D: [null-sink] util.c: RealtimeKit worked.
I: [null-sink] util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5.
D: [pulseaudio] sink.c: auto_null: state: INIT -> IDLE
D: [pulseaudio] source.c: auto_null.monitor: state: INIT -> IDLE
I: [pulseaudio] core.c: default_source: (unset) -> auto_null.monitor
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
I: [pulseaudio] core.c: default_sink: (unset) -> auto_null
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
I: [pulseaudio] module.c: Loaded "module-null-sink" (index: #15; argument: "sink_name=auto_null sink_properties='device.description="Dummy Output"'").
I: [pulseaudio] module.c: Loaded "module-always-sink" (index: #14; argument: "").
I: [pulseaudio] module.c: Loaded "module-intended-roles" (index: #16; argument: "").
D: [pulseaudio] module-suspend-on-idle.c: Sink auto_null becomes idle, timeout in 5 seconds.
I: [pulseaudio] module.c: Loaded "module-suspend-on-idle" (index: #17; argument: "").
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-console-kit.so': success
D: [pulseaudio] module.c: Checking for existence of '/usr/lib64/pulse-15.0/modules/module-systemd-login.so': success
I: [pulseaudio] client.c: Created 0 "Login Session 2"
D: [pulseaudio] module-systemd-login.c: Added new session 2
I: [pulseaudio] core.c: exit_idle_time: 20 -> 0
I: [pulseaudio] module.c: Loaded "module-systemd-login" (index: #18; argument: "").
I: [pulseaudio] module.c: Loaded "module-position-event-sounds" (index: #19; argument: "").
D: [pulseaudio] stream-interaction.c: Using role 'phone' as trigger role.
D: [pulseaudio] stream-interaction.c: Using roles 'music' and 'video' as cork roles.
I: [pulseaudio] module.c: Loaded "module-role-cork" (index: #20; argument: "").
I: [pulseaudio] module.c: Loaded "module-filter-heuristics" (index: #21; argument: "").
I: [pulseaudio] module.c: Loaded "module-filter-apply" (index: #22; argument: "").
W: [pulseaudio] cli-command.c: stat('/etc/pulse/default.pa.d'): No such file or directory
D: [pulseaudio] dbus-util.c: Successfully connected to D-Bus session bus c50f3068e569b911e3dd80c9a958124a as :1.258
D: [pulseaudio] main.c: Got org.PulseAudio1!
D: [pulseaudio] main.c: Got org.pulseaudio.Server!
I: [pulseaudio] main.c: Daemon startup complete.

(省略无关行)

我想知道数据库是否以某种方式损坏,但我真的不知道。

部分成功:

我在 IRC 上得到了一些关于 Pipewire 如何取代 Pulseaudio 的建议。我想也许就我而言,这种更新过程出了问题,我也许应该帮助解决问题。

dnf安装了以下软件包:

  • 管道线脉冲音频
  • 管道线-gstreamer
  • 管道线实用程序

这需要选项--allowerasing作为pulseaudio在此过程中被卸载。有人告诉我这不会是一个大问题,因为多亏了 pipeline-pulseaudio,我仍然可以使用诸如pavucontrol等工具。

我还被建议保留wireplumber而不是用 替换它pipewire-media-session

结果 - 重新启动后,我的声音正常了 - 有点。此设置仍然存在问题:

  • 我无法热插拔设备。如果我插入一个新麦克风,我将无法使用它pavucontrol

这是非常不理想的。这对于网络摄像头之类的东西来说并不是什么大问题,因为我仍然可以使用其他麦克风,但是如果我拔掉麦克风,它就无法使用,直到我重新启动(我还没有尝试重新启动服务器,我仍然发现我绕过管道的方式)。

相关内容