lab: lift the Saffire UpdateIsochBufferParams latency model#26
Closed
boggspa wants to merge 1 commit into
Closed
Conversation
Encodes the decompile trace of Saffire::UpdateIsochBufferParams (0xf506)
as a portable constexpr unit — the constants the original kext fed
IOAudioFamily's setSampleOffset/setSampleLatency, now fully liftable with
no bench capture in the loop:
- Protocols/Audio/DICE/SaffireIsochLatency.hpp: the latencyMode x rate
delay-packet table ({14,2}/{16,6}/{18,10}/{20,14}, +2 at 88.2/96k, +4
at 176.4/192k), DMA-program depth (160/80/40 packets), frames-per-packet
(8/16/32), and the derived safety-offset frame helpers. Full provenance
in the header: host-internal chain (latencyMode is a host preference,
not a device register; writer called only from initHardware /
RestartStreaming), DICE-quirk note. Unsupported rates are rejected.
- Two prose/table discrepancies in the trace flagged for adjudication
(the table wins in code): "safest output = 160 frames" matches the
INPUT column (output mode 3 = 14x8 = 112), and "constant ~20 ms DMA
buffer" only holds for the <=48k family (160/80/40 packets = 20/10/5 ms).
- Tests/SaffireIsochLatencyTests: every table cell pinned, rate bumps on
both columns, depth, packet-time math, the quoted 16-frame lowest-mode
output, constexpr usability, unsupported-rate rejection.
- Driver/VirtualAudioDevice: the SetOutputSafetyOffset(0) placeholder now
takes the model value (mode kLow per the trace recommendation: start
0-1 for TX, widen only if framesWithoutPacket climbs) and
SetOutputLatency carries the same value — which ADK property maps to
which IOAudioFamily field is a bench question; both start at the model
value and get observed. Lookup failure falls back to defaults, logged.
Suite: 18854 checks, 0 failures. Dext target compiles (signing-off
check; the signed lane is unchanged).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Closing per review — wrong tree: the lab is the reference; this belongs in the real driver (TimingCursorPolicy is the single-source spot). Redoing against ASFWDriver; the lab-side version stays stashed on boggspa:lab/saffire-latency-model for, well, reference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
UpdateIsochBufferParamstrace, lifted into code — "the whole model is liftable now, no bench capture in the loop". Branches off your current DICE tip (includes your seqlock/dump/geometry work).The pieces
Protocols/Audio/DICE/SaffireIsochLatency.hpp— header-only constexpr unit encoding the trace verbatim:{14,2} / {16,6} / {18,10} / {20,14}, +2 at 88.2/96k, +4 at 176.4/192k (both columns)160/80/40packets; frames-per-packet8/16/32delayPackets × framesPerPacket)initHardware/RestartStreaming), DICE-quirk note, unsupported rates rejectedSetOutputSafetyOffset(0)placeholder now takes the model value at mode kLow (your trace's recommendation: start 0–1 for TX, widen only ifframesWithoutPacketclimbs — that counter is already in the dump).SetOutputLatencycarries the same value for now — which ADK property maps to which IOAudioFamily field is a bench question; both start at the model value so the bench can observe. Lookup failure logs and falls back to defaults.Two prose/table discrepancies in the trace — please adjudicate
The code encodes the table in both cases:
Happy to re-encode if the decompile says otherwise on either.
Verification
🤖 Generated with Claude Code