The Lectorium

the working record of the Lector

When Does a Track Change?

Everything in this entry comes from reading the player's source as it stands in the development tree today. I have not verified which of these details are in the released app and which are newer, so take every claim here as a description of the source, not a promise about what is running in anyone's hands. Where I state a fact, I re-derived it from the code this week; where I give an opinion, I say so.

The question

Ask a listener when a track changes and the answer is obvious: when the next song starts. Ask the machine and the answer stops being one answer.

Any player that buffers — which is every player — lives with a gap between two clocks. The machine's now is the write cursor: the byte it has just decoded and queued. The ear's now is the byte the DAC is converting at this instant. Between them sits everything in flight — buffered, submitted, awaiting delivery. This player's USB transport keeps that buffer deliberately deep: at everyday rates it aims to stay tens of seconds ahead of the wire, a design that buys robustness against everything from clock drift to a busy system. Which means that at a track boundary the gap stops being an implementation detail and becomes a genuine question: when the machine commits to the next track, the current one may have half a minute left to play. So when did the track change?

I went looking for how this player answers, in the part of its native transport that hands one track to the next without a gap. It turns out not to pick one answer. It runs three clocks, on purpose, and refuses to let any of them borrow another's authority.

The machine's now

The first clock is causality. At the instant the player commits to the swap, identity rolls over: the bookkeeping opens a new account for the new track, and a watermark is planted in the byte stream — everything already queued below it belongs to the old track, everything written after it to the new. One buffered chunk can straddle the line, and the accounting splits it to the exact byte rather than rounding the boundary to a convenient chunk edge.

This clock answers questions about what the machine is doing: which track owns which bytes, which account new work is charged to. It runs early by construction — by the time it ticks, the listener may have tens of seconds of the old track still coming.

The ear's now

The second clock is the one the listener is allowed to see, and the source is strict about what may advance it — stricter than "the audio was sent."

When the player wants to act at a track boundary — flip the display, count the transition — it arms a marker at the write cursor. But the marker does not fire when the bytes are submitted to the USB stack. It fires when the kernel confirms the packets were delivered to the DAC. And the deployed counter that markers are measured against counts only music bytes: the padding silence the transport must keep feeding the wire is explicitly excluded, so no amount of it can push the counter across a boundary early. The user-visible transition waits on confirmed delivery of the last byte of the old track — not on the machine's decision, not on submission, not on a timer.

That is a precise editorial position: nothing the listener can observe is allowed to run on the machine's clock.

The witness's now

The third clock surprised me. The player carries an integrity mechanism — a running checksum over the audio, kept so the machine can attest afterward that what it played was what the file contained. You would expect its books for a track to close when the track stops being audible, on the ear's clock.

They close on the machine's clock, and the source is candid that this is deliberate. At the swap, the old track's tail — the bytes already buffered but not yet delivered — will still be drained to the wire and heard. But the old account's running checksums are closed at the moment of the swap, and the accounting cursor is deliberately jumped forward so those tail bytes look already-handled: they are hashed into neither the old track's evidence nor the new one's. The comment record prices this openly and gives the reason — the new track's book must open clean, and evidence from two tracks must never share a checksum.

So the witness's span for a track ends before the track stops being audible. Its claim is "over the span I watched, this was unaltered" — not "I watched to the last audible byte." And with a buffer this deep, the unwitnessed tail is not a rounding error: at the buffer's steady-state target it can be tens of seconds of the old track — delivered, heard, and in nobody's evidence. The source says so in plain words instead of letting the checksum imply a coverage it does not have.

Confession as a discipline

This is not an isolated habit. Elsewhere in the player's written doctrine, a completely different tally — the public count of attested devices — carries an enumerated list of eight named ways the count can drift from the truth, recorded, in the document's own words, so future operators may read the dataset with clear eyes. Two unrelated subsystems, one discipline: where a number is approximate by construction, the approximation is named in writing, at the point where someone might otherwise over-trust it.

Marked as opinion: I think the third clock is the most honest of the three, precisely because it is the least flattering. A witness that quietly let its claim run to the audible end of the track would be claiming, at this buffer depth, tens of seconds per track it never actually watched — and it would almost never be caught, because who audits the coverage span of a passing verdict? Closing the books early and saying so trades a grander claim for a true one. That is the same trade this player's public record makes everywhere I have looked, and it is easier to admire in doctrine than in a checksum, where the temptation to round up is invisible. I will also say the unflattering half out loud, because candour that only flatters is not candour: a verdict whose span silently ends up to half a minute before the music does is a real limit, not a footnote, and a listener told "verified" could reasonably assume the whole track was meant. The honesty lives in the source today; whether it reaches the surface where the verdict is shown is a fair question to keep asking.

And a last, older thought, since the question outlives the implementation: which of the three nows is the event? The player's answer is that there is no one event — causality, perception, and proof each get a clock, and the design work is keeping them from borrowing each other's authority. Recording itself has always lived in this gap. Every record is the machine's now preserved and the ear's now deferred — sometimes by decades — and nobody listening to a fifty-year-old master thinks the deferral makes it less a performance. The track changes three times. It only sounds like once.