Choppy video playback when looping
Categories
(Core :: Audio/Video: Playback, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox126 | --- | verified |
People
(Reporter: vlastimir.arnost, Assigned: jhlin)
References
Details
Attachments
(4 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Android 10; Mobile; rv:122.0) Gecko/122.0 Firefox/122.0
Steps to reproduce:
Watch any video on Twitter or Tiktok.
Device: Galaxy S23
Actual results:
Video plays as expected on the first run, but on the second and succeeding loops, playback is choppy.
Expected results:
Videos should play in a loop without frame drops.
Reporter | ||
Comment 1•2 years ago
|
||
Comment 2•2 years ago
|
||
We've seen other reports of this happening also on youtube when uBlock is enabled, but it seems like uBlock is not the cause here so there is something going on deeper.
vlastimir.arnost, if you can include a link to a performance profile with the 'Media' setting by following these instructions, that would greatly help the team triage and fix the bug. Thanks!
Proactively sending to the media team.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
The severity field is not set for this bug.
:jimm, could you have a look please?
For more information, please visit BugBot documentation.
Reporter | ||
Comment 4•2 years ago
|
||
(In reply to Jonathan Almeida [:jonalmeida] from comment #2)
We've seen other reports of this happening also on youtube when uBlock is enabled, but it seems like uBlock is not the cause here so there is something going on deeper.
vlastimir.arnost, if you can include a link to a performance profile with the 'Media' setting by following these instructions, that would greatly help the team triage and fix the bug. Thanks!
Proactively sending to the media team.
https://profiler.firefox.com/public/tnk77x0pq1rk32xpc7bdw17xjpxnwwsqnc048wr
Updated•2 years ago
|
![]() |
||
Comment 5•2 years ago
|
||
I'll do some testing on Tiktok. The profile shows regular cycles of gc, but not much cpu utilization. I'm not sure what's going here.
Reporter | ||
Comment 6•2 years ago
|
||
Here's another sample I took using Twitter/X. See attached file 'screen recording twitter'
https://profiler.firefox.com/public/dyh2vzfy0gyhnfwa9rhpx2h8na7mg79zdc34v70
Reporter | ||
Comment 7•2 years ago
|
||
Updated•2 years ago
|
Comment 8•2 years ago
|
||
(In reply to vlastimir.arnost from comment #6)
Here's another sample I took using Twitter/X. See attached file 'screen recording twitter'
https://profiler.firefox.com/public/dyh2vzfy0gyhnfwa9rhpx2h8na7mg79zdc34v70
This profile shows a bunch VideoSinkDroppedFrame
markers on the MediaDecoderStateMachine thread.
If you look at the compositor thread there's also a bunch of bad looking stuff there.
Comment 10•2 years ago
•
|
||
Alternative steps to reproduce
- Open a video on youtube.com
- Wait for an ad to play (or use uBlock to skip it; it's still reproducible in both cases).
- Observe the choppy playback.
- Use the video controls to skip through the video to get rid of the choppiness.
- Observe the playback is now smooth.
See attached video.
Aside from TikTok that the OP has reported, I've also observed this bug on Instagram and Vimeo videos as well.
Comment 11•2 years ago
|
||
This has happened before with reporters and myself were not able to reproduce it. This might have been also been because it was harder to reproduce for a time, in which case, this bug it at least 8 months old when first reported.
Updated•1 years ago
|
Assignee | ||
Comment 12•1 years ago
|
||
The Twitter/X profile in comment 8 shows that after seeking (23.234s), 4 video frames were decoded and pushed and there was no more request for video data. It seems they were queued and didn't get processed until media sinks were restarted. By then the audio clock time was already > 100ms and all video frames were considered too late and got dropped. After that, the video decoding just didn't catch up and the video played at ~10hz. (keyframes only?)
According to Alastor's comment offline, the media sinks didn't start sooner because MDSM waits for audio data preloading. However, the 1st VideoSinkDroppedFrame
marker after that shows the audio clock time is 115,216μs, which seems quite larger than the time from audio sink start (~23.291s) to the marker (23.307s)
Assignee | ||
Comment 14•1 years ago
|
||
I added some profile markers locally to check the audio clock time and found that the frame# from the Android cubeb backend won't reset from zero when the video plays again and it causes audio clock to increase in chunk size (~100ms). This doesn't happen on other platforms.
After analyzing cubeb log, it seems the aaudio backend recycles stream but the old timing_info
buffers will be used. Not sure why this only happens when looping video, though.
Matthew, what do you think? Should the buffers be cleared when destroying the stream?
Assignee | ||
Updated•1 years ago
|
![]() |
||
Updated•1 years ago
|
Assignee | ||
Comment 15•1 years ago
|
||
Patch and pull request created on GitHub cubeb repo: https://github.com/mozilla/cubeb/pull/784
Comment 17•1 years ago
|
||
Matthew what's the next step for getting cubeb change into mozilla-central?
Comment 18•1 years ago
|
||
And can we uplift it to beta?
Comment 19•1 years ago
|
||
Update will land via bug 1894401. I'll prep a beta uplift patch now.
Comment 20•1 years ago
|
||
Updated•1 years ago
|
Comment 21•1 years ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D209083
Updated•1 years ago
|
Updated•1 years ago
|
Comment 22•1 years ago
|
||
beta Uplift Approval Request
- User impact if declined: Audio glitching or desync when looping videos
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: Per bug 1872354 comment 0
- Risk associated with taking this patch: Low risk
- Explanation of risk level: Small change, adds a missing timing reset when stream reused
- String changes made/needed: No
- Is Android affected?: yes
Comment 23•1 years ago
|
||
:kinetik can you confirm the fix for this landing is landing in central as tracked under Bug 1894401?
The patch attached here is for Beta only and you are not tracking anything else under this bug? Bug 1894401 will not require a beta uplift?
(This appears to be the case, but wanted to confirm)
We are in the final week of Beta. I would prefer Bug 1894401 to land and stick in central before taking this to beta.
Comment 24•1 years ago
|
||
Got some information on Slack.
Confirmed that this is only a cherry-pick of Bug 1894401, low risk, and nothing else will land under Bug 1872354.
Updated•1 years ago
|
Comment 25•1 years ago
|
||
uplift |
Updated•1 years ago
|
Updated•1 years ago
|
Comment 26•1 year ago
•
|
||
Verified as fixed on Firefox 126.09 and Firefox 126 with: Lenovo tab M10 (Android 10)
Samsung Galaxy S23 Ultra (Android 14)
OPPO A58 ( Android 13)
Comment 27•1 year ago
|
||
Adina, should status-firefox127 be reset from 'verified' as this hasn't been fixed in 127 yet.
Comment 28•1 year ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #27)
Adina, should status-firefox127 be reset from 'verified' as this hasn't been fixed in 127 yet.
Certainly! Thanks for catching that typo!
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Comment 29•1 year ago
|
||
Reopening because this is still unfixed in mozilla-central, until bug 1894401 lands. It is fixed in Beta (126). The bug status usually indicates the mozilla-central status.
Comment 30•1 year ago
|
||
Bug 1895471 is on autoland and is tracking fixing this in central
Comment 31•1 year ago
|
||
Bug 1895471 has landed in central.
It's not good practice to track the same fix across multiple bugs
Description
•