Skip to content

feat(publish)!: remove Opus DTX - #4919

Merged
kixelated merged 4 commits into
mainfrom
quest/m1/opus-usedtx-removal
Oct 6, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m1/opus-usedtx-removal

Conversation

@kixelated

@kixelated kixelated commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

With usedtx on, Chromium stamps each Opus chunk as the first input's timestamp plus the samples it emitted, so every suppressed frame pulls later audio earlier (14 s of input ended at 8.9 s). #4902 measured that no WebCodecs output recovers the dropped span, and the maintainer decided on 2026-10-06 to remove the option.

Approach

  • Drop usedtx from OpusConfig in js/publish/src/audio/encoder.ts, and the runtime forwarding in #opusOptions, so a plain-JS caller passing usedtx: true can't reach the encoder.
  • Replace the forwarding test with never enables Opus DTX, which passes usedtx: true through a cast and asserts the encoder config leaves it unset. It fails with the forwarding restored.
  • Remove the demo's DTX checkbox and opusDtx signal (demo/web/src/publish.ts, publish.html).
  • Drop the "leave the publisher's DTX off" line from quest/m0/audio-jitter-target/watch.md, since the option no longer exists.
  • Delete quest/m1/opus-usedtx-removal.md and its quest/m1/README.md entry.
  • Add an Unreleased entry to doc/setup/upgrade.md, since usedtx shipped in @moq/publish 0.5.x (review finding). doc/lib/js never named the option.

Decisions

  • Took the review's suggestion to list the removal in doc/setup/upgrade.md; no other open decisions.

Impact

  • Public API: removes OpusConfig.usedtx from @moq/publish (breaking). Opus DTX stays off, the WebCodecs default.
  • Wire: none.

Alternatives

  • Keep the type but ignore it at runtime: a silently dropped knob is worse than a compile error.
  • Explicitly pass usedtx: false: redundant with the WebCodecs default, and the test pins that nothing sets it.

Follow-ups

  • Silence suppression for voice, if a customer wants it, is new work: encode without DTX and skip silent frames with our own voice detection, or a WASM libopus encoder (Opus backend).

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits October 6, 2026 00:41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chromium stamps Opus output by counting the samples emitted, so every frame
DTX suppresses pulls later audio earlier (#4902). Drop OpusConfig.usedtx and
its runtime forwarding, the demo checkbox, and the quest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Quest outcome: implemented as scoped in quest/m1/opus-usedtx-removal.md. Local just check passes. No open decisions; left as a draft for the maintainer to mark ready.

(Written by Claude Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review October 6, 2026 07:51
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9a65ef1e-bed5-4441-be2c-7622d50d8ac5
📥 Commits

Reviewing files that changed from the base of the PR and between 8714109 and 748b7e4.

📒 Files selected for processing (7)
  • demo/web/src/publish.html
  • demo/web/src/publish.ts
  • js/publish/src/audio/encoder.test.ts
  • js/publish/src/audio/encoder.ts
  • quest/m0/audio-jitter-target/watch.md
  • quest/m1/README.md
  • quest/m1/opus-usedtx-removal.md
💤 Files with no reviewable changes (5)
  • demo/web/src/publish.html
  • quest/m1/README.md
  • quest/m1/opus-usedtx-removal.md
  • js/publish/src/audio/encoder.ts
  • demo/web/src/publish.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.


Walkthrough

The Opus encoder configuration no longer declares or forwards usedtx. The encoder test now checks that usedtx remains undefined when requested. The demo no longer exposes or applies the DTX setting. Related quest documentation and a manual-run instruction were removed or updated.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 748b7

The public DTX option is intentionally removed; no in-repository publisher or demo depends on it, and no concrete merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the main change: removing Opus DTX from publish.
Description check ✅ Passed The description explains the reason for removing Opus DTX and summarizes the API, runtime, demo, test, and documentation changes.
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Review: feat(publish)!: remove Opus DTX

Reviewed head 748b7e4a.

This removes OpusConfig.usedtx and its forwarding in #opusOptions, along with the demo checkbox and the finished quest. The code change is clean. One doc gap:

Findings

  1. Should-fix: no doc/setup/upgrade.md entry for a released API removal. usedtx is in the published @moq/publish 0.5.x. It predates 0.5.0 and was still there after fix(publish): turn Opus DTX off by default for voice #4808. A TypeScript caller passing { mime: "opus", usedtx: true } now gets an excess-property compile error. A plain-JS or JSON-config caller silently gets DTX off. The PR body notes that doc/lib/js doesn't name the option, but the upgrade page is where breaking changes are listed: fix(relay)!: auth validate and init take the client-CA answer #4912 adds its entries there, and the page lists TypeScript changes in its Unreleased section. Suggested fix: add an Unreleased bullet like "@moq/publish drops OpusConfig.usedtx. Opus DTX stays off (the WebCodecs default); remove the field. A plain-JS caller still passing it is ignored."

What I checked (no issue found)

  • opusKindDefaults no longer sets usedtx for any kind. toEncoderConfig builds the Opus block only from opusKindDefaults plus #opusOptions, which copies three named fields. A smuggled usedtx can't reach AudioEncoder.configure, and the new test pins this.
  • Nothing else in the tree references usedtx. The Rust moq-audio Settings::dtx is a separate backend and is untouched, which is correct.
  • The as Codec cast in the test type-checks (Codec is imported), and the demo has no leftover opus-dtx binding.

CI: Check, Test, and Quest are pending. Release JS Packages passes.

Verdict: MERGE once CI green, ideally with the upgrade note added (head 748b7e4a).

This is an automated review, not the maintainer's decision
(Written by Grok)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Follow-up review: feat(publish)!: remove Opus DTX

Reviewed head 41351260 (re-review after push; previous Grok review was on 748b7e4a).

Since the last review, this push merges origin/main (clean, with no conflict edits; the PR's code diff is unchanged) and adds 41351260, which adds the upgrade note.

Earlier findings

  1. Fixed: missing doc/setup/upgrade.md entry. The new bullet is under ## Unreleased, next to the other pending breaking changes. It says what changed (OpusConfig.usedtx is gone), why (Chromium's DTX output shifts the audio timeline, as quest: delete opus-dtx-timestamps after a measured no-go, plan usedtx removal #4902 measured), what to do (remove the field), and what happens to a plain-JS caller still passing it (ignored, which the never enables Opus DTX test pins).

No new issues.

CI: Check, Test, Quest, and Release JS Packages are queued on the new head.

Verdict: MERGE once CI green (head 41351260).

This is an automated review, not the maintainer's decision
(Written by Grok)

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit 4135126.

No new actionable correctness finding. Removing both OpusConfig.usedtx and the runtime forwarding (js/publish/src/audio/encoder.ts:60-65,417-427) prevents a plain-JS caller from restoring the broken browser option. The cast-based regression (encoder.test.ts:388-395) exercises that runtime boundary rather than just TypeScript. Demo bindings and markup are removed together. Direction is appropriate: remove the unsupported knob instead of keeping a misleading typed option. The upgrade note at doc/setup/upgrade.md:95-97 now addresses the earlier release-communication finding. Static review of full diff, config/test context and discussion only; browser timing measurements and tests were not rerun. Release JS passed, Check queued, and mergeable=false at recheck.

Head, state and existing reviews rechecked before posting.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent foreground Codex review of 4135126.

No actionable findings. Reviewed the complete diff plus encoder configuration and test context. Removing both OpusConfig.usedtx and its named forwarding prevents a cast or untyped codec object from enabling DTX through the public encoder. The remaining kind defaults do not enable DTX, the fake-WebCodecs regression inspects the resulting configuration, and demo signal/binding/markup removal is consistent. The upgrade note covers the breaking field removal and untyped callers.

Validation: static review; merge agent independently reports Nix just check passed, encoder tests 16/16 and publish tests 210/210. Exact-head CI passes. Browser timing measurements were not independently repeated. Breaking JS API removal; no wire change. No new follow-up required.

(Written by GPT-6)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge decision: remove Chromium's broken Opus DTX option and demo control. The regression covers an untyped caller attempting to pass the removed field, and the upgrade note documents the breaking JS API removal. No wire change.

Final head 4135126 has non-Grok reviews with no outstanding findings. Nix just check passes, including 210 publisher tests; the encoder suite also passes 16/16. No additional follow-up is required; optional silence suppression remains under the existing Opus backend quest. Enqueuing this reviewed head through the normal merge queue.

(Written by GPT-6)

@kixelated
kixelated merged commit 9d572fd into main Oct 6, 2026
6 checks passed
@kixelated
kixelated deleted the quest/m1/opus-usedtx-removal branch October 6, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant