54 lines
1.9 KiB
Lua
54 lines
1.9 KiB
Lua
-- Kaisa (sof-rt5682): enable UCM + ACP so HiFi profile / Jack-driven ports work.
|
||
-- WirePlumber 0.4.x: appended after stock alsa rules.
|
||
--
|
||
-- 若仅启用 use-ucm 而不固定 profile,栈常会默认选 stereo-fallback,界面只剩模拟/耳机,HDMI 消失。
|
||
--
|
||
-- 交付策略:必须由 UCM/HiFi 管理音频(Jack-driven ports)。
|
||
-- 若某台机器在 PipeWire/ACP 枚举阶段暂未暴露 HiFi profile(pactl「配置文件」里看不到 HiFi:),
|
||
-- 这是安装/时序/内核问题,应修复根因,而不是回退到 pro-audio。
|
||
local KAISA_WP_DEVICE_PROFILE = "HiFi"
|
||
|
||
table.insert(alsa_monitor.rules, {
|
||
matches = {
|
||
{
|
||
{ "api.alsa.card.name", "equals", "sof-rt5682" },
|
||
},
|
||
},
|
||
apply_properties = {
|
||
-- 交付策略:仅使用 UCM/HiFi,避免 ACP 注入 pro-audio 等通用 profile。
|
||
-- 这会让系统枚举中不再出现 pro-audio(仅保留 UCM 定义的 HiFi / off 等)。
|
||
["api.alsa.use-acp"] = false,
|
||
["api.alsa.use-ucm"] = true,
|
||
-- ACP disabled; keep these unset to avoid confusing policy.
|
||
["device.profile"] = KAISA_WP_DEVICE_PROFILE,
|
||
},
|
||
})
|
||
|
||
-- Default route among HDMI: WirePlumber policy-node picks highest priority.session.
|
||
-- Stock UCM tends to give pcm=2 (HDMI1) the highest value, which matches observed
|
||
-- defaults and a flaky pcm2 path (SOF ipc -5 / set_hw_params). Prefer pcm 3/4.
|
||
table.insert(alsa_monitor.rules, {
|
||
matches = {
|
||
{ { "node.name", "matches", "alsa_output.*HiFi__hw_sofrt5682_4__sink*" } },
|
||
},
|
||
apply_properties = {
|
||
["priority.session"] = 900,
|
||
},
|
||
})
|
||
table.insert(alsa_monitor.rules, {
|
||
matches = {
|
||
{ { "node.name", "matches", "alsa_output.*HiFi__hw_sofrt5682_3__sink*" } },
|
||
},
|
||
apply_properties = {
|
||
["priority.session"] = 850,
|
||
},
|
||
})
|
||
table.insert(alsa_monitor.rules, {
|
||
matches = {
|
||
{ { "node.name", "matches", "alsa_output.*HiFi__hw_sofrt5682_2__sink*" } },
|
||
},
|
||
apply_properties = {
|
||
["priority.session"] = 700,
|
||
},
|
||
})
|