Skip to content

fix(publish): turn Opus DTX off by default for voice (backport #4808) - #6598

Merged
kixelated merged 1 commit into
releasefrom
fix/release-opus-dtx-off
Oct 24, 2026
Merged

kixelated merged 1 commit into
releasefrom
fix/release-opus-dtx-off

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Backport of #4808 onto release, so moq.dev/publish stops letting microphone audio fall behind video.

Why

Release configures Opus for voice with usedtx: true. Chromium stamps Opus output by counting the samples it emits, so each frame DTX suppresses during silence pulls all later audio 20 ms earlier. Measured on moq.dev/publish (6f204fd) with a physical camera and microphone, wrapping AudioEncoder in the page:

t (s) frames in frames out input ts minus output ts
174.7 1123 1030 1860 ms
189.7 1874 1651 4460 ms
202.2 2498 2029 9380 ms

(in - out) × 20 ms equals the timestamp gap exactly. Input stamps stayed within 35 ms of the clock and encodeQueueSize stayed 0, so this is neither lost capture samples nor an encoder backlog. The DTX keep-alive every 400 ms matches the 400 ms steps the viewer saw in the audio catalog delay, which drove the steady SUBSCRIBE_UPDATE stream.

main already fixed this in #4808 and then removed the knob in #4919. A local main build with the same camera showed no drift.

Change

Only the code part of #4808: the voice default no longer sets usedtx, and a test checks that voice configures without DTX and that an explicit request still passes through. The quest file moves in #4808 are left out.

API and wire impact

None. OpusConfig.usedtx stays, so this ships as a patch. A caller that sets usedtx: true explicitly still gets DTX and its drift; the field's comment now says so.

Checks

bun test src/audio (52 pass), tsc --noEmit, and biome check in js/publish.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Chromium stamps Opus output by counting the samples it emits, so every
frame DTX suppresses during silence pulls all later audio 20 ms earlier.
A microphone published from moq.dev/publish fell seconds behind video
within a minute and the catalog delay ratcheted without bound.

Ports the code change of #4808 from main onto release. The usedtx knob
stays, so the published API is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T05:57:57.534087Z c2182a5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: c2182a563c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kixelated
kixelated merged commit 5abd07c into release Oct 24, 2026
4 checks passed
@kixelated
kixelated deleted the fix/release-opus-dtx-off branch October 24, 2026 06:00
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