yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] :
You're a ****ing master, THANK YOU! I love you! will you marry me? :D

With this post and the new CROSS_COMPILE argumen I have been able to apply your diffs files and compile a working bcm4329.ko for my HTC Desire Gingerbread using salsa kernel! Now I feel like a kernel hacker :P

I will try to search and change the -88dBm limit for testing purposes but I'm too noob to get a working mod, I'll wait for your solution but your help is highly appreciated.

Tanks again master!
[Desire Android Development] :
Searching in dmesg output when wifi disconnects I get two messages

Link Down

disassoc client!

Searching in the code this two messages are located in wl_iw.c i think that the method that check if rssi is greater than -88 is near but my knowledge in programming is very limited.

These lines look suspicious...

g_ss_cache_ctrl.last_rssi == 0

g_ss_cache_ctrl.m_link_down = 1

Other suspicius line, I've changed and compile this line to se if it changes something or wifi still drop at -81 but I'm sure I'll break something :\

g_ss_cache_ctrl.last_rssi = rssi;

/* if rssi is 0, it means we lost the connection */

if (rssi == 0)

//TEST I'VE PUT THIS VALUE TO SEE IF WIFI NOT DROP

rssi = -91;

//ORIGINAL VALUE

//rssi = WL_IW_RSSI_MINVAL;

I hope it helps.

UPDATE: Wifi still drops around -88 but in *#*#4634#*#* menu RSSI shows the value -91 instead of -200 :(
[Desire Android Development] :
Confusion mode ON...

I'm a little bit confused, I thought if the module bcm4329.ko worked fine with HTC Desire froyo release why not compile the same module for the gingerbread release...

Then I've downloaded Desire froyo source code and overwrite the bcm4329_204 folder of the gingerbread source to compile bcm4329.ko for gingerbread, after a few compile errors I've been able to compile a working module :) but wifi still drops around -91dBm :( I don't know if I made a mistake but if seems that the -91dBm limit is in another folder not in bcm4329_204...

I've restored a backup of froyo for my desired and checked if the limit it the same but in froyo wifi go ahead -100dBm without problems.

Confusion mode OFF...

UPDATE:

It seems that I did not get a working froyo bcm4329.ko for gingerbread, I've made another attempt to do it and I get this error that I cannot solve:

drivers/net/wireless/bcm4329_204/dhd_linux.c: In function '_dhd_set_multicast_list':

drivers/net/wireless/bcm4329_204/dhd_linux.c:618:14: error: 'struct net_device' has no member named 'mc_list'

drivers/net/wireless/bcm4329_204/dhd_linux.c:619:11: error: 'struct net_device' has no member named 'mc_count'

drivers/net/wireless/bcm4329_204/dhd_linux.c:641:36: error: 'struct net_device' has no member named 'mc_count'

drivers/net/wireless/bcm4329_204/dhd_linux.c:641:71: error: dereferencing pointer to incomplete type

drivers/net/wireless/bcm4329_204/dhd_linux.c:642:30: error: dereferencing pointer to incomplete type
[Desire Android Development] Alex-V:
Kernel source is out :)
[Desire Android Development] bemymonkey:
OK, cat'd.

http://www.multiupload.com/B9CHRCNXC9

Thanks for doing all this, you're a lifesaver! :D
[Desire Android Development] Myshkinbob:
Here you go, you need to unzip and push it to the phone over adb. I'm not sure of the modules directory for opendesire so i didn't make it into a recovery menu patch.

you need to push it to wherever the bcm4329.ko is currently located, my guess is /system/lib/modules/ unless opendesire uses a more unique path (some roms seem to). Then you'll need to reboot the phone. :)
[Desire Android Development] bemymonkey:
So if I backup the old file pretty much nothing can go wrong? :p

Nandroiding now :)

Thanks!
[Desire Android Development] Myshkinbob:
The worst that can happen is your wifi fails to turn on anymore (in which case you just put the original driver back), but it seems unlikely since the kernel version and localversion should match fine. :)
[Desire Android Development] copas2:
Sorry but this frakking rapidshare is fully loaded. Do you eventually have a different place to upload the zips? Or you could just attach them... Thank you in advance... :)
[Desire Android Development] bemymonkey:
Sounds good - having a bit of a problem though, because I realized I can't write to /system/ while the Desire's booted, and I can't find my MicroUSB cable :o... and Wireless ADB doesn't work in Recovery :rolleyes:

Been sorting through boxes to find a goddamned cable (had to eat dinner in between)... will get back to you about whether or not it worked though :D. If all else fails I'll just get a new cable tomorrow :cool:

Here's the first one (Rapidshare's making me wait 5 minutes for the second one):

http://www.multiupload.com/Q8KXXEAFWF
[Desire Android Development] Myshkinbob:
If i'd known you had no cable... :)

Attached a recovery flashable zip version to this post, let me know if it works ok and i can add it to the OP. It's not signed btw.

Also i'll add the original HTC rom versions as attachments to the OP, i didn't realise rapidshare had download limits.
[Desire Android Development] mattiadj:
I have tried the file on first post with latest AuraxTSense v7.6 but after flash wifi is not usable anymore.

Can you post a correct version of file for this rom?
[Desire Android Development] bemymonkey:
LOL, thanks, I found my cable like 5 minutes ago :D... Spent half the evening looking for it because my battery's going on empty, so I really need it ;)

Desire is rebooting from recovery as I type :). Can't wait to see if it worked ;)

W00T, That seems to have done it! Transfer rate via FTP while the phone's sleeping is 1.5MB/s :D:D:D

Thanks so much!

So what happens when the next version of OpenDesire comes out? Is it safe to reuse this file? :)
[Desire Android Development] Myshkinbob:
if you go to settings - about phone - software versions, is your kernel version 2.6.32.15-gf9c0527 ?

So far as i know the module works on all roms based on the official HTC 2.2 kernel.

If the kernel version is correct, after you try to turn on wifi and it fails, immediately go to either a terminal as su, or use adb shell, and run...

dmesg > /sdcard/dmesg.log

then copy it off your sd card and post it here and i'll take a look at why wifi is failing to start.
[Desire Android Development] Myshkinbob:
Cool, glad it's working. :)

I'll try to keep it up to date for opendesire versions when they change kernel revisions. It doesn't happen very often luckily. If you could post back on the standby battery usage compared to the normal CM6 driver that'd be great, thanks. :)

I'm fairly sure it won't be affected too badly if at all, but i'd like to be certain since i didn't actually test this CM6 version out myself.
[Desire Android Development] ghmail2:
you did a such good job:p

thanks for you effort and your zip package for opendesire

opendesire is good but only wifi sleep issue bothers me:)

btw: there is a apk called wififixer

this makes a same effect for wifi sleep issue,what is the difference?
[Desire Android Development] mattiadj:
No in this relase the kernel version is a little different.

I attach information about my ROM.

sent from my Nokia 3300
[Desire Android Development] mattiadj:
sent from my Nokia 3300
[Desire Android Development] Myshkinbob:
I tried out wififixer when i first got my desire, i found it a little unreliable sadly. Half the time it worked perfectly, other times it would make my file transfer fail, or cause my music to stop playing, and sometimes just disabled my wifi until i manually enabled it again. I believe it works by resetting the wifi connection once the phone enters standby, depending on the fix method you select in the advanced menu.
[Desire Android Development] Myshkinbob:
Oh that is a different kernel version. I'll recompile the module to match it on the quick here.
[Desire Android Development] mattiadj:
Can I help you in any way?

sent from my Nokia 3300
[Desire Android Development] Myshkinbob:
Sure, test this out and let me know if it works. :)

Applies from recovery same as before. Only works on 2.6.32.15-g1fc4045 kernels.
[Desire Android Development] mattiadj:
If I can turn on the WiFi it works?

sent from my Nokia 3300
[Desire Android Development] Myshkinbob:
Yup, that means it works. Try downloading/streaming some data while the phone is in standby mode, to be sure. :)
[Desire Android Development] mattiadj:
Can I try with YouTube too?

sent from my Nokia 3300
[Desire Android Development] Myshkinbob:
I don't think youtube will work, video with the screen in standby? hehe
[Desire Android Development] mattiadj:
Thanks man!all seems to work perfectly!

But only a question:is my impression or when screen is off download speed is lower?

sent from my Nokia 3300
[Desire Android Development] bemymonkey:
DUDE! It works so freaking perfectly! :D:D:D

I just tried a test call over SipDroid with the screen off - crystal clear! :eek::D... thanks so much :)

As for power usage, it is significantly higher - might be problematic for people who don't really use their phones and just leave 'em in standby for 3 days.

CurrentWidget Logs:

With your tweak:

2010/09/07 07:18:53 -12mA

2010/09/07 07:19:53 -18mA

2010/09/07 07:20:53 -8mA

2010/09/07 07:21:54 -18mA

2010/09/07 07:22:54 -12mA

2010/09/07 07:23:54 -12mA

2010/09/07 07:24:54 -8mA

2010/09/07 07:25:54 -8mA

2010/09/07 07:26:54 -8mA

2010/09/07 07:27:54 -10mA

2010/09/07 07:28:54 -8mA

2010/09/07 07:29:54 -8mA

2010/09/07 07:30:55 -8mA

2010/09/07 07:32:07 -8mA

2010/09/07 07:33:07 -8mA

2010/09/07 07:34:30 -8mA

2010/09/07 07:35:30 -8mA

2010/09/07 07:36:31 -13mA

2010/09/07 07:37:31 -13mA

2010/09/07 07:38:31 -5mA

Without:

2010/09/06 19:06:11 -5mA

2010/09/06 19:07:11 -5mA

2010/09/06 19:08:11 -5mA

2010/09/06 19:09:11 -5mA

2010/09/06 19:10:11 -5mA

2010/09/06 19:11:11 -39mA

2010/09/06 19:12:11 -40mA

2010/09/06 19:13:11 -61mA

2010/09/06 19:14:11 -7mA

2010/09/06 19:15:11 -7mA

2010/09/06 19:16:11 -25mA

2010/09/06 19:17:11 -5mA

2010/09/06 19:18:11 -63mA

2010/09/06 19:19:11 -63mA

2010/09/06 19:20:11 -6mA

2010/09/06 19:21:12 -15mA

2010/09/06 19:22:12 -7mA

2010/09/06 19:23:13 -5mA

2010/09/06 19:24:24 -7mA

2010/09/06 19:25:29 -5mA

The 20mA+ spikes are things like Locale trying to relocate and Sipdroid reassociating - don't have a log from a whole night with the old driver, so I'm having a hard time finding a spot where the phone wasn't actually doing anything :p. It seems that the lowest average value has gone up to about 8mA from 5mA before...

Lost about 10% battery over night (bout 8 hours) with the new driver, which is OK, IMO. Gives me about 80 hours of usable standby life, and if I use the phone as normal (lots of active use) I shouldn't notice a difference at all :)

By the way: When do we need a new driver? When there's an actual kernel version number change? Or even when the changelog for the ROM just lists something like "Kernel tweaks"...?

-edit- Getting lower power consumption more in line with "old-driver" values now (might be because I have better WiFi reception now):

2010/09/07 08:39:21 -10mA

2010/09/07 08:40:21 -4mA

2010/09/07 08:41:21 -5mA

2010/09/07 08:42:21 -9mA

2010/09/07 08:43:21 -5mA

2010/09/07 08:44:21 -5mA

2010/09/07 08:45:21 -17mA

2010/09/07 08:46:21 -5mA

2010/09/07 08:47:21 -5mA

2010/09/07 08:48:22 -4mA

2010/09/07 08:49:22 -5mA

2010/09/07 08:50:22 -5mA

2010/09/07 08:51:22 -5mA

2010/09/07 08:52:22 -34mA

2010/09/07 08:53:22 -4mA

2010/09/07 08:54:23 -8mA

2010/09/07 08:55:23 -5mA

2010/09/07 08:56:23 -5mA

Even dipped to 4mA once, as you can see :eek:

I'm loving this tweak! :D
[Desire Android Development] mattiadj:
Hello.

A question.I'm trying this mod with a web radio and after screen off the radio continues to play without any problem.so the problem is now fixed? I never have tried this :-) so I don't know if before this patch I can listen web radio with screen off :-)

sent from my Nokia 3300
[Desire Android Development] bemymonkey:
You could try a Sipdroid call or an FTP Server... Not sure which Webradio apps had problems before.
[Desire Android Development] deaglun:
This is fantastic, thank you very much.

I like to use twonky media server and upload all the photos I take to picassa, but it becomes unusable once the screen turns off so it's great to have a solution. I'll do the update via adb I think so that I can always put it back if for some reason I need a day or two of extremely frugal battery use.

Thank you very much again. I use opendesire.
[Desire Android Development] maassk213:
Just applied the patch and now I can actually use my CIFS shares! Thanks :)
[Desire Android Development] mattiadj:
Tried to download some files and some of them works other no and download is waiting for connection data.:-( what can I do?

sent from my Nokia 3300
[Desire Android Development] bemymonkey:
What did you try to download? With what program? From where?
[Desire Android Development] copas2:
Thank you.
[Desire Android Development] bemymonkey:
And the other one if you need WiFi-N: http://www.multiupload.com/112M9DBLR0
[Desire Android Development] mattiadj:
I have tried this link http://ief.tsone.info/ota22.zip and this link http://files.c0urier.net/neophyte/N...6.1_Official_OTA_2.2_FRF91__new_NexTSense.zip

and after few minutes donwload stops and tells me "Wainting for data connection".

This links seems to work

http://neophyte.vipme.com/ftp/AuraxTSense_7.6.1_Official_OTA_2.2_FRF91__new_NexTSense.zip
[Desire Android Development] bemymonkey:
Then it's likely that the servers are just screwed. Nothing to do with your WiFi :confused:
[Desire Android Development] mattiadj:
If i download from these link with screen on or phone plugged to ac cargher all is ok....Any idea?
[Desire Android Development] bemymonkey:
o.O

Interesting. Testing now...

-edit- First link downloads fine with the display off... Might be your WiFi connection (router side)...?
[Desire Android Development] mattiadj:
May be! can you help to configure my router if you want :)
[Desire Android Development] bemymonkey:
Oof... every router is different ;). Just make sure all your power saving settings are off. They often screw with stuff like this...

Sometimes turning off additions like 802.11g++ (those proprietary hacks to get faster 802.11g) helps too, or restricting to just 802.11g or 802.11n instead of all abgn at once...
[Desire Android Development] mattiadj:
But with your phone all download work???
[Desire Android Development] bemymonkey:
Yup.

10characters
[Desire Android Development] mattiadj:
Not understand :D
[Desire Android Development] bemymonkey:
That was a "YES"!
[Desire Android Development] Myshkinbob:
Glad it's working for everyone. :)

The original HTC Sense rom versions are now attached to the first post if anyone has problems with the rapidshare links.

The driver will only need updating for opendesire when OD changes kernel version from 2.6.34.5, basically your kernel module version has to match the running kernel version for it to be loaded.

I was a little surprised at your power readings the first time, the second set are closer to what i see for it myself. So far as i can tell there isn't any noticeable difference in battery consumption, and my standby battery usage hovers around the same as the default wifi driver. :)

I wouldn't try to twist any CM6 rom author's arms about integrating the patch into their builds, the diff is available in this thread if they'd like to though. To be honest i'd be sceptical that you can alter the wifi power saving mode without impacting battery life too. It's one of those things where you have to try it out yourself to believe it.

I did have a peek in the opendesire thread and noticed the wifi driver isn't quite the same as the CM6 one apparently, but i still can't find the git repository for OD's kernel, so if anyone knows where to find it, i can make a driver based directly on the OD wifi driver rather than throw out any tweaks OD is using too.

The driver i posted on page 4 is only for kernel 2.6.34.5-Opendesire, so if anyone needs a version for a different kernel (defrost or CM 2.6.35.x etc), let me know.
[Desire Android Development] bemymonkey:
Yah, my battery life with your driver is perfect :)

I'm guessing the power saving mode you've set (is it really ConstantAwakeMode? I'm not quite sure) just scales well with traffic, using very little power when there's none.

I know what you mean about the arm-twisting, but it seems like it's only a matter of time until HTC figures out himself that PSP isn't a good idea :p

Hmmm... no idea whether or not that's the case, but your driver still works fine as a replacement. Really, downright perfect :)

You know you'll be hearing from me as soon as we get a kernel upgrade on OpenDesire ;) :D

I suppose posting a tutorial for making our own WiFi modules is probably a lot more work than just taking requests? :)
[Desire Android Development] Myshkinbob:
The actual patch itself for the non-HTC driver is tiny, it's literally two lines being edited, so it's really not difficult, take a look at the diff.

Compiling is a bit more complicated but far from difficult also, and i'm sure many tutorials exist about compiling a kernel for android.

Essentially you need an x86 linux installation, download a cross compiler toolchain for arm mobile processors here and extract it, then you just..

-set the toolchain to be part of your path e.g.

export PATH=$PATH:/path/to/toolchain/bin/

(adding the toolchain's executables to where linux will look for them)

-download the kernel source code that matches your rom's kernel and extract it (htc's kernel source is on their site, CM6 based rom kernel's are on various gits, google 'git clone' to download them)

-cat the kernel config.gz off your phone, gunzip it and copy it to the kernel source root as .config (earlier in the thread)

-do a make menuconfig or make oldconfig to ensure your copied .config was in the right place and matches etc, edit the localversion append for HTC kernels (the funky 8 digit hex string on the end of the kernel version)

-apply the driver diff patch to the kernel source (earlier in the thread)

-do a make modules using the cross compile toolchain for the arm architecture e.g.

make ARCH=arm CROSS_COMPILE=arm-none-eabi modules

-copy the driver module from the computer to the phone (in this case the built module is found at /drivers/net/wireless/bcm4329/bcm4329.ko in the kernel source tree)

There's a few pitfalls you might come across, such as missing libraries on a fresh linux install (ncurses for menuconfig etc), or even missing utilities (make, gcc, ld, etc), but again you can google to find out how to install those on your flavour of linux. :)
[Desire Android Development] bemymonkey:
So basically you need to compile a complete Android (or just the kernel?) from the two-line-patched source code and then pull out the driver file for replacing the one in your ROM?

Sounds like a whole lot of wasted CPU cycles, lol...

If they upgrade OpenDesire and you're unreachable, I'll take another look at it and try to compile myself... or maybe if I'm just bored :D

Thanks for the quick how-to :)
[Desire Android Development] Myshkinbob:
It just makes the modules, it doesn't compile the whole kernel (for that you use just make, or make zimage), takes typically less than a minute for just the modules alone.

No problem btw. I'd suggest you give it a try if only to learn how it works, since it only helps the community to have one more person capable of compiling things. :)
[Desire Android Development] bemymonkey:
Aha! Now that sounds more like it. :)

I usually get the feeling I'm more or less the only one who's a complete Linux noob on here. Isn't compiling kernels and stuff day-to-day normalcy for you Linux guys? :D
[Desire Android Development] Myshkinbob:
I don't know about that, if anything i suspect the vast majority of the forum users are just end users for the roms and rooting guides. That's no bad thing per-se, i mean you don't need to know how to make something to use it, after all.

I wouldn't say development is restricted to linux guys either, i have a little experience, but i haven't ran it for a server or desktop system in years. For this android stuff i just installed a virtual machine on my windows desktop (virtualbox) and installed linux on that.

If anything it's never very clear how roms or root methods or kernel drivers have been created, so that's the main barrier for people to get involved in the development side of things. I think it can only promote a healthy community to share how things have been created, not only how to use them, since then we have more people contributing and actively working on whatever cool things we might want on our phones. :)
[Desire Android Development] iscaela:
Can you add the original diff against incrediblec-2.6.32.15-gb7b01d1 to the OP? Looks like dhd_set_suspend moved to drivers/net/wireless/bcm4329/dhd_cdc.c there.

I'm considering writing a module that patches the running bcm4329 driver (like my undervolt module does to the voltage regulator code) so you don't have to replace the existing bcm4329.ko.
[Desire Android Development] bemymonkey:
= appliable to any kernel? :)
[Desire Android Development] ebekerman:
Did you mean that a patch exists for the MAC addresses that don't begin with 00?

If yes, please point me to the patch.
[Desire Android Development] mattiadj:
I resolved the problem changing the value of beacon intervall to 20 from 40 in router setting.but what is this value???with this value my Wii can't connect to internet :-(

sent from my Nokia 3300
[Desire Android Development] bemymonkey:
LOL. No idea :confused:
[Desire Android Development] mattiadj:
LOL!!!! I don't understand why now work!!!:-)

sent from my Nokia 3300
[Desire Android Development] bemymonkey:
Don't know if I'd trust the source though, as they don't even seem to know how long a ms is... (according to that paragraph there's 100ms in a second).
[Desire Android Development] mattiadj:
I found the same article!

So have logic but if leave blank the value, what happen???

Edit....I must set the value and the minimum is 20

sent from my Nokia 3300
[Desire Android Development] Ireas:
Any solution for the 2.6.34.5 kernel? (cyanogen)
[Desire Android Development] Myshkinbob:
I didn't actually make a diff for the HTC driver, just edited it and compiled. I'll make one now. :)

The HTC kernel doesn't use the stock bcm4329 btw, instead it uses the bcm4329_204 source, which is basically the stock bcm4329 with some heavy modification to the sleep functions and a few other changes. In the HTC driver dhd_set_suspend is defined in dhd_cdc.c like you say, but i haven't looked through the code to check it's actually used by the HTC driver (edit: been a few weeks since i'd looked at it, seems it's modified to call the function i mention below, rather than directly set the PM mode as in the stock driver.)

The reason i say that is the HTC driver instead appears to use dhdhtc_update_wifi_power_mode defined in the same file when the phone enters suspend. At least i'm sure that's where it calls dhdcdc_set_ioctl with WM_SET_PM to set the current power mode when the phone is entering and leaving standby.

Anyhow i'll just make that diff and edit this post to attach it. :)

If you go to About Phone and check the exact kernel name i can make a version for it, until iscaela gets his patch module going.
[Desire Android Development] iscaela:
That is the idea, but problem with Linux kernel modules is the "vermagic" string embedded in them is required to match the running kernel version, so right now I actually have to edit the same binary to produce the different "versions" with otherwise identical contents.

I personally feel a bit horrified by any runtime patching approach including my own, but the intent is that it can continue to work in the face of future updates to the software it's patching, as long as the bits it needs haven't changed substantially.
[Desire Android Development] almz:
Hi, this is the kernel name in CM6 Desire. Thanks a lot.

dropbox.com/gallery/11006401/1/Desire?h=fc3ee3#/

Sorry for the link. I can't post a proper link cause this is my first post :)
[Desire Android Development] Myshkinbob:
np, here you go. :)