WebVR opens "VR Server" repeatedly and stalls the entire browser when no HMD is plugged in
Categories
(Core :: WebVR, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox66 | --- | affected |
People
(Reporter: bpeiris, Assigned: kip)
References
Details
(Whiteboard: [webvr])
Tested in Nightly 66 with SteamVR 1.1.4 installed and no HMD plugged in. Load https://webvr.info/samples/03-vr-presentation.html, Nightly starts SteamVR and you can see it open "VR Server" as a sub-process repeatedly in the Task Manager. The entire browser stalls while it's trying to do this.
Reporter | ||
Comment 1•5 years ago
|
||
Here are profiles taken in Nightly and Stable when visiting a webvr site without an HMD plugged in. The GPU Compositor shows 90% of its time spend in SleepEx while the browser is stalling. Nightly: https://perfht.ml/2V7vxC5 Stable: https://perfht.ml/2Vaw5a7
Comment 2•5 years ago
|
||
The reason is it [1] checks if the VR display state is available from the VR backend, otherwise, it will tell the current thread, Compositor thread, to sleep and let other threads take the priority. It seems like not a right way to make the Compositor thread to sleep, even though we land VR process, Bug 1516554, it will still happen because this function is running at the GPU process. We should consider to replace it with a timer thread. [1] https://dxr.mozilla.org/mozilla-central/rev/c2593a3058afdfeaac5c990e18794ee8257afe99/gfx/vr/gfxVRExternal.cpp#677
Comment 3•5 years ago
|
||
(In reply to Brian Peiris from comment #1) > Here are profiles taken in Nightly and Stable when visiting a webvr site > without an HMD plugged in. The GPU Compositor shows 90% of its time spend in > SleepEx while the browser is stalling. > > Nightly: https://perfht.ml/2V7vxC5 > > Stable: https://perfht.ml/2Vaw5a7 The profiler from Stable seems not be able to see what function is the bottleneck. I would suspect it should happen at OpenVR ::vr::VR_Init for asking to launch SteamVR runtime.
Assignee | ||
Comment 5•5 years ago
|
||
While doing refactoring in Bug 1473402 to simplify the code, I have spotted the cause. During enumeraton, we are looping with sleep(0) waiting for a flag signalling that the enumeration has completed. This loop is blocking events in the GPU process. We can fix this after Bug 1473402 lands.
Assignee | ||
Comment 6•5 years ago
|
||
Bug 1473402 has landed (included in the patch for Bug 1466702). The enumeration of devices is now asynchronous an should not freeze the browser.
Assignee | ||
Comment 7•5 years ago
|
||
Further investigation is ongoing on the SteamVR popups, so I will keep this issue open for that part.
(In reply to :kip (Kearwood Gilbert) from comment #7)
Further investigation is ongoing on the SteamVR popups, so I will keep this issue open for that part.
Kudos! I basically stopped using Firefox at home because of this.
Assignee | ||
Comment 9•4 years ago
|
||
With recent refactoring and implementation of WebVR permission prompts, there are no longer any cases where OpenVR will be initialized without the user's explicit consent.
Description
•