Closed
Bug 1093951
Opened 10 years ago
Closed 10 years ago
WiFi Multicast/Broadcast filter don't work when system is sleep
Categories
(Firefox OS Graveyard :: Wifi, defect)
Firefox OS Graveyard
Wifi
Tracking
(blocking-b2g:2.0+, b2g-v2.0 fixed, b2g-v2.1 fixed, b2g-v2.2 fixed)
People
(Reporter: paradoxj, Assigned: hchang)
References
Details
(Whiteboard: [caf priority: p2][CR 758801])
Attachments
(3 files, 1 obsolete file)
46 bytes,
text/x-github-pull-request
|
alive
:
review+
chucklee
:
feedback+
bajaj
:
approval-gaia-v2.0+
bajaj
:
approval-gaia-v2.0+
|
Details | Review |
46 bytes,
text/x-github-pull-request
|
bajaj
:
approval-gaia-v2.1+
|
Details | Review |
46 bytes,
text/x-github-pull-request
|
alive
:
review+
|
Details | Review |
User Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E; Tablet PC 2.0; CNS_UA; AD_LOGON=4C47452E4E4554) Steps to reproduce: 1. WiFi ON. 2. WiFi connect to some AP. 3. Phone sleep. Actual results: Phone wake up many times because of multicast packet.(ex. HSRP multicast packet) So power consumption is up. Expected results: It filter multicast / broadcast packet. So phone don't wake up by multicast packet.
Comment 1•10 years ago
|
||
wayne I was informed by CAF that this is a TA blocker highlighted as *critical*. Can you help follow-up on how madai didn't' flag us here? Chuck, This could be related to https://bugzilla.mozilla.org/show_bug.cgi?id=950124, can you help here?
Flags: needinfo?(wchang)
Flags: needinfo?(chulee)
The issue(950124) is solved. But is there any modification that enable filter when phone is sleep? FFOS filter enabling scinario like that - wifi.screen_off_timeout is expired and wifi lock is held. Maybe I think that they don't know why filter is needed when phone is sleep. When phone is sleep with WiFi connected, phone can get many multicast packet that just needs network management entity.(ex HSRP..) So in some network phone can't sleep because of multicast packet. In android platform, they set multicast filter when screen is off. I think FFOS alos need this logic.
Comment 3•10 years ago
|
||
(In reply to None from comment #2) > The issue(950124) is solved. > But is there any modification that enable filter when phone is sleep? > > FFOS filter enabling scinario like that > - wifi.screen_off_timeout is expired and wifi lock is held. > > Maybe I think that they don't know why filter is needed when phone is sleep. > > When phone is sleep with WiFi connected, phone can get many multicast packet > that just needs network management entity.(ex HSRP..) So in some network > phone can't sleep because of multicast packet. In android platform, they set > multicast filter when screen is off. > > I think FFOS alos need this logic. Does it mean that we should start multicast filter[1] when set wifi power save mode[2]? [1]http://dxr.mozilla.org/mozilla-central/source/dom/wifi/WifiCommand.jsm?from=wificommand.jsm&case=true#196 [2]http://dxr.mozilla.org/mozilla-central/source/dom/wifi/WifiWorker.js#3367
I thinks packet filter working when LCD is off. And when LCD is on filter is releaved. Already this API is exist( wifiManager.setPowerSavingMode() ). wifi.js(gaia) use that API.
Assignee | ||
Comment 5•10 years ago
|
||
It seems android disable multicast by default but provides a multicast lock [1] whenever needed. We can do as how android does as long as there's no current app supposing to be able to receive multicast packet. [1] http://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html
Assignee | ||
Comment 6•10 years ago
|
||
(In reply to None from comment #4) > I thinks packet filter working when LCD is off. And when LCD is on filter is > releaved. > > Already this API is exist( wifiManager.setPowerSavingMode() ). > > wifi.js(gaia) use that API. If no app needs to receive multicast packets, we can always turn on multicast filter. Perfect! However, if some apps need, I doubt if the app still needs to receive multicast packet during power saving mode ...
(In reply to Henry Chang [:henry] from comment #6) > (In reply to None from comment #4) > I thinks packet filter working when LCD > is off. And when LCD is on filter is > releaved. > > Already this API is > exist( wifiManager.setPowerSavingMode() ). > > wifi.js(gaia) use that API. > If no app needs to receive multicast packets, we can always turn on > multicast filter. Perfect! However, if some apps need, I doubt if the app > still needs to receive multicast packet during power saving mode ... Most of mobile WiFi chip vendor's implementations of host off-load or filter can block just unnessary packet. There are parameters that determin which packet can pass this filter.(All multicast/broadcast or Just nessary multicast...) We can set like this ... If some app bind specific multicast IP address, WiFi chip remember multicast MAC orginated multicast IP address and don't block packets that have same multicast MAC. Broadcast filter has same mechanism. Normally they call MC/BC filter(Broadcast and Multicast filter)
Assignee | ||
Comment 8•10 years ago
|
||
Assignee | ||
Comment 9•10 years ago
|
||
Since the multicast filter will be enabled when we request the wifi driver to go to power save mode, what we only have to do is to make sure WifiManager.setPowerSavingMode is called at the proper timing. We choose to enable wifi power saving mode when the screen becomes off and the phone is not charging. To sum up, there are two check points: 1) To confirm we do call WifiManager.setPowerSavingMode when we turn off the screen. 2) After calling WifiManager.setPowerSavingMode, the filter takes effect. attachment 8518801 [details] [diff] [review] is a fast fix to invoke to go to power saving mode no matter the wifi lock is held.
Reporter | ||
Comment 10•10 years ago
|
||
Thanks to make patch. We test your patch. The filter is setted correctly. But it don't remove filter. So we modify code.(wifi.js - gaig/apps/system/js ) You can find our code comment - //LGE patch. The if statement(if (!this.wifiDisabledByWakelock) ) block to remove filter. --wifi.js---- // ... and quietly turn it back on or cancel the timer otherwise else { if (this._alarmId) { navigator.mozAlarms.remove(this._alarmId); this._alarmId = null; } // If wifi is enabled but disconnected. // we would need to call getNetworks() so we could join known wifi network if (this.wifiEnabled && wifiManager.connection.status == 'disconnected') { wifiManager.getNetworks(); } //LGE patch - This code needed to apply Bug 1093951 from Bugzilla // Mozilla patch don't reset PowerSavemode. if (this.wifiEnabled) { // Restore from power save mode is wifi is already enabled. wifiManager.setPowerSavingMode(false); releaseCpuLock(); return; } // We don't need to do anything if we didn't disable wifi at first place. if (!this.wifiDisabledByWakelock) { releaseCpuLock(); return; } Thanks.
Assignee | ||
Comment 12•10 years ago
|
||
(In reply to None from comment #10) > Thanks to make patch. > > We test your patch. The filter is setted correctly. But it don't remove > filter. > > So we modify code.(wifi.js - gaig/apps/system/js ) You can find our code > comment - //LGE patch. > > The if statement(if (!this.wifiDisabledByWakelock) ) block to remove filter. > > --wifi.js---- > > // ... and quietly turn it back on or cancel the timer otherwise > else { > if (this._alarmId) { > navigator.mozAlarms.remove(this._alarmId); > this._alarmId = null; > } > > // If wifi is enabled but disconnected. > // we would need to call getNetworks() so we could join known wifi > network > if (this.wifiEnabled && wifiManager.connection.status == > 'disconnected') { > wifiManager.getNetworks(); > } > > //LGE patch - This code needed to apply Bug 1093951 from Bugzilla > // Mozilla patch don't reset PowerSavemode. > if (this.wifiEnabled) { > // Restore from power save mode is wifi is already enabled. > wifiManager.setPowerSavingMode(false); > releaseCpuLock(); > return; > } > > // We don't need to do anything if we didn't disable wifi at first > place. > if (!this.wifiDisabledByWakelock) { > releaseCpuLock(); > return; > } > > Thanks. Thanks for pointing this out! By the way, you mentioned you set the screen timeout to 0 to avoid wifi being disabled. However, roughly reading the code, it seems it only makes wifi turned off right after screen is off. Have you confirmed this? Thanks!
Flags: needinfo?(hchang)
Reporter | ||
Comment 13•10 years ago
|
||
(In reply to Henry Chang [:henry] from comment #12) > (In reply to None from comment #10) > Thanks to make patch. > > We test > your patch. The filter is setted correctly. But it don't remove > filter. > > > So we modify code.(wifi.js - gaig/apps/system/js ) You can find our code > > comment - //LGE patch. > > The if statement(if > (!this.wifiDisabledByWakelock) ) block to remove filter. > > --wifi.js---- > > > // ... and quietly turn it back on or cancel the timer otherwise > > else { > if (this._alarmId) { > > navigator.mozAlarms.remove(this._alarmId); > this._alarmId = null; > > } > > // If wifi is enabled but disconnected. > // we would > need to call getNetworks() so we could join known wifi > network > if > (this.wifiEnabled && wifiManager.connection.status == > 'disconnected') { > > wifiManager.getNetworks(); > } > > //LGE patch - This code > needed to apply Bug 1093951 from Bugzilla > // > Mozilla patch don't reset PowerSavemode. > if (this.wifiEnabled) { > > // Restore from power save mode is wifi is already enabled. > > wifiManager.setPowerSavingMode(false); > releaseCpuLock(); > > return; > } > > // We don't need to do anything if we didn't > disable wifi at first > place. > if (!this.wifiDisabledByWakelock) { > > releaseCpuLock(); > return; > } > > Thanks. Thanks for > pointing this out! By the way, you mentioned you set the screen timeout to 0 > to avoid wifi being disabled. However, roughly reading the code, it seems it > only makes wifi turned off right after screen is off. Have you confirmed > this? Thanks! We roll back wifi.screen_off_timeout to 600000. But this timer value is never set because of [comment 8] patch. If WiFi on and screen off/no charing, it just setup power-saving mode. Then return. If wifi.screen_off_timeout is 0, it just return and never set up filter. Any way, thanks a lot.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Comment 14•10 years ago
|
||
(re-opening, as we'd like this fix landed in m-c at least)
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Updated•10 years ago
|
Assignee: nobody → hchang
Comment 15•10 years ago
|
||
ni?Vincent for comment 14. Can you assess and work with Henry on landing a solution to M-C? Thanks
Flags: needinfo?(chulee) → needinfo?(vchang)
Assignee | ||
Comment 16•10 years ago
|
||
(In reply to Wayne Chang [:wchang] from comment #15) > ni?Vincent for comment 14. > > Can you assess and work with Henry on landing a solution to M-C? > > Thanks It's actually a gaia patch :)
Comment 17•10 years ago
|
||
[Blocking Requested - why for this release]: This is a critical power saving fix and needs to land on 2.1 also.
blocking-b2g: --- → 2.1?
Assignee | ||
Comment 18•10 years ago
|
||
We are going to land the quick fix on 2.0/2.1. But for master, we are planning to introduce more sophisticated power saving strategy and more configurable behavior like what Android's done.
Assignee | ||
Comment 19•10 years ago
|
||
Attachment #8518801 -
Attachment is obsolete: true
Assignee | ||
Comment 20•10 years ago
|
||
Assignee | ||
Comment 21•10 years ago
|
||
Comment on attachment 8521962 [details] [review] gaia PR for 2.0 Hi alive, Could you help review this patch for the quick fix regarding wifi power save mode on 2.0/2.1? We will always enter wifi power save mode when screen off and usb unplugged to reduce the power consumption before screen timeout. Wifi would still be turned off after screen timeout. Feel free to direct the review to someone you consider suitable if you are not. Thanks! Chuck, could you also give some feedback? Thanks!
Attachment #8521962 -
Flags: review?(alive)
Attachment #8521962 -
Flags: feedback?(chulee)
Comment on attachment 8521962 [details] [review] gaia PR for 2.0 Looks good to me.
Attachment #8521962 -
Flags: feedback?(chulee) → feedback+
Comment 23•10 years ago
|
||
(In reply to Henry Chang [:henry] from comment #18) > We are going to land the quick fix on 2.0/2.1. But for master, we are planning > to introduce more sophisticated power saving strategy and more configurable > behavior like what Android's done. We had a discussion of how to exploit Power Save Mode or even aggressively turn off Wi-Fi in order to optimize power consumption. The design is in a draft phase. You can refer to the diagram: https://wiki.mozilla.org/images/c/c6/WifiPowerModeState.svg
Updated•10 years ago
|
Attachment #8521962 -
Flags: review?(alive) → review+
Assignee | ||
Comment 24•10 years ago
|
||
Assignee | ||
Comment 25•10 years ago
|
||
(In reply to Henry Chang [:henry] from comment #24) > Created attachment 8522059 [details] [review] > gaia PR for master Thanks alive and chuck!
Comment 26•10 years ago
|
||
(In reply to Ethan Tseng [:ethan] from comment #23) > (In reply to Henry Chang [:henry] from comment #18) > > We are going to land the quick fix on 2.0/2.1. But for master, we are planning > > to introduce more sophisticated power saving strategy and more configurable > > behavior like what Android's done. > > We had a discussion of how to exploit Power Save Mode or even aggressively > turn off Wi-Fi in order to > optimize power consumption. > The design is in a draft phase. You can refer to the diagram: > https://wiki.mozilla.org/images/c/c6/WifiPowerModeState.svg I think we can do this in bug 1084156.
Flags: needinfo?(vchang)
Updated•10 years ago
|
blocking-b2g: 2.1? → 2.1+
Comment 27•10 years ago
|
||
Inder, feel free to try the patch and let us know if it fixes the issue. Since its r+ it will land in our trees soon.
Flags: needinfo?(ikumar)
Blocks: CAF-v2.1-CC-metabug
Flags: needinfo?(ikumar)
Comment 28•10 years ago
|
||
Henry, This has a review+ already so can we land it on master and get it uplifted on branches? Unclear if we are waiting for anything else here.
Flags: needinfo?(hchang)
Assignee | ||
Comment 29•10 years ago
|
||
(In reply to bhavana bajaj [:bajaj] from comment #28) > Henry, This has a review+ already so can we land it on master and get it > uplifted on branches? Unclear if we are waiting for anything else here. Hi, I was working on fixing some gaia test errors for the past few days. Actually what I was doing is to accommodate the gaia unit test cases to the new policy. Everything seems to be okay now. Going to ask someone to help me merge soon. Thanks!
Flags: needinfo?(hchang)
Updated•10 years ago
|
Whiteboard: [CR 758801]
Updated•10 years ago
|
Whiteboard: [CR 758801] → [caf priority: p2][CR 758801]
Assignee | ||
Comment 30•10 years ago
|
||
Comment on attachment 8522059 [details] [review] gaia PR for master Hi Alive, Based on the previous r+, I further modified test cases to fit the new policy and all the relevant failure has been fixed. Could you have another review and help merge (if r+) the PR for master? (because I have no permission to merge.) Thanks!
Attachment #8522059 -
Flags: review?(alive)
Comment 31•10 years ago
|
||
Comment on attachment 8522059 [details] [review] gaia PR for master r=me
Attachment #8522059 -
Flags: review?(alive) → review+
Assignee | ||
Comment 32•10 years ago
|
||
(In reply to Alive Kuo [:alive][NEEDINFO!] from comment #31) > Comment on attachment 8522059 [details] [review] > gaia PR for master > > r=me Thanks alive! Could you also help merge this PR for master? Thanks!
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(alive)
Updated•10 years ago
|
Flags: needinfo?(alive)
Keywords: checkin-needed
Comment 33•10 years ago
|
||
master: https://github.com/mozilla-b2g/gaia/commit/bd9507aa5ca35eef9541f65298d64f4bfad66de0
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
status-b2g-v2.2:
--- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S9 (21Nov)
Assignee | ||
Comment 34•10 years ago
|
||
Comment on attachment 8521962 [details] [review] gaia PR for 2.0 NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings. [Approval Request Comment] [Bug caused by] (feature/regressing bug #): Wifi [User impact] if declined: Wifi would consume more power before sleeping [Testing completed]: Yes [Risk to taking this patch] (and alternatives if risky): No [String changes made]: No
Attachment #8521962 -
Flags: approval-gaia-v2.0?
Assignee | ||
Comment 35•10 years ago
|
||
Comment on attachment 8521962 [details] [review] gaia PR for 2.0 NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings. [Approval Request Comment] [Bug caused by] (feature/regressing bug #): Wifi [User impact] if declined: Wifi would consume more power before sleeping [Testing completed]: Yes [Risk to taking this patch] (and alternatives if risky): No [String changes made]: No
Assignee | ||
Comment 36•10 years ago
|
||
Comment on attachment 8521964 [details] [review] gaia PR for 2.1 [Approval Request Comment] [Bug caused by] (feature/regressing bug #): Wifi [User impact] if declined: Wifi would consume more power before sleeping [Testing completed]: Yes [Risk to taking this patch] (and alternatives if risky): No [String changes made]: No
Attachment #8521964 -
Flags: approval-gaia-v2.1?
Updated•10 years ago
|
blocking-b2g: 2.1+ → 2.0+
Updated•10 years ago
|
Attachment #8521962 -
Flags: approval-gaia-v2.0?
Attachment #8521962 -
Flags: approval-gaia-v2.0+
Updated•10 years ago
|
Attachment #8521964 -
Flags: approval-gaia-v2.1? → approval-gaia-v2.1+
2.1: https://github.com/mozilla-b2g/gaia/commit/4297952929674ab2bf1747380ee2d6cd2dcd5269 2.0: https://github.com/mozilla-b2g/gaia/commit/a4b7067b62dadfe3573d2ccaffedb3f43cd4eb84
status-b2g-v2.0:
--- → fixed
status-b2g-v2.1:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•