Android OS Forum banner

Kernel Wakelock ("wlan_rx_wake")

56K views 25 replies 10 participants last post by  timdor  
#1 ·
Is it possible that being connected to a particular wi-fi network would induce a kernel wakelock; but connected to a different wi-fi network would not? I have an issue with my GNex not entering the deep sleep state when connected to my apartment's wi-fi network. However, when connected to a standard home network router, the phone enters deep sleep fine. I have this narrowed down to the "wlan_rx_wake" kernel wakelock, as indicated by BetterBatteryStats and CPU Spy. This is occuring on the stock kernel. This happens when the screen is off, no matter what I set the Keep wifi on during sleep in settings. This happens on a clean install with nothing syncing in the background. Any thoughts? Thanks in advance.
 
#2 ·
That particular wake lock is triggered any time the phone is awoken from deep sleep to send or receive data on wifi. If you are having issues with just one particular wifi network, that is likely DHCP/dynamic IP related. There are reports of issues with certain wifi routers that are using dynamic IP addresses causing DHCP queries to constantly wake the device. The only known work-around is to set a static IP address or use a different router. Since this is your apartment's wifi, you may not be able to do either of those, unfortunately.
 
  • Like
Reactions: oz0ne
#3 ·
Correct, happens on just the one particular wifi network - the apartment's. I used Wireshark on my computer and Shark on my phone, and best I can tell, you are right. I see the constant queries. Unfortunately as you guessed, I don't have the capability to set a static IP or change the router. I can confirm that this network uses dynamic IPs. So if I understand, there's no way to stop the queries from waking the phone on my end? Thank you so much for your help.
 
#10 · (Edited by Moderator)
I would have suggested that option, however to connect in bridge mode, OP would need access to the primary access point to configure it as well.

Edit: Oh and in bridge mode, connected devices would still obtain DHCP addresses from the primary router, which is what the OP is trying to get away from.
 
#11 ·
I know this thread is old, but i'm now searching on the same subject and found this - Wanted to add a few notes to possible solutions.

1. Increase DHCP Lease time to the maximum possible, will cause less DHCP Activity on the network.
2. Allow DHCP Snooping to prevent DHCP Activity on unwanted ports (usually on large scale switches)
3. If you don't need to access any of the local hosts on the network, but only get internet, you can activate AP Isolation to prevent from useless junk arriving from different hosts. Broadcast packets mainly. Some DHCP packets are broadcast packets.
4. And the 4th, which should be the 1st :) use iptables to filter out stuff you don't want arriving to your network card. might even filter-out dhcp packets with source mac address which is not your router. This should prevent all broadcast packets from clients looking for addresses from reaching your phone.

Home this helps.
 
#14 ·
I had this trouble too.. I found out that my android devices hated belkin routers haha. I tried 2 different belkins and now have a netgear. Zero problems with that wake lock. I was seeing the up and down arrows constantly on my wifi but no app was requesting data so I knew it was my router. Hope this helps

Sent from my Galaxy Nexus using Tapatalk 2
 
#16 ·
Hi, my phone's been experiencing a disproportionate amount of wlan_rx_wake wakelocks ever since I switched to JB. Through a (not 100% thorough) process of elimination, I've found that switching from WPA2-TKIP to AES virtually eliminates all of the excessive wlan_rx_wake wakelocks, bringing it back down to the minutes instead of hours in BBS readings after a whole day's use.

Did I do something wrong, or is it possible that TKIP was the cause of the wakelocks? I did a quick google and found that TKIP is software-based encryption, and AES hardware based. Any truth to that?
 
#17 · (Edited by Moderator)
It just so happens that my wife's phone (AT&T SGS2) is experiencing this on our home WiFi and it is frustrating. Everything was working fine and then suddenly the wakelocks - no switching routers, ROMs, kernels, etc. The strange thing is I don't get any wlan_rx_wake wakelocks on my GNex. How could that be?

The solutions provided above are a little beyond me at the moment but I will Google and see what I can learn in order to find a solution. Meantime, this post on xda might be helpful:

http://forum.xda-developers.com/showpost.php?p=25876666&postcount=3

Any additional guidance and suggestions are appreciated. Thanks.

EDIT: I should also mention that I'm on a Mac.
 
#21 · (Edited by Moderator)
Found this thread searching just now as I started having this problem today. I swapped two routers around in my house to get a better signal in the rooms I'm usually in when home, and while that's been nice for my laptop, it looks like the new router is draining my phone's battery. The problem router is running ddwrt and I'm going to play with some of the settings people have proposed here and see if I can pinpoint anything in particular. For science!

Attached is a screencap just to illustrate the drain and how drastic it can be. A rough timeline so you know what you're looking at: I was mostly home today. The first three-fifths of the graph are idle drain while I was sleeping or home in the morning. Pretty clean data; dips when I used the phone, nice even slope when it was idling. Trace up from the "46s" on the timestamp; at that dip, I installed the router, promptly went out for a bit (drain from using phone while out), and then came back. After that dip, it's still largely idle drain, but the slope speaks for itself.

Premptive edit: Doodled on picture for added clarity.

Postemptive edit: Hmm, competing theory: Where I'm sitting right now, I've got two routers broadcasting a signal. One is good (about -50 rssi), the other varies wildly (from better than the steady one all the way up to the -80 range). I wonder if it's not actually a problem of the phone switching between the two of them when they're both in range. Maybe the first course of action will be to just unplug the further one and see if the supposedly bad router plays nice when it's alone.
 

Attachments

#23 ·
Honestly, I would probably start with the network log app, first. Install it, and let it run for a while with the screen off.

See if there are any apps that are transferring data behind your back, in a major way, first. Also, pay attention to the app named "KERNEL" (lol.)

the kernel handles all the DHCP and low level traffic. If the kernel has a lot of activity, then shark captures might be in order.
 
#26 ·
I also hate to bump an old thread but I was hunting down this problem last night and I seemed to have found an answer. I downloaded Network Log from the play store and started looking through the data this app provided. I found most of my wifi traffic was to/from my desktop PC downstairs on port 17500. Turns out, DropBox was trying LanSync and it was apparently polling my phone and keeping it awake.

Killing LanSync and/or the DropBox app fixed the problem for me. Hope this helps anyone else having the same issue!
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.