Audio from video still plays after closing GeckoView_example
Categories
(GeckoView :: GeckoViewExample, defect, P2)
Tracking
(geckoview64 wontfix, geckoview65 wontfix, geckoview66 wontfix, firefox63 wontfix, firefox64 wontfix, firefox65 wontfix, firefox66 wontfix, firefox67 wontfix, firefox68 affected)
People
(Reporter: squib, Unassigned)
References
Details
After opening this page <https://clips.twitch.tv/PoliteSpinelessStarlingPipeHype> in GeckoView example, I left the video playing (with audio on) and closed the app via the app list. The audio continues to play, and even keeps looping back around to the beginning of the video! The only way I know of to stop this is to fully rebooting the phone (a Moto G5 in this case). This may be related to bug 1482185...
Comment 1•6 years ago
|
||
Happens with any twitch stream. Even after closing the app. Starting another Geckoview example app and closing that, the audio keeps playing. Killing the wifi stops the audio stream but when you enable it again the stream continues so it's definitely using data in the background.
Comment 2•6 years ago
|
||
Worth noting that on Focus Nightly when I background the app or erase the page, the audio stops.
Jim, you can 'force stop' the example app. That will kill the process.
> Worth noting that on Focus Nightly when I background the app or erase the page, the audio stops.
Focus sets something that causes us to pause media when backgrounded. We could set that for the example app too, but it's not the default.
We talked about this a little bit on Slack, and I think it's reasonable to expect us to close any sessions that are attached to a GeckoView instance when the containing task for that activity is removed (which is what happens when you swipe in the app switcher). However, I'm not really sure if it's possible for GV to know if this is the case. The only notification you get when an app is swiped from the recents list is Service.onTaskRemoved[0]. It gives you the Intent that started the task, but no more. It's not clear to me at all if we can deduce from there which sessions should be closed. [0] https://developer.android.com/reference/android/app/Service#onTaskRemoved(android.content.Intent)
Comment 5•6 years ago
|
||
And of course to receive even that notification, you need to have a service running continuously in the first place. I'm not really a fan of creating a new service just for that when you didn't need one before, because even if it's not a foreground service, it can still mess around with Android's memory management and unnecessarily keep us alive under memory pressure, even though we don't have anything important to do.
Comment 6•6 years ago
|
||
(In reply to Jan Henning [:JanH] from comment #5) > I'm not really a fan of creating a new service > just for that when you didn't need one before, [...] ... although as this bug was about audio playback - of course when playing back audio, you'll want to create a foreground service anyway so that Android doesn't accidentally kill you. So you could utilise *that* service's onTaskRemoved interface, at least as long as that service is running, i.e. while the app is actually playing back media, respectively as long as a corresponding notification is shown. Still wouldn't help in the general case, though...
Comment 7•6 years ago
|
||
Agi, what does WebView do? James says Chrome does not appear to use onTaskRemoved. Dylan has been investigating a similar issue in Fennec.
Comment 8•6 years ago
|
||
For easier testing (and because the performance of https://clips.twitch.tv/PoliteSpinelessStarlingPipeHype seems horrible, at least on my phone), I used a plain mp3 file. I think I could reproduce this once, but on subsequent attempts, swiping away geckoview_example stopped the audio playback as well (with multi-process enabled all the time).
Comment 9•6 years ago
|
||
64=wontfix because this bug only affects geckoview_example and thus doesn't need to block Focus 8.0.
Comment 12•5 years ago
|
||
Vicky is this something your team could investigate?
I don't think there's any performance issue here, we just have some lifetime issues to figure out.
Updated•5 years ago
|
Comment 14•5 years ago
|
||
P1 for Fenix
Comment 15•5 years ago
|
||
FWIW I tried this on Fenix and I swiped away the app the audio stopped.
Comment 16•5 years ago
|
||
(In reply to Vicky Chin [:vchin] from comment #15)
FWIW I tried this on Fenix and I swiped away the app the audio stopped.
We can defer this bug until after Fenix MVP. We can then determine whether this is a GV bug that has been fixed or is a bug in the geckoview_example app itself.
Comment 17•5 years ago
|
||
Will Bug 1537964 and Bug 1537931 have an impact here?
Comment 18•5 years ago
|
||
(In reply to csheany from comment #17)
Will Bug 1537964 and Bug 1537931 have an impact here?
Probably not. This is probably a geckoview_example-specific bug. This bug affects geckoview_example but not Fenix even though both apps use the same GeckoView version (without the BIND_IMPORTANT fix).
Comment 19•5 years ago
|
||
What about the Reference Browser?
Comment 20•5 years ago
•
|
||
This is not geckoview_example specific. I just reproduced this on Fenix while working on a similar bug. Audio plays even though no Fenix app is visible in the "recent apps" the only way that made it stop was to "Force Stop" the app from the App settings.
Comment 21•5 years ago
|
||
I don't think it's quite a dupe, but it's fair to say that this is closely related to the same issue in Fennec (bug 1382637).
Comment 22•5 years ago
|
||
I realize they are built differently which may be a factor but is GVE similar to a private tab in Fennec?
Comment 23•5 years ago
|
||
(In reply to Agi | :agi | ⏰ EST | he/him from comment #20)
This is not geckoview_example specific. I just reproduced this on Fenix while working on a similar bug. Audio plays even though no Fenix app is visible in the "recent apps" the only way that made it stop was to "Force Stop" the app from the App settings.
Adding the [geckoview:fenix:m5] whiteboard tag because it sounds ;) like we should fix this for Fenix MVP. The audio playing is annoying but might also mean that GV is still burning up power in the background.
Comment 24•5 years ago
|
||
Just wondering, is Firefox Reality affected?
Comment 25•5 years ago
|
||
James said today this bug should be fixed in the app. mozilla-mobile/fenix#1679 and mozilla-mobile/fenix#1117 are Fenix issues for Fenix's lingering audio playback, so I will morph this bug to be just about fixing geckoview_example.
Will Eugen's lifecycle bug 1544076 be helpful here?
Updated•5 years ago
|
Updated•5 years ago
|
Comment 26•3 years ago
|
||
We now have a much better story around this with MediaSession, so we can close this.
Description
•