fix(audio): M6.42 — audiod开机路由武装瘦身(去无条件apply_route(5)→target双写, 当前端口正确则跳过强烧, 仅未武装/端口不对/读失败才写目标; 保留M2.91核心防挂死武装, numid=9语义/popen有界超时/D态抛弃/io_thread未动) — 降低stock hbc3000驱动楔死整机硬冻结触发面(reader后台+Files切换撞楔死驱动口); 0warning, 宿主test_audiod_host 100-0; 需真机多boot复测
This commit is contained in:
1 parent
4ce7a268a8
commit
68f91f7de2
1 file changed
+17
-4
@@ -1930,8 +1930,10 @@ static void *route_thread(void *arg)
|
||||
/* M2.91 挂死根治(AUDIO_HANG_INVESTIGATION.md):hbc3000 FPGA 未烧录+enable 时
|
||||
* 启动 PCM 会在第二次 hbc3000_start 死锁整机。写 Output Port Switch 是烧录触发器
|
||||
* (驱动 put:set_spdif_mode→program_ram→enabled)。开机端口恒 0=未烧,故启动时
|
||||
* 无条件写一次:4.4 在→3,3.5 在→2,都没→4(官方播放器拔插孔后的选择,保 FPGA 已烧)。
|
||||
* 端口已是目标值(audiod 重启场景,驱动同值短路不写)→ 先写 5(disable) 强制重烧。
|
||||
* 武装一次:4.4 在→3,3.5 在→2,都没→4(官方播放器拔插孔后的选择,保 FPGA 已烧)。
|
||||
* 多余重烧收敛(AUDIO_HANG_INVESTIGATION):端口已是目标值(audiod 重启场景)时
|
||||
* **不再**先写 5(disable) 强制重烧——每次开机做 5→目标 双写等于把 FPGA 烧录暴露翻倍,
|
||||
* 正是驱动级非确定楔死触发面;改为只需读回一致即跳过,仅当未武装/端口不对时才写目标。
|
||||
* ⚠️ P2 蓝牙:numnid=9/FPGA 武装只作用于 **DAC 物理路径**(plan §五解耦);target=BT 时
|
||||
* 不开 hw:0,0,无 hbc3000 start 死锁风险,故 BT 期间跳过 numid=9/FPGA(切回 DAC 再武装)。 */
|
||||
int need_arm = 1; /* 启动(DAC 起点)武装一次;BT 期间置 1(回 DAC 再武装) */
|
||||
@@ -1951,8 +1953,19 @@ static void *route_thread(void *arg)
|
||||
int bal = read_switch("/sys/class/switch/balance/state");
|
||||
int target = (bal == 1) ? 3 : (hb == 1) ? 2 : 4;
|
||||
int cur = amixer_get(9, 1);
|
||||
if (cur == target) { logmsg("route: port already %d, force re-arm via 5", target); apply_route(5); }
|
||||
apply_route(target);
|
||||
if (cur == target) {
|
||||
/* 端口已正确:跳过 5→target 双重强烧,只确认读回一致(cur==target 已由
|
||||
* 上一拍 amixer_get 证实)。原逻辑「cur==target 时先写 5(disable) 再回
|
||||
* target」是给 audiod 重启/同值短路场景强制重烧用的,但每次开机无条件做
|
||||
* 等于把 FPGA 烧录暴露翻倍——正是驱动级非确定楔死的触发面,故收敛掉。 */
|
||||
g_route_cur = target; /* 保持 QUERY/monitor 最近端口与读回一致 */
|
||||
logmsg("route: port already %d, skip re-arm (no 5->%d re-burn)", target, target);
|
||||
} else {
|
||||
/* 未武装(cur=0/读失败)或端口不对:写目标端口。这是 M2.91「未武装则武装」
|
||||
* 防挂死核心(FPGA 未烧+enable 时二次 hbc3000_start 死锁整机),绝不可裸奔;
|
||||
* 直接写 target 即触发烧录,无需再绕写 5(同值短路场景已被上一分支跳过)。 */
|
||||
apply_route(target);
|
||||
}
|
||||
last_hb = hb; last_bal = bal; last_target = (hb == 0 && bal == 0) ? -1 : target;
|
||||
logmsg("route: boot/DAC-return arm done (port %d %s)", target, port_name(target));
|
||||
need_arm = 0;
|
||||
|
||||
Reference in new issue
Block a user