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
66 lines
2.0 KiB
Bash
Executable File
66 lines
2.0 KiB
Bash
Executable File
#!/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)。"
|