Closed Bug 1167656 Opened 5 years ago Closed 4 years ago

Audio stuttering on Auralux menu

Categories

(Core :: Canvas: WebGL, defect)

x86_64
Windows 8.1
defect
Not set

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox38 - wontfix
firefox39 + wontfix
firefox38.0.5 --- wontfix
firefox40 + wontfix
firefox41 + wontfix
firefox42 - affected
firefox-esr31 --- unaffected
firefox-esr38 --- affected

People

(Reporter: ssimon, Unassigned)

References

()

Details

(Keywords: perf, regression, Whiteboard: [betabreakers-fx40][gfx-noted])

Attachments

(11 files)

Attached file about:support file
Actual Results:
Audio on menu stutters a bit in Firefox 40. Does not occur on Chrome.  Does not seem to be affected by e10s toggle.  Does not seem to occur in game, just in the menu when selecting levels.


Expected Results:
Audio should play back smoothly like it does in Chrome.

Steps to recreate:
1 Using Firefox40, navigate to Auralux
2 Listen to the audio on the level selection menu while navigating around
3 Verify audio stutters and is choppy in Firefox
Attached file Surface_DxDiag.txt
Whiteboard: [betabreakers-fx40]
I tested on Windows7.

Works ok on Firefox36.0.4
The noticeable stuttering occurs in Firefox37.0.2 and later.

Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=6f49eb8f1ee0&tochange=a790927adb60

Regressed by: Bug 1079398

webgl.angle.try-d3d11 = false helps on Firefox39.0beta and earlier.
webgl.angle.try-d3d11 = false and desabled e10s helps on Aurora40 and later.
Blocks: 1079398
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Keywords: perf
[Tracking Requested - why for this release]: this is a regression in Firefox 37 which puts us at a competitive disadvantage to Chrome.
Attached file fx40_Marwyn_dxdiag.txt
The app uses AudioBufferSourceNode scheduled one after the other to play the soundtrack. Maybe the new angle uses more CPU and we cannot schedule them tightly enough? This is surprising anyway.
Flags: needinfo?(jmuizelaar)
Flags: needinfo?(jgilbert)
Whiteboard: [betabreakers-fx40] → [betabreakers-fx40][gfx-noted]
Can someone get a profile with and without D3D11 angle?
Flags: needinfo?(jmuizelaar)
(In reply to Jeff Muizelaar [:jrmuizel] from comment #7)
> Can someone get a profile with and without D3D11 angle?

Todd should be able to do this if you can provide him with instructions.
This page has instructions for setting up the profiler.
https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler

It should be possible to capture a profile and then share it to get a url to post on this bug.

Do this with webgl.angle.try-d3d11 set to and true and set to false. (Provided that is sufficient for reproducing the bug)
Thanks Jeff.

Todd or Simon, could one of you please follow Jeff's instructions in comment 9?
Flags: needinfo?(tbrais)
Flags: needinfo?(ssimon)
Hi Jeff,
Reading over the attached instructions, I'm somewhat confused about where and how to set webgl.angle.try-d3d11 set to true/false.  Any additional information would be much appreciated. Thanks

(In reply to Jeff Muizelaar [:jrmuizel] from comment #9)
> This page has instructions for setting up the profiler.
> https://developer.mozilla.org/en-US/docs/Mozilla/Performance/
> Profiling_with_the_Built-in_Profiler
> 
> It should be possible to capture a profile and then share it to get a url to
> post on this bug.
> 
> Do this with webgl.angle.try-d3d11 set to and true and set to false.
> (Provided that is sufficient for reproducing the bug)
Flags: needinfo?(tbrais)
Reading over the attached instructions, I'm somewhat confused about where and how to set webgl.angle.try-d3d11 set to true/false.  Any additional information would be much appreciated. Thanks


(In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #8)
> (In reply to Jeff Muizelaar [:jrmuizel] from comment #7)
> > Can someone get a profile with and without D3D11 angle?
> 
> Todd should be able to do this if you can provide him with instructions.
In about:config, search for "webgl.", and it should be an option to toggle.
Flags: needinfo?(jgilbert)
profile.json with gl.angle value set to 'true' results in a little audio stutter
profile.json when gl.angle value set to 'false'. Hardly any audio stutter
Anthony/Jeff:
 Hopefully I did this properly and recorded what you needed (See attached json files). A couple things that I noticed.
 When setting the gl value to true; resulted in very little audio stutter. When setting the value to 'false' I also hardly noticed any audio stutter. 
 However closing the performance window (ctrl+shift+f1 window) the audio stutter was significant, and reflected this bug.

Hope this helps, please let me know if you have any questions.
Todd, can you get a profile with webgl.angle.try-d3d11 toggled instead of gl.angle?
Flags: needinfo?(tbrais)
(In reply to Jeff Muizelaar [:jrmuizel] from comment #17)
> Todd, can you get a profile with webgl.angle.try-d3d11 toggled instead of
> gl.angle?

Or sorry. I see that you did that.
Flags: needinfo?(tbrais)
Todd, is it possible to get the profiles using FF Nightly?

There's a share button in the profiler that will let you post profile links directly to the bug.
Flags: needinfo?(tbrais)
[Tracking Requested - why for this release]:
Too late for 38. Request tracking for 39 to make sure Liz sees it.
Too late for a fix in 39, but we can still take a patch for 40. 
Anthony is this something you want to follow up on further?
Flags: needinfo?(anthony.s.hughes)
(In reply to Liz Henry (:lizzard) from comment #21)
> Too late for a fix in 39, but we can still take a patch for 40. 
> Anthony is this something you want to follow up on further?

This depends on a profile from Todd, as requested in comment 19.
Flags: needinfo?(anthony.s.hughes)
I've retested this using Firefox41 for the current pass of testing.

Cannot reproduce on Marwyn with Win 8 using default driver because Auralux never finishes loading.  A static splash screen is displayed, but it never loads into the "Click to Start" page before the main menu.  There is not new video driver for Win 8 for this system.

I was able to reproduce the issue on the Surface, and I have attached a profile.  When I stopped recording the profile, the stuttering got much worse for a couple of seconds.

I have also attached dxdiags for both systems.

During gameplay, the audio does not stutter.  When in the menu there is audio stuttering. When completing a game and being shown the score screen, the stuttering begins again and will continue until a new game is started.
Flags: needinfo?(ssimon)
Jeff, can somebody review the profiles attached by ssimon to further investigate this bug? We are tracking this for FF40 and trying to see if we can get a (stable) patch ready in time for the release. Thanks!
Flags: needinfo?(jmuizelaar)
Simon can you get profiles from Nightly firefox? The ones from FF41 will not be useful.
Flags: needinfo?(jmuizelaar) → needinfo?(ssimon)
I test with profiler on Nightly(2015-07-20)

Graphics section (default)

Adapter Description: AMD Radeon HD 6450
Adapter Drivers: aticfx64 aticfx64 aticfx64 aticfx32 aticfx32 aticfx32 atiumd64 atidxx64 atidxx64 atiumdag atidxx32 atidxx32 atiumdva atiumd6a atitmm64
Adapter RAM: 1024
Asynchronous Pan/Zoom: none
ClearType Parameters: Gamma: 2200 Pixel Structure: R ClearType Level: 100 Enhanced Contrast: 300
Device ID: 0x6779
Direct2D Enabled: true
DirectWrite Enabled: true (6.2.9200.17292)
Driver Date: 6-22-2015
Driver Version: 15.200.1046.0
GPU #2 Active: false
GPU Accelerated Windows: 1/1 Direct3D 11 (OMTC)
Subsys ID: 23111787
Supports Hardware H264 Decoding: true
Vendor ID: 0x1002
WebGL Renderer: Google Inc. -- ANGLE (AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)
windowLayerManagerRemote: true
AzureCanvasBackend: direct2d 1.1
AzureContentBackend: direct2d 1.1
AzureFallbackCanvasBackend: cairo
AzureSkiaAccelerated: 0



Test with default profile (webgl.angle.try-d3d11;true) :
http://people.mozilla.org/~bgirard/cleopatra/#report=3116e22d6921407c7ffbecabfcc068671e970a47


Test with webgl.angle.try-d3d11;false :
http://people.mozilla.org/~bgirard/cleopatra/#report=bb13dad4319806c7dcf9a677a2553ce310ef8095
As suspected we end up waiting in Map for the driver while updating data... It's not yet clear to me what we can do about this.
I have attached a profile from the Nightly build.  Same behavior.
Flags: needinfo?(ssimon)
We don't have a fix for this issue and, as we've shipped 37-39 with this bug, this is not critical enough to hold the release. I'm marking 40 as wontfix.
Jeff, Anthony, we do have update profiles from Simon for this issue. Is there enough info in the profiles to understand the cause of the audio stuttering? Jeff seemed to have some leads in comment 31. Two more profiles were provided since then.

I am afraid we have only a few cycles to take this in Beta41. Any help here is appreciated.
Flags: needinfo?(jmuizelaar)
Flags: needinfo?(ajones)
Not sure where I come in here. NI'ing another Anthony just in case.
Flags: needinfo?(anthony.s.hughes)
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #36)
> Not sure where I come in here. NI'ing another Anthony just in case.

Yeah, I think that should have come to me.

Ritu, I'll defer to Jeff for follow-up on comment 35.
Flags: needinfo?(anthony.s.hughes)
Flags: needinfo?(ajones)
Milan, just wanted to get your opinion on this bug too. We have been wontfix'ing this issue for a few past releases. Do you think we will be able to investigate some more based on the new profiles I mentioned in comment 35? Or does it seem like this one will not get fixed in time for FF41? Thanks for your help!
Flags: needinfo?(milan)
I doubt we'll get to this, but I wonder if this could be related to the audio issues Jukka identified recently.
Flags: needinfo?(tbrais)
Flags: needinfo?(milan)
Flags: needinfo?(jujjyl)
Flags: needinfo?(jmuizelaar)
This does not look like audio specific. On a high end PC, the performance is good enough that the game is able to keep up and push audio samples to the browser to produce a smooth audio stream. On another lower end computer it is worse.

Profiling with gecko profiler, I see a lot of JIT bailouts when the code is calling glUniform3fv() function with a negative index. That looks normal and like the author expected, the negative values come from glGetUniformLocation(). I don't know how big performance impact that causes - gecko profiler doesn't seem to be implying that it would be a big thing. The single biggest time hog for CPU time is in glDrawElements, which consumes about half of the CPU, followed by other GL functions that upload uniforms to a shader program. A profile from a very high end PC is available here: http://people.mozilla.org/~bgirard/cleopatra/#report=c4953f0d5e5428041d8f4b563ab11abd6bb68dab
Flags: needinfo?(jujjyl)
Adding tracking for 42. Untracked for FF41 and setting to wontfix. I hope we find a fix in the 42 cycle.
I am going to stop tracking it as we shipped several versions with this bug.
This bug no longer occurs on the latest build. Closing as INCOMPLETE as per instructions.
Note: Browser v 43 was used to try to replicate.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.