Files
chromebox_10th_audio_driver/scripts/disable-kaisa-pro-audio-wireplumber.sh
jack 17f0a4521f docs(kaisa): ProAudio 主路线、WirePlumber default-profile 与一键脚本
- 新增 OPERATION_PipeWire_Kaisa_ProAudio / UCM_HiFi,核心问题复盘与恢复 Ubuntu 重测手顺;HDMI 旧文改为 stub。
- 脚本:apply / verify-pro-audio、strip default-profile、reapply-session、remove deb 与 UCM overlay、verify-audio-environment。
- systemd-user:kaisa-pro-audio-reapply.service 示例。
- README、docs 索引、REPO_INDEX、REPRO deb 存档说明;deb 标为未来计划;reference/ucm2 与采集脚本小改。
- debian 与 _bmad-output 规划文件随本次工作区一并更新。

Made-with: Cursor
2026-04-08 11:07:13 +08:00

66 lines
2.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 切换到 UCM 路线前:禁用本仓库提供的「强制 pro-audio」WirePlumber 片段(与 UCM 互斥)。
# 用法:./scripts/disable-kaisa-pro-audio-wireplumber.sh
# 会重命名用户级与(可选)系统级 drop-in并重启用户 pipewire 栈。
set -euo pipefail
disable_dir() {
local d="$1"
[[ -d "$d" ]] || return 0
shopt -s nullglob
local f
for f in "$d"/*; do
[[ -f "$f" ]] || continue
local b
b="$(basename "$f")"
if [[ "$b" == *kaisa* ]] || [[ "$b" == 50-kaisa* ]]; then
if [[ "$b" == *.disabled ]] || [[ "$b" == *.bak ]]; then
continue
fi
local target="${f}.disabled"
if [[ -e "$target" ]]; then
target="${f}.disabled.$(date +%s)"
fi
echo "rename: $f -> $target"
mv -n -- "$f" "$target"
fi
done
}
echo ">>> 用户级: ${HOME}/.config/wireplumber/wireplumber.conf.d"
mkdir -p "${HOME}/.config/wireplumber/wireplumber.conf.d"
disable_dir "${HOME}/.config/wireplumber/wireplumber.conf.d"
if [[ "${1:-}" == "--system" ]]; then
if ! command -v sudo &>/dev/null; then
echo "需要 sudo 以处理 /etc/wireplumber/。" >&2
exit 1
fi
echo ">>> 系统级: /etc/wireplumber/wireplumber.conf.d需 sudo"
sudo bash -c '
d="/etc/wireplumber/wireplumber.conf.d"
[[ -d "$d" ]] || exit 0
shopt -s nullglob
for f in "$d"/*; do
[[ -f "$f" ]] || continue
b="$(basename "$f")"
if [[ "$b" == *kaisa* ]] || [[ "$b" == 50-kaisa* ]]; then
[[ "$b" == *.disabled ]] && continue
t="${f}.disabled"
[[ -e "$t" ]] && t="${f}.disabled.$(date +%s)"
echo "rename: $f -> $t"
mv -n -- "$f" "$t"
fi
done
'
fi
if systemctl --user is-system-running &>/dev/null; then
echo ">>> systemctl --user restart wireplumber pipewire pipewire-pulse"
systemctl --user restart wireplumber pipewire pipewire-pulse
else
echo "(无 user systemd 会话,请登录桌面后手动执行 restart" >&2
fi
echo "完成。随后请安装 UCM overlay 与 wireplumber/main.lua.d/60-kaisa-ucm.lua见 docs/linux-hdmi/OPERATION_PipeWire_Kaisa_UCM_HiFi.md。"