Open Bug 1720902 Opened 3 years ago Updated 11 months ago

youtube quality is auto-reduced if using 1+ window of firefox

Categories

(Core :: Graphics, defect, P3)

Firefox 89
defect

Tracking

()

People

(Reporter: adam.jarosz, Unassigned)

References

Details

(Keywords: steps-wanted)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

open more than one instance (window) of FF, and begin streaming youtube at 1080p on both windows.
make sure your ISP speed is at least 100/10 via ethernet cable.

Actual results:

Without exception, Firefox downregulates the video last opened to a quality below 1080p. This is extremely unnerving as my ISP speed easily supports several instances of 1080p streamed videos.

Expected results:

Firefox should behave like google chrome does and not touch the resolution (quality) when there is not an bandwidth issue. My desktop is perfectly capable of streaming multiple sources of 1080p footage without having to regulate quality, which makes firefox undesirable for me, as I use 3 monitors, and want 1080p on all of them.
i hate having to switch to google chrome, but i cant use FF the way I want it to work.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Be gone, bot!

Component: Widget: Gtk → Performance

Hey adam,

We're not having much luck reproducing this. Would you mind trying a few things:

  1. Are you able to reproduce this if all of the Firefox windows are on the same display?
  2. Can we presume you're keeping all of the windows up and not occluded or minimized?
  3. Is this true for all 1080p videos on YouTube, or just some? If the latter, can you provide links to the videos that you're experiencing this with?
Flags: needinfo?(adam.jarosz)
Keywords: steps-wanted

(In reply to Mike Conley (:mconley) (:⚙️) from comment #3)

Hey adam,

We're not having much luck reproducing this. Would you mind trying a few things:

  1. Are you able to reproduce this if all of the Firefox windows are on the same display?
  2. Can we presume you're keeping all of the windows up and not occluded or minimized?
  3. Is this true for all 1080p videos on YouTube, or just some? If the latter, can you provide links to the videos that you're experiencing this with?

Thanks for responding. I am unable to reproduce this at the moment too, but will keep testing until, or in best case, if the problems reoccur.

2= All windows are raised and visible. 3= This concerned all HD videos.

In retrospect; there might have been some process on the system that (I believe) made Firefox reduce quality, Im trying to retrace my steps but will re-post when I find out.

Flags: needinfo?(adam.jarosz)

(In reply to Mike Conley (:mconley) (:⚙️) from comment #3)

Hey adam,

We're not having much luck reproducing this. Would you mind trying a few things:

  1. Are you able to reproduce this if all of the Firefox windows are on the same display?
  2. Can we presume you're keeping all of the windows up and not occluded or minimized?
  3. Is this true for all 1080p videos on YouTube, or just some? If the latter, can you provide links to the videos that you're experiencing this with?

Okay, Ive done more investigation, and it seems to occur on separate displays.

(In reply to Mike Conley (:mconley) (:⚙️) from comment #3)

Hey adam,

We're not having much luck reproducing this. Would you mind trying a few things:

  1. Are you able to reproduce this if all of the Firefox windows are on the same display?
  2. Can we presume you're keeping all of the windows up and not occluded or minimized?
  3. Is this true for all 1080p videos on YouTube, or just some? If the latter, can you provide links to the videos that you're experiencing this with?

Okay, Ive done more investigation, and it seems to occur on separate displays.

I tested keeping all on the same display and dont recall observing the issue.

So I dont know how to edit comments on here, but just want to describe that this happens when browsing from one video to another by clicking a thumbnail on the right of the streaming video, just adding that to aid in reproduction of issue.

(In reply to adam.jarosz from comment #7)

So I dont know how to edit comments on here

(You might see a pencil icon on the top-right of your previous comments; I'm not sure if that's available by default or only to accounts that have been around for a while)

Question: In your testing, have you come up with reliable steps-to-reproduce that trigger this? You've mentioned using separate monitors, and navigating via a thumbnail on the right, but it's not clear whether it requires either/both/etc. of those, and whether it happens only a small fraction of the time vs. all of the time.

Another question: as you figure out the exact steps that make this happen most-reliably, I'm wondering if you could see whether Chrome is similarly-affected when using those same steps? I know you initially had a hunch that this was Firefox-specific and Chrome was unaffected, but then later you were unable to reproduce in Firefox for a while. So I'm wondering if maybe this is just a general YouTube behavior which happens with a particular set of factors that you happened to have in-effect for Firefox (in comment 0) but not for Chrome.

Flags: needinfo?(adam.jarosz)

(In reply to Daniel Holbert [:dholbert] from comment #8)

(In reply to adam.jarosz from comment #7)

So I dont know how to edit comments on here

(You might see a pencil icon on the top-right of your previous comments; I'm not sure if that's available by default or only to accounts that have been around for a while)

Question: In your testing, have you come up with reliable steps-to-reproduce that trigger this? You've mentioned using separate monitors, and navigating via a thumbnail on the right, but it's not clear whether it requires either/both/etc. of those, and whether it happens only a small fraction of the time vs. all of the time.

In retesting I used separated monitors and browsing youtube.com, to spell it out: browse from one video to another, repeatedly.
I am retesting currently, and this problem has become more elusive, I dont recall if Ive updated FF since, current version is 89.0.2.
Will continue to re-test, so far I have only been able to reproduce it by streaming HD on all (three) monitors simultaneously, but

Another question: as you figure out the exact steps that make this happen most-reliably, I'm wondering if you could see whether Chrome is similarly-affected when using those same steps? I know you initially had a hunch that this was Firefox-specific and Chrome was unaffected, but then later you were unable to reproduce in Firefox for a while. So I'm wondering if maybe this is just a general YouTube behavior which happens with a particular set of factors that you happened to have in-effect for Firefox (in comment 0) but not for Chrome.

Flags: needinfo?(adam.jarosz)

(In reply to Daniel Holbert [:dholbert] from comment #8)

(In reply to adam.jarosz from comment #7)

So I dont know how to edit comments on here

(You might see a pencil icon on the top-right of your previous comments; I'm not sure if that's available by default or only to accounts that have been around for a while)

Question: In your testing, have you come up with reliable steps-to-reproduce that trigger this? You've mentioned using separate monitors, and navigating via a thumbnail on the right, but it's not clear whether it requires either/both/etc. of those, and whether it happens only a small fraction of the time vs. all of the time.

Freaking bugzilla published my response before I could finish it.
I was saying that I will continue re-testing and if nothing occurs I will report back. The issue only occurred after some time of browsing to next video on YT, but it was with regular intervals.

Another question: as you figure out the exact steps that make this happen most-reliably, I'm wondering if you could see whether Chrome is similarly-affected when using those same steps? I know you initially had a hunch that this was Firefox-specific and Chrome was unaffected, but then later you were unable to reproduce in Firefox for a while. So I'm wondering if maybe this is just a general YouTube behavior which happens with a particular set of factors that you happened to have in-effect for Firefox (in comment 0) but not for Chrome.

Chrome was unaffected. I switched to it, and never experienced the issue.

Perhaps this was somehow fixed in 89.02, and the only down-regulation I see now is bandwidth related, but hopefully with continued testing we'll learn more. Best greetings, Adam!

(In reply to adam.jarosz from comment #9)

I am retesting currently, and this problem has become more elusive, I dont recall if Ive updated FF since, current version is 89.0.2.

Note that 89.0.2 is the previous version -- the up-to-date release is version 90 (released in early July), and version 91 is being released next week.

Generally, it's great to do your testing with the latest release version (or even beta!), in case this is a known issue that has already been fixed.

I just tested with 92.0b4 and the issue persists. For a while, 1080 remained, but I then pulled one window from the right most monitor to the left most monitor and repeated with another window to the middle monitor (If I recall correctly) and resolution was now 720p and less on two monitors.
The issue then went away for a while, so I tried to close the YT tab on each window, and enter YT on a new one, on two or more monitors and, what do you know, quality is now 720p and less.

More desired behaviour would be to never have to change resolution more than once, then move on.

Thanks. Are some of your monitors High-DPI (also called "retina" display or pixel-scaling) and others not, out of curiosity?

Specifically: if you open the Web Console (Ctrl Shift K) and type in...

window.devicePixelRatio

...what does it tell you? (Probably 1 or 2)

Importantly, does the answer change if you drag your window from one monitor to another and query the value again? (With the web console still open, just hit "up" and then "enter" to repeat the query.)

If the value does change, I could imagine that difference causing some confusion for YouTube's code, if they have some logic that links the video quality to your pixel-density. This would explain the connection to having multiple monitors which is otherwise a bit mysterious.

(If this is indeed the issue, then it theoretically should affect Chrome in just the same way that it affects Firefox, except that YouTube probably a different codepath for Firefox vs. for Chrome, and maybe this is a wrinkle that they haven't worked out in their Firefox codepath...)

ni?ing adam for dholbert's question in comment 13.

Flags: needinfo?(adam.jarosz)

(In reply to Daniel Holbert [:dholbert] from comment #13)

Thanks. Are some of your monitors High-DPI (also called "retina" display or pixel-scaling) and others not, out of curiosity?

Specifically: if you open the Web Console (Ctrl Shift K) and type in...

window.devicePixelRatio

...what does it tell you? (Probably 1 or 2)

Importantly, does the answer change if you drag your window from one monitor to another and query the value again? (With the web console still open, just hit "up" and then "enter" to repeat the query.)

If the value does change, I could imagine that difference causing some confusion for YouTube's code, if they have some logic that links the video quality to your pixel-density. This would explain the connection to having multiple monitors which is otherwise a bit mysterious.

(If this is indeed the issue, then it theoretically should affect Chrome in just the same way that it affects Firefox, except that YouTube probably a different codepath for Firefox vs. for Chrome, and maybe this is a wrinkle that they haven't worked out in their Firefox codepath...)

The output of window.devicePixelRatio is ofcourse 1 on all monitors, if called on each one, separately. Its pretty obvious this wouldnt be the issue, and the troubleshooting for firefox is really disappointing. You dont think a user would know if they had a High-DPI monitor?
By the way: the shortcut for console isnt Control Shift K on linux, its Control Shift J.

Flags: needinfo?(adam.jarosz)

(In reply to adam.jarosz from comment #15)

The output of window.devicePixelRatio is ofcourse 1 on all monitors, if called on each one, separately.

Darn, ok. There goes that theory. I don't have any other ideas/diagnostics to suggest right now, offhand.

Its pretty obvious this wouldnt be the issue, and the troubleshooting for firefox is really disappointing. You dont think a user would know if they had a High-DPI monitor?

We're shooting in the dark a bit here, since we haven't been able to reproduce and since this is ~magic quality-switching behavior that's coming from YouTube, not directly from Firefox.

And yes, from experience; plenty of users don't know whether they have high-DPI monitors. It's not always something they need to know/care about (but it can be a relevant diagnostic bit of info for bugs like this one)

By the way: the shortcut for console isnt Control Shift K on linux, its Control Shift J.

For me at least (on linux), Ctrl Shift K brings up the Web Console (for the given webpage), whereas Ctrl Shift J brings up the whole-browser "Browser Console". (either one will do for this purpose, I think)

(In reply to Daniel Holbert [:dholbert] from comment #16)

(In reply to adam.jarosz from comment #15)

The output of window.devicePixelRatio is ofcourse 1 on all monitors, if called on each one, separately.

Darn, ok. There goes that theory. I don't have any other ideas/diagnostics to suggest right now, offhand.

Its pretty obvious this wouldnt be the issue, and the troubleshooting for firefox is really disappointing. You dont think a user would know if they had a High-DPI monitor?

We're shooting in the dark a bit here, since we haven't been able to reproduce and since this is ~magic quality-switching behavior that's coming from YouTube, not directly from Firefox.

And yes, from experience; plenty of users don't know whether they have high-DPI monitors. It's not always something they need to know/care about (but it can be a relevant diagnostic bit of info for bugs like this one)

By the way: the shortcut for console isnt Control Shift K on linux, its Control Shift J.

For me at least (on linux), Ctrl Shift K brings up the Web Console (for the given webpage), whereas Ctrl Shift J brings up the whole-browser "Browser Console". (either one will do for this purpose, I think)

Okay, sorry about the whining, just' a very lengthy process.

About you reproducing this: how many monitors do you have, are you running 1080p on the video streams and are you closing/reopening new tabs and switching to videos enough times for this to occur? Just asking, because it would be great if anyone else observed this.

*By the way, I assume this is youtube only, really its the only relevant candidate, right now anyway :)

  • and shifting videos enough times for this to occur?

Sorry for delayed reply. Answering your question: personally, I believe I tested this with one external monitor, and I spent a few minutes loading videos and dragging them around, and didn't notice the quality being auto-reduced.

I'm going to reclassify this to our Audio/Video component, in any case.

Component: Performance → Audio/Video

Recapping now that this is in Audio/Video.

YouTube is changing the video quality to less than 1080p. This is happening when multiple videos are being played on different monitors in Firefox. The issue is more prevalent (or only takes place?) when undertaking actions such as dragging a video between monitors or navigating to a new video in YouTube. Is that correct?

YouTube is responsible for the resolution switching behaviour, but will do so based on certain metrics it gets from the browser. I don't know the specific thresholds YT are using (and they may change over time), but would expect them to lower resolution in response to performance dropping. This could be because of bandwidth, but could also be due to other issues, like video decoding not taking place as fast as desired.

If the issue is performance related, it makes sense that this problem could be worsened by moving a window between screens, as this can generate more load. Navigating between pages can also generate more load, particularly if a lot is happening as a page is loaded.

Could you capture a Firefox Profiler run, using the 'Media' profiler preset, of the issue taking place, then upload and share the link on this bug?

Severity: -- → S3
Component: Audio/Video → Audio/Video: Playback
Flags: needinfo?(adam.jarosz)
Priority: -- → P3

(In reply to Bryce Seager van Dyk (:bryce) from comment #20)

Recapping now that this is in Audio/Video.

YouTube is changing the video quality to less than 1080p. This is happening when multiple videos are being played on different monitors in Firefox. The issue is more prevalent (or only takes place?) when undertaking actions such as dragging a video between monitors or navigating to a new video in YouTube. Is that correct?

Ive investigated further, and resolution will reduce also when skipping ahead, perusing time line of a video, and so on. I believe its actions that require some type of loading function.

YouTube is responsible for the resolution switching behaviour, but will do so based on certain metrics it gets from the browser. I don't know the specific thresholds YT are using (and they may change over time), but would expect them to lower resolution in response to performance dropping. This could be because of bandwidth, but could also be due to other issues, like video decoding not taking place as fast as desired.

If the issue is performance related, it makes sense that this problem could be worsened by moving a window between screens, as this can generate more load. Navigating between pages can also generate more load, particularly if a lot is happening as a page is loaded.

Could you capture a Firefox Profiler run, using the 'Media' profiler preset, of the issue taking place, then upload and share the link on this bug?

here's the link to the profile capture, https://share.firefox.dev/3AC7YWp which i believe catches the issue somewhat close to the end.

When stopping recording my whole browser freezes, for a moment, and Im not sure if this is the long capture, or a accidental one that I started when trying to hit stop again. I think its the right one.

Oh, and if you need more more 'additional data' then let me know!

Flags: needinfo?(adam.jarosz)

Okay, here's one with all the additional data https://share.firefox.dev/2Z6doe9

Again, have to spam, cant edit posts. It may be helpful if I time profile captures so you can find the exact moment in the capture, but its sunday and Im lazy so you'll have to let me know if I'm to do it :)

No longer blocks: media-triage
Depends on: 1716049
Status: UNCONFIRMED → NEW
Component: Audio/Video: Playback → Graphics
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.