YouTube videos stuttering and not playing back smoothly

Bug #1417258 reported by Bill Filler
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
Olivier Tilloy
Oxide
Invalid
Undecided
Unassigned
webbrowser-app
Fix Released
Critical
Olivier Tilloy
webbrowser-app (Ubuntu)
Fix Released
Undecided
Olivier Tilloy
webbrowser-app (Ubuntu RTM)
Fix Released
Undecided
Olivier Tilloy

Bug Description

rtm build 224 on krillin
on fast wifi connection

- Go to videos scope
- Choose the first YouTube video
- Play it in YouTube and maximize the screen

Expected results:
- The video should play back smoothly

Actual results:
- The video pauses frequently and stutters
- The progress bar shows it's not a buffering issue as most of the video has been downloaded already

This is new. Wondering if it could be related to the YouTube user-agent string

Note: oxide-renderer process is using 180% CPU according to top when the video is being played back

Related branches

Bill Filler (bfiller)
Changed in webbrowser-app:
importance: Undecided → Critical
Revision history for this message
Bill Filler (bfiller) wrote :

Might not be specific to YouTube, seeing it on cnn.com as well trying to play this video:
http://www.cnn.com/2015/02/02/us/super-bowl-5-things/index.html

Revision history for this message
Olivier Tilloy (osomon) wrote :

I can easily reproduce the issue.
Some observations:

 - the issue affects krillin, both the latest rtm-proposed and vivid-proposed
 - on krillin, I’m seeing the 180% CPU usage by oxide-renderer (both rtm and vivid)
 - the issue doesn’t affect my nexus 7 on the latest vivid-proposed
 - on nexus 7, the CPU usage of oxide-renderer is capped at 99%

Changed in oxide:
status: New → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

On krillin, if I cap the CPU usage of oxide-renderer at e.g. 80% (using cpulimit), the stuttering goes away, but the resolution of the video is visibly degraded. It seems youtube uses adaptive bitrate streaming.

Revision history for this message
David Barth (dbarth) wrote :

This is similar and linked to https://bugs.launchpad.net/oxide/+bug/1414743

Revision history for this message
David Barth (dbarth) wrote :

Justin recently investigated the ebay ad problem and we have a few theories here:

1. The high cpu usage is due to a highdef video format that is pushing the limits of what our HW can support. However, trying various user-agent strings for higher-end or lower-end devices did not change the type of video that was sent. So we can infer that the video we are sent is the one meant for our class of devices.

2. The high cpu usage is due to a switch of Youtube to using by default a new MediaSource construct. In particular, this involves demuxing the stream in the webview, in javascript. That may explain the higher cpu usage, causing the dropped frames. However, since that does not happen on Android, it would highlight a performance problem in our port the chrome engine. If the difference is mostly the js demuxing, that would indicate a v8 engine performance problem. Or maybe the fact that once processed the stream is sent via JS to a construct (the video frame) with a higher penalty than on other platforms.

3. This behavior is limited to Youtbe, and other video sites like Vimeo or Dailymotion seem to work fine for all of the popular video we have tested.

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Remember that android doesn't do software decoding, so while it might consume more CPU, it might still be fine for Android. In our case we're adding that on top of a heavily software decoding process.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Ricardo, is there a way to enforce CPU usage limitations on a given process in Ubuntu Touch?
I’m thinking that if we were able to somehow declare that oxide-renderer is not allowed to use more than 80% CPU, then this would fix the issue (by ensuring the youtube serves a lower-resolution video).

Revision history for this message
David Barth (dbarth) wrote :

I investigated further, and reverted my krillin to image #9, and then upgrade to the current #16 image.
With the older #9 image, the CPU usage is about 50% for the oxide renderer process. If switching to #16, the CPU usage goes through the roof at 150+% (120% on average).

Revision history for this message
David Barth (dbarth) wrote :

Upgrading the #9 RTM image to use the newest oxide, ie from 1.3.4 to 1.3.5, I observe that the cpu usage is still contained, ie around 50% for the main renderer process. The browser process consumes about 40% which is on par with what I was observing with 1.3.4.

So overall, it doesn't seem to be an oxide regression.

Revision history for this message
David Barth (dbarth) wrote :

Upgrading to the newest webbrowser-app triggers the frame skipping again.

ie: it works fine with: 0.23+15.04.20141118~rtm-0ubuntu1
but burns a lot of cpu with: 0.23+15.04.20150127~rtm-0ubuntu1

Not sure if this is webbrowser-app, or another interaction it has with oxide or mir though, or the newer UA string.

Olivier Tilloy (osomon)
Changed in oxide:
status: Confirmed → Invalid
Changed in webbrowser-app:
status: New → In Progress
assignee: nobody → Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu):
status: New → In Progress
assignee: nobody → Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu RTM):
status: New → Confirmed
Revision history for this message
Bill Filler (bfiller) wrote :

confirming that reverting the UA string to old version fixes the stuttering when using youtube webapp or visiting youtube in browser.

But it doesn't fix problem where pages have embedded youtube videos, like this:
http://m.bleacherreport.com/articles/2352016-papa-johns-airs-wrong-commercial-congratulates-seahawks-after-super-bowl

These still exhibit the problem even with the youtube specific UA string

Changed in canonical-devices-system-image:
status: New → In Progress
importance: Undecided → Critical
milestone: none → ww07-2015
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webbrowser-app - 0.23+15.04.20150203.1-0ubuntu1

---------------
webbrowser-app (0.23+15.04.20150203.1-0ubuntu1) vivid; urgency=medium

  [ Olivier Tilloy ]
  * Update translation template.
  * Revert the UA override for m.youtube.com as it was causing a lot of
    stuttering (due to very high CPU usage) on krillin. In the meantime,
    the issue with videos not playing that this update was meant to
    address (bug #1415107) was resolved on youtube’s side. (LP:
    #1417258, #1415107)
 -- Ubuntu daily release <email address hidden> Tue, 03 Feb 2015 17:35:27 +0000

Changed in webbrowser-app (Ubuntu):
status: In Progress → Fix Released
Olivier Tilloy (osomon)
Changed in webbrowser-app:
status: In Progress → Fix Released
Changed in canonical-devices-system-image:
assignee: nobody → Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu RTM):
status: Confirmed → In Progress
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
David Barth (dbarth) wrote : Re: [Ubuntu-webapps-bugs] [Bug 1417258] Re: YouTube videos stuttering and not playing back smoothly

I confirm the change also fixes the problem on rtm (silo 8)

On Wed, Feb 4, 2015 at 7:16 AM, Olivier Tilloy <<email address hidden>
> wrote:

> ** Changed in: webbrowser-app
> Status: In Progress => Fix Released
>
> ** Changed in: canonical-devices-system-image
> Assignee: (unassigned) => Olivier Tilloy (osomon)
>
> ** Changed in: webbrowser-app (Ubuntu RTM)
> Status: Confirmed => In Progress
>
> ** Changed in: webbrowser-app (Ubuntu RTM)
> Assignee: (unassigned) => Olivier Tilloy (osomon)
>
> --
> You received this bug notification because you are a member of Ubuntu
> WebApps bug tracking, which is subscribed to Oxide.
> https://bugs.launchpad.net/bugs/1417258
>
> Title:
> YouTube videos stuttering and not playing back smoothly
>
> Status in the base for Ubuntu mobile products:
> In Progress
> Status in Oxide Webview:
> Invalid
> Status in Web Browser App:
> Fix Released
> Status in webbrowser-app package in Ubuntu:
> Fix Released
> Status in webbrowser-app package in Ubuntu RTM:
> In Progress
>
> Bug description:
> rtm build 224 on krillin
> on fast wifi connection
>
> - Go to videos scope
> - Choose the first YouTube video
> - Play it in YouTube and maximize the screen
>
> Expected results:
> - The video should play back smoothly
>
> Actual results:
> - The video pauses frequently and stutters
> - The progress bar shows it's not a buffering issue as most of the video
> has been downloaded already
>
> This is new. Wondering if it could be related to the YouTube user-
> agent string
>
> Note: oxide-renderer process is using 180% CPU according to top when
> the video is being played back
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/canonical-devices-system-image/+bug/1417258/+subscriptions
>
> --
> Mailing list: https://launchpad.net/~ubuntu-webapps-bugs
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~ubuntu-webapps-bugs
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

With silo 8 packages (see below), I still cannot reproduce this video smoothly, gets over 150% CPU usage: http://pages.ebay.com/shoptheworld/

current build number: 226
device name: krillin
channel: ubuntu-touch/ubuntu-rtm/14.09-proposed

Upgrade: qtdeclarative5-ubuntu-web-plugin:armhf (0.23+15.04.20150127~rtm-0ubuntu1, 0.23+15.04.20150203~rtm-0ubuntu1), qtdeclarative5-ubuntu-ui-extras-browser-plugin:armhf (0.23+15.04.20150127~rtm-0ubuntu1, 0.23+15.04.20150203~rtm-0ubuntu1), webbrowser-app:armhf (0.23+15.04.20150127~rtm-0ubuntu1, 0.23+15.04.20150203~rtm-0ubuntu1), qtdeclarative5-ubuntu-web-plugin-assets:armhf (0.23+15.04.20150127~rtm-0ubuntu1, 0.23+15.04.20150203~rtm-0ubuntu1), webapp-container:armhf (0.23+15.04.20150127~rtm-0ubuntu1, 0.23+15.04.20150203~rtm-0ubuntu1)

Revision history for this message
Olivier Tilloy (osomon) wrote :

Victor, silo 8 only fixes videos on youtube.com. It won’t address playback issues on other websites. That’s because it’s a UA string override for m.youtube.com.
Let’s track similar issues for other websites in different bugs, please.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webbrowser-app - 0.23+15.04.20150203~rtm-0ubuntu1

---------------
webbrowser-app (0.23+15.04.20150203~rtm-0ubuntu1) 14.09; urgency=medium

  [ Olivier Tilloy ]
  * Revert the UA override for m.youtube.com as it was causing a lot of
    stuttering (due to very high CPU usage) on krillin. In the meantime,
    the issue with videos not playing that this update was meant to
    address (bug #1415107) was resolved on youtube’s side. (LP:
    #1417258, #1415107)
 -- Ubuntu daily release <email address hidden> Tue, 03 Feb 2015 17:35:26 +0000

Changed in webbrowser-app (Ubuntu RTM):
status: In Progress → Fix Released
Olivier Tilloy (osomon)
Changed in canonical-devices-system-image:
status: In Progress → Fix Released
Revision history for this message
Bill Filler (bfiller) wrote :

filed this bug to track problems with embeded YouTube videos that are not addressed by this fix:
https://bugs.launchpad.net/ubuntu/+source/webbrowser-app/+bug/1418626

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.