Skip to content

JS Watch: Configuring a buffer of more than 0 causes audio sync and play issue #8031

Closed

Description

@danrossi

I had a wrong configuration of the buffer aswell as latency which is what the demo only sets. And found it was causing issues with audio sync and playback issues. It won't play or audio is cutting out like it used to before with console warning logs about the audio codec.

So the buffer needs to stay unset as zero and latency changed to 0-500ms. Anything more than 500 I believe causes lipsync issues. I was hoping to create a buffer config option but that causes the error.

const watch = document.createElement("moq-watch") as MoqWatch;
	watch.name = name;
	watch.echo = `${VIEWER}-${++tileCount}`;
	watch.muted = true; // unmuted only while active (see below)
	watch.buffer = Milli(500);
Image

Activity

  1. coderabbitai commented on Nov 6, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #6609 - fix(watch): gate buffered playback on the shared startup floor [merged]
    #7941 - feat(watch): per-track timelines on the shared Sync clock [closed]
    #6484 - fix(watch): keep audio above a fixed decoded floor encoded [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    questBeing tracked/planned in a quest. See `quest/`
    on Nov 6, 2026
  3. kixelated commented on Nov 6, 2026

    @kixelated
    Collaborator

    Thanks for the report. Short version: buffer isn't a jitter buffer, and on a live stream it should stay at 0.

    buffer is a lookahead for media produced faster than real time, such as a TTS reply written in one burst. With a nonzero buffer, the audio ring plays through everything it holds and turns off its catch-up. Any lag it picks up on a live stream (a stall, an "auto" delay rise, publisher clock drift) is therefore permanent: audio drifts behind video, and once it trails by more than delay + buffer, the consumer drops whole audio groups. Those drops are the skipping slow groups: track=2.aac warnings and the cut-outs. The skipping covered group line is a harmless video skip.

    Workaround now: leave buffer unset and put the slack in delay, either a fixed value like watch.delay = Milli(500) or "auto" (the default), which sizes it from measured arrival jitter. I couldn't reproduce lip-sync problems from delay above 500 ms in a simulation (300, 800 and 1500 ms all held about 20 ms). If you still see that with buffer at 0, please share the setup.

    Decisions:

    • Buffered audio will converge back onto the shared clock by time-stretching (playing slightly faster), never skipping. Lip sync then returns after a stall, and TTS keeps every word. Tracked by quest/m1/audio-jitter-target/buffered-converge.md; that quest's PR closes this issue.
    • buffer will be renamed lookahead in the next breaking release so the name stops suggesting a jitter buffer: quest/m2/watch-lookahead.md.

    Planned in moq-dev/moq#8034. Anyone who wants to donate tokens can pick one up with /quest-start quest/m1/audio-jitter-target/buffered-converge or /quest-start quest/m2/watch-lookahead. The first waits on the jitter epic's Watch quest, which lands the time stretch it reuses.

    (Written by Claude Opus 5.5)

  4. added 2 commits that reference this issue on Nov 9, 2026
    43529cf
    0ceaa13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questBeing tracked/planned in a quest. See `quest/`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions