feat(kaisa): UCM2 Jack-driven HDMI + WirePlumber UCM Lua

Add GoogleKaisa HiFi UCM with JackControl and IEC958 sequences for HDMI1/2/3,
card entry under conf.d/sof-rt5682, and main.lua.d rule to enable UCM/ACP on
sof-rt5682. Add install/disable helper scripts and OPERATION section for
verification; restore pro-audio wireplumber sample under docs.

Made-with: Cursor
This commit is contained in:
2026-04-08 00:12:17 +08:00
parent 543385a56e
commit 60f249773e
8 changed files with 282 additions and 1 deletions

View File

@@ -0,0 +1,65 @@
#!/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见 OPERATION。"