Closed Bug 1308184 Opened 8 years ago Closed 7 years ago

[Meta] [Phase 1+2] Shutdown video decoders when Firefox is in the background

Categories

(Firefox for Android Graveyard :: Audio/Video, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX
Firefox 55

People

(Reporter: bwu, Assigned: kaku)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

(Keywords: meta)

Currently decoders shutdown is always on nightly and its phase 1 (bug 1293963)targets to land on 52/53 and phase 2 may take more time. We should have this fully(phase 1 and 2) on on Fennec when it is in the background since CPU and memory are quite expensive on mobile.
(In reply to Blake Wu [:bwu][:blakewu] from comment #0)
> Currently decoders shutdown is always on nightly and its phase 1 (bug
> 1293963)targets to land on 52/53 and phase 2 may take more time. We should
> have this fully(phase 1 and 2) on on Fennec when it is in the background
> since CPU and memory are quite expensive on mobile.
Even more, it can make CPU spend more resource in playing audio and avoid out-of-memory happening (Bug 1307069). 

Kaku, 
Please help on this bug. 
Thanks.
Assignee: nobody → kaku
Target Milestone: --- → Firefox 52
Blocks: 1307069
Summary: Shutdown video decoders when Firefox is in the background → [Meta] [Phase 1+2] Shutdown video decoders when Firefox is in the background
The expected functionality will be ready as soon as the bug 1295921 is fixed. 

However, please be noted that, in general, the resuming time of Fennec is a little bit slower than desktop:
Telemetry of desktop: https://mzl.la/2dFJhAn
Telemetry of Fennec: https://mzl.la/2dFJ14I
@Dan, 

Do you have any concern on enabling this feature for all videos on the Fennec?
Flags: needinfo?(dglastonbury)
@Kaku,

I think we want to shutdown video decoders on Android in the first round because we are trying to target ads and we're looking for a power saving for not decoding those.
Flags: needinfo?(dglastonbury)
Keywords: meta
I think we should ship shutdown decoders first on Fennec due to the following reasons.  

Besides comment 0 and comment 1, 
1. One of Fennec's big advantages over other browsers on Android (they started to implement it) is it can play video playback in the background. People can use it to listen to music and news in the background. Personally, I love this feature! If we shutdown decoders, it will releases some CPU resources (improve the performance of the foreground App/tab), video codec resources and save power/mobile data/network bandwidth. 

2. For the current problems related to shutdown decoder we see on the desktop, like resume delay, could be tolerated reasonably.    

3. Mobile users seems not to tend to switch tabs often (my assumption).    

Anthony, 
What do you think?
Flags: needinfo?(ajones)
I'm happy with shipping it on both mobile and desktop. My experience is that resuming is fast enough. On slow machines, shutting down video decode actually helps more than it hurts in my experience.
Flags: needinfo?(ajones)
I would also prefer not to make mobile unnecessarily different.
Hi Joe, 
Could you please share your views on this from product's perspective ?
How do you think if we enable this on Firefox Fennec 54?

Thank you !
Flags: needinfo?(jcheng)
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #7)
> I would also prefer not to make mobile unnecessarily different.
I still have some worries about enabling it on desktop on 54. Maybe we should implement taint mechanism in Bug 1345403 and show the last frame with a spinner in Bug 1346120 (if resume takes longer) on Firefox 55 and ship it on 55. To me, it could be better for desktop users. The above might not be important to mobile users. Anyway, I am going to find a time to discuss with you for more details. :-)
responding to Rachelle. Let's take a look at the testing results before we make any decision.

do we have any idea on the CPU / memory saving before and after we enable this feature? Bwu?
Flags: needinfo?(jcheng) → needinfo?(bwu)
Yes. 
Let's measure it on 55.
Flags: needinfo?(bwu)
Target Milestone: Firefox 52 → Firefox 55
Depends on: 1276556
Per offline discussion with :bwu, fennec now follows desktop's roll map, so close this bug.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.