The track file cannot say where the audio was during an interruption #50

Open
opened 2026-08-10 00:02:35 -04:00 by agent · 0 comments
Member

The route map's playhead marker is placed by adding the elapsed playback time to the
recording's start. Those are two different clocks, and an interruption separates them.

Audio presentation timestamps come from frames written — deliberately, so an interruption is
spliced out rather than leaving a file no player will open. Location collection does not stop for
an interruption: it runs from markRunning to the top of stop(). So a memo interrupted by a
two-minute phone call is two minutes shorter than the walk it describes, and every fix after the
call is that much ahead of where the marker puts it.

What M2-08 does about it

Nothing on disk records the offset, so it cannot be corrected. It can be detected: a route
spanning more wall time than the memo holds audio is one the memo cannot account for, and
TrackTimeline answers with no marker at all rather than a wrong one. A memo whose length will not
read is exempt, because that is the capture the app was killed during and it is the route somebody
most wants to see.

So today an interrupted recording has a route you can look at and no marker while you play it.

Scope

Give the track file what it needs to say where the audio was during a fix. Two shapes to weigh:

  • an audio-relative offset per point, alongside the absolute <time> that is already there;
  • the interruption spans themselves, recorded once in the header, with the offset derived.

The second is smaller on disk and keeps one fact in one place, which is the argument that chose
absolute <time> over relative seconds in #34. The first survives a reader that knows nothing about
Stash's extensions, which is the argument that chose GPX at all.

This changes the track file format, so it is M2-07's contract and not a loose end of M2-08 —
which is why Wes asked for it as its own issue on 2026-08-09. Old tracks have no mapping and must go
on working exactly as they do now: detected, and no marker.

Done when

  • A track written during an interrupted recording can place the playhead correctly.
  • A track written before this change still reads, and still shows no marker when the clocks
    disagree.
  • The file still opens in a reader that knows nothing about Stash.
The route map's playhead marker is placed by adding the elapsed playback time to the recording's start. Those are two different clocks, and an interruption separates them. Audio presentation timestamps come from **frames written** — deliberately, so an interruption is spliced out rather than leaving a file no player will open. Location collection does not stop for an interruption: it runs from `markRunning` to the top of `stop()`. So a memo interrupted by a two-minute phone call is two minutes shorter than the walk it describes, and every fix after the call is that much ahead of where the marker puts it. ## What M2-08 does about it Nothing on disk records the offset, so it cannot be corrected. It can be *detected*: a route spanning more wall time than the memo holds audio is one the memo cannot account for, and `TrackTimeline` answers with no marker at all rather than a wrong one. A memo whose length will not read is exempt, because that is the capture the app was killed during and it is the route somebody most wants to see. So today an interrupted recording has a route you can look at and no marker while you play it. ## Scope Give the track file what it needs to say where the audio was during a fix. Two shapes to weigh: - an audio-relative offset per point, alongside the absolute `<time>` that is already there; - the interruption spans themselves, recorded once in the header, with the offset derived. The second is smaller on disk and keeps one fact in one place, which is the argument that chose absolute `<time>` over relative seconds in #34. The first survives a reader that knows nothing about Stash's extensions, which is the argument that chose GPX at all. **This changes the track file format**, so it is M2-07's contract and not a loose end of M2-08 — which is why Wes asked for it as its own issue on 2026-08-09. Old tracks have no mapping and must go on working exactly as they do now: detected, and no marker. ## Done when - [ ] A track written during an interrupted recording can place the playhead correctly. - [ ] A track written before this change still reads, and still shows no marker when the clocks disagree. - [ ] The file still opens in a reader that knows nothing about Stash.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Stash/stash-ios#50
No description provided.