SMTC interface doesn't be reset completely (show firefox.exe)
|
8.34 MB,
video/mp4
|
Details | |
|
11.54 KB,
application/x-zip-compressed
|
Details | |
|
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta-
|
Details | Review |
|
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta-
|
Details | Review |
|
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta-
|
Details | Review |
|
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta-
|
Details | Review |
| Reporter | |
Descriptionβ’5 years ago
|
[Affected versions]:
Beta 81.0b5
[Affected platforms]:
Platforms: Windows 10
Steps :
- Launch the Firefox browser and reach https://www.youtube.com/watch?v=dl6pWnbUWCY
- Start the video and use loop in order for the short video to keep playing over and over.
- Open a new video in a new tab and use the Media control key to Pause it.
- Open a third video in a new tab and use the Media control key to pause it.
- Close the two separate tabs until only the tab with the short video remains.
- Use the Media control key in order to pause / play the short video.
Expected Results :
The Virtual control interface should not be displayed since the short video cannot be controlled from the Media key.
Actual Results :
The Virtual Control interface is displayed with greyed out buttons and the firefox.exe text displayed.
| Reporter | |
Comment 1β’5 years ago
|
I think this is an S3 severity issue, maybe even an S4 since it only happens in specific conditions and it will not affect the users experience.
| Reporter | |
Comment 2β’5 years ago
|
Attached some log files hoping it helps.
| Reporter | |
Comment 3β’5 years ago
|
I also have a different scenario for this exact same issue but please let me know if you would like me to log a separate issue for it.
- Start the Firefox browser and play a Youtube video with sound.
- Use the Media control key from the keyboard a few times.
- Reach Youtube in a private window.
- Mute the video before starting it.
- Hit the Media control button in order to start/pause the video from the normal window.
- Close the Normal window.
- Hit the Media control key in order to start/pause the muted video.
Expected results:
The Virtual control interface should not be displayed at all since the user cannot control the muted video.
Actual Results:
The Virtual control interface is displayed with the firefox.exe information displayed and greyed out buttons.
Comment 4β’5 years ago
β’
|
Thanks for the log you provided!
I can reproduce this bug now. I'll let you know if I need your help.
In log.txt.child-4.moz_log.0, I do find Not listening because media's duration 2.981000 is too short, which indicates that short video is not being controlled. It seems the virtual control interface stays on the screen even no media is being controlled. I can reproduce this bug without opening a short-duration video by the following steps
- Play an audible video whose duration is at least 3 seconds in a tab
- Open an empty tab
- Go back to the tab contains video
- Press any media key (e.g. volume+/-) that can prompt the virtual control interface
- While the virtual control interface stays, close the tab playing video
- Press volume+/- key
Now the virtual control interface stays with a title firefox.exe. There is no any video now. However, if volume+/- key is pressed again, the virtual control interface pop up again, with the title firefox.exe.
I can reproduce this on Windows 10, but not on Ubuntu 18.04. I suspect it's a windows-only issue. I'll investigate what happens.
Updatedβ’5 years ago
|
| Assignee | |
Comment 5β’5 years ago
|
I can reproduce this issue, but it's still no clear what happened to me. If I start normal videos first, and start short duration video, then the interface would be reset completely. Or if you don't pause normal video, and close them directly, this issue also doesn't happen.
I guess we didn't reset SMTC's interface correctly under that situation, I've tried to call ClearAll() [1] when we close the SMTC, but it didn't work. I would continue to check how we can fix that.
Comment 6β’5 years ago
|
Chrome uses ISystemMediaTransportControls::put_IsEnabled [1] to close the SystemMediaTransportControls (or SMTC) panel [2], but somehow it doesn't work for us. I tried to destroy the window-handle bound to SMTC [3] when there is no more media elements in Firefox but it didn't work either. One difference is that chrome uses the existing singleton window-handle instead of creating a new one [4].
Molly, do you have idea what's going on? I wonder if we do something wrong when creating a window for SMTC [5], since the SMTC panel can still pop up even it's bound window-handle is destroyed.
Does Firefox has a singleton window-handle used in parent process? Do you happen to know how to get that window handle? I'd like to try using a similar way chrome applied to see if the SMTC panel will be disappeared or not. Or it's ok to create a new window-handle in this case?
[1] https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mediatransport/isystemmediatransportcontrols-put-isenabled?redirectedfrom=MSDN
[2] https://source.chromium.org/chromium/chromium/src/+/master:components/system_media_controls/win/system_media_controls_win.cc;l=283-286;drc=aeb70b905ac38796b9801ec6a0230e71005c8b6b;bpv=1;bpt=0
[3] https://searchfox.org/mozilla-central/rev/62c443a7c801ba9672de34c2867ec1665a4bbe67/widget/windows/WindowsSMTCProvider.cpp#116
[4] https://source.chromium.org/chromium/chromium/src/+/master:components/system_media_controls/win/system_media_controls_win.cc;l=79;drc=fd31128cb7b8cee546f71e7051c7cd81ff7acd9b
[5] https://searchfox.org/mozilla-central/rev/62c443a7c801ba9672de34c2867ec1665a4bbe67/widget/windows/WindowsSMTCProvider.cpp#102-133
Comment 7β’5 years ago
β’
|
Another interesting thing I found is that if the enabled states of the media-key buttons are never changed once they are set, then we are free from this problem (e.g., enable all the buttons when opening SMTC, do nothing in SetSupportedMediaKeys, disable all the buttons when closing SMTC). That's weird.
Comment 8β’5 years ago
|
Note that I saw this kind of panel during development as I only had registered the interface and called put_IsEnabled(true).
So it's like neither UpdateButtons, SetPlaybackState etc are ever called (for that instance or maybe after this has been reset by another media being done).
Could this be a "race condition", as in Open -> Close -> Set Metadata (where the Close is called by a previous media ending).
At least I think it's not about the panel creation in itself, but rather that there is a panel, whose state/metadata is not set correctly, right?
This would on one hand match to the strange conditions under which this happens, but I'm just guessing there.
It never happens for a single video at a time, right?
Comment 9β’5 years ago
β’
|
(In reply to Marc StreckfuΓ [:MeFisto94] from comment #8)
It never happens for a single video at a time, right?
This could be reproduced by a single video. See #comment 4. But Set Metadata could be called several times indeed. We will set some empty data when there is no more media.
Open , Close, SetPlaybackState, SetMediaMetadata, SetSupportedMediaKeys are all on the main thread, so data racing won't happen in the Firefox end.
Comment 10β’5 years ago
β’
|
I've worked out a workaround here. It seems we can avoid this problem if put_IsEnabled(false) is called at the same time when all buttons on the SMTC panel is disabled via put_Is*Enabled. It seems to me this is a Windows bug.
Here is a straightforward workaround patch and here is an alternative that looks slightly better.
It works on my Windows 10 machine but it's better to confirm that works on other machines.
| Reporter | |
Comment 11β’5 years ago
|
Hi, we are testing this feature in Beta now and after we control any video with sound using the media key, load a different video in a new tab but muted and close the other tab, every time we hit the Pause/Play media key on the keyboard the Virtual Control interface is displayed with the firefox.exe text. I dont think this is a new issue I think its related to this one but please let me know if we should log a separate issue for it.
- Launch the Firefox browser and start a video on youtube with sound.
- Use the Pause / Play media key in order to control the video.
- Load a separate video in a new tab and mute it before starting the video.
- Close the first tab.
- Hit the media keys on the keyboard in order to control the muted video.
Expected Results:
The Virtual control interface should not be displayed at all since the video cannot be controlled from the media keys.
@Alastor , please let me know if we should log a separate issue for this.
| Reporter | |
Comment 12β’5 years ago
|
The Virtual Control interface is also displayed on Gifs if the user controlled any video before reaching the page :
https://giphy.com/gifs/series-canal-killing-eve-canalplus-sries-H3GjxERjsR4YXIihsM
I can log a separate issue for this as well but it does seem its the same issue.
| Assignee | |
Comment 13β’5 years ago
|
Yes, they look like same issue for me. I guess the issue is we didn't reset the interface, so it keeps displaying. I will start debugging this bug today, to see if we have other way to sove it completely. Thank you.
| Assignee | |
Updatedβ’5 years ago
|
| Assignee | |
Comment 14β’5 years ago
|
| Assignee | |
Comment 15β’5 years ago
|
| Assignee | |
Comment 16β’5 years ago
|
| Assignee | |
Comment 17β’5 years ago
|
Comment 18β’5 years ago
|
Comment 19β’5 years ago
|
Backed out for perma failures.
Log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=317861579&repo=autoland&lineNumber=5515
Backout: https://hg.mozilla.org/integration/autoland/rev/961cfd1bea4d6ec21a671263370590bbcaa79810
| Assignee | |
Updatedβ’5 years ago
|
Comment 20β’5 years ago
|
Comment 21β’5 years ago
|
|
| bugherder | |
https://hg.mozilla.org/mozilla-central/rev/92a26a171220
https://hg.mozilla.org/mozilla-central/rev/00ff29a35291
https://hg.mozilla.org/mozilla-central/rev/571dc734bba1
https://hg.mozilla.org/mozilla-central/rev/4bda24c82a0b
| Assignee | |
Comment 22β’5 years ago
β’
|
Comment on attachment 9179076 [details]
Bug 1663128 - part1 : remove unused function 'SetControlledTabBrowsingContextId()'.
Beta/Release Uplift Approval Request
- User impact if declined: On Windows, when users play media, it would show a virtual control interface to allow them to control media via its virtual button. That should be removed when user closes the tab which was playing audio.
But currently that wasn't removed correctly and would display firefox.exe, which can only be removed after users restart Firefox.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: Follow comment0 or comment4.
- List of other uplifts needed: All patches
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): It doesn't introduce behavior change, but only perform a correct steps to remove the virtual interface.
- String changes made/needed:
| Assignee | |
Updatedβ’5 years ago
|
Comment 23β’5 years ago
|
We're about to build the last beta for 82, and this affects 81 already, so I'd prefer to let it ride the trains.
Updatedβ’5 years ago
|
Updatedβ’5 years ago
|
Updatedβ’5 years ago
|
Updatedβ’5 years ago
|
Updatedβ’5 years ago
|
| Reporter | |
Comment 24β’5 years ago
|
This issue is Verified as Fixed in our latest Nightly build 83.0a1 (2020-10-08) on Windows 10 and Ubuntu.
