[ROOT] A simple guide to block/Reduce qcom_rx_wakelock and some other wifi wakelocks - Android General

Two weeks felt like two years when my phone suddenly started acting odd. High CPU usage, 2x battery drain compared to before, phone heating up while doing simple tasks drove me insane. I thought there might be something wrong with the phone but couldn't find anything so I sent it to the customer service center. All they did was factory reset, installed the latest stock OS, and sent it back which didn't solve my issue.
So I rooted the phone, installed a custom ROM and the problem was still there. I lost the tiny bit of hope I had left and concluded that it's a hardware issue and I might have to buy a new device. Two days later I installed the Better Battery Stats app and kept my phone idle overnight with wifi on.
The next day I finally found out what's been eating my battery. In BBS under Kernel wake-locks, I saw qcom_rx_wakelock was on for 8 straight hours, as long as my wifi was on. Checked the CPU states on the FK Kernel manager and found out the phone never went to deep sleep, not for a second! Also, there was that idle wifi usage.
So I downloaded the Network Log app and kept logging on the next night. 9 hours passed, none of my apps used the internet but the kernel used almost 500 mbs in 9 hours! So that's where my wakelock was coming from.
I went to my friend's house and used his wifi for a few hours to identify what's going on and I was surprised to see there was no battery drain, low CPU usage, and zero idle wifi usage. For a moment there everything seemed to went back to normal. When I came back to the school dormitory the nightmare started again.
I started scouring on the internet and I found this which led me to this terrific post!
This comment explains everything!
To summarize, the phone was going crazy because of wifi multicast, and arp flooding. I couldn't do anything about it as I was in the university's public wifi. You can disable multicast by going to the router page and turning off wifi multicast from IGMP snooping setting. But it was impossible for me cause school won't allow me to change anything and even if I complain they won't care.
So I decided to fix it by adding some of the Pixel 3's WCNSS_qcom_cfg.ini properties to my phone's WCNSS_qcom_cfg.ini which I located in the vendor/etc/wifi/ as r/skanadian recommended in the second post which took my qcom_rx wakelock to 19%, way less compared to 86% before.
This is a step-by-step guide to reducing battery drain -
• Backup your phone's WCNSS_qcom_cfg.ini in case something go wrong. I found it in system/vendor/etc/wifi/here
It might be different for you depending on what Rom or device you are using. The filename will be the same but the location might be different.
• Get a text editor. Mixplorer is recommended as it helps to search properties quickly with its find feature.
• Open your devices WCNSS_qcom_cfg.ini using Mixplorer and keep it open. Alternatively, you can copy it to a different folder on your phone. I suggest the second one cause it's better than directly editing the file from the system.
• Go to this page
• Go to your browser option and select find in page to search. Search for the word "offload" on that page.
• Copy all the lines related to offload one by one and replace them on your devices WCNSS_qcom_cfg.ini that you opened using Mixplorer.
• If there isn't anything to replace simply add those lines. Don't forget to hit the save button while doing that.
• After that, search for these properties on your WCNSS_qcom_cfg.ini and set them as I did below
RoamRssiDiff=3
g11dSupportEnabled=0
gEnablePowerSaveOffload=5
gRuntimePM=1
RTSThreshold=1048576
gMCAddrListEnable=1
gActiveMaxChannelTime=40
gActiveMinChannelTime=20
gMaxConcurrentActiveSessions=2
If you don't see one of these to replace in your WCNSS_qcom_cfg.ini you should add it.
• Now reboot your phone, give it some time and see if the battery improves. If everything remains the same then go to WCNSS_qcom_cfg.ini using Mixplorer again, find BandCapability, and set it like this -
BandCapability=1
It will disable 5ghz from your phone. I found out most companies release their phones with bad wifi drivers which don't handle the 5ghz wifi band appropriately. Lack of power-saving and not blocking multicast requests properly leads to higher CPU usage and bad battery life.
Again you can set the BandCapability=2 if you want to use 5ghz mode only. If you have a good wifi driver, the battery drain might come from switching between 2.5 and 5ghz so keeping on one of them helps.
• Why qcom_rx wakelock and what is the best fix?
It can occur for several reasons.
- Wifi multicasting. Multicasting can be disabled from IGMP snooping on router settings. You don't need multicasting in your home network at all. But when you're on office wifi or school wifi, it does improve the speed slightly by reducing data loss and interference. It also can be solved the same way but if your school management is like mine, then they might not care if your laptop or phone burns.
- DHCP timers
- A software bug from server-side
- Band switching
- Even interference, if you have a public network with a lot of phones and PCs
There are some more reasons I can not remember now. The best way to fix it is to build a custom kernel with WLAN and qcom_rx blockers/limiters e.g. Franko Kernel.
But sadly a lot of us will never have that unless we make a kernel for ourselves. So as of now, this is the solution I could come up with.
My knowledge of this sector is very little. It would be great if you all could help me get rid of this problem.
I would love it if there was a feature built-in on Android OS to block some kernel wake-locks.
OnePlus phones allow you to turn off multicasting from Developer Options but that makes little to no difference depending on what wifi you are using.
• Very Important :
Depending on you wifi, you can try setting hostArpOffload=0 and hostNsOffload=0
or you can try setting both to 1. Use whichever improves the battery backup. Don't forget to reboot after changing anything.
If you are an expert, please help us. Cause these wakelocks aren't going anywhere. They will give some of us many more sleepless nights.
Thank you for reading. Have a good day!

For those who don't want to change settings they don't understand:
RoamRssiDiff: The difference in signal strength required before phone will switch to a new Access Point. Measured in -dbs. 3 means it will switch APs if the signal strength is 3dbs better than the one in use.
g11dSupportEnabled: WIFI 802.11d
gEnablePowerSaveOffload: Level of Powersave
gRuntimePM: Runtime Powermanagement
RTSThreshold: How long to wait before asking to send wifi packets. Should be as high as possible, only lowered if you have wifi dropouts.
gMCAddrListEnable=1: Drops all Multicast frames except for ARP. You don't want to disable ARP entirely or your internet will break, so don't lower this to 0.
gActiveMaxChannelTime: Time spent scanning.
gActiveMinChannelTime: Ditto
gMaxConcurrentActiveSessions: Self-explanatory
While looking this up I also found gNeighborLookupThreshold or RoamLowRssiThreshold: The signal strength at which the phone starts looking for a new AP (the step before RoamRssiDiff becomes relevant). Typical values are 65-80. Changing this might help too if your phone is switching AP too often or not often enough.

Thanks for this, my device was also affected by this (though not as badly as yours) I've just disabled Multicast from my router.

TrenchFullOfSlime said:
For those who don't want to change settings they don't understand:
RoamRssiDiff: The difference in signal strength required before phone will switch to a new Access Point. Measured in -dbs. 3 means it will switch APs if the signal strength is 3dbs better than the one in use.
g11dSupportEnabled: WIFI 802.11d
gEnablePowerSaveOffload: Level of Powersave
gRuntimePM: Runtime Powermanagement
RTSThreshold: How long to wait before asking to send wifi packets. Should be as high as possible, only lowered if you have wifi dropouts.
gMCAddrListEnable=1: Drops all Multicast frames except for ARP. You don't want to disable ARP entirely or your internet will break, so don't lower this to 0.
gActiveMaxChannelTime: Time spent scanning.
gActiveMinChannelTime: Ditto
gMaxConcurrentActiveSessions: Self-explanatory
While looking this up I also found gNeighborLookupThreshold or RoamLowRssiThreshold: The signal strength at which the phone starts looking for a new AP (the step before RoamRssiDiff becomes relevant). Typical values are 65-80. Changing this might help too if your phone is switching AP too often or not often enough.
Click to expand...
Click to collapse
Cool!
There are some other wakelocks that's bothering me more than qcom_rx and I have no idea what they are!
Could you please tell?

Mario3DS said:
Thanks for this, my device was also affected by this (though not as badly as yours) I've just disabled Multicast from my router.
Click to expand...
Click to collapse
Sadly I'm on school wifi and can't do anything about it!

lpass is a Qualcomm audio subsystem for things like voice based wakeup, and IPCRTR (inter-process communication router) is just how different processes on your phone communicate with each other.
Others have reported these wakelocks too, almost always when they have a wifi/cell connection. Maybe it has to do with voice assistants communicating with their home servers?

TrenchFullOfSlime said:
lpass is a Qualcomm audio subsystem for things like voice based wakeup, and IPCRTR (inter-process communication router) is just how different processes on your phone communicate with each other.
Others have reported these wakelocks too, almost always when they have a wifi/cell connection. Maybe it has to do with voice assistants communicating with their home servers?
Click to expand...
Click to collapse
Well
I asked a kernel dev and he gave exactly the same explanation you gave me. He also said these are necessary and doesn't drain battery too much.
I am on a custom kernel now and wlan, qcom_rx wls are gone.
Thanks for the help
With the new kernel, I'm not seeing Lpass wakelocks much. They are there but limited.

TrenchFullOfSlime said:
lpass is a Qualcomm audio subsystem for things like voice based wakeup, and IPCRTR (inter-process communication router) is just how different processes on your phone communicate with each other.
Others have reported these wakelocks too, almost always when they have a wifi/cell connection. Maybe it has to do with voice assistants communicating with their home servers?
Click to expand...
Click to collapse
I see you've gained quite some knowledge regarding wakelocks. Your explanation was simple and easy to grasp. Could you please guide me to a thread where I can learn more about it?
Thank you so much

I just googled all the terms. Qualcomm publishes some of its stuff (source code and .ini files) with comments, others were referenced in AOSP sources.

Thanks for posting this, with my pixel 4a setting "hostArpOffload" to 0 solved it. NETLINK wakelok are much less and no battery drain.
Although on onePlus 7 pro which I've rooted few days ago none of this is working and NETLINK wakelok is draining battery at 2-3% per hr.
I'll try flashing a different ROM and If found any fix will post it here.
Device1 : Pixel 4a | LineageOS 18.1 | microG
Device2 : OnePlus 7pro | LineageOS 18.1 | microG
Edit : There are many multicast requests and NETBIOS requests too and looks like NETBIOS requests are coming from all the windows machines which are connected via Access point.
Edit:
Tried packet capture and Router is just flooding network with Multicast and ARP traffic.
I'm in the same situation as you since I live in University Campus so no router access, Have no idea how to solve this now.
A viable option is maybe buy your own router then use it as an extender and block all these garbage requests but no idea in extender mode will you be able to block stuff or not.

seated_singer said:
Thanks for posting this, with my pixel 4a setting "hostArpOffload" to 0 solved it. NETLINK wakelok are much less and no battery drain.
Although on onePlus 7 pro which I've rooted few days ago none of this is working and NETLINK wakelok is draining battery at 2-3% per hr.
I'll try flashing a different ROM and If found any fix will post it here.
Device1 : Pixel 4a | LineageOS 18.1 | microG
Device2 : OnePlus 7pro | LineageOS 18.1 | microG
Edit : There are many multicast requests and NETBIOS requests too and looks like NETBIOS requests are coming from all the windows machines which are connected via Access point.
Edit:
Tried packet capture and Router is just flooding network with Multicast and ARP traffic.
I'm in the same situation as you since I live in University Campus so no router access, Have no idea how to solve this now.
A viable option is maybe buy your own router then use it as an extender and block all these garbage requests but no idea in extender mode will you be able to block stuff or not.
Click to expand...
Click to collapse
OP 7 pro is the device you mentioned? I think it has custom kernels with bult in wakelock blockers that automatically blocks wlan, netlink and qcom rx.

Edit: Netlink can be blocked by using Custom kernel others wakelocks are due to ARP network flood. Turning it off from WCNSS_qcom_cfg or blocking introduces another problem of few seconds delay in connection ( due to ARP Resolving issue ) when switching from one access point to another ( only when automatic ) and since I do it quite often when roaming my University campus it's a hassle.
One way to mitigate this ( if you need to keep ARP offloading off ) is by using static IP, worked for me and my roommate too, but not viable since you need root. Finally I have set up my own router, checked and there were no wakelock.
Few of my friends are also facing this battery drain issue not on all Access points but some maybe after complaining authority will fix this.
Note : Netlink is only showing on Android 11/12 with other versions there are other wakelocks.

seated_singer said:
Netlink can't be blocked nor does it show since It's a part of kernel itself, here now about other two they are due to ARP network flood. Turning it off from WCNSS_qcom_cfg or blocking introduces another problem of few seconds delay in connection ( due to ARP Resolving issue ) when switching from one access point to another ( only when automatic ) and since I do it quite often when roaming my University campus it's a hassle.
One way to mitigate this ( if you need to keep ARP offloading off ) is by using static IP, worked for me and my roommate too, but not viable since you need root. Finally I have set up my own router, checked and there were no wakelock.
Few of my friends are also facing this battery drain issue not on all Access points but some maybe after complaining authority will fix this.
Note : Netlink is only showing on Android 11/12 with other versions there are other wakelocks.
Click to expand...
Click to collapse
I have NetLink blocked from kernel.
Some of this problems are impossible to fix from phone. So I contacted school management. They didn't believe me at first then I went to the head office and showed them with Network Log app that records every single packet.
A week later they fixed it. Contact your authority and see if it helps.

Thanks for the info mate, edited. Never thought I have to deal with this stupid WiFi problem.

RyanCr7 said:
Two weeks felt like two years when my phone suddenly started acting odd. High CPU usage, 2x battery drain compared to before, phone heating up while doing simple tasks drove me insane. I thought there might be something wrong with the phone but couldn't find anything so I sent it to the customer service center. All they did was factory reset, installed the latest stock OS, and sent it back which didn't solve my issue.
Thank you for reading. Have a good day!
Click to expand...
Click to collapse
Thanks for sharing, same thing happened to me..
Reading this post and turning off Multicast on both my wifi APs worked!

Just wanted to say that following this advice with all the Offload parameters, my wifi wakelocks have pretty much vanished so far on my nexus 4, i was getting something like 14000 wakelocks in battery guru. Thank you.
I can't understand why they don't specify what commands work for what Qualcomm chipset, since even though that is a newer phone, they still work on an older WiFi chipset, I've been mixing and matching for years.

KitsuneFoxy said:
Just wanted to say that following this advice with all the Offload parameters, my wifi wakelocks have pretty much vanished so far on my nexus 4, i was getting something like 14000 wakelocks in battery guru. Thank you.
I can't understand why they don't specify what commands work for what Qualcomm chipset, since even though that is a newer phone, they still work on an older WiFi chipset, I've been mixing and matching for years.
Click to expand...
Click to collapse
I'm glad it worked for you.

Related

WiFi using 300KB/s UPSTREAM - Why?

Hi,
I was troubleshooting poor VoIP quality on my LAN when I discovered our upstream usage was a constant 300KB/s (yes, that's Bytes). I tried turning off all of our PC's one at a time but the bandwidth utilization didn't change. However, when I turned off WiFi on my Motorola Photon Q 4G LTE (Unlocked, Rooted, 77.8.14.XT897.Sprint.en.US) upstream bandwidth dropped to zero. I switched the WiFi back on but the bandwidth stayed at or near zero. Can anyone think of why the phone would use that much upstream when idle? Could this be malware?
By no means a dev or super knowledgeable but throwing some ideas out there: could be Google apps syncing, any online games, updates, email blah blah blah. Have you checked to see if data (3/4g) is doing anything while idle?
None of the Above
I don't have any games installed nor do I have Google apps. If it were some type of sync, nothing I do on the phone produces that much data, all I have is emails and some Evernotes.
3G and 4G are disabled when WiFi is enabled, so that's not the issue. Don't forget, this is UPSTREAM I'm talking about, not downstream.
It stopped immediately when I turned off the WiFi and didn't continue on the mobile data connection. I re-enabled the WiFi a minute later and it didn't reappear.
It's just bizarre.
It could be that something got stuck in the process of the phone's normal operation. For example, perhaps the phone was busy sending a (large) email when you transitioned from one connection type to the next, and due to the transition, the email app "forgot" to release the 300KB/s uplink. Or something else along those lines, but the app is closed by the system mid-process, thus the app never gives the radio the command to sever the upload connection (until you manually cycled the wifi).
In all honesty, though, this is just my best guess, so take it with a grain of salt.
Also, if you're running the stock ROM, I read that Motorola set up their phones to check in every 9 seconds or something crazy like that for whatever reason. Don't remember exactly for what, though. One of the main reasons I switched to Carbon.

Getting rid of wlan_rx_wake wakelocks

Hey guys,
have you noticed that your device uses up a lot more battery on certain wifi networks (e.g. at work or university)? It is probably caused by the wlan_rx_wake wakelock.
From the wakelocks database:
Rationale: Wifi chip received a packet from somewhere - On a Galaxy S II, lots of these combined with the fact that the device takes 650 msec to resume from suspend and 150 to go back to sleep means that occasional wifi packets coming in will skyrocket Android OS usage. As an extreme example, run the following from a Linux box when wifi sleep policy is "never" and watch your deep sleep percentages plummet, your battery drain, and Android OS skyrocket: ping -i 5 <wifi IP address of phone>
Know actions: Use a sniffer to determine the cause of the traffic.
Click to expand...
Click to collapse
So apparently some other device in the network keeps waking up the Nexus. If the problem occurs in your home network you can easily find out which device is causing the problem by using Shark and Wireshark. You'll get a log that shows every network activity.
Here are some tips from a similiar thread at the SGSII-forums (thanks!):
use a static IP instead of DHCP (you may have to set a static IP every time you sign up in that particular network)
disable IPv6 protocol on your phone - see below
update your router firmware
buy a gaming adapter for your Wifi network that gets the DHCP IP adress, but gives your phone a static IP
optimise router settings: click
Windows network is causing the problem - solution here: click
Change wireless network encryption method, change wifi channel, instead of using auto baseband use only 2.4 or 5GHz baseband (Wi - Fi - advanced - Wi - Fi frequency band)
turn off uPNP in router/AP
t urn off netbios in windows network ("Go to Network and Sharing Center then change adapter settings. Right click on your wireless and select Properties.
Click on the ipv4 and then the properties button. Select Advanced, go to the Wins tab and disable tcp over netbios.")
Thoravukk FAQ tells you: Q. My device not entering deep sleep if i use Wifi?
A: That's not a Kernel issue! It's a Router and (Windows 7) Network problem. Disable IPv6, IP Helper service, shell hardware detection service and the Windows Media Player Network Sharing Service. Source: here
Other apps and devices that can cause the wakelock:
TP Link routers: disable the print server in USB settings
Asus routers: disable AiCloud
disable Dropbox Lan Sync
disable wireless on (HP) printers
disable Canon network scan utility.
Using another kernel might also help to solve this problem: but I haven't tried that yet.
Try out the Franco kernel: http://forum.xda-developers.com/showthread.php?t=2508284
He has merged some wifi driver patches which should adress this problem. It reduced the wakelocks for me to 1 min in over 8 hours on my home network and to 3 min in one hour ony my university network!
So it should be possible to get rid of this problem in your home network.
But what about work or university networks? There are even more devices connected so the problem gets even worse. In Europe we have the Eduroam wifi network at many universities. If I'm connected to this network I get about 20 min wakeup time in one hour. There are a lot of ARP, DHCP and IPv6 request from different sources. Unfortunately you can't change anything about the configuration on your university/school/work network, so we need to find a solution to block these requests on our phone.
A solution for the IPv6 requests might be to disable IPv6 on your phone if you don't use it. In terminal:
Code:
echo 1 > /proc/sys/net/ipv6/conf/wlan0/disable_ipv6
Change the 1 to a 0 if you want to reactivate IPv6. Android resets this setting every time you connect to a network, so you might try Tasker to do this.
I still haven't found a solution for the ARP and DHCP requests though. Any help or input would be appreciated.
Thanks
edit (05/14/14): updated OP with other tips you mentioned
Thanks, this was a useful post. When I am at work on their wifi my phone doesn't go to sleep and definitely drains the battery quickly. Hopefully a better solution can be found.
laxor said:
Hey guys,
have you noticed that your device uses up a lot more battery on certain wifi networks (e.g. at work or university)? It is probably caused by the wlan_rx_wake wakelock.
From the wakelocks database:
So apparently some other device in the network keeps waking up the Nexus. If the problem occurs in your home network you can easily find out which device is causing the problem by using Shark and Wireshark. You'll get a log that shows every network activity.
Here are some tips from a similiar thread at the URL="http://forum.xda-developers.com/showthread.php?t=2133176"] SGSII-forums[/URL] (thanks!):
use a static IP instead of DHCP (you may have to set a static IP every time you sign up in that particular network)
disable IPv6 protocol on your phone (Dorimanx kernels have an option for this in ST tweaks or you can use "Android Firewall" for this
update your router firmware
buy a gaming adapter for your Wifi network that gets the DHCP IP adress, but gives your phone a static IP
optimise router settings: click
Windows network is causing the problem - solution here: click
Change wireless network encryption method, change wifi channel, instead of using auto baseband use only 2.4 or 5GHz baseband (Wi - Fi - advanced - Wi - Fi frequency band)
turn off uPNP in router/AP
t urn off netbios in windows network
Thoravukk FAQ tells you: Q. My device not entering deep sleep if i use Wifi?
A: That's not a Kernel issue! It's a Router and (Windows 7) Network problem. Disable IPv6, IP Helper service, shell hardware detection service and the Windows Media Player Network Sharing Service. Source: here
Other apps and devices that can cause the wakelock:
Dropbox Lan Sync, (HP) Wireless printer, Canon network scan utility.
Using another kernel might also help to solve this problem, but I haven't tried that yet.
So it should be possible to get rid of this problem in your home network.
But what about work or university networks? There are even more devices connected so the problem gets even worse. In Europe we have the Eduroam wifi network at many universities. If I'm connected to this network I get about 20 min wakeup time in one hour. There are a lot of ARP, DHCP and IPv6 request from different sources. Unfortunately you can't change anything about the configuration on your university/school/work network, so we need to find a solution to block these requests on our phone.
A solution for the IPv6 requests might be to disable IPv6 on your phone if you don't use it. In terminal:
Code:
echo 1 > /proc/sys/net/ipv6/conf/wlan0/disable_ipv6
Change the 1 to a 0 if you want to reactivate IPv6. Android resets this setting every time you connect to a network, so you might try Tasker to do this.
I still haven't found a solution for the ARP and DHCP requests though. Any help or input would be appreciated.
Thanks
___
Use the new BBS beta to check your wakelocks.
Click to expand...
Click to collapse
Been having this wakelock as well. Almost all of the packets being picked up by my phone are being sent by my router to random ports. No idea what is really causing it, but it is pretty annoying. Doesnt seem to drain much battery from the device though.
695886915
Apparently this is a known problem. Franco has already merged two fixes from Google in his kernel which reduce the wakelock, but still don't eliminate it completely. But I'm sure that this issue will soon be resolved with custom kernels or even an update from Google.
I'm hoping for this to be fixed too. My N4 didn't exhibit this wakelock, and my N5 is not deep sleeping at all when I'm at work as a result. I'm just using LTE at work, which is okay, but still not the best solution.
Franco Kernel didn´t help at all, since he seem to include all the google wifi patches as well, the official Google update is unlikely to solve the problem... so pissed off by this, eating up my battery so quickly I have to switch off wifi completely (and I hardly have cell data reception here at my workplace) ... sucks!
Thanks finally contained this problem.
Thanks for a great summary of causes and the info I needed to finally contain it. This problem had been dogging me since I got the N5 on my home network.
I tried static IP, no good.
I tried wifi-off on sleep, no good (never got to sleep i guess!!).
I tried forcing 5 GHz, no good.
Finally I followed the advice to Disable IPv6, IP Helper service, shell hardware detection service and the Windows Media Player Network Sharing Service on each Windows PC, and my stay awake time from Android OS plummeted from hours to minutes which I can deal with.
May not work for everyone, but seems to have done it for me. Thanks again.
Thank you for the post. It makes me nervous that I'm getting this wake lock. I previously got it on my GNex and Nexus7 (2012). I tried every method above to fix but got nowhere. For whatever reason my Nexus 4 didn't suffer from this. Hopefully I can figure something out for my new nexus 5
The update to 4.4.1 does not fix this issue. Still getting this wakelock.
Yes. I found the android OS is still killing the battery after updating to 4.4.1
muyoso said:
The update to 4.4.1 does not fix this issue. Still getting this wakelock.
Click to expand...
Click to collapse
Sunkins said:
Yes. I found the android OS is still killing the battery after updating to 4.4.1
Click to expand...
Click to collapse
Wish this would get fixed, as it's my last remaining wakelock issue and the only thing holding me back from getting fantastic battery life.
Sent from my Nexus 5 using xda app-developers app
laxor said:
Hey guys,
have you noticed that your device uses up a lot more battery on certain wifi networks (e.g. at work or university)? It is probably caused by the wlan_rx_wake wakelock.
From the wakelocks database:
So apparently some other device in the network keeps waking up the Nexus. If the problem occurs in your home network you can easily find out which device is causing the problem by using Shark and Wireshark. You'll get a log that shows every network activity.
Here are some tips from a similiar thread at the SGSII-forums (thanks!):
use a static IP instead of DHCP (you may have to set a static IP every time you sign up in that particular network)
disable IPv6 protocol on your phone - see below
update your router firmware
buy a gaming adapter for your Wifi network that gets the DHCP IP adress, but gives your phone a static IP
optimise router settings: click
Windows network is causing the problem - solution here: click
Change wireless network encryption method, change wifi channel, instead of using auto baseband use only 2.4 or 5GHz baseband (Wi - Fi - advanced - Wi - Fi frequency band)
turn off uPNP in router/AP
t urn off netbios in windows network
Thoravukk FAQ tells you: Q. My device not entering deep sleep if i use Wifi?
A: That's not a Kernel issue! It's a Router and (Windows 7) Network problem. Disable IPv6, IP Helper service, shell hardware detection service and the Windows Media Player Network Sharing Service. Source: here
Other apps and devices that can cause the wakelock:
Dropbox Lan Sync, (HP) Wireless printer, Canon network scan utility.
Using another kernel might also help to solve this problem: but I haven't tried that yet.
Try out the Franco kernel: http://forum.xda-developers.com/showthread.php?t=2508284
He has merged some wifi driver patches which should adress this problem. It reduced the wakelocks for me to 1 min in over 8 hours on my home network and to 3 min in one hour ony my university network!
So it should be possible to get rid of this problem in your home network.
But what about work or university networks? There are even more devices connected so the problem gets even worse. In Europe we have the Eduroam wifi network at many universities. If I'm connected to this network I get about 20 min wakeup time in one hour. There are a lot of ARP, DHCP and IPv6 request from different sources. Unfortunately you can't change anything about the configuration on your university/school/work network, so we need to find a solution to block these requests on our phone.
A solution for the IPv6 requests might be to disable IPv6 on your phone if you don't use it. In terminal:
Code:
echo 1 > /proc/sys/net/ipv6/conf/wlan0/disable_ipv6
Change the 1 to a 0 if you want to reactivate IPv6. Android resets this setting every time you connect to a network, so you might try Tasker to do this.
I still haven't found a solution for the ARP and DHCP requests though. Any help or input would be appreciated.
Thanks
___
Use the new BBS beta to check your wakelocks.
Click to expand...
Click to collapse
Thanks for this thread. Not sure if it will help or not but I have done all the things in the op and will report back. Have to start somewhere I guess. Although this isn't totally killing my battery in home .8% per hour will sleeping at night It by far is the biggest thing waking my phone. In 9 hrs I have 45 minutes of wake and 35 come from this. If I can get this under control I an sure I can get a little better battery performance. :good:
HP wireless printer
Hi, I have done everything you have listed, though I am still experiencing the wakelock. I have an HP wireless printer so I think this is the problem. Though, what could I do to stop it from creating the wakelock on my phone? This doesn't list what you need to do for the HP printer. Thanks in advance.
Any recommendations for a good modem/router that will not cause these wakelocks?
Sent from my Nexus 5 using xda app-developers app
For those who have tp link routers and get this wake lock, disable the print server in USB settings. It stopped almost all the RX_wake..
Before stopping I used to get some regularly spaced packets from 192.168.1.1 (router) to 255.255.255.255 UDP 7437 .. Bite completely stopped..
Hit thanks if I've helped you.
gpkumaran said:
For those who have tp link routers and get this wake lock, disable the print server in USB settings. It stopped almost all the RX_wake..
Before stopping I used to get some regularly spaced packets from 192.168.1.1 (router) to 255.255.255.255 UDP 7437 .. Bite completely stopped..
Hit thanks if I've helped you.
Click to expand...
Click to collapse
I might sound like a noob, but where do you find the USB settings to disable the print server?
grumpyfuzz said:
I might sound like a noob, but where do you find the USB settings to disable the print server?
Click to expand...
Click to collapse
in ur router setup page 192.168.1.1(probably)
Kyle C said:
Thank you for the post. It makes me nervous that I'm getting this wake lock. I previously got it on my GNex and Nexus7 (2012). I tried every method above to fix but got nowhere. For whatever reason my Nexus 4 didn't suffer from this. Hopefully I can figure something out for my new nexus 5
Click to expand...
Click to collapse
Have you figured anything out yet? I have also tried everything and still getting this wakelock also.
grumpyfuzz said:
Have you figured anything out yet? I have also tried everything and still getting this wakelock also.
Click to expand...
Click to collapse
Franco kernel working to fix this?
Momotani-Hitoshi said:
Franco kernel working to fix this?
Click to expand...
Click to collapse
It didn't work for me, but it might work for other people.

CM11 M7 Wifi dead? here's a potential fix

OK, so I know M7 isn't the latest CM build, but it's the latest one without issues with GPS, so that's what I'm on since I use GPS a lot.
So last week I replaced my home router. This of course means reconfiguring all the wifi devices around the house, including my wifi thermostat. The unique thing about the thermostat is that to configure it, you connect a laptop/phone/tablet to the thermostat's ad-hoc wifi network, tell it which infrastructure ssid to connect to, verify a pin from the thermostat's screen (so nobody can hijack your t-stat from outside the house), and that's it.
thing is, when you use Cyanogenmod (at least on the relay) to connect to an adhoc network, it breaks wifi. what happens is you can't connect to any other wifi networks, and can't even scan to see available networks till you reboot. sometimes it doesn't work even after a reboot. strangely, the tethering/hotspot still works fine. you just can't connect the phone to a hotspot whether it's at home or work or anywhere.
i'd been having other issues and general slowness with the phone, so i decided to backup a few apps with TiBu and do a factory reset. that worked... till i tried connecting to the thermostat again, and it broke wifi completely this time.
solution? go to /data/misc/wifi/ and rename wpa_supplicant.conf to wpa_supplicant.conf.old (or whatever, as long as it's a different name) and reboot. the system will automatically create a new conf file. boom - wifi fixed.
obviously this requires root, but that's not an issue in CM. I doubt it matters, but i used ES file explorer since it's got a good root filesystem browser and mounting / or system as RW is a simple matter of a checkbox in the settings.
when i compared the newly created wpa_supplicant.conf with the one i'd renamed (.old) the only real difference i could see was the saved networks at the bottom. so you might be able to get away with simply deleting the offending network={ blah blah } section instead of completely renaming the conf file. the advantage here would be if you have a bunch of saved networks that you don't want to get rid of, it will keep those saved networks. the conf file is a plaintext file so it's easy enough to understand what you're looking at, and modify appropriately.
MODS: I apologize if this is in the wrong forum. I figured since it probably only applies to CM, I should post it in the dev forum rather than the general one. If it needs to be moved, I don't be offended.
Gibson99 said:
OK, so I know M7 isn't the latest CM build, but it's the latest one without issues with GPS, so that's what I'm on since I use GPS a lot.
So last week I replaced my home router. This of course means reconfiguring all the wifi devices around the house, including my wifi thermostat. The unique thing about the thermostat is that to configure it, you connect a laptop/phone/tablet to the thermostat's ad-hoc wifi network, tell it which infrastructure ssid to connect to, verify a pin from the thermostat's screen (so nobody can hijack your t-stat from outside the house), and that's it.
thing is, when you use Cyanogenmod (at least on the relay) to connect to an adhoc network, it breaks wifi. what happens is you can't connect to any other wifi networks, and can't even scan to see available networks till you reboot. sometimes it doesn't work even after a reboot. strangely, the tethering/hotspot still works fine. you just can't connect the phone to a hotspot whether it's at home or work or anywhere.
i'd been having other issues and general slowness with the phone, so i decided to backup a few apps with TiBu and do a factory reset. that worked... till i tried connecting to the thermostat again, and it broke wifi completely this time.
solution? go to /data/misc/wifi/ and rename wpa_supplicant.conf to wpa_supplicant.conf.old (or whatever, as long as it's a different name) and reboot. the system will automatically create a new conf file. boom - wifi fixed.
obviously this requires root, but that's not an issue in CM. I doubt it matters, but i used ES file explorer since it's got a good root filesystem browser and mounting / or system as RW is a simple matter of a checkbox in the settings.
when i compared the newly created wpa_supplicant.conf with the one i'd renamed (.old) the only real difference i could see was the saved networks at the bottom. so you might be able to get away with simply deleting the offending network={ blah blah } section instead of completely renaming the conf file. the advantage here would be if you have a bunch of saved networks that you don't want to get rid of, it will keep those saved networks. the conf file is a plaintext file so it's easy enough to understand what you're looking at, and modify appropriately.
MODS: I apologize if this is in the wrong forum. I figured since it probably only applies to CM, I should post it in the dev forum rather than the general one. If it needs to be moved, I don't be offended.
Click to expand...
Click to collapse
It does belong in q&a...but my lollipop validus has working gps
REV3NT3CH said:
It does belong in q&a...but my lollipop validus has working gps
Click to expand...
Click to collapse
As does FatToad. However, I do know that the privacy bit in the GPS can be flipped with the drivers we're using in FT. There's an old thread with a post from nard about how to fix that.
Magamo said:
As does FatToad. However, I do know that the privacy bit in the GPS can be flipped with the drivers we're using in FT. There's an old thread with a post from nard about how to fix that.
Click to expand...
Click to collapse
Do you understand more about this "privacy bit", what call in the API flips it, or can give me any other pointers about it? The poster previous to you indicates that GPS works with M7. I thought I had it working with M8, but can't really guarantee that, any more. The post from nard was quite an onerous process, including what looked like reflashing the baseband.
It seems to me that if we really understood this problem, the fix would be quite simple, and could be done by a root-access app. I've done more digging, and see that it seems to be common to many models of Samsung Galaxy phones, and some of the fixes involve doing potentially horrible things to the NVRAM. (like clearing it completely - what could possibly go wrong?)
It seems that the GPS is done in the baseband processor, along with the other radio stuff, but so far I haven't been able to find it. The transceiver chip is just a transceiver, no baseband processor. It looks like the baseband processor might be on the Snapdragon main processor chip, though they don't enumerate it well. In addition they mention a "gpsOne engine" without describing exactly what it is.
I'm still relatively ignorant about Android, a year after getting one. (not enough time) I'm better versed on hardware, but this problem seems to be in the cracks between.
Come to think of it, a simple question... Is there documentation on the communications between Android and the baseband processor?
Gibson99 said:
OK, so I know M7 isn't the latest CM build, but it's the latest one without issues with GPS, so that's what I'm on since I use GPS a lot.
Click to expand...
Click to collapse
I just took my wife's phone outside and tested it. GPS works on M8 from last summer, as does wifi. AFAIK the only thing that doesn't work on M8 is the video camera. (Stills on the camera work.)
This was an older phone than mine, purchased after mine. With mine I didn't need the radio or bootloader updates, my wife's did. I bought the phone for her, used it briefly with my PureTalkUSA SIM card to make sure it was really unlocked. Then I put CM11 on it.
phred14 said:
I just took my wife's phone outside and tested it. GPS works on M8 from last summer, as does wifi. AFAIK the only thing that doesn't work on M8 is the video camera. (Stills on the camera work.)
This was an older phone than mine, purchased after mine. With mine I didn't need the radio or bootloader updates, my wife's did. I bought the phone for her, used it briefly with my PureTalkUSA SIM card to make sure it was really unlocked. Then I put CM11 on it.
Click to expand...
Click to collapse
no idea how old mine actually is; i bought it "like new" from a tmobile reseller here in town and i actually use tmobile for service.
right now i'm on fattoad and once i stepped down my paranoia (i turned on privacy guard for everything including all system apps. hint: don't do that ) it seems good so far. nova launcher has an issue with flickering or disappearing icons, and everything is huge (i need to adjust the dpi) but so far no issues with gps or wifi (though i havent needed to connect to an adhoc network yet).
Do be careful with Privacy Guard. I didn't mention, but although Privacy Guard out of the box tends to make it so that most system apps are unable to be tuned, TeamApexQ likes the option of being able to tune everything in that regard, so we removed the safeguard. (For example, when PG was first ported to CM12, you could tune the settings of the 'Settings' app. Then at our next internal testing build, it was suddenly coming up empty, because CM made a change to exclude tuning for it. We restored full capability because we liked it. But that does mean you can more easily 'shoot yourself in the foot'.
Magamo said:
Do be careful with Privacy Guard. I didn't mention, but although Privacy Guard out of the box tends to make it so that most system apps are unable to be tuned, TeamApexQ likes the option of being able to tune everything in that regard, so we removed the safeguard. (For example, when PG was first ported to CM12, you could tune the settings of the 'Settings' app. Then at our next internal testing build, it was suddenly coming up empty, because CM made a change to exclude tuning for it. We restored full capability because we liked it. But that does mean you can more easily 'shoot yourself in the foot'.
Click to expand...
Click to collapse
I've recently begun to wonder if Privacy Guard might be partially responsible for reduced battery life. I'm under the impression that it lies to apps, providing false information when they have insufficient authority for the real information. Some of those permissions in Privacy Guard are to turn radios on and off. If an app thinks it's turned a radio on, and is trying to communicate based on faked (Really, it's going to look like a failure, at this point.) returns, it may spend more time continuing to try instead of just staying asleep. My battery life comes an goes, but I've noticed that on a "bad day" there are quite a few wakeups in the middle of nowhen, when the phone was sitting there in airplane mode with all radios off.
Of course I may be all wet on this - radio control may be one area where it can say, "You're in Airplane Mode, no program can turn the radio on."
good theory, and like you said, it depends on the app and how pg implements each block.
personally i'm having great battery life in L. i have a 5000mah battery, but usually by this point in the day i'm at about 60%. right now i'm still at 83%. i like how it projects your estimated remaining battery time. first time i looked at the battery chart, i lol'd - it was projecting 4.5 days before it died. i can probably get 2 no sweat even with regular usage, but i'd have to turn off sync and really cut back to make it 4 days.
I've had very good results with some simple rules with Privacy Guard. Generally the only thing I've turned off is the ability for Google Play Services and the Google App (Google Now) to wake up my device and to keep it awake. With those turned off, my battery life has gotten to be pretty damned nice... Though it makes Google Play Services FC once maybe every 24 hours. It restarts just fine, no harm no foul.
My battery life seems to be "bimodal". It either barely makes it 24 hours - basically needs recharging every night, or it lasts on the order of three or four days on a charge.
It seems to be somehow wifi-related, if I were guessing, and in an odd way. If wifi is largely off, but occasionally on, the battery life seems shorter. After wifi has been left off for "a while" (quantity not yet determined) it seems to go into long-battery-life mode. If I keep wifi largely on, and occasionally off (basically between known/trusted wifi places) the battery life comes out somewhere in between, consistent with wifi itself taking some power.
It's been really tough to detect any sort of pattern, but this is the best I've been able to come up with so far. I haven't done rigorous testing, or at least attempts at rigor so far have yielded inconsistent results. I've looked at what the Settings->Battery has available for power diagnostics, and one thing I noted was a lot of spurious wakeups when all radios were turned off. That's what led me to tentatively finger Privacy Guard.
I just saw the setting to show "built-in" apps on PG. I see two different entries for google.services and google.services.framework. The former has scads of wakeups - thanks for the tip. The latter has many, but a much smaller number. Did you block wakeups for both? I presume "built-in" are also "system" that others have said shouldn't be bulk-denied in PG. Are there guidelines anywhere about which are OK, which are useful, etc? (Like this case, and perhaps battery life.)
phred14 said:
My battery life seems to be "bimodal". It either barely makes it 24 hours - basically needs recharging every night, or it lasts on the order of three or four days on a charge.
It seems to be somehow wifi-related, if I were guessing, and in an odd way. If wifi is largely off, but occasionally on, the battery life seems shorter. After wifi has been left off for "a while" (quantity not yet determined) it seems to go into long-battery-life mode. If I keep wifi largely on, and occasionally off (basically between known/trusted wifi places) the battery life comes out somewhere in between, consistent with wifi itself taking some power.
It's been really tough to detect any sort of pattern, but this is the best I've been able to come up with so far. I haven't done rigorous testing, or at least attempts at rigor so far have yielded inconsistent results. I've looked at what the Settings->Battery has available for power diagnostics, and one thing I noted was a lot of spurious wakeups when all radios were turned off. That's what led me to tentatively finger Privacy Guard.
I just saw the setting to show "built-in" apps on PG. I see two different entries for google.services and google.services.framework. The former has scads of wakeups - thanks for the tip. The latter has many, but a much smaller number. Did you block wakeups for both? I presume "built-in" are also "system" that others have said shouldn't be bulk-denied in PG. Are there guidelines anywhere about which are OK, which are useful, etc? (Like this case, and perhaps battery life.)
Click to expand...
Click to collapse
It's difficult to give tips for this, because everyones' usage is different. Get 'WakeLock Detector' and keep an eye on that when your power drain seems more intense. Disable things that make sense to disable based on that.
I know this isn't really the topic, but just because you get a new router doesn't mean you have to reconfigure everything. Why couldn't you just configure the new router with the SSID and password from the old one?
slartibartfast42 said:
I know this isn't really the topic, but just because you get a new router doesn't mean you have to reconfigure everything. Why couldn't you just configure the new router with the SSID and password from the old one?
Click to expand...
Click to collapse
believe me, i tried that. it's stupidly tedious to enter a long keyphrase via the remote control on our tivos and only slightly less tedious on the roku (its remote is much more responsive). laptops and phones aren't as bad since they have keyboards. apparently the devices are smart enough to notice a different MAC behind the BSSID. which if you think about it, is actually a GOOD thing in terms of security, since it makes spoofing a little more difficult. granted, you'd also have to know the wpa key to successfully spoof, but it's a simple check to implement for security's sake, and i'm glad they did.
by the way, do you like fjords?
Magamo said:
It's difficult to give tips for this, because everyones' usage is different. Get 'WakeLock Detector' and keep an eye on that when your power drain seems more intense. Disable things that make sense to disable based on that.
Click to expand...
Click to collapse
"Wakelock Detector" has certainly been enlightening. "Google Fit", which makes sense, once you think about it. But the other aspect that was even more important, I just happened to see when one of the other forums popped up on some sort of search result or other.
You have to boot your Android device on battery. If the kernel starts up on charger, it never gets into the deepest power-saving states. When I first started using Wakelock Detector, my phone showed up as being awake something like 97% of the time. Google Fit was the biggest user, but not that big. After seeing that advice I've been careful to boot on battery, and now most of the time is spent asleep. Google Fit still uses wakes as much, but when it's not, the phone is really sleeping. My normal battery life has moved out to two or three days, sometimes into a fourth. As long as I consider Google Fit worth having around, this battery life is good enough for me - there is always a decent window to recharge.
phred14 said:
You have to boot your Android device on battery. If the kernel starts up on charger, it never gets into the deepest power-saving states.
Click to expand...
Click to collapse
So much for that theory. A day or two back, after good battery life since this post, I noticed it draining faster. Today I looked, and sure enough, it's not going into deep sleep. I tried rebooting with all four states of wifi and cell service, and nothing has gotten deep sleep back. I think I'm going to try charging tonight, booting while charging, then rebooting after disconnecting. It would be good to have an exact and repeatable set of circumstances that cause both good and bad battery life.

Connection to my VPN drops every 10-20 minutes when phone is idle

My last android phone did not have this problem. I connect to my home VPN while at work. Ever since I got this phone the connection just drops every 10-20 minutes when the phone is sitting idle, or when I'm just listening to a podcast or something.
I don't know if it's phone related or android version related but I can't find any information on it. Has anyone else experienced this?
I tried looking through the power save settings to see if there was some option cutting data when the phone went idle but didn't find anything.
thoughts?
Thanks
check to see if battery optimization is on for your VPN app....Settings > Battery > (3 dots menu) > Battery Optimization > set your VPN app to Not Optimized. Honestly not well versed in how the VPN config works, but the activity you describe sounds very much like Doze (battery optimization) is kicking in and killing your connection. For example, I turn off battery optimization on my exchange mail app and other apps that I want to ensure stay active even if my phone is idle.
I have added VPNdialogs to the don't optimize list. I couldn't find anything else that was VPN related, but this doesn't seem like the proper app I need. Unless anyone knows what the VPN app is called?
Thanks for the suggestion, with any luck this will work.
Frontier3 said:
I have added VPNdialogs to the don't optimize list. I couldn't find anything else that was VPN related, but this doesn't seem like the proper app I need. Unless anyone knows what the VPN app is called?
Thanks for the suggestion, with any luck this will work.
Click to expand...
Click to collapse
no worries, good luck with it. you may wan tot explore some of the VPNService config information in the AOSP/Dev site here. This probably starts to get into the connectivity/network aspects of the optimization, and it's hard to say how those services are isolated from general phone connectivity and the battery optimization (that is, does turning off optimization for one of the potentially related services cause a lot of stuff to go out of optimization by detraction, which could hamper battery life significantly but not in a way that's immediately obvious). You could guess and check, but another method may be to reexamine your VPN app of choice. You could try free options like OpenVPN Connect, Open VPN for Android, or Speed VPN (all free) and see if you can run your vpn through them and control battery optimization at that app's level to better success. There's also VYPR (VYPYR? spelling?) that's free up to a limited amount of data usage and could be used in P.O.C. manner to test things out. Again, I'm not a VPN expert, but I did tinker with a few of these when I was recently in China (to no avail, but not due to the apps, due to China being very Chinese/Anti-Google).
That said, we still don't even know if this is Doze/battery optimization related, but it's worth eliminating as an obvious potential culprit. I fear I'm not going to be able to help much beyond this, but have used android as a "super-enthusiast" for many years. I can also ask my buddy at work tomorrow who's a network and security freak, he might know...
Just an update, putting vpndiags out of battery optimization did not affect the issue. It's still disconnecting regularly. When I find time I'll look through the dev link posted above.
In the mean time if anyone else has any ideas I'm all ears.
Just a random thought, but did you remember to check the always on box when you configure the VPN setup, so that it transmits a keep-alive packet across the tunnel to prevent disconnection?
Yeah I couldn't figure out what that button was doing. When I check it the connect button greys out. I tried checking it but it seemed like it wasn't doing anything. I'll play around with it a bit more. Thanks for the suggestion.

Wi-Fi router tweaking

Everytime I get a new phone I install BBS and enable root features but I'd like to wait with the s8 before rooting. That's why I installed BBS and used adb comments to have root features without root. The reason for this is mainly checking for kernel and partial wakelocks and see what I can and can't control. A lot of people will have high battery drain on Wi-Fi without knowing it as it will be under Android system stats. After you install BBS CHECK if you have rx_wlan_wakelock. This one is caused by the router sending beacons to your phone constantly and preventing it from sleeping. There are 3 settings to change to avoid this.:
DTIM interval: set it as high as possible
BEACON interval: set it as high as possible
Fixed IP: assign your phone a fixed IP so the router doesn't send new IP to the phone frequently.
Or... create a virtual wifi ID and have your phone just connect to that with your settings.
Being that we are on XDA. Ill assume you know DD-wrt, Openwrt, etc.. which case changing the settings there on the router could help.
Rather have those tweaked for best speed for my pc anyways vs my phone thus the virtual wifi ssid config.

Categories

Resources