[Kernelpatch][25.03.2011] Bluetooth battery drain fix

Search This thread

mponte

Senior Member
May 15, 2008
210
38
A Coruña
Testing results in Typhoon v2.8.0 with BT patch applied:

Wifi off | BT off | GPS off | Data off 5-7-5 mA
Wifi off | BT on | GPS off | Data off 10-11-10 mA
Wifi on | BT on | GPS off | Data off 13-19-13 mA
Wifi on | BT on | GPS off | Data on 18-13-12 mA
Wifi on | BT on | GPS on | Data on 13-13-18 mA

all results in standby. No BT device connected.

Tests for 6mins each option, with 2mins history rate interval (3 times), using Battery Monitor Widget. 2 mins interval between each other (after unlock screen and read results).
 
  • Like
Reactions: tomj777

karendar

Senior Member
Aug 9, 2010
2,214
883
Montreal
Create a folder including unyaffs, mkyaffs2image, unpack.sh, pack.sh, and boot.img (Get boot.img from cLK thread).

1. unpack.sh
Code:
if [ -f boot.img ]; then
  rm -rf boot
  mkdir boot
  cd boot
  ../unyaffs ../boot.img

  cd ..
  rm -rf initrd
  mkdir initrd
  cd initrd
  gzip -dc ../boot/initrd.gz | cpio -i
else
  echo cannot find boot.img
fi

2. replace boot/zImage

3. pack.sh
Code:
cd initrd
find . | cpio -o -H newc | gzip -9 > ../boot/initrd.gz
cd ..
mkyaffs2image boot/ boot.img
Then you will get a modified boot.img.

Whenever I try and unyaffs, I get "broken image file". Any idea why? Tried it on multiple boot.img in ubuntu, windows, etc.
 

trilu

Senior Member
Apr 17, 2008
68
108
munich
Testing results in Typhoon v2.8.0 with BT patch applied:

Wifi off | BT off | GPS off | Data off 5-7-5 mA
Wifi off | BT on | GPS off | Data off 10-11-10 mA
Wifi on | BT on | GPS off | Data off 13-19-13 mA
Wifi on | BT on | GPS off | Data on 18-13-12 mA
Wifi on | BT on | GPS on | Data on 13-13-18 mA

all results in standby. No BT device connected.

Tests for 6mins each option, with 2mins history rate interval (3 times), using Battery Monitor Widget. 2 mins interval between each other (after unlock screen and read results).

with editing init.rc and enabling the --enable_lpm i get 3 to 5ma with Data on, BT on, Wifi and GPS off
 
  • Like
Reactions: yashper

czacha234

Senior Member
Mar 15, 2010
286
64
Hamilton
After install this kernel, i cannot pair with my ad2p nokia bh-503 bluetooth headphone.

Hi,

I cant connect my BT headset to phone. It says is paired but not connected, when try to connect manually, its connecting and nothing happens. Dont know how to provide a logcat, sorry. Also tried unpair and pair it again, nothing. After applied this patch I get 9-15mA in standby, which is better result then before. Great work :D
 

buttami

Member
Dec 23, 2009
15
0
Hi,

I cant connect my BT headset to phone. It says is paired but not connected, when try to connect manually, its connecting and nothing happens. Dont know how to provide a logcat, sorry. Also tried unpair and pair it again, nothing. After applied this patch I get 9-15mA in standby, which is better result then before. Great work :D

+1 some here
 

trilu

Senior Member
Apr 17, 2008
68
108
munich
I have added some possible missing code from board-mahimahi.c and is compiling a new kernel.

if you want or need i can upload you the whole kerneltree....
i've used as base the board_bravo files.

for all who having problems with pairing - without a logcat dump it is like reading a crystall ball.
you get a logcat dump in this way:
adb logcat > logcat.txt
and after 1 or 2 seconds press crtl + c
 
Last edited:

tytung

Senior Member
Jun 21, 2010
3,574
15,005
sites.google.com
Hi,

I cant connect my BT headset to phone. It says is paired but not connected, when try to connect manually, its connecting and nothing happens. Dont know how to provide a logcat, sorry. Also tried unpair and pair it again, nothing. After applied this patch I get 9-15mA in standby, which is better result then before. Great work :D

kernel_tytung_r8.2_beta_update.zip
http://www.multiupload.com/FEQVJQBYZR

Based on Trilu's patch
Removed some debug and unnecessary code, and added some possible missing code
 

Top Liked Posts

  • There are no posts matching your filters.
  • 74
    Hi all,

    i think i have fixed the ugly bluetooth battery drain bug.
    It works for me since yesterday evening. Battery drain is between 2ma and 5ma with GSM and BT enabled. Also the headset in my car works very well.

    Base for my work was tytungs kernel git - i think it was v8, but not sure...
    In this post you will find a patch file, the compiled kernel and the source files i have modified. I'm a absolutly beginner with compiling linux, so i am not sure that the patch file will work, diff has a realy big manual :p

    http://gitorious.org/~tytung/linux-on-wince-htc/tytungs-hastarins-linux_on_wince_htc

    Also i am not sure how this kernel will work with Sense roms, because Sense use btld which has the power saving features in the binary and not in the kernel.

    Last but not least i will thank Charansingh for the work he has done on the BT problem and tytung for his kernel base.

    If you like to test the kernel, please take also my modules, because i get with the precompiled files from tytung a version magic error.
    Your feedback is highly appreciated.

    Best regards
    trilu


    In this Post you will find the zip file for updating magldr
    http://xdaforums.com/showpost.php?p=12374073&postcount=7

    Here you find the zip file for updating clk
    http://xdaforums.com/showpost.php?p=12378215&postcount=34



    Just found another point to save 3 to 5ma more
    I installed Typhoons CM7 Image and was wondering why me drain in standby was 7 to 10ma with BT enabled.
    Yesterday with Charansingh's nightly it was arround 3 to 5ma.

    The solution is to set the low power flag on brcm_patchram_plus in init.rc
    service hciattach /system/bin/brcm_patchram_plus --enable_lpm --enable_hci \
    --baudrate 3000000 --patchram /etc/firmware/bcm4329.hcd /dev/ttyHS0

    Also seen that in a lot of images hciattach service is set in init.rc and init.htcleo.rc
    In my experience the hciattach service should start only in init.rc, before bluetoothd service.
    10
    can anybody build a boot.img to flash via cwm?

    here you are :) magldr version; for cLK use fastboot flash:raw command. (you'll need your own initrd.gz or the one delivered with build).
    6
    I have prepared a update for clk systems.
    Enclosed is tytungs latest kernel, and some scripts i have found for ppp.
    Also the update deletes all pairing settings for BT.
    Tested with typhoons CM7 Image only.

    Please do a complete backup before testing!!!!!!
    4
    I've tested with Charansingh CM7 nightly - but it should work with every rom which uses tytungs kernel v8 and is Gingerbread.
    As mentioned, feedback for Froyo and Sense is welcome...
    4
    Hi,

    I cant connect my BT headset to phone. It says is paired but not connected, when try to connect manually, its connecting and nothing happens. Dont know how to provide a logcat, sorry. Also tried unpair and pair it again, nothing. After applied this patch I get 9-15mA in standby, which is better result then before. Great work :D

    kernel_tytung_r8.2_beta_update.zip
    http://www.multiupload.com/FEQVJQBYZR

    Based on Trilu's patch
    Removed some debug and unnecessary code, and added some possible missing code