yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] meangreenie:
Google suck IMO.. I wish history will show how they allowed their flagship phone to have buggy WiFi/notifications without being fixed for best part of a year and counting. But no, every official review will omit this fact.... Let down by Google and the whole of the dedicated android sites community with this issue... poor show.
[Nexus 4 General] acid74:
This wifi bug is the main reason i use sgs2,while my N4 is sleeping deep in the drawer:)
[Nexus 4 General] Fire-Dragon-DoL:
What is WiFi Lock? Didn't find it on the first page of the topic.
[Nexus 4 General] andy o:
Cause it doesn't solve the specific problem of this thread which is not about Wi-Fi fully disconnecting, only delayed notifications on Wi-Fi. It may help, but its trick is keeping a wakelock so there is more battery drain.
[Nexus 4 General] Blockberd:
https://play.google.com/store/apps/details?id=opotech.advancedwifilock
[Nexus 4 General] namurt:
here's how to do it:

1.) find the mac address of your phone (this can be found under advanced menu option within the system -> wifi settings (or alternatively under about phone)

2.) login to your dd-wrt control panel

3.) go to services

4.) under static leases click add and then enter the mac address of your phone, pick any host name and ip address you'd like, and leave lease time blank

5.) scroll down and click apply settings and then save

6.) go to administration

7.) go to commands

8.) enter the following:

arp -i br0 -s xxx.xxx.xxx.xxx xx:xx:xx:xx:xx:xx

obviously, you'll need to use the static ip you set in step 4 and the second string will be your phone's mac address

9.) scroll down and click save startup

10.) reboot your router

11.) reboot your phone

12.) you're done! :)

if you want to be sure the settings took, log back into your router control panel and go to administration -> commands and type "arp -a" minus the quotes, then click run commands. this will give you a list of all active clients in your arp table, and you should see your phone listed.

note: the only item within this list that i'm unsure about is whether or not the host name matters. i set my host name on my router control panel as "nexus4" whereas by default your phone will have a hostname of android-<serial-number>. just to be sure there were no issues, i used trickster to manually set my host name on my phone to nexus4. ymmv. :p
[Nexus 4 General] andy o:
Thanks a lot, unfortunately setting a static ARP doesn't fix the problem here, I still can't ping the phone with the screen off, and notifications on WiFi are still delayed. I checked with arp -a and the phone was indeed in the list, with the others. I had already set static IPs for all my devices, and all of them are showing, the only difference is that the Nexus 4 has "PERM" in its line.

I haven't changed anything from the wifi file referenced in the first post, and using CM 10.1 and Faux's 4.2.2. stock kernel. Not sure if that would do anything.
[Nexus 4 General] Salty Wagyu:
Didn't work. :(
[Nexus 4 General] namurt:
forgive me for not having the time to do the requisite research, but do either cm 10.1 or faux's kernel have any known wifi issues? i'm running aospa and franco, so i simply don't know if they do. i believe faux's enhanced stock kernel has a custom "hsic fix" but i don't recall if he's touched anything in the way of wifi in his stock kernel.

following the steps i outlined, i have no problems with aospa and franco. i'm running the latest franco nightly (r155) and i know franco didn't touch wifi. it's as stock as stock can be.
[Nexus 4 General] andy o:
Yeah, I'm using enhanced stock 4.2.2. I reinstalled CM so with the CM kernel apparently notifications come immediately, though I have to do some more testing. I still can't ping the phone with the screen off though, can you? I get destination host unreachable.

Unfortunately I need one of faux's kernels more than I need this fix right now cause I use FauxSound to lower the mic gain. If you happen to know if Franco's has the required code for it (published in the Play Store FauxSound page), I'd be happy to know.

Thanks again.
[Nexus 4 General] namurt:
i just tried pinging my phone with the screen off, and i also got host unreachable. i don't get it, though, because i've tested notifications alongside a verizon phone and the two deliver the same push notifications at virtually the same time. there is an ever-so-slight delay on my nexus 4, but i'm betting that's just the difference between t'mo's and verizon's networks. the verizon phone is a thunderbolt with the latest radio and a custom ics rom (liquid smooth).

i'm not so sure any of this quirkiness is going to be ultimately resolved until 4.3 drops. google damn well better have fixed these issues with the upcoming release!
[Nexus 4 General] themcfly:
I really can't believe this. Just switched from iPhone 5 because i was sick of iOs, just to find myself stuck with a phone that won't receive any notification. Welcome to Android...

Read all this thread, rooted and tried the fix that DID NOT WORK for me.

I don't even have a comment for how Google is -not- handling this. His top smartphone can't really do the only thing they are designed for.

The only solution I found is to use Advanced Wifi Lock to keep the connection alive. That would be good if only it wasn't responsible for draining 60% of the battery overall...
[Nexus 4 General] nyijedi:
Hmmmm. This problem was just brought to my attention as a potential cause of some issues I'm having receiving notifications from my Pebble watch. However, I've had the N4 since launch and am on WiFi for the majority of every day, and have never had any problems with delayed notifications from the stock GMail app. I wonder why? This seems like it's something that should affect all N4s across the board, no?
[Nexus 4 General] lyall29:
I have had 3 nexus 4's (or nexi however you say it), the first 2 had no problems but my new one would not stay connected to WiFi. That is until I flashed this mod today! I am now connected at all times. Thank you bganley for this mod! I only flashed it today, but so far so good.:D
[Nexus 4 General] andy o:
FWIW, the problem eventually showed up with the cm kernel as well.
[Nexus 4 General] devastator83:
Experiencing the same thing over here ...

GCM messages are received with a delay of 10 seconds or so.

However, I perceive this behaviour only on 1 of my 2 AP's.

On the other one the messages are received instantaneously.
[Nexus 4 General] viktorlj:
Try best wifi keeper app. It fixed delayed notifications on stock 4.2.2 for me.
[Nexus 4 General] Lownita:
Any ideas why this is working on sts and harsh kernel, but not on Franco for me?

Tapatalked from my Nexus 4
[Nexus 4 General] Xoib:
Yes, I'm on CM 10.1 latest nighly (rom & kernel) since a long time ago and still have the problem even with the static arp<->ip setup in my router.

It's crazy but I prefer to be on 3G even at my home because of this problem...

(I'm also wondering if CM team are thinking about getting the new Prima Wifi drivers into a next nightly to test...)
[Nexus 4 General] thracemerin:
No, for 2 reasons:

1) The new prima drivers are not for the N4 they are for the Qualcomm Atheros testing platform which contains a slightly newer RIVA chip, as a result there are a number of issues that manifest themselves from using the new Prima driver on the N4.

2) The relevant ARP offload patches (ARP offload or lack thereof on the N4 is the underlying cause of the issues discussed in this thread) were tested already in CM and ended up causing the problems I alluded to above.
[Nexus 4 General] Xoib:
I read your previous posts.

So to summarize about this Wifi problem :

- Prima Drivers are really not the solution because they are not directly make for the Nexus 4.

- ARP offload patches :

-- McastBcastFilter tricks : battery drains because of answer during deep sleep to broadcast or multicast depending of the settings you choose.

-- gEnableSuspend : I heard different feedbacks about this one. But for me it still is the best fix at this moment.

Btw for peoples who are confused, peoples speaking about the CAF patch, it is for the msm_hsic_host wakelock problem (data related 2g or 3g problem, not Wifi).

PS : [MENTION=4303511]thracemerin[/MENTION] maybe I'm wrong, I agree that I didn't follow this thread since the beginning though !
[Nexus 4 General] meangreenie:
What's the betting the problem still persists when (eventually) 4.3 comes?

I bet 100% 4.3 won't fix it.
[Nexus 4 General] acid74:
If wifi problems are still after the next update,i swear i will smash my N4 in to small peaces. I have never had such bad experience with any other device.
[Nexus 4 General] chrisgtl:
+1 - apart from the smashing up bit. I will opt to sell it on fleebay and buy something that works.

Seriously lost a lot of faith in Google with this wifi mess on their flagship phone. If I was Google I would be completely embarrassed by this novice error.
[Nexus 4 General] thracemerin:
Well, if (and its a big if) the problem with the new Prima driver and the N4 is a chip firmware problem (something we can't flash but Google can push and update for) then it might be fixed, if its a hardware issue that can't be fixed completely in software then we're screwed. I can't say for sure which it is, but I'm beginning to think the second one which troubles me. The good news is, rumors say Nexus 5 in October.
[Nexus 4 General] kzakhar:
I was going to buy Nexus 4, when I saw this thread. So, basically, if I get N4 I will have some weird notification issues on WiFi, which I use most of the time, and there is no fix?
[Nexus 4 General] Blockberd:
You will get no notification at all while in WiFI unless you install some hacks or apps to prevent the WiFi from going into deep sleep.

My advice right now: Go and get a HTC One if you want kind of quality. They even sell them now with stock Android.
[Nexus 4 General] kzakhar:
I promised to myself to never buy an HTC flagship phone again and it's rather expensive. Nexus 4 at €350 is a much better deal, but no notifications is a deal breaker. Is this something that affects all Nexus 4 devices and will definitely get this issue?
[Nexus 4 General] Blockberd:
As far as I can tell: Yes. At least most of the ppl have issues with N4 + notification on WiFi.
[Nexus 4 General] kzakhar:
The funny thing is that I just asked three different Nexus 4 owners, they don't seem to have this issue and claim their notifications are ok on WiFi when the screen is off. I guess I'll just try it :)
[Nexus 4 General] KeePeeR26:
Make it 4 owners :p no issues what so ever here.
[Nexus 4 General] Stryder5:
The possibility of issues is there. It depends on a few factors, including, but not limited to your router and choices of apps. My friend doesn't have issues. I did, but the fix in OP worked for me.
[Nexus 4 General] sayogs:
I am not getting full speed how could I know that my WiFi needs to fix the issue ??????
[Nexus 4 General] chrisgtl:
That is also part of the rubbish wifi drivers too.

If you are lucky enough to not get the sleep notification problem 99% chances are your wifi speeds will suck.

If you change gEnableBmps=0 in the wifi config file and re-check wifi speeds they really are day and night difference but the downside is your battery life will suck!
[Nexus 4 General] acid74:
You will surely regret trying it.
[Nexus 4 General] qwerty9876:
Anyone know if this is fixed on the leaked 4.3 ROM?
[Nexus 4 General] zdenoh1975:
I tried, still the same issue.
[Nexus 4 General] Salty Wagyu:
That's not good news :mad: If it still doesn't work with the included radio when its officially released it's time to RMA as faulty or sell it on. Have been sick of waiting really.
[Nexus 4 General] zdenoh1975:
We will see, but Im skeptik. Big shame for google...
[Nexus 4 General] Fatherboard:
When i try to ping my nexus 4 i get inconsistent latency results. From 10ms to 800ms~. Also when i try to ping it while the screen is off, I'm getting "destination host unreachable". The moment I turn the screen back on, it starts to reply back with the same inconsistent results.

The WiFi is set to be always enabled.

Running stock ROM. Is this normal?
[Nexus 4 General] meangreenie:
I knew there was no chance... Even if there is a new final 4.3 it still won't work, 100% guarantee.
[Nexus 4 General] Neefy:
What this guy is trying to say is that some people don't get notifications while on wifi and screen is off, I don't have this issue.
[Nexus 4 General] kzakhar:
I hope this issue is fixed when they release 4.3. Still haven't ordered my Nexus, waiting for 4.3 and N4 owners' feedback.
[Nexus 4 General] MasterJam882:
Please do following:

-flash the new radio posted on xda

-disable wifi optimisation

-let phone go to sleep

-ping it

It should work!

Gesendet von meinem Nexus 4 mit Tapatalk 2
[Nexus 4 General] Salty Wagyu:
What new radio? And where is it?
[Nexus 4 General] MasterJam882:
see here:

http://xdaforums.com/showthread.php?t=2087227
[Nexus 4 General] kzakhar:
So, does this mean the notification issue will be fixed with 4.3 that will, I assume, come with the new radio?
[Nexus 4 General] zdenoh1975:
I doubt. Wi-fi behaviour don't depends on radio..
[Nexus 4 General] thracemerin:
Correct, it does look like maybe the issue is fixed or partially fixed if you flash the full 4.3 leak though, it does come with a different version of the WiFi drivers.
[Nexus 4 General] Fatherboard:
Anybody, please? :(
[Nexus 4 General] rayiskon:
Just wait for the official release, if this leak didn't solve it for you as it did to some, there's nothing you can do about it. Keep in mind this is only a leak and it doesn't mean these are gonna be the final drivers/baseband
[Nexus 4 General] diegozz:
Crappy tp-link 541wr router + 4.3 leaked rom + .83 radio = WiFi bug fixed for me, tunein streams just fine now and instant notifications even on the middle of the night... first time my N4 is doing that without turning the screen on.
[Nexus 4 General] zdenoh1975:
I tryed it 4.3 again with new radio, new bootloader and in wifi settings - dont mark "optimalization wifi" and finally is it OK!!

So - 4.3 leaked rom + .83 radio + new bootloader = WiFi delayed screen off bug fixed for me. unbelievable.. Finelly! :good:
[Nexus 4 General] meangreenie:
Didn't turning off optimisation always work though?
[Nexus 4 General] Blockberd:
Nope. In this case this was not the cause of the problem. You can read it now and then in this thread. If solution would be THAT easy, don't u think that ppl would complain so hard about this damn issue? ;)
[Nexus 4 General] acid74:
It never worked for me. It is always turnned off on mine. No improvement at all.
[Nexus 4 General] meangreenie:
Some good news then :)
[Nexus 4 General] bender29:
Rats, if fixing this bug requires the .83 radio, it'll be a crappy decision to make. Hard to lose LTE connectivity now that it's widely deployed in my area. But I guess I'd rather have a useful smartphone.
[Nexus 4 General] thracemerin:
Radio should have nothing to do with WiFi, are you sure it's not fixed without the .83 radio?
[Nexus 4 General] Blockberd:
Good news till now from my side. At least at home it seems to work pretty nicely with latest radio (.83) and with frozen Advanced WiFi Lock!

Let me check for a couple of days and report back.

BTW: Stock 4.2.2 + stock bootloader. Just root.

[MENTION=4303511]thracemerin[/MENTION]:

I dont know but what I know for sure is that since I flashed that radio I can disable and freeze AWL and still receive notifications. Nothing else changed except that.

I tried to disable AWL a few times before that and still had to come back to enable it again...
[Nexus 4 General] thracemerin:
This is likely coincidence, like I said above, the radio has 0 to do with WiFi.

I'm not saying it didn't work, there were always reports that flashing different kernels, ROMs and modems fixed the problem on both 4.2.1 and 4.2.2, in almost all cases something else happened too, like the phone was being kept awake by a wakelock, in some cases it was a coincidence and it reverted to the previous behavior eventually. The baseband has 0 to do with the WiFi, the WiFi driver is contained in the kernel and the ROM.
[Nexus 4 General] danielvc:
I can confirm that Android 4.3 solved my wifi problem with delayed notificaties. Hooray!
[Nexus 4 General] TaintedByte:
Looking positive guys! Oh how much we will rejoice if this I'd indeed fixed. I will provide cookies for everyone!

Still need to do some testing to be sure it's actually fixed since some people are claiming it doesn't fix it for them.

I'll run tests in about a week (going through some massive life changes right now [why I've been inactive] and I need a stable phone) to see if its indeed fixed.

Unless someone beats me to it, digs through the driver and confirms it, or 4.3 releases officially and the amount of confirmations will pour in.
[Nexus 4 General] bender29:
I was just going by what other people had posted. I hadn't seen anyone confirm that 4.3 with an older radio fixed the issue. But what you say makes perfect sense.

I'm still wondering what the root issue is here.. Why not everyone is affected by this bug.
[Nexus 4 General] Zainiak:
Is there a way we can use the 4.3 drivers on 4.2? I liked 4.3 but I switched back 20 4.2 because of roms
[Nexus 4 General] thracemerin:
Nope, not until the sources are available at which point most ROMs will probably update to 4.3.
[Nexus 4 General] Salty Wagyu:
They probably don't notice. They get a notification, read message and that's it, not paying attention to timestamp maybe.
[Nexus 4 General] thracemerin:
The root cause is how the Nexus 4 handles ARP requests (by default it's set to ignore them while in deep sleep), depending on how your WiFi is set up and whether your router caches ARP information for a long or short time this problem can be more or less apparent, this is why some people never have the problem even on bone stock while others have constant problems, there are a lot of external variables that can make a huge difference.
[Nexus 4 General] Fatherboard:
Does 4.3 + 83 radio solve the random data stalls as well? I'm kinda tired of exiting an app and see that the wifi stopped responding (reception bar is at its max), and the only solution is to disconnect & reconnect to my router.
[Nexus 4 General] bender29:
I dunno. Like some other folks in this thread, the static ARP entry doesn't fix the problem for me.

And if ARP is out of the equation, I'm not sure how nexus4 ignoring ARP requests is the underlying cause.

For sure though, there must be other external factors.

Ultimately, maybe I'll just bite the bullet and install 4.3 tomorrow when i have a chance and see if it fixes my problem. At least I'll have peace of mind of knowing one way or another whether it's fixed for my situation.
[Nexus 4 General] andy o:
Could you try and ping the phone on the LAN with the screen off, and see if it responds?
[Nexus 4 General] jeffwei8:
4.3 seems to fix the delayed notifications for me. I always use a static ip between my phone and router at home. I do not disable wifi-optimization.

On 4.2.2, if I ping my phone (right after screen off AND after a few minutes of screen off), it would definitely lose connectivity and I would definitely drop all the packets. The only way I could fix it before was from changing McastBcastFilter to 1 as in OP or by using gEnableSuspend=2.

On 4.3 (deodexed, 0.83 baseband, did not update bootloader), I didn't make any modifications to the WCNSS_qcom_cfg.ini file at all. Notifications come through if my screen is off. Sometimes slightly delayed, but not noticeably worse than from using the fixes used in 4.2.2 above. First ping is sometimes longer (~800-1000ms) or very rarely dropped; but subsequent pings are always returned in the 50-500ms range. Not perfect but good enough for me.

Now if only the msm_hsic wakelock problem on 3g were reduced...
[Nexus 4 General] :
I hope Google solves the problems of JB 4.2.2, which was a disaster. Usual we have the problem with delays in notifications via Wifi.

Myself I face another problem boring as hell, which is to install some application by sending Google Play using the browser, simply download never starts on the unit. I have to start the app google play on the device, so that it can start to download. :mad:
[Nexus 4 General] paulyz:
I have a problem with wifi too. My N4 runs on rooted stock 4.2.2.At home I haven't any problem with wifi, everything works fine, but at work wifi works only 2-3 seconds. Wifi signal shows what phone is connected, but after couple seconds phone losing internet. My laptop, my old phone OptimusBlack, my colleagues S3 and iphone4 works without problem on same router. I tried flash n4-wifi-sleepfix-mcast_and_bcast.zip , but now success. I saw some peoples flash baseband from older 4.2.1 Rom, but I not sure it will help? not brick my phone? Or somewhere is another solution for my problem?
[Nexus 4 General] Xoib:
The "Background Wifi Location" in the release notes of the 4.3 means the problem that we are talking about ?
[Nexus 4 General] Salty Wagyu:
Spill the beans, has official 4.3 image fixed it? :D
[Nexus 4 General] ogrillion:
I haven't had the image from Google running long. But the leaked 4.3 fixed all WiFi issues for me and also fixed VoIP issues also.

I will post back later but I am sure the factory images are the same.

I am using new radio and boot loader also
[Nexus 4 General] eezdva:
It's fixed. So thank god . Was mighty annoying but now get all instantly. Even after not using the machine for like 10 minutes or so.
[Nexus 4 General] Fatherboard:
That's great to hear.
[Nexus 4 General] Fabriciohss:
Well, it seems I still have the problem...
[Nexus 4 General] chlehqls:
It seems to be fixed for me.

Before, I could update/download apps with my screen off, but I managed to update a whole column of apps with the screen off today with a clean flash image.
[Nexus 4 General] mobilehavoc:
I am running official 4.3 (factory image) and it is definitely fixed without a doubt. Best part is that because they fixed the ARP offloading the standby time on the Nexus 4 while on WiFi is ridiculous. I'm talking < .5% hour while on standby with all syncing on and notifications coming in. Never seen anything like that.
[Nexus 4 General] jcru53:
Fixed for me as well.
[Nexus 4 General] andy o:
That wasn't the problem detailed in this thread though.
[Nexus 4 General] archibald_schlick:
Same Problem here, I flashed 4.3 and the first Whatsapp message i received, came when i turn on my screen (about 4 min to late). So no fix in 4.3 for me. Google, Google, Google...nice phone but...

I try to turn off the wifi optimizations, maybe it helps.
[Nexus 4 General] zdenoh1975:
turn off the wifi optimizations - it will be OK (it must be turn off !)
[Nexus 4 General] Rivermind:
If you wipe before you flash, yes you will need to flash this fix again. Not sure about dirty flashes but I wouldn't count on it.
[Nexus 4 General] bganley:
I took a quick look at the linux source for the firmware you are running and compared to what I have running. The various ARP timers on your firmware are actually double what mine are. As a result, ARP entries will remain valid in your ARP cache longer - in your case apparently long enough to prevent this issue from affecting you.

I think the ARP timers are one of the main variables here that are causing such a difference between phones. They very wildly between different implementations of ARP. I've seen the timeout range from 60 secs on stock linux (what mine is set to) to 4 hours on Cisco's enterprise gear!

Anyways, glad to hear yours is working.