Closed Bug 950124 Opened 11 years ago Closed 10 years ago

Powersave filters are not working in with wifi

Categories

(Firefox OS Graveyard :: Wifi, defect)

ARM
Gonk (Firefox OS)
defect
Not set
critical

Tracking

(blocking-b2g:1.3+, firefox27 wontfix, firefox28 fixed, firefox29 fixed, b2g-v1.3 fixed, b2g-v1.3T fixed, b2g-v1.4 fixed)

RESOLVED FIXED
1.3 C2/1.4 S2(17jan)
blocking-b2g 1.3+
Tracking Status
firefox27 --- wontfix
firefox28 --- fixed
firefox29 --- fixed
b2g-v1.3 --- fixed
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed

People

(Reporter: ggrisco, Assigned: chucklee)

Details

(Keywords: feature, Whiteboard: [CR 589304])

Attachments

(1 file)

WE are seeing that power save filters (MC/BC, BET, DTIM, MDTIM) are not working in FFOS build. This is due to no suspend indication from Framework.

WLAN driver depends on the SETSUSPENDMODE indication to enable these power save optimisations.

Suggestion is for "DRIVER SETSUSPENDMODE 1" and "DRIVER SETSUSPENDMODE 0" to be sent to driver at the appropriate times.
Ken, this is one of the high priority blockers for bug 942267. Can you find an owner to help diagnose this one?
Flags: needinfo?(kchang)
(In reply to Dylan Oliver [:doliver] from comment #2)
> Ken, this is one of the high priority blockers for bug 942267. Can you find
> an owner to help diagnose this one?
Why do you think it is a blocker? Does the wifi chip which we used support wifi low power mode?

Chuck, can you please take this bug?
Flags: needinfo?(kchang) → needinfo?(ggrisco)
Chuck, could you please take this bug.
Flags: needinfo?(chulee)
I think this is a new feature, it's better not put it into 1.3 at this time.

We don't have corresponding logic in wifi manager now.
And I need time to check how this function is uesd in android - I didn't know this function before, and have no other reference here.
Also QA needs find a way to test this function does work on all devices.

There's more work to do than implement the command in comment 1.
Flags: needinfo?(chulee)
Also it seems that different driver use different driver command for setSuspendOptimization, changing the command might affect other devices.
Keywords: feature
Please don't move this to 1.4? till QC confirms.
(In reply to Chuck Lee [:chucklee] from comment #6)
> Also it seems that different driver use different driver command for
> setSuspendOptimization, changing the command might affect other devices.
But for WPA_Supplicant, this command seems have been defined in Android.
We still can add this command, right? Although, it may not work in some device not
supporting this feature in driver level.
Flags: needinfo?(chulee)
(In reply to Ken Chang[:ken] from comment #8)
> (In reply to Chuck Lee [:chucklee] from comment #6)
> > Also it seems that different driver use different driver command for
> > setSuspendOptimization, changing the command might affect other devices.
> But for WPA_Supplicant, this command seems have been defined in Android.
> We still can add this command, right? Although, it may not work in some
> device not supporting this feature in driver level.

Vincent found that Android uses SETSUSPENDOPT before ICS[1] and use SETSUSPENDMODE after JB, we can support commands according to the sdk version.
Although gonk is mostly compatible with Android platform, partners still need to check/modify the command set[3] to ensure they are supported in specific platform.

[1] http://androidxref.com/4.0.4/xref/frameworks/base/core/jni/android_net_wifi_Wifi.cpp#504
[2] http://androidxref.com/4.1.1/xref/frameworks/base/wifi/java/android/net/wifi/WifiNative.java#337
[3] http://dxr.mozilla.org/mozilla-central/source/dom/wifi/WifiCommand.jsm
Flags: needinfo?(chulee)
Hi Gerg,
  Please help check this patch fit your requirements.

Thanks.
Comment on attachment 8358203 [details] [diff] [review]
Use different powersave command based on sdk version.

Review of attachment 8358203 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thank you.
Attachment #8358203 - Flags: review?(vchang) → review+
blocking-b2g: 1.3? → 1.3+
(In reply to Chuck Lee [:chucklee] from comment #11)
> Hi Gerg,
>   Please help check this patch fit your requirements.

Hi Chuck, this looks good to me, thanks!
Flags: needinfo?(ggrisco)
Sorry for the delay. We got to test this patch today and seems this code path is never reached?
I see setSuspendOptimizations is called by SetPowerSavingMode.
However Gaia/Gecko never calls DOM SetPowerSavingMode?

In Android, power save mode is enabled by WifiStateMachine.java, when 3 conditions are satisfied [1], else disabled
1. Screen state is off [2]
2. DHCP set up is not going on [3][4]
3. High performance mode is disabled. [5]

Was able to enable power save mode by checking #1 similar to some other observer topics used here [6]
Not sure how to do #2 and we may need a performance user pref from gaia for #3


[1] https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/java/android/net/wifi/WifiStateMachine.java?h=jb_3.2#n391
[2] https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/java/android/net/wifi/WifiStateMachine.java?h=jb_3.2#n1268
[3] https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/java/android/net/wifi/WifiStateMachine.java?h=jb_3.2#n1877
[4] https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/java/android/net/wifi/WifiStateMachine.java?h=jb_3.2#n1911
[5] https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/java/android/net/wifi/WifiStateMachine.java?h=jb_3.2#n1138
[6] http://dxr.mozilla.org/mozilla-central/source/dom/wifi/WifiWorker.js#25
Flags: needinfo?(chulee)
Ken

Please take a look to resolve the Wifi issue per #6
Flags: needinfo?(kchang)
https://hg.mozilla.org/mozilla-central/rev/bbc7ef6e8fba
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.3 C2/1.4 S2(17jan)
(In reply to Preeti Raghunath(:Preeti) from comment #17)
> Ken
> 
> Please take a look to resolve the Wifi issue per #6

I think QC want a new user scenario like Android, but not a test interface.
In current design, Wifi will be turn off after entering suspend mode, so this power saving mechanism is not such effective for firefox OS now. But it will be very useful after we finish 1.4/1.5 features, bug 930969 and bug 930972. I would suggest moving this bug to be a 1.4/1.5 bug and also putting it into Gaia system team's backlog. Thanks.
Flags: needinfo?(kchang)
(In reply to vasanth from comment #16)
> Sorry for the delay. We got to test this patch today and seems this code
> path is never reached?
> I see setSuspendOptimizations is called by SetPowerSavingMode.
> However Gaia/Gecko never calls DOM SetPowerSavingMode?
> 
> In Android, power save mode is enabled by WifiStateMachine.java, when 3
> conditions are satisfied [1], else disabled
> 1. Screen state is off [2]
> 2. DHCP set up is not going on [3][4]
> 3. High performance mode is disabled. [5]
> 
> Was able to enable power save mode by checking #1 similar to some other
> observer topics used here [6]
> Not sure how to do #2 and we may need a performance user pref from gaia for
> #3

#1 scenario is controlled by gaia system app[1][2], you can use SetPowerSavingMode() instead of change wifi setting for your test today.

[1] http://git.mozilla.org/?p=releases/gaia.git;a=blob;f=apps/system/js/wifi.js#l218
[2] http://git.mozilla.org/?p=releases/gaia.git;a=blob;f=apps/system/js/wifi.js#l198
Flags: needinfo?(chulee)
(In reply to Ken Chang[:ken] from comment #19)
> In current design, Wifi will be turn off after entering suspend mode

Hi Ken, this doesn't happen for us.
Even when device is in suspend mode, still wifi is on, able to ping the device and after coming out suspend, status bar also shows Wifi is still connected.

1. How long it takes to turn off wifi after entering suspend mode?
2. Can you please point me to the code which does this?
Flags: needinfo?(kchang)
(In reply to vasanth from comment #22)
> 1. How long it takes to turn off wifi after entering suspend mode?
> 2. Can you please point me to the code which does this?

I think Chuck had answered this in comment 20.
Flags: needinfo?(kchang)
(In reply to vasanth from comment #22)
> (In reply to Ken Chang[:ken] from comment #19)
> > In current design, Wifi will be turn off after entering suspend mode
> 
> Hi Ken, this doesn't happen for us.
> Even when device is in suspend mode, still wifi is on, able to ping the
> device and after coming out suspend, status bar also shows Wifi is still
> connected.
> 
> 1. How long it takes to turn off wifi after entering suspend mode?

It depends on the value of setting "wifi.screen_off_timeout", the system default is 10 minutes [1].
Also it only turn off wifi when screen is off, no wifi wakelock, and not charging [2].

> 2. Can you please point me to the code which does this?

Please refer to wifi enable/disable code in comment 20.

[1] http://git.mozilla.org/?p=releases/gaia.git;a=blob;f=apps/system/js/wifi.js#l81
[2] http://git.mozilla.org/?p=releases/gaia.git;a=blob;f=apps/system/js/wifi.js#l148
(In reply to Chuck Lee [:chucklee] from comment #24)
> It depends on the value of setting "wifi.screen_off_timeout", the system
> default is 10 minutes [1].

Thanks for the clarifications.

One more question is why the default wifi timeout is 10 minutes? Whether it can be reduced?
As you mentioned wifi wakelock should take care of some background internet tasks if there is something.
If nothing else is going on, in the 10 minutes device may get many longer wakeups which will increase power consumption.
Flags: needinfo?(chulee)
(In reply to vasanth from comment #25)
> (In reply to Chuck Lee [:chucklee] from comment #24)
> > It depends on the value of setting "wifi.screen_off_timeout", the system
> > default is 10 minutes [1].
> 
> Thanks for the clarifications.
> 
> One more question is why the default wifi timeout is 10 minutes? Whether it
> can be reduced?
> As you mentioned wifi wakelock should take care of some background internet
> tasks if there is something.
> If nothing else is going on, in the 10 minutes device may get many longer
> wakeups which will increase power consumption.

I don't know how this value is chosen, and you can optimize timeout value by settings per comment 24.
If you are talking about changing the default value in Gaia master, I am not sure if it will be accepted to merge into Gaia master. You can open a bug for this.
Flags: needinfo?(chulee)
Flags: in-moztrap-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: