From 56d2dfd6726ad465490a0df6e263a5702ce3bc30 Mon Sep 17 00:00:00 2001 From: James Dansereau <106631954+jkdansereau@users.noreply.github.com> Date: Wed, 16 Sep 2026 16:06:44 -0400 Subject: [PATCH] fix: gate EVTQ-DROP audio diagnostic behind GE_AUDIOTRACE The D202/M-71 evtq-exhaustion probe in alEvtqPostEvent was left unconditional, so shipped builds wrote an unbounded log line on every dropped event -- found reading GitHub #87's session logs, which showed real sustained event-pool exhaustion. Gate it on GE_AUDIOTRACE, the same switch the sibling probes in synthesizer.c/csplayer.c/load.c already use. --- src/libultra/audio/event.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/libultra/audio/event.c b/src/libultra/audio/event.c index d89bd466..a433c440 100644 --- a/src/libultra/audio/event.c +++ b/src/libultra/audio/event.c @@ -88,10 +88,17 @@ void alEvtqPostEvent(ALEventQueue *evtq, ALEvent *evt, ALMicroTime delta) if (!item) { #ifdef PORT /* D202/M-71 diag: silent drop is the prime suspect for missing - * [VOICE+]; log every exhausted-queue post. Remove with probe set. */ - geTracePrintf("audiotrace.log", "[EVTQ-DROP] evtq=%p type=%d state=%p delta=%d\n", - (void *)evtq, (int)evt->type, - (void *)((u8 *)evt + 2), (int)delta); + * [VOICE+]. Gated on GE_AUDIOTRACE (same switch as the sibling + * probes in synthesizer.c/csplayer.c/load.c) -- this was left + * unconditional, so shipped builds wrote an unbounded log on every + * exhausted-queue post; found via GitHub #87's session logs, which + * showed sustained pool exhaustion (a real pool-sizing question, + * tracked separately) but should never write to disk by default. */ + if (getenv("GE_AUDIOTRACE")) { + geTracePrintf("audiotrace.log", "[EVTQ-DROP] evtq=%p type=%d state=%p delta=%d\n", + (void *)evtq, (int)evt->type, + (void *)((u8 *)evt + 2), (int)delta); + } #endif osSetIntMask(mask); #ifdef _DEBUG