[Bug Report] 系统更新后检测不到声音设备
Tofloor
poster avatar
Vellichor
deepin
20 hours ago
Author

新系统更新完声音设备成空的了,怎么办。

image.png

image.png

Reply Favorite View the author
All Replies
deepin流云
Super Moderator
Community OP
19 hours ago
#1

内核日志贴一下:sudo journalctl -k > ~/Desktop/kernel_journal.txt

更新前是正常的么?看下/var/log/apt/history.log升级之前是什么内核,换成之前的看看。

Reply View the author
Vellichor
deepin
19 hours ago
#2
It has been deleted!
Vellichor
deepin
19 hours ago
#3
deepin流云

内核日志贴一下:sudo journalctl -k > ~/Desktop/kernel_journal.txt

更新前是正常的么?看下/var/log/apt/history.log升级之前是什么内核,换成之前的看看。

Reply View the author
Vellichor
deepin
19 hours ago
#4

在ai的帮助下问题解决了是pipewire配置缺失了。

感谢你提供 systemctl --user status 的输出!现在问题已经非常清晰了。


🔥 核心问题:ALSA 配置文件缺失导致 PipeWire 无法访问声卡

关键错误日志:

1月 23 14:29:59 Superior-PC pipewire[10388]: ALSA lib conf.c:4122:(config_file_open) cannot access file /etc/alsa/conf.d/99->
1月 23 14:29:59 Superior-PC pipewire[10388]: ALSA lib conf.c:4042:(snd_config_hooks_call) function snd_config_hook_load retu>
1月 23 14:29:59 Superior-PC pipewire[10388]: ALSA lib conf.c:4649:(snd_config_update_r) hooks failed, removing configuration
1月 23 14:29:59 Superior-PC pipewire[10388]: spa.alsa: open failed: 没有那个文件或目录

📌 spa.alsa: open failed: 没有那个文件或目录
这表示 PipeWire 的 ALSA 插件无法初始化音频设备,因为 ALSA 配置损坏或关键文件缺失。

虽然内核驱动(snd_hda_intel)和 codec(ALC256)都正常,但 用户空间的 ALSA 库因配置错误而拒绝工作,导致 PipeWire 无法“看到”声卡。


🧩 问题根源分析

1. 缺失的配置文件

  • 错误提到 /etc/alsa/conf.d/99->(路径被截断,实际可能是 99-pipewire-default.conf 或类似)
  • 在 Deepin / Debian 系系统中,PipeWire 会安装一个 ALSA 配置 hook,将 ALSA 应用重定向到 PipeWire:
    /etc/alsa/conf.d/99-pipewire-default.conf
    
  • 系统更新后,该文件可能被删除、损坏,或权限错误

2. Deepin 25 的 immutable root 特性

  • 由于使用 ostree,/etc 是可变的,但某些包管理操作可能未能正确部署配置文件
  • 导致 ALSA 配置不完整

✅ 解决方案:修复 ALSA + PipeWire 集成

步骤 1:检查缺失的配置文件是否存在

ls -l /etc/alsa/conf.d/99-pipewire-default.conf

如果文件不存在是空文件/损坏链接,就需要重建。

步骤 2:重新安装 PipeWire ALSA 支持包

在 Deepin(基于 Debian)上,该文件由 pipewire-audiolibspa-0.2-bluetooth 等包提供。最稳妥的方式是:

# 重新安装 PipeWire 音频栈(包括 ALSA 配置)
sudo apt install --reinstall pipewire-audio pipewire-alsa libspa-0.2-bluetooth

💡 如果 apt 报错找不到包,可尝试:

sudo apt install --reinstall pipewire libpipewire-0.3-0 libspa-0.2-modules

步骤 3:手动恢复配置文件(备选)

如果重装无效,可手动创建:

sudo tee /etc/alsa/conf.d/99-pipewire-default.conf <<'EOF'
# Use PipeWire as the default audio server
defaults.pcm.card pipewire
defaults.ctl.card pipewire
EOF

步骤 4:验证 ALSA 配置是否有效

# 测试 ALSA 是否能通过 PipeWire 工作
aplay -L | grep pipewire

应看到 pipewire 设备。

再测试播放:

speaker-test -D pipewire -c 2

步骤 5:重启服务

systemctl --user daemon-reload
systemctl --user restart pipewire pipewire-pulse

步骤 6:检查 sink 是否出现

pactl list sinks short

现在应该能看到类似:

0	alsa_output.pci-0000_06_00.6.analog-stereo	...

🔍 补充诊断:确认 ALSA 基础是否完好

即使 PipeWire 出问题,原生 ALSA 应仍可工作。请运行:

# 直接通过 hw 接口播放(绕过所有配置)
speaker-test -D hw:1 -c 2
  • 如果能听到声音 → 证明硬件和内核驱动完全正常,纯属用户空间配置问题
  • 如果无声 → 再查 alsamixer -c 1 是否静音

📝 总结

现象 原因 修复
PipeWire 启动但无音频设备 ALSA 配置文件缺失 →spa.alsa: open failed 重装 pipewire-audio或手动创建 /etc/alsa/conf.d/99-pipewire-default.conf

你现在要做的就是:

sudo apt install --reinstall pipewire-audio pipewire-alsa
systemctl --user daemon-reload
systemctl --user restart pipewire pipewire-pulse
pactl list sinks short

完成后,Deepin 的声音设置应该就能识别“内置音频”了。

如果仍有问题,请贴出:

ls -l /etc/alsa/conf.d/
cat /etc/alsa/conf.d/99-pipewire-default.conf 2>/dev/null || echo "File not found"

我会继续帮你!

Reply View the author
Shalling
Deepin Wiki Editor
17 hours ago
#5

👍

Reply View the author