mirror of
https://github.com/D-Modem/courier-emu.git
synced 2026-11-28 20:38:07 -08:00
Scott's correction, and it gives the fix directly. The AC01 sits on the C52's
primary serial port, where the DSP is a slave - SPC = 0x40c8, MCM = 0 so CLKX is
an input, TXM = 0 so FSX is an input. The codec converts the line and shifts a
word into DRR every frame, clocked by something that is not the C52 and does not
stop when the C52 is reset. There is no FIFO on the board: the words in flight
are in the AC01 and on its serial link, outside the part being reset, and the
dial tone is still on the wire when the DSP comes back.
native/c5x_core.cpp:codec_frame already models the receiving end properly - one
word per primary frame into DRR, a delivered zero when there is nothing, never a
stale repeat. What was wrong was ownership: the bridge's queue stood for the
codec's serial stream and was destroyed with the core.
The bridge now keeps what the codec has clocked out and the C52 has not taken,
trimmed each time to the core's own codec_rx_queued - codec_rx_consumed so it
holds exactly the words in flight, and re-presents them to the rebuilt core.
replayed across the rebuild 11,305 words
DSP-side codec_rx_peak 0 -> 7,878
codec_rx_consumed 130,684 -> 141,989
The C52 now hears the dial tone - over a second and a half of it, where before
it heard silence. 302 plain and 403 + ATX1 are unchanged, both still dialling
6245 and connecting, and neither replays anything because neither rebuilds while
audio is in flight.
Still not enough, and now cleanly so: 403 + ATX2 answers NO DIAL TONE with every
other number in the run identical to before - same DAA, same seizure, same
exchange timing, same 134 DSP-originated messages, with only codec_rx_consumed
moving by exactly the 11,305 replayed. The resident hears the tone and does not
report it. That is no longer an audio-path question.
The audio path also keeps its instrumentation: a peak at each hop, plus the
instruction the core was rebuilt at and the last one at which non-zero audio was
handed over. Those are what made this findable, and what makes the difference
between "the DSP heard nothing" and "the DSP that heard it no longer exists"
readable from a run.
44 tests green.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2.8 MiB
2.8 MiB