port(audio): D207 diag probe — GE_FORCEALARM

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).
This commit is contained in:
James Dansereau committed 2026-09-07 22:23:01 -04:00
1 parent 9bf0c49151
commit 0845d70953
1 file changed
+19
+19
View File
@@ -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))