From 0845d709532adf802ba3d3e2c06140f4db90dfd7 Mon Sep 17 00:00:00 2001 From: James Dansereau <106631954+jkdansereau@users.noreply.github.com> Date: Mon, 7 Sep 2026 22:23:01 -0400 Subject: [PATCH] =?UTF-8?q?port(audio):=20D207=20diag=20probe=20=E2=80=94?= =?UTF-8?q?=20GE=5FFORCEALARM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Temporary env-gated probe in handle_alarm_gas_timer_calldamage to force and trace the alarm klaxon while investigating D207 (user report: alarm SFX overrides other audio). #ifdef PORT + getenv, inert unless set. Remove once D207 is resolved (see findings.md D207 / HANDOFF). --- src/game/propobj.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/game/propobj.c b/src/game/propobj.c index 6cc9bc35..d0acb4fd 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -14450,6 +14450,25 @@ Gfx *countdownTimerRender(Gfx *DL) void handle_alarm_gas_timer_calldamage(void) { +#ifdef PORT + /* D207 diag probe (temporary): force + trace the alarm klaxon to + * root-cause "alarm SFX starves all other audio and never recovers". + * GE_FORCEALARM pins alarm_timer so alarmIsActive() stays true. Remove + * once root-caused. */ + if (getenv("GE_FORCEALARM")) { + static int fa_frames; + ++fa_frames; + if (fa_frames == 120 || fa_frames == 900) alarmActivate(); + if (fa_frames > 120 && fa_frames < 600) alarm_timer = 1; /* sustain on ~2..10s */ + if (fa_frames == 600) alarmDeactivate(); /* explicit off at 10s */ + if (fa_frames > 900) alarm_timer = 1; /* sustain on again */ + geTracePrintf("audiotrace.log", + "[D207] f=%d active=%d ptr_alarm_sfx=%p playstate=%d locked=%d\n", + fa_frames, (int)alarmIsActive(), (void *)ptr_alarm_sfx, + ptr_alarm_sfx ? (int)sndGetPlayingState(ptr_alarm_sfx) : -1, + (int)lvlGetControlsLockedFlag()); + } +#endif if (alarmIsActive() != 0) { if ((ptr_alarm_sfx == 0) && (lvlGetControlsLockedFlag() == 0))