yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] almz:
Thanks again but unfortunately I can't seem to scan any wifi network after installing the patch. I rebooted 3x and FC everytime I try to turn on wifi. Well I guess I'll try Opendesire later.
[Desire Android Development] Myshkinbob:
I'll double check i zipped up the right version, seems strange it FC'd.
[Desire Android Development] iscaela:
As promised, I've created a preliminary kernel module (uninmaginatively named bcm4329_pmfast) that should allow you to use "fast" power mode for WiFi in standby without replacing the existing WiFi driver. You can revert to the default PM_MAX by unloading the module.

I've attached it as an update.zip for the 2.6.32.15-gf9c0527 kernel, the vermagic string can be edited for others. Source is also provided, of course.

This is the init script in the update.zip:

#!/system/bin/sh
#
# Load bcm4329_pmfast for htc-kernel
# Load bcm4329 first
insmod /system/lib/modules/bcm4329.ko
addr=`awk '$3 == "dhdhtc_update_wifi_power_mode" { print "0x"$1; }' \
/proc/kallsyms`
if [ -n "$addr" ]; then
insmod /system/lib/modules/bcm4329_pmfast.ko \
"dhdhtc_update_wifi_power_mode_addr=$addr"
if [ $? -eq 0 ]; then
echo "+++ Fast WiFi power mode on standby enabled"
exit 0
fi
fi
echo "+++ Fast WiFi power mode on standby could not be enabled"
[Desire Android Development] bemymonkey:
Hi Iscaela,

Looks very interesting. Any chance of a 2.6.34.5 version? :)

Battery life with Myshkinbob's driver continues to be fantastic. Lost 8 percent over night with Sipdroid, Locale and imo.im (IM client) running in the background. FANTASTIC!
[Desire Android Development] iscaela:
It should work with 2.6.34.5 with just a version string change, can you give me the full version number?
[Desire Android Development] bemymonkey:
Does this help? http://www.multiupload.com/B9CHRCNXC9

:)
[Desire Android Development] mattiadj:
I have made a lot of test with my router settings and WiFi sleep sometimes remain :-( I think if the screen is close for a lot of time.for example after 5 minutes ok, after 10 ok again after 25 download tells me that it is waiting for data connection!!!:-(

sent from my Nokia 3300
[Desire Android Development] mattiadj:
I have made a lot of test with my router settings and WiFi sleep sometimes remain :-( I think if the screen is close for a lot of time.for example after 5 minutes ok, after 10 ok again after 25 download tells me that it is waiting for data connection!!!:-(

Of course with screen on or connect to charger all works!help...

sent from my Nokia 3300
[Desire Android Development] lubo777:
I had the same strange problems with my WiFi ...

with my home router (Asus router with openwrt OS) everything is OK, but at work (linksys AP) ... after 5-10 min my SIPDroid can't register anymore and no Internet ...

I have to switch the wifi OFF and back ON in order to have Internet access.

I'm using now Wi-Fi Keep Alive with all 4 workarounds activated and have NO more problems with WiFi when my phone is in sleep mode.
[Desire Android Development] albino71:
Is the modified zip (for OpenDesire/CM) good for the new kernel (with OJ fix)??
[Desire Android Development] ghmail2:
is this still good for OD 4.0.10?
[Desire Android Development] bemymonkey:
That's a good question. I'll definitely install the alternative driver Myshkinbob made on 4.0.10 tomorrow and try it out, but a confirmation that it'll probably work (or rather that the effort isn't quite futile :p) would be great :D

The kernel version didn't change at least (still 2.6.34.5)...

Just did another cat config.gz for 4.0.10: www.narcotic-symphony.de/simon/config.gz

Can't install the old 4.0.4 driver to test yet though, because I'm not at my PC... :(
[Desire Android Development] ghmail2:
I had a wifi error after phone goes to sleep, make a another try to see what is going on,but after reboot it goes well
[Desire Android Development] ghmail2:
this is my bad,forgott to change wifi sleep policy:p

you need set this to never to use this patch

everything is fine with this patch on OD 4.0.10
[Desire Android Development] bemymonkey:
Yay, still working here on 4.0.10 as well :)
[Desire Android Development] deaglun:
Thats great news. I'll go ahead and installed OD 4.0.10 today.

Myshkinbob - Thank you very much for this. It's so good to be able to safely leave my downloads when my screen turns off, and to be able to use twonky and other media servers on my phone.

Thanks also for your tutorial. When I get a bit of time I intend to sit down with my linux box and give it a crack. I always love to learn.
[Desire Android Development] Sebby:
where can i find this patch for the desire 4.0.10

how do i install it is there a zip file to install via recovery

please help my wifi disconnect after 15 min everytime i turn off screen
[Desire Android Development] bemymonkey:
This will most likely NOT help you if your WiFi is disconnecting. It only helps if your WiFi stays connected, but drops packets and generally has unacceptable performance when the screen is off.

If you want to try it anyway, there's a zip file for installation via recovery around page 3...
[Desire Android Development] bemymonkey:
Hi Myshkinbob!

Any chance of a new module? OpenDesire just got a kernel upgrade to v2.6.35.4

:)

If you need the config.gz again, it'll be here in about 3 minutes :D

Thanks in advance!

-edit- Here it is: http://www.multiupload.com/68KPJ1VYV5

Haven't gotten around to setting up Virtualbox yet, otherwise I'd try building the thing myself ;)
[Desire Android Development] needto:
Hi,

I have tried your CM6 and cyanogen patches but havnt gotten one to work yet. Can you build a driver based off my kernel?

<http> drop <dot> io/nig4psc (Im a new user and cant post outside links, my config.gz is attached)

thanks!

the kernel version in the about phone section (on my nexus one at&t) is:

2.6.34.5-cyanogenmod shade@toxygene # 1
[Desire Android Development] bemymonkey:
Looks like we need the same version ;)
[Desire Android Development] needto:
actually our config.gz are different(check out the diff below).. so maybe different versions? are there some directions for compiling this anywhere? I have some debian machines kicking around... I could have a go at it over the weekend.

$ diff config config\ \(1\)
4c4
< # Fri Aug 27 23:26:26 2010
---
> # Wed Sep 8 18:31:25 2010
36c36
< CONFIG_LOCALVERSION="-cyanogenmod"
---
> CONFIG_LOCALVERSION="-OpenDesire"
268c268,269
< CONFIG_MACH_MAHIMAHI=y
---
> # CONFIG_MACH_MAHIMAHI is not set
> CONFIG_MACH_BRAVO=y
1057a1059,1063
> CONFIG_LIGHTSENSOR_MICROP=y
> CONFIG_INPUT_OPTICALJOYSTICK=y
> CONFIG_OPTICALJOYSTICK_CRUCIAL=y
> CONFIG_OPTICALJOYSTICK_CRUCIAL_uP=y
> # CONFIG_OPTICALJOYSTICK_CRUCIAL_SPI is not set
1135c1141
< CONFIG_VP_A1026=y
---
> # CONFIG_VP_A1026 is not set
1565c1571
< CONFIG_EXT4_FS=y
---
> CONFIG_EXT4_FS=m
1571c1577
< CONFIG_JBD2=y
---
> CONFIG_JBD2=m
1573c1579
< CONFIG_FS_MBCACHE=y
---
> CONFIG_FS_MBCACHE=m
[Desire Android Development] bemymonkey:
They're different, but AFAIK, the version number is what's important...
[Desire Android Development] bemymonkey:
Hmmm, just set up an Ubuntu virtual machine, and I can't even find the right git to clone :(

OpenDesire is supposedly compiled from AOSP, so do I need to use that git? Or is there a specific one? Or should I use CM6.0.1 since OD is based on that? :confused:

-edit- Never mind that, I can't even get freakin "git" to install.

"sudo apt-get install git-core" just keeps timing out when trying to contact the servers... :|

-edit- Hmmm, gotten a bit farther.

1. Downloaded the OD source right off of the OD thread as an archive, extracted

2. copied .config to the kernel root folder, did a make menuconfig which worked (just exited the menu it then showed... hope that was right?)

3. Left out "edit the localversion append for HTC kernels (the funky 8 digit hex string on the end of the kernel version)" since I don't have an HTC kernel (?)

4. applied the driver diff, apparently successfully

5. Ran make ARCH=arm CROSS_COMPILE=arm-none-eabi modules

Now I am presented a list of diffreent ARM chips to compile for. If I enter 37 (Qualcomm MSM), it automatically selects MSM7x00A - but isn't that the old 528MHz chip used in the Dream/Magic? I need to select QSD8X50 (Snapdragon), but it won't let me - automatically selects the first option already... :| why?

-edit- Hmmm, I think the problem is that it's not recognizing "arm-none-eabi":

make: arm-none-eabigcc: Command not found

Any ideas?

Ah crap, looks like I didn't set the PATH properly. And now I seem to have killed my whole terminal: All commands say command not found because I seem to have screwed up the path variable... :(
[Desire Android Development] Myshkinbob:
You can close and reopen the terminal window to fix your broken path. :)

When you export the path, you're changing the path variable, but since you don't want to lose the existing path to your linux install's binaries, you append it, with the colon (each directory you want included in your path is seperated with a colon). So the below is saying set my path to my current path ($PATH) plus this new path...

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

In my specific lazily thrown together install, i decompressed the toolchain in my Downloads folder so my export is...

export PATH=$PATH:/home/mysh/Downloads/toolchain/arm-2010q1/bin/

By the way, the kernel version and localversion both need to match, so a module for 2.6.34.5-OpenDesire won't work with a 2.6.34.5-cyanogenmod kernel. :)

Since you got prompted to choose a cpu type i don't think you copied the .config correctly. With config.gz you need to decompress it (gunzip) to leave with you a config file, you then copy it to your kernel source root dir as .config, eg.

cp config /path/to/kernel/source/.config

it's important you copy it as .config and not plain config.

Lastly, the command not found for arm-none-eabigcc because you missed the trailing hyphen from the CROSS_COMPILE argument, it should be arm-none-eabi- (as in it should reflect the prefix on all the files found in the toolchain's /bin directory) :)

Could you install the cyanogen module and attempt to enable wifi, then in adb run..

dmesg > /sdcard/dmesg.txt

and upload the dmesg.txt somewhere, thanks. I'm not sure why the module fails to insert but the dmesg output should reveal it.
[Desire Android Development] bemymonkey:
Hey, you're back! Hooray, we're saved! ;) :D

I'm still trying to get everything to work... had to go shopping with the girlfriend so I'm still sort of stuck :D. Good to know that you can reset the PATH variable by closing the terminal though. I went back to a Virtualbox snapshot from right after Ubuntu install, so it took ages to get back to where I am :(

Let's see if it works this time. :p

Setting the path worked fine though :D

-edit- crap, didn't realize I needed to decompress the bin file the toolchain was in... no wonder it didn't work...

-edit2- How the hell do I extract a .bin file? :p. Guess I should've downloaded teh tar.bz2 :(
[Desire Android Development] needto:
haha.. ok, I have had broken wifi the last day.. Ill try and get the cyanogen driver re-installed

-cheers
[Desire Android Development] Myshkinbob:
Yup download the toolchain as .tar.bz2, i'd assume the .bin version is an executable self-extracting version.

I realised you're getting prompted for a cpu type when you do a make menuconfig since i might've not mentioned you need to use the ARCH and CROSS_COMPILE arguments for that too, not just when doing make modules.

Could you upload the 2.6.35.4 config.gz from your phone? the last one you posted is still 2.6.34.5 and i don't want to guess what's been used in the OD kernel. :)
[Desire Android Development] Myshkinbob:
Sorry i might've not have been too clear there, i mean the cyanogenmod module i compiled that you said isn't working. :)
[Desire Android Development] Myshkinbob:
I had a look at the new kernel features and took a guess at what OD might use, i don't think any of it directly affects the wifi driver anyhow. 2.6.35.4 version is attached.

I'll go back and edit the OP later today and rename the files to exact kernel versions like the attached file has, since the naming has gotten a little confusing after so many different versions are in the thread.
[Desire Android Development] needto:
ok.. so got my wifi working with the bcm4329.ko file from :

mirror.kanged.net/cm/stable/nexus/update-cm-6.0.0-N1-signed.zip

here is my dmesg output:

pastebin.ca/1938295

please let me know if there is anything else I should grab, thanks a ton for your help.
[Desire Android Development] Myshkinbob:
Read up a couple of posts, i meant the cyanogenmod module i compiled (post #82), not the official one. Sorry for the confusion. :)
[Desire Android Development] needto:
ok, heres the dmesg using the driver from post #82:

pastebin.ca/1938314

when under wifi settings, When I check wifi to turn it on.. it just says scanning... and then times out and unchecks itself
[Desire Android Development] Myshkinbob:
I need to pay better attention when reading posts, this is on a nexus one i assume? (the log mentions mahimahi).

My module was built for the bravo (desire) board, so i think that's the problem. I'll compile a version for the n1 if you can upload the config.gz from your phone (using the command "cat /proc/config.gz > /sdcard/config.gz" without the quotes).
[Desire Android Development] needto:
yep for a nexus one at&t(passion-a)

:D YOU ROCK!

*giddy*
[Desire Android Development] needto:
sorry missed your request in my last post

here is my config.gz:

drop.io/dw4enqu
[Desire Android Development] ghiki:
Hi! Myshkinbob, can you adapt this module for Kernel 2.6.32.15-gd96f2c0??
[Desire Android Development] bemymonkey:
Hey, thanks :)

I'll post a proper config file as soon as I've got the latest OD on my phone again - went back to 4.0.10 because 4.0.15 was annoying me and I needed my phone for use out and about ;)...

Can't wait to try out the new module though... should be good for the next few (bug-free) OD versions anyway, and I'm pretty close to being able to build one myself, I think (just need to actually make the modules), but my girlfriend dragged me off again for a banana split and an espresso :D

Thanks again for all your help, I feel I've learned a lot today... considering I was a complete Linux noob until this morning :eek:
[Desire Android Development] Myshkinbob:
Try the attached file. :)

If anyone wants to try it on 2.6.34.5-cyanogenmod for the desire, it ought to work for that too.

No problem, let me know when you get chance to try the new module (it should be fine). :)
[Desire Android Development] Myshkinbob:
See attached, only use the _N_ version if you need wireless-n support. :)
[Desire Android Development] needto:
ahh no luck.. it allows me to turn on the interface.. then fails after a few moments of scanning

I wonder if it has todo with these lines in my dmesg:

<4>[ 76.898193] dhd_bus_rxctl: resumed on timeout
<4>[ 76.898986] dhdsdio_readshared: sdpcm_shared version 2 in dhd is different than sdpcm_shared version 1 in dongle
<4>[ 79.901092] dhd_bus_rxctl: resumed on timeout
<4>[ 79.902191] dhdsdio_readshared: sdpcm_shared version 2 in dhd is different than sdpcm_shared version 1 in dongle
<4>[ 79.902832] dhdsdio_probe: failed

heres my dmesg output

pastebin.ca/1938394
[Desire Android Development] bemymonkey:
Just installed, working fine so far :)
[Desire Android Development] Myshkinbob:
Hmm the patch doesn't alter the dhd code to change any versions, but i'll look at the rest of it to see if that's related. Incidentally, can you link the forum thread of the rom you're using? I built the module against 2.6.34.5 from the cyanogenmod kernel git, but perhaps your kernel is slightly different.

actually could you also post a dmesg after doing the following in adb shell...

rmmod bcm4329.ko
insmod /system/lib/modules/bcm4329.ko

thanks.
[Desire Android Development] needto:
ran those commands

# rmmod bcm4329.ko
rmmod: delete_module 'bcm4329' failed (errno 2)
# insmod /system/lib/modules/bcm4329.ko
#

heres the new dmesg:

pastebin.ca/1938408

thanks!
[Desire Android Development] Myshkinbob:
could you link the thread you got your rom from also? :)
[Desire Android Development] ghiki:
YUHUU!!! THANKS!THANKS!THANKS! Works good!
[Desire Android Development] needto:
this is the rom I am using

mirror.kanged.net/cm/stable/nexus/update-cm-6.0.0-N1-signed.zip

http://xdaforums.com/showthread.php?t=722798
[Desire Android Development] needto:
tested with bcm4329_nexus1test_2.6.34.5-cyanogenmod.zip... same issue: I can turn on wifi.. it tries to scan then fails after a moment and turns off wifi.

heres the dmesg:

pastebin.ca/1938626
[Desire Android Development] btuser001:
Hi Myshkinbob, can you make your module work for Kernel 2.6.32.15-g6a358a9??

Thanks a lot :D
[Desire Android Development] bemymonkey:
I think I got it working!

Aaaaah, I found the problem.

I was following this too strictly:

I did a make menuconfig every time, which, each time, would overwrite my freshly copied .config fle :eek:

That's why it kept asking me for CPU types.

Now it's compiling modules, but just gave me an error when it got to the wireless driver:

Looks like the patch didn't apply properly?

The CM6 2.6.35.4 version from a few pages back is showing a bit of buggyness too on OpenDesire 4.0.15, btw. Disconnecting be itself every now and then... Here's the 4.0.15 config.gz in case you wanted to check out what's causing it:

http://www.multiupload.com/LNHLJ8VC6Q
[Desire Android Development] bemymonkey:
OK, extracted a fresh source package and reapplied the patch... and guess what...? I'm now running a wireless module I compiled myself :eek:

Thanks so much Myshkinbob, never would've worked without all your help :)

Here's a condensed tutorial for those who don't want to search the whole thread for the individual steps (they're a bit spread out). If you notice any errors, please correct me, might have forgotten something or just had a typo or two...

Condensed tutorial for CM6-based stuff:

1. Download toolchain from here: http://www.codesourcery.com/sgpp/lite/arm/portal/release1294

2. Set toolchain as part of path variable:

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

3. Download kernel source for your ROM, extract

4. Use

cat /proc/config.gz > /sdcard/config.gz

at an ADB Shell to get the config.gz file from your phone (kernel config, compressed as a .gz)

5. Extract the new config.gz file and copy the config file to the root of the extracted kernel

6. Rename config to .config

7. Download the diff file from here: http://xdaforums.com/showpost.php?p=8028615&postcount=18

8. Extract it and copy the .diff file to <kernel source root dir>/drivers/net/wireless/

9. Open a terminal in that folder and patch the source for the bcm4329.ko file with

patch -p0 < bcm4329_pmfast.diff

10. Compile your modules with:

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

from the source root directory (where you copied the config file)

11. Copy bcm4329.ko from <kernel source root dir>/drivers/net/wireless/bcm4329/ to your phone to replace the old one in /system/lib/modules/

Done. :)

Here is the bcm4329.ko file compiled from OpenDesire 4.0.15's source, btw.: http://www.multiupload.com/PBNRCAISLB
[Desire Android Development] Myshkinbob:
nice to see you got it working there bemymonkey. :)

Regarding the nexus one CM6 module, i had a look and the best i can tell is there's a mismatch between the kernel driver and the platform driver / firmware. Opendesire's bcm4329 driver is identical to the CM6 one so i'm a little stumped why the stock CM6 module fails. I am a bit new to android kernels though.

I'll post a version of the driver for the HTC 2.6.32.15-g6a358a9 kernel tomorrow. :)
[Desire Android Development] bemymonkey:
Hi Bob,

I'm starting to get the feeling that the wireless driver wasn't at fault at all... OpenDesire 4.0.15 is showing all sorts of weirdness, even with the default driver (tested all day yesterday).

Back to 4.0.10 with the driver you originally compiled and all is fine ;)
[Desire Android Development] Myshkinbob:
Fair enough about the OD module. :)

I've just updated the first post with the module for HTC's 2.6.32.15-g6a358a9 kernel.
[Desire Android Development] btuser001:
Thank you so much for the update :D if its not too much trouble.. could you make one with wireless N enabled?
[Desire Android Development] bemymonkey:
Looks like WiFi Fixer was causing my weirdness - forgot I had it installed. Back to 4.0.15 with the recompiled driver for me, and it's running well! :)
[Desire Android Development] Myshkinbob:
Ah yeah WiFi fixed was a little buggy for me, hence the new kernel module. :)

I'll put up an N mode version of the module for the latest htc kernel when I get home later, np at all.
[Desire Android Development] Myshkinbob:
Mode N version for 2.6.32.15-g6a358a9 attached to the first post. :)
[Desire Android Development] btuser001:
Thank you once again, much appreciated myshkinbob!
[Desire Android Development] mattiadj:
It's possible to have a WiFi n file for the kernel in the attached image?

Thanks

sent from the future
[Desire Android Development] Myshkinbob:
See the first post attachments, the 6th attachment is mode N for that kernel. :)

http://xdaforums.com/attachment.php?attachmentid=399545&d=1284241280
[Desire Android Development] nachod0g:
Hey Myshkinbob. Any chance you could compile a bcm4329.ko for Nexus One FRF91 stock/MCR21 with these changes? Kernel version is 2.6.32.9-27227-g3c98b0d.

As this kernel is old it's also missing the fix for mac addresses not beginning with 00 dropping all packets in sleep mode. It would be great if you could include that fix as well. Details here and here.

Thanks heaps!
[Desire Android Development] bemymonkey:
Hey Myshkinbob!

Trying to compile for CM6.0.14 (2.6.34.5), but I keep geting the error:

"make: *** [modules] Error 1

simon@simon-ubuntu:~/aosp/cmsource/kernel601$ make ARCH=arm CROSS_COMPILE=arm-none-eabi- modules

scripts/kconfig/conf -s arch/arm/Kconfig

drivers/staging/Kconfig:82: can't open file "drivers/staging/frontier/Kconfig"

make[2]: *** [silentoldconfig] Error 1

make[1]: *** [silentoldconfig] Error 2

The present kernel configuration has modules disabled.

Type 'make config' and enable loadable module support.

Then build a kernel with module support enabled.

make: *** [modules] Error 1"

How do I enable loadable module support without overwriting the whole .config file (which I extracted from the running ROM)?
[Desire Android Development] wired69:
Hi Myshkinbob,

I just wanted to say a big thank you for this fix! I have been sufferring with these issues for a while now since switching to the OpenDesire ROM and this has fixed it perfectly.

I can confirm that bcm4329_nofullsleep_2.6.34.5-OpenDesire.zip works with OpenDesire v4.0.23.

Cheers!
[Desire Android Development] soCram:
Hi Myshkinbob,

bcm4329_nofullsleep_N_2.6.32.15-gd96f2c0 is working fine with LeeDroid 2.1. Thanks for your nice work!
[Desire Android Development] bemymonkey:
Hey Bob,

What's the most likely reason a newly compiled WiFi module would just refuse to work? It compiles without error messages using the .config extracted from the running ROM, but when I move the bcm4329.ko file to /system/lib/modules, WiFi refuses to connect at all...

Any idea what could or would cause that? Is it possible that I'm using the wrong source code? Should be the right batch, but I'm at as to what else could be going wrong...

This is for CyanogenMod 6.0.1.4 (patched 6.0.1, kernel 2.6.34.5, config here: http://www.multiupload.com/FW6MLT495X)... I just can't get the damned thing to work properly :(

Dmesg: http://pastebin.com/ubppUvA4

The 2.6.34.5 module you compiled doesn't work either...

I'd be very thankful for a pointer in the right direction if you have time ;)
[Desire Android Development] lubo777:
hmm, it's not working on OpenDesire v 4.0.25 (2.6.34.5-vorkKernel)

# insmod /system/lib/modules/bcm4329.ko

insmod: init_module '/system/lib/modules/bcm4329.ko' failed (Exec format error)

#dmesg

...

<3>[ 203.176269] bcm4329: version magic '2.6.34.5-OpenDesire preempt mod_unload ARMv7 ' should be '2.6.34.5-vorkKernel preempt mod_unload ARMv7 '

I'll have to recompile the driver with CONFIG_LOCALVERSION="-vorkKernel" :)