Recovery takes two encoders started together for one stream #173

Open
opened 2026-11-15 14:57:41 -05:00 by cmoriarty · 0 comments
Owner

What happens

Since #91 two links are "one stream" when their clocks (a segment's first timestamp less the time it was listed) are within 20 s (stream_identity.Mark.same, behind resolution.same_stream). The reasoning was that two encoders' clocks start anywhere in 26.5 hours. They do not: sites start their encoders when the game does.

On a recording of Gonzaga vs. LSU (2026-11-14), thetvapp's stream and the embedsports player's read about 16 s apart by their clocks. They are two encodes: their timestamps for the same sound are 23.6 s apart, and their frame rates differ (30 and 29.97).

Pull request #172 (#168) fixed what a join, the watch's comparison, Admin's "Same stream" tag and the measured seconds do with such a pair. It did not change recovery or the standby choice, which still ask resolution.same_stream:

  • resolution.recovery_pick: a "copy" of the failed stream is ranked a worse rescue (#101).
  • The duplicate check in resolution.py (any(same_stream(e, held) for e in above)): a standby that is a copy of the stream playing is treated as one that fails with it (#74).
  • background.better and background._order_decision: the standby order puts a different stream before a copy (#95).

So an independent stream whose clock agrees with the one playing can be passed over as a rescue, or replaced as a standby, though it is the alternative the app wants.

What is known, and what is not

  • Known: one of the two recorded pairs run through a channel for #168 agreed by clock without being one stream.
  • Not known: how often this happens on live games, and how often it has changed which link a recovery took. Nothing was measured on the live app.

The idea

  • These decisions go by what offsets.one_stream knows (added in #172): a pair heard on other timestamps, seen to carry other frames, or compared for five minutes with no match is two streams. The clock stays a first guess for a pair nothing is known of yet.
  • Links named as one stream (the same address identity, or the same stream id) stay one stream.

First step, before any code: count on the live app (read only) the pairs of one game that agree by clock and are not named as one stream, once #172 is deployed and their rows say where they are.

Done when

In the unit lane:

  • A pair found to be two streams is not a "copy" to recovery_pick, to the standby order check, or to the duplicate check.
  • A pair named as one stream is a copy to all three, as today.
  • A pair that agrees by clock with nothing known of it is treated as today.

Needs #172 merged. backend/app/channel.py is also edited by #169 and #170.

## What happens Since #91 two links are "one stream" when their clocks (a segment's first timestamp less the time it was listed) are within 20 s (`stream_identity.Mark.same`, behind `resolution.same_stream`). The reasoning was that two encoders' clocks start anywhere in 26.5 hours. They do not: sites start their encoders when the game does. On a recording of Gonzaga vs. LSU (2026-11-14), thetvapp's stream and the embedsports player's read about 16 s apart by their clocks. They are two encodes: their timestamps for the same sound are 23.6 s apart, and their frame rates differ (30 and 29.97). Pull request #172 (#168) fixed what a join, the watch's comparison, Admin's "Same stream" tag and the measured seconds do with such a pair. It did not change recovery or the standby choice, which still ask `resolution.same_stream`: - `resolution.recovery_pick`: a "copy" of the failed stream is ranked a worse rescue (#101). - The duplicate check in `resolution.py` (`any(same_stream(e, held) for e in above)`): a standby that is a copy of the stream playing is treated as one that fails with it (#74). - `background.better` and `background._order_decision`: the standby order puts a different stream before a copy (#95). So an independent stream whose clock agrees with the one playing can be passed over as a rescue, or replaced as a standby, though it is the alternative the app wants. ## What is known, and what is not - **Known:** one of the two recorded pairs run through a channel for #168 agreed by clock without being one stream. - **Not known:** how often this happens on live games, and how often it has changed which link a recovery took. Nothing was measured on the live app. ## The idea - These decisions go by what `offsets.one_stream` knows (added in #172): a pair heard on other timestamps, seen to carry other frames, or compared for five minutes with no match is two streams. The clock stays a first guess for a pair nothing is known of yet. - Links named as one stream (the same address identity, or the same stream id) stay one stream. First step, before any code: count on the live app (read only) the pairs of one game that agree by clock and are not named as one stream, once #172 is deployed and their rows say where they are. ## Done when In the unit lane: - **A pair found to be two streams** is not a "copy" to `recovery_pick`, to the standby order check, or to the duplicate check. - **A pair named as one stream** is a copy to all three, as today. - **A pair that agrees by clock with nothing known of it** is treated as today. Needs #172 merged. `backend/app/channel.py` is also edited by #169 and #170.
Sign in to join this conversation.
No labels
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
cmoriarty/sports-breaker#173
No description provided.