yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Android Development] thracemerin:
Looks like prima v3.2.3.93 requires changes on the kernel side as well, and if those changes are in the CAF repos somewhere I have yet to find them, until then we're stuck with v3.2.3.92a. I'm not sure there was anything added that would change the notification problems, so I'm not too worried about it.

As for the scrambled MAC address issue, I'm not sure what's causing it and I'm beginning to fear its in one of the binaries because I don't seem to be able to track it down, I'll keep working on this. As a temporary workaround if you ping the PC you want to use from the device first, it will put the device in the ARP cache of the PC correctly and it will work properly after that.
[Nexus 4 Android Development] roi14:
hi guys,

sorry if was not able to read the whole thread, i'm currently running PA 3.15 with franco's 117,. do i have to flash something first before i jump in to this kernel? the thing is, i can connect to my wifi but it seems i cant browse the net or there is no connection at all, all my devices that are connected to the same wifi are working properly,. sorry for any inconvenience, and thank you.

good day.:)
[Nexus 4 Android Development] chrone:
as far as i know PA use stock AOSP kernel, so you need to download a stock/AOSP kernel or anykernel and flash it on top of PA.
[Nexus 4 Android Development] roi14:
i'm flashing the one from this post:

http://xdaforums.com/showpost.php?p=39830661&postcount=432

and it says that it is an anykernel build. sorry if im a bit confused. thanks for your reply.

P.S. i'm on latest franco kernel
[Nexus 4 Android Development] chrone:
Didn't you get bootloop flashing the kernel from franco?

Sent from my Nexus 4
[Nexus 4 Android Development] roi14:
i'm still at franco's. i have not flashed anything as of now as im finding my directions.what would you recommend? thanks
[Nexus 4 Android Development] chrone:
Oh, i guess you need a reset kernel either using faux reset kernel or any other great devs reset kernel before flashing theracemerin anykernel. I might be wrong though.

Since i'm on stock rom, i always fastboot flash system system.img and fastboot flash boot boot.img just be perfectly back to stock after trying different kernels which put some modules on /system.

Sent from my Nexus 4
[Nexus 4 Android Development] Hyflex:
I went from franco's 116 straight to flashing the anykernel version and it worked fine.
[Nexus 4 Android Development] chrone:
Oh that' great! :)

Sent from my Nexus 4
[Nexus 4 Android Development] Proda:
Hi guys,

I'm on latest CM 10.1 nightly. I flashed this fix and it really helped getting Gmail notifications. But I still do have some wifi drops.

The worst gets when I'm at my University's wifi (it's 802.1x EAP security). Wifi disconnects a lot. And if I have Data on at the same time then when wifi is disconnected Data cannot connect. Also when only wifi is on, sometimes wifi is not able to connect to the network for more than 30min. So I have to reboot phone in order to connect it to wifi.

Before flashing this fix, wifi at University could connect easily but it would be off more often.

A question: can I flash over this fix motley kernel? Am I gonna lose the fix?

Thanks.

Sent from my Nexus 10
[Nexus 4 Android Development] bouaroudj:
WIFI fix killed my wi direct

Hi,

I can confirm that with the wifi fix kernel I can't share files with my nexus 7 using wifi direct. I tried to go back to the stable kernel (without the wifi fix) but the wifi brokes.

Is there a way to go back to the old wifi drivers?
[Nexus 4 Android Development] BlueFlame4:
AW: [Kernel][GPL] msm_hsic_host wakelock fix (Now with WiFi notification fix!)

Reflash your ROM without wipes.

Sent from my Gameboy Color
[Nexus 4 Android Development] Hyflex:
no no no he needs to use the revert zip
[Nexus 4 Android Development] thracemerin:
Either way should work
[Nexus 4 Android Development] bouaroudj:
Thanks guys. I used the revert
[Nexus 4 Android Development] OCmylife:
Hey thracemerin,

The kernel runs very well on my phone, but I miss the feature from faux to adjust the gammasettings. I think you`ll find the patches here: http://xdaforums.com/showpost.php?p=36956045&postcount=5

I don`t know much about kernel developing and tried to apply these patches on your kernel, but I was afraid to build the kernel and messing up my device. Could you do it for me? I would spent you a beer. :)

TIA

OCmylife
[Nexus 4 Android Development] thracemerin:
No, my reasons why are posted a number of times in the thread.
[Nexus 4 Android Development] BlueFlame4:
This might be a bit off topic, but is there a way to inject the new drivers in another kernel after flashing?

I really like your kernel and don't want to be rude, but I'd like to try some others as well ;)

Best regards! :)

Blue
[Nexus 4 Android Development] thracemerin:
Nope
[Nexus 4 Android Development] kszaq:
Hello Thracemerin.

I don't follow your thread so I don't know if this has been mentioned earlier, but probably with your kernel some users are observing increased qcom_rx_wakelock on busy networks (a thing we have discussed some time ago). Yesterday I thought I'd take a look at the code and noticed that there's a flag WLAN_FEATURE_HOLD_RX_WAKELOCK enabled in Prima Makefile (it's called Kbuild in your kernel tree since you didn't change the name of this file) that allows the driver to keep the wakelock. I compiled a kernel without this flag last night and the results are promising: I no longer see this wakelock at all yet the notification lag is still gone (McastBcastFilter=3, hostARPOffload=1). Still, this may be working for me and won't for others, so I though you may also want to do your tests. :)

Here's the patch I applied: https://github.com/kszaq/kernel_lge_mako/commit/a0b3ef2aff44d7eb71898f3fad08320897da6beb
[Nexus 4 Android Development] thracemerin:
Thanks for the info.

Out of curiosity, do you have the issue outlined here: http://xdaforums.com/showpost.php?p=40240290&postcount=894 with your version of the fix?
[Nexus 4 Android Development] kszaq:
ARP doesn't seem to be an issue for me. I noticed that we use a bit different config files, maybe that's the reason? I'm attaching mine in case you wanted to check this.

And despite not having ARP issue, I still can't connect to AirDroid when my screen is off. I guess that this time it may be related to that flag I deleted from my code. I don't use AirDroid though, so it's not a big deal for me.
[Nexus 4 Android Development] thracemerin:
ok, do this for me to test something:

from a computer check to see if your arp cache includes your device (type arp -a)

if it does, remove it (arp -d <ip address>)

then ping it from that computer

do you get Destination Host Unreachable or Request timed out?

if so, check your arp cache again (arp -a)

does the mac address match the one for your device?
[Nexus 4 Android Development] kszaq:
1. When my screen is off, sometimes the result is "Destination host unreachable" or "Request timed out" for the first few times and then it starts responding and a correct ARP shows up is ARP cache table. And sometimes it's more than a few times that I have to wait.

2. When I ping my device while its screen is on, it respond immidiately and the correct IP address appears in ARP cache.

Now that you asked me to do these tests I'm starting to think that removing that flag may have made my device respond slower to pings while the screen is off. :confused:
[Nexus 4 Android Development] thracemerin:
Ok, well here's what happens with mine:

Starting with the device not in my ARP cache in Windows 8 (a similar thing happens on linux too)

Screen on:

Ping works

ARP cache shows the correct MAC

Screen off:

Destination Host Unreachable

ARP cache shows a garbled MAC (all the right numbers are there, just in the wrong order)

Once something is in the ARP cache it obviously won't work properly again until I flush it or the cache times out, even with the screen on.

So, you're saying that on your device it shows the correct MAC address in your ARP cache when you ping it with the screen off and it wasn't previously cached correctly?

My router shows the correct MAC because it gets the correct one during the DHCP negotiation, I'm talking about other devices on the same network.
[Nexus 4 Android Development] kszaq:
Yea. I did the following:

Kept phone's screen off all the time.

Rebooted my router and my computer to make sure that ARP caches are cleared.

Waited until my phoned logged in to WiFi netowork - I kept monitoring router's ARP cache and DHCP table via ssh. As you said, router's got correct ARP thanks to DHCP request.

Then, from my computer:

on Ubuntu, I wasn't able to ping my phone at all

on Windows 7, the device started responding to pings after a few seconds and my computer got correct phone's ARP.

I am using TP-Link router with Atheros radio chip(s) and OpenWRT on board. I used a kernel compiled without a flag enabling qcom_rx_wakelock and with config file as in my previous post.
[Nexus 4 Android Development] thracemerin:
Yeah, on Ubuntu did the wrong MAC address get cached?
[Nexus 4 Android Development] kszaq:
Not really. arp -a shows the following:

android-ded58b241622c33a.lan (192.168.1.152) at <incomplete> on wlan0

It shows that for every IP I try to ping in my network when the device's not present, for example:

? (192.168.1.153) at <incomplete> on wlan0

The correct hostname comes from my router's cache, I suppose.
[Nexus 4 Android Development] thracemerin:
This is the arp table on my Ubuntu machine after I pinged my device which is at 192.168.1.147 (screen off, ARP cache was clear)

Thrace-PC (192.168.1.116) at 30:85:yy:96:76:2c [ether] on eth0
android-ec21ef8bb17fcaa2 (192.168.1.147) at 9a:a4:92:xx:e9:96 [ether] on eth0
DD-WRT (192.168.1.1) at 58:6d:8f:4a:zz:d8 [ether] on eth0

the thing is, my phone's actual mac is xx:92:a4:9a:96:e9

(xx isn't really the correct digits, but for security sake its safer not to post the full thing, it's in the correct spot in both places however)

No idea what causes this.

ARP requests are handled in the OS, and since the OS isn't changing something is being goofed up by the kernel in the incoming our outgoing packet, but I can't understand why.
[Nexus 4 Android Development] kszaq:
Okay, after trying to ping my phone a few times in a row (on Ubuntu) I got a messed up MAC as well. :( Seems like a bug (or is it a feature?) of ARP offload.
[Nexus 4 Android Development] thracemerin:
Yeah, it's not fixed in v3.2.2.6 either which is now the latest JB release.

So I'm thinking since the prima driver is for all Atheros chips on MSM boards, it's something unusual with this specific board that hasn't been noticed by the folks at Codeaurora.
[Nexus 4 Android Development] JAS_21:
When I first got my device a few weeks ago I tried using wifi during setup. The wifi was connected, but downloads were extemely slow or wouldn't work at all. The next day at work wifi worked flawlessy there. A little searching brought me here and I've been using this kernel with CM nightlies. This seems to fix my problem with connecting at home. My router at home is a Embarq 660 series.

I'm a little confused by the different wifi issues. From what I've found by searching around, it seems this issue only happens with certain routers. Is this one of the issues the kernel was designed to fix?
[Nexus 4 Android Development] thesebastian:
The main reason for this fix. Its solve delayed WiFi notification when the phone is in deep sleep or whatever.

Of course the are a lot of other bugs with the atheros chip. And some of them could be fixed or not with these newer drivers.
[Nexus 4 Android Development] socali:
Possible Solution for Gray WiFi and Mangled MAC address in ARP

After getting frustrated with my phone waking up to gray WiFi bars and inoperable WiFi, and after going through threads here and CYAN-558 trying different drivers and patches, I believe I found a solution to both the gray WiFi and mangled MAC address! I did only limited amount of testing, but it looks good for now.

In /system/etc/wifi/WCNSS_qcom_cfg.ini I changed gEnableSuspend=3 (Enable Mcast/Bcast Filter) to gEnableSuspend=2 (Deep sleep). Also gEnableSuspend=1 (standby) seems to work but from limited testing I think Deep sleep is working better.

I did not notice a difference between McastBcastFilter=0 and McastBcastFilter=3. I kept the setting hostArpOffload=1 as-is.

So in short, I only set gEnableSuspend=2 and left everything else as-is.

Now when I ping the phone while it's sleeping I get the correct MAC address and when I wake it up, the WiFi and Cell bars are blue! I also get e-mail notifications on time.

I tested this setting on CM10.1-M3 and the nightly, as well as thracemerin's WiFi fix kernel and got same results on all three.

Please try this setting on your phone and hit thanks if it resolves the issue for you too!
[Nexus 4 Android Development] thracemerin:
Interesting, I'll have a look and do some testing.
[Nexus 4 Android Development] tylercarter:
Could this finally be the fix we have been looking for? :fingers-crossed::fingers-crossed::fingers-crossed:
[Nexus 4 Android Development] thracemerin:
Shows promise in initial testing, I also got 3.2.3.98 working i think, I'll get a new build out soon.
[Nexus 4 Android Development] tylercarter:
I can't wait :D
[Nexus 4 Android Development] thracemerin:
Ok folks, new version v5 is ready to go, yes I know there was no v4 (it was an internal testing version, you don't want it).

Changes:

Prima v3.2.3.98

Changed gEnableSuspend to 2 by default as suggested by socali (thanks to him)

Same deal as always, make sure you have a backup and can recover if something goes wrong.

I haven't had enough time to test whether this affects battery life or deep sleep percentage, so I'd like people to post their experiences along with the kernel wakelock screen or a dump file from BBS (

don't just say 'battari iz teh crap', because I will have a mod infract you

) after you have tested this for a significant period (12+ hours preferably mostly on wifi).

April 14, 2013:

Download: hsic_fix_nexus4_wlan_v5.zip

MD5: 96a43dffbb0aecd67737e160f713b40a

Happy flashing! :victory:
[Nexus 4 Android Development] DenyDarko:
@thracemerin

Do I have to flash over the kernel everytime I update to a newer nightly CM?
[Nexus 4 Android Development] thracemerin:
Yes
[Nexus 4 Android Development] tylercarter:
So far I've got this

I'll let it run a while longer and get more shots and logs.
[Nexus 4 Android Development] thracemerin:
Is that more or less than you would have expected? Mine seems about the same, but I've been doing things like running lengthy ping tests.
[Nexus 4 Android Development] tylercarter:
so far it appears close to normal. i felt like the qcom_rx_wakelock kinda took off quick. im not sure how the deleted wakelocks got there :laugh:

i havent been doing any ping tests. kids wont let me haha. just normal usage.

---------- Post added at 07:16 PM ---------- Previous post was at 06:43 PM ----------

I still get a disconnect from WiFi when waking :( ive attached some logs. hopefully they help.

EDIT: I did just update the firmware on my router. linksys ea4500.
[Nexus 4 Android Development] thracemerin:
Like grey bars when you wake the device up or no bars? grey bars means you aren't connected fully to Google, that isn't necessarily a problem.
[Nexus 4 Android Development] tylercarter:
no the wifi icon wasnt even there and when it popped up it had to reconnect again.
[Nexus 4 Android Development] thracemerin:
Strange....ok, i'll look into it.
[Nexus 4 Android Development] tylercarter:
it happened again. :(

EDIT: Its actually happened to me several times. I dont wanna spam the board with logs lol
[Nexus 4 Android Development] thracemerin:
Weird, I can't reproduce this at all.
[Nexus 4 Android Development] tylercarter:
i did just upgrade the firmware on my router. ill see how wifi is on my n7.

edit: i was using 2.5 ghz with wifi optimization checked. wifi always on and no network notification.
[Nexus 4 Android Development] thracemerin:
I see it failing and disconnecting and then re-initializing in your dmesg, but mine is not doing this and I don't seem to be able to get it to happen.

Anyone else seeing this?

Edit: using 5ghz or 2.5ghz?
[Nexus 4 Android Development] AmeriKan47:
I'm not having any issues at this time. I'm connected to 2.5ghz. If I have any issues over the next several hours, I will let you know and post a log.
[Nexus 4 Android Development] socali:
Something is wrong with this build..

Out of 40 mins that my phone was sleeping, BBS reports that 32% of the time phone was in Deep Sleep and 68% phone was awake. Also, there's noticeable battery drain. I also see 2 events that do not show up with CM10.1 at the top of the list: qcom_rx_wakelock 15mins and suspend_backoff 6mins.

Same gEnableSuspend=2 setting on CM10.1 Nightly shows 75% of the time in Deep Sleep and 25% in awake. I'm testing this one more time to confirm.

Also, I'm not sure how different is Standby (=1) from Deep sleep (=2). Need some more time to test and see how it behaves.
[Nexus 4 Android Development] thracemerin:
I'm not seeing this, it sounds like something on your network is waking the phone up a lot.

suspend_backoff is the wake lock the kernel holds when android wakes up and goes to sleep repeatedly in short succession.

Edit: a thought, did you replace the WCNSS_qcom_cfg.ini that comes with the kernel with a different one? like one that has McastBcastFilter set to something other than 3? because that'd do it.
[Nexus 4 Android Development] thracemerin:
This is what my kernel wakelocks look like (minimal usage, but it shouldn't matter for this test since I'm looking at whether or not the phone wakes up from WLan traffic)
[Nexus 4 Android Development] socali:
Your battery stats do look much better than mine.. I'll keep testing this tonight and tomorrow and see what I get. I'll try to find out what keeps waking up my phone and wlan.

I did not modify the ini file on your build. I only modified the CM10.1 but there kept McastBcastFilter=0. Since we're not enabling McastBcastFilter in the first setting, I'm not sure if the filter setting is making a difference.

So frustrating.. I want to test all configurations but each one takes a while to run. :)
[Nexus 4 Android Development] thracemerin:
It does, this driver uses a different set of patches for McastBcastFilter than the CM kernel, it must be 3 to function correctly, the qcom_rx_wakelock is a result of it being set to 0.
[Nexus 4 Android Development] socali:
Thanks for explaining. I'll let you know tomorrow how it's going.
[Nexus 4 Android Development] thracemerin:
Yeah, the CAF guys changed the ordering of how the filter works between v3.2.2.2 which is where the CM patch came from and v3.2.3.98 which is what I'm using, as a result the flag was switched back in their release.
[Nexus 4 Android Development] darkamikaze:
This sounds promising! Flashing it now

Mm so it's barely been a couple hours but deep sleep is really miniscule. Perhaps could be the reason why it's not causing issues. I cleaned caches with some reboots to see if it would be different but still very very little deep sleeps. Will see tomorrow if it's the issue is prevalent without Wi-Fi.

For reference: On aokp with stock aokp kernel prior to flashing
[Nexus 4 Android Development] dancer810:
Hi!

1) Installed the latest CM

2) Installed FRANCO 121

3) Installed hsic_fix_nexus4_wlan_v5.zip

I'm trying to send yourself a message in Gtalk with another account when the phone is asleep, but the message does not come even after 10 minutes. As soon as I unlock the screen - the message immediately comes.

Tried to install McastBcastFilter = 0. Pings are normal even after 10 minutes, but the message never arrives. Only when I unlock the screen.

What am I doing wrong?
[Nexus 4 Android Development] rawdealer:
Nothing :) I had the same issue on HTC Sensation, HTC One X and also on N4 :) So...obviously Talk doesn't push notifications when phone sleeps :)
[Nexus 4 Android Development] dancer810:
Only Gtalk?

Whatsapp works fine?
[Nexus 4 Android Development] thesebastian:
Isn't step 3 an stock based Kernel? I think you should re install 1 (or restore the backups that Franco kernel create automatically) and jump straight to step 3.
[Nexus 4 Android Development] thracemerin:
A few things:

1) v5 is a full kernel, you can't flash it and then flash a different kernel (franco, faux, motley, etc) over top or vice versa

2) don't mess with the McastBcastFilter or any other setting in the WCNSS_qcom_cfg.ini file, it's set in a specific way for a reason

3) if you were on a custom kernel (especially one without MPDecision) you may need to reflash your ROM to get it's stock Ramdisk first.
[Nexus 4 Android Development] thesebastian:
There is a lot of people who flash Franco kernel and after that another kernel over Franco kernel (for instance: stock kernel again)...That people may notice a lagged nexus 4.

Less than a half know that.
[Nexus 4 Android Development] bouaroudj:
WiFi-Direct

Hi, is wifi direct working with v5?

Edit : still broken. I'll have to revert again :(
[Nexus 4 Android Development] jakejm79:
I am having the same issue, running 4.2.2 stock and I have barely used my phone over the last couple of hours and over 50% of the time is spent awake. With qcom_rx_wakelock being over an hour.

I just accidentally rebooted, but I will post some screencaps and a log shortly.
[Nexus 4 Android Development] thracemerin:
Can you verify the following values in /system/etc/wifi/WCNSS_qcom_cfg.ini

McastBcastFilter=3

hostArpOffload=1

gEnableSuspend=2
[Nexus 4 Android Development] jakejm79:
All present and correct.
[Nexus 4 Android Development] thracemerin:
I'm not seeing this at all, my deep sleep time is roughly the same as it was previously, I'm not sure how to explain that.
[Nexus 4 Android Development] jakejm79:
Yeah it's weird, on the plus side changing gEnableSuspend to 2 is the only thing that makes my device get timely push notifications on wifi when sleeping, all your previous versions of the kernel hadn't helped.
[Nexus 4 Android Development] thracemerin:
Are you running CM10.1? If so can you dirty flash it so you get the stock CM kernel, switch gEnableSuspend to 2 in the WCNSS_qcom_cfg.ini and reboot, don't flash my kernel. Just to see what happens.
[Nexus 4 Android Development] jakejm79:
I'm just running the stock 4.2.2. I'm going to try flashing one of your older just HSIC fix kernels and do the above and see what happens.

Meanwhile I attached my BBS stats from earlier.
[Nexus 4 Android Development] thracemerin:
That'll work, I suspect that setting gEnableSuspend=2 is actually completely disabling the McastBcastFilter by bypassing it in the firmware, why it seems to be affecting some more than others, I don't know.
[Nexus 4 Android Development] jamesrt:
Hi,

Just to chip in my $0.02 worth; that's exactly the position I'm in. Flashed CM10.1-m3 the other day, and have hand-edited the cfg.ini file to set "gEnableSuspend", so I now have these settings:

# adb shell cat /system/etc/wifi/*ini | egrep "McastBcast|hostArpOffload|gEnableSuspend"

gEnableSuspend=2

McastBcastFilter=0

hostArpOffload=1

Phone responds to pings almost immediately when screen has been off for a while (it drops the first one or two, presume during the ARP stage; but I'm just on the edge of coverage of the work-based WiFi I'm using, so that could be contributing). No longer getting the scrambled ARP responses which I was getting before setting "gEnableSuspend" to 2.

Current stats:

6 hours, 5 mins on battery

"msm_hsic_host" wakelock = 8m 23s

"Deep Sleep" = 4h 45min

I'm happy with that.

Thanks for the diagnostic efforts to date - much appreciated!
[Nexus 4 Android Development] socali:
I'm still testing my theory, but was wondering if you have a 2WIRE router (common with at&t service) by any chance?

From my tests so far, I noticed device stays awake the least (~20%) on a CM10.1 build from march, then longer on the latest nightly (~40%) and even longer on build v5 (~80%)

I will post an update once I validate my thoughts.
[Nexus 4 Android Development] darkamikaze:
I have a 2Wire router by AT&T though i'm using AOKPm6 which I believe don't have the new firmware. Do tell?