快速检查
# 检查音量是否静音
amixer get Master
# 查看声卡
aplay -l
cat /proc/asound/cards
# 检查 PipeWire 服务
systemctl --user status pipewire pipewire-pulse wireplumberUbuntu 26.04 音频架构
Ubuntu 26.04 默认使用 PipeWire 作为音频服务器,替代了旧版的 PulseAudio。层次关系:
应用程序
↓
PipeWire(音频服务器)
↓
ALSA(内核音频驱动)
↓
硬件声卡PipeWire 排查
检查服务状态
systemctl --user status pipewire
systemctl --user status pipewire-pulse
systemctl --user status wireplumber重启 PipeWire
systemctl --user restart pipewire pipewire-pulse wireplumber查看音频设备
# 列出音频输出设备
wpctl status
# 查看默认输出设备
wpctl inspect @DEFAULT_AUDIO_SINK@
# 设置音量
wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.8
# 取消静音
wpctl set-mute @DEFAULT_AUDIO_SINK@ 0切换输出设备
# 列出所有 sink(输出设备)
wpctl status | grep -A 20 "Audio"
# 设置默认输出(替换 ID 为实际设备 ID)
wpctl set-default <设备ID>重置 PipeWire 配置
rm -rf ~/.config/pipewire ~/.local/state/pipewire
systemctl --user restart pipewire pipewire-pulse wireplumberALSA 层排查
检查声卡驱动
# 列出声卡
cat /proc/asound/cards
# 如果显示 "no soundcards found",声卡驱动未加载
sudo dmesg | grep -i "snd\|sound\|audio\|hda"ALSA 音量调节
alsamixer在 alsamixer 中:
- 按 F6 选择声卡
- 按 M 切换静音/取消静音(
MM表示静音) - 上下方向键调节音量
- 确保 Master、PCM、Speaker 通道均未静音
保存 ALSA 设置:
sudo alsactl store重新加载声卡驱动
# Intel HDA 声卡
sudo modprobe -r snd_hda_intel
sudo modprobe snd_hda_intel
# 如果加载失败
sudo dmesg | tail -20常见场景
HDMI 无声音
# 检查 HDMI 音频输出
aplay -l | grep HDMI
# 在 PipeWire 中切换到 HDMI 输出
wpctl status
wpctl set-default <HDMI设备ID>也可以在 GNOME 设置 > 声音 中选择 HDMI 输出。
蓝牙耳机无声音
# 确认蓝牙音频设备已连接
wpctl status | grep -i bluetooth
# 如果编解码器问题,安装额外支持
sudo apt install libspa-0.2-bluetooth
systemctl --user restart pipewire pipewire-pulse wireplumber仅浏览器无声音
部分 Snap 应用可能有权限问题:
# 检查浏览器音频权限
snap connections firefox | grep audio
# 确保音频接口已连接
sudo snap connect firefox:audio-playback麦克风无法使用
# 检查录音设备
arecord -l
# 测试麦克风
arecord -d 5 -f cd test.wav
aplay test.wav
# 在 PipeWire 中检查输入设备
wpctl status | grep -A 10 "Sources"
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 0深入排查 PipeWire
Ubuntu 26.04 已不再随系统提供 PulseAudio 守护进程,无法再”回退到 PulseAudio”——PipeWire 通过 pipewire-pulse 提供完全兼容的 PulseAudio 接口。遇到顽固问题时,应直接排查 PipeWire 本身:
# 完整重启用户态音频栈
systemctl --user restart pipewire pipewire-pulse wireplumber
# 查看 PipeWire / WirePlumber 日志定位错误
journalctl --user -u pipewire -u pipewire-pulse -u wireplumber -b --no-pager
# 实时查看图状态(节点、链路、设备)
pw-top # 类似 top 的实时视图
pw-cli ls Node
wpctl status如果配置损坏,重置用户配置后重启即可(详见上文”重置 PipeWire 配置”):
rm -rf ~/.config/pipewire ~/.local/state/pipewire ~/.config/wireplumber
systemctl --user restart pipewire pipewire-pulse wireplumberNote
仍可通过 pactl、pavucontrol 等熟悉的 PulseAudio 工具操作 PipeWire,它们会经由 pipewire-pulse 兼容层工作,无需安装 PulseAudio。
收集诊断信息
# 生成完整音频诊断报告
sudo apt install alsa-utils
alsa-info.sh --upload输出的链接可以分享给社区寻求帮助。
相关文章
Last updated on