diff --git a/js/net/src/ietf/subscriber.ts b/js/net/src/ietf/subscriber.ts index 8a4d822f75d..a0a94912115 100644 --- a/js/net/src/ietf/subscriber.ts +++ b/js/net/src/ietf/subscriber.ts @@ -2006,10 +2006,6 @@ export class Subscriber { // the track ends with it, and at object 0 it ends before it. if (producer && frame.idDelta !== 0) throw new ObjectIdGap(frame.idDelta); await last(); - // Our own unsubscribe can release the track while its marker is in flight. A - // released track has no end left to declare, and the publisher did nothing wrong, - // so refusing it would close the session and every other subscription with it. - if (hooks.trackReleased(track).peek() !== undefined && !hooks.trackFinished(track)) return; const end = { group: group.groupId, frame: nextObject + frame.idDelta }; producer?.finish(); try { diff --git a/js/net/src/track.ts b/js/net/src/track.ts index c219735a0e7..adaaf7ec75c 100644 --- a/js/net/src/track.ts +++ b/js/net/src/track.ts @@ -2318,13 +2318,15 @@ export class Producer { // The wire's end: repeating it is a no-op, and a mid-group end may refine the group // boundary it falls just before. Either must carry the same error code. Mirrors the Rust // `finish_at` on a `received()` copy. Only a wire subscription owes a tail below the end: a - // FETCH's end leaves nothing in flight, as the Rust `set_end` a fill declares. + // FETCH's end leaves nothing in flight, as the Rust `set_end` a fill declares. An end that + // lands after the track closed, such as a viewer releasing it while the marker was in + // flight, has nothing left to end. #endPending(end: Position, error?: Error): void { const declared = this.#state.end.peek(); const code = (err?: Error) => (err === undefined ? undefined : toStreamCode(err)); const tail = this.#wire !== undefined; if (declared === undefined) { - if (this.#state.closed.peek() !== undefined) throw new Error("track is closed"); + if (this.#state.closed.peek() !== undefined) return; this.#declareEnd(end, error, tail); } else if (code(declared.error) !== code(error)) { throw new ProtocolViolation(`conflicting track end error: ${error}`); diff --git a/quest/m0/interop-green/README.md b/quest/m0/interop-green/README.md index 7b3db82f778..27bca842fd0 100644 --- a/quest/m0/interop-green/README.md +++ b/quest/m0/interop-green/README.md @@ -212,7 +212,9 @@ Scheduled runs The JS subscriber refused the END_OF_TRACK of a withdrawn route after its own unsubscribe had released the track, and a protocol violation closes the whole session. - [moq-dev/moq#8769](https://github.com/moq-dev/moq/pull/8769) tolerates the marker on a released track. + [moq-dev/moq#8769](https://github.com/moq-dev/moq/pull/8769) tolerated the marker on a released track, + and [moq-dev/moq#8754](https://github.com/moq-dev/moq/pull/8754) moved that into the track's wire end, so a + late PUBLISH_DONE or FETCH_OK keeps the session too. That is not the whole case: since [moq-dev/moq#8443](https://github.com/moq-dev/moq/pull/8443) dropped the Chromium quarantine, `just test media --media-cases replacement` at `ce616b52c` failed 4 of 14 local runs (host at load 50), as `live incumbent diff --git a/quest/m0/nightly/README.md b/quest/m0/nightly/README.md index 3c051abaebe..270764f7085 100644 --- a/quest/m0/nightly/README.md +++ b/quest/m0/nightly/README.md @@ -57,4 +57,8 @@ report's output ([moq-dev/moq#8654](https://github.com/moq-dev/moq/pull/8654)), the firefox resume ([moq-dev/moq#8635](https://github.com/moq-dev/moq/pull/8635)), and the chromium `av_lag` rows ([moq-dev/moq#8676](https://github.com/moq-dev/moq/pull/8676)). +After #8635 landed, run +[43601796176](https://github.com/moq-dev/moq/actions/runs/43601796176) still +failed the firefox resume, now on audio arriving late rather than trailing: +[Firefox resume audio](/quest/m0/nightly/firefox-resume-audio.md) owns it. diff --git a/quest/m0/nightly/firefox-resume-audio.md b/quest/m0/nightly/firefox-resume-audio.md new file mode 100644 index 00000000000..b1a28a68b6a --- /dev/null +++ b/quest/m0/nightly/firefox-resume-audio.md @@ -0,0 +1,36 @@ +# [M] Firefox audio resumes with the picture + +## Goal + +Nightly's `Media (firefox player)` job passes its `after resume` window: after +a pause, audio is audible within the window's first samples, as in Chromium, +instead of staying silent for about half a second after the picture resumes. + +## Plan + +[moq-dev/moq#8635](https://github.com/moq-dev/moq/pull/8635) removed the +1.7 s trail behind the picture, but Nightly +[43601796176](https://github.com/moq-dev/moq/actions/runs/43601796176) (at +4fec611d4, after it and the [lag rule](https://github.com/moq-dev/moq/pull/8722)) +still failed with `68/79 samples carried the fixture tone` (11-13: 60/78). The +window's first 11 samples are silent with the audio byte counter flat +(`audio=94041B`) while video presents live frames; then about 1.8 KB of +audio lands in one burst, `[player] skipping missing groups: track=audio +1165 -> 1258` fires, and audio plays in sync. So the audio subscription's +first groups reach the Firefox player about 0.4 s after video's. + +Not reproduced locally: `just test media --media-engines firefox +--media-cases rename,pause` passed 4 of 4 on an idle host (2026-11-14). The +CI host was 14 to 60% idle during the window, and Firefox dials the relay +over WebSocket, so the difference is likely in that path under load. + +Recommended: reproduce under load first (the job's own +`busiest host processes` table shows the shape), with the relay's and +player's logs kept (`HARNESS_KEEP=1`), and find which hop holds audio's +first groups after the resubscribe: the relay's upstream re-subscribe and +gap backfill (the fixture logs a fetch of audio group 1156 that the relay +aborts), the WebSocket session's stream scheduling, or the consumer's hole +wait from its pre-pause cursor (1165). Fix that hop; do not widen the test's +window or agreement. + +Kept in m0 by the maintainer (2026-11-15): ✅ m0 (rejected: m1, drop).