Open Bug 1812900 Opened 2 years ago Updated 2 years ago

Audio out of sync on Linux after increasing speed and reverting back to 1x

Categories

(Core :: Audio/Video: cubeb, defect)

Firefox 111
Unspecified
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: tustamido, Unassigned)

Details

Attachments

(1 file)

Attached video screen_recording.mp4

STR:

  1. Start a video with audio.
  2. Increase the speed (I use 3x) and watch it for a few seconds.
  3. Slow it down back to 1x.
  4. Repeat 2 and 3.

The more you repeat, the more out of sync the audio will be compared to the video.

This is not a new bug. I switched to Linux from Win10 a year ago and this has always bothered me.

This is not a driver/hardware issue unsolvable on Firefox side because the same machine running the same OS can't reproduce the issue on Vivaldi, the Chromium-based browser I have here when I want to test something on Blink instead of Gecko.

I just replaced PulseAudio by PipeWire as my last attempt to fix the issue on my side, but nothing has changed.

For may years I use Video Speed Controller extension, I set a single key to toggle playback speed between 1x and 3x. This extension is also available on Chrome Web Store so I used it to confirm that Chromium-based browsers (Vivaldi) don't have this issue. Windows 10 is also not affected.

I'll attach a short screen capture video showing the issue. It would be clearer if I had recorder a longer time, but I tried to keep the file small. You can see playback speed at top left.

Video used in the test, from Firefox's Youtube channel: https://www.youtube.com/watch?v=5NQ2ueB0pkI

The issue is not restricted to a single codec or website. The video above plays here as dash streaming using VP9 for video and opus for audio, but I can also reproduce the issue with, for instance, h264 and aac in a .mp4 file.

The only way to restore the sync is by seeking, like clicking at some point of the progress bar.

Just in case, my setup: Linux (openSUSE Tumbleweed), Wayland (but X11 is also affected), AMD Radeon RX 570.

I wasn't able to reproduce in Firefox 110.0b7, neither with Shift+> and Shift+< on YouTube, nor with document.getElementsByTagName("video").playbackRate[0] = 3 and = 1 in the Web Console (Hamburger -> More tools -> Web Developer Tools -> Console tab). Do either of those methods reproduce for you, or does this happen only with the Video Speed Controller extension?

If one of those methods do reproduce for you, can you attach a screenshot of the "Media" section of about:support, please?

I can reproduce the issue by adjusting speed with document.getElementsByTagName("video")[0].playbackRate, which is actually the exact same code the extension runs.

Media section:
https://i.imgur.com/qLfti1Z.png

A standard deviation of 159.86 seems high on mean roundtrip latency of 212.46ms, but the default input device is the monitor of the default output device. Still, an input device is not involved in playback.

Component: Audio/Video: Playback → Audio/Video: cubeb

Weird numbers indeed.

Reporter, would you mind reproducing the scenario you used in your initial comment with logging enabled, so we can have a look?

https://paul.cx/public/about-logging-presentation.webm has video instructions, simply change the playback rate (by any mean, e.g. the extension, the console, etc.) while logging, and then upload the recording and give us the URL here (or save it and send it privately at <padenot@mozilla.com>).

Thanks for the report, hopefully we can figure out what's going on with your setup, I have an idea, but I'm not entirely sure -- logging will probably shed light on this issue.

Flags: needinfo?(tustamido)
Flags: needinfo?(tustamido)

The severity field is not set for this bug.
:karlt, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(karlt)
Severity: -- → S3
Flags: needinfo?(karlt)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: