[V5][FIX][CM][OMNI][ALL AOSP]Bug Fix : After call battery drain in AOSP is fixed

Search This thread

RohanAJoshi

Senior Member
Mar 17, 2011
2,454
1,671
Pune
OnePlus 8 Pro
Samsung Galaxy S22 Plus
Hello fellow i9300 users.

As we know all, the most nasty bug after call battery drain which affected our device and most of smdk4x12 varients..
.
Details About bug :
On every AOSP build from android v4.0 / cm9, after making a call normally ie. without using headset or Bluetooth, we were getting heavy battery drain sleep, around ~1.5% / hr (depends upon your settings, for me it was 1% /hr ).
But without normal call we were getting fair drain like around 0.4% / hr (depends upon your settings, for me it was 0.2% /hr ).
Most of devs tried to fix this bug, but because of exynoss, many talented devs left maintaining this devices..
So, we were lost, I myself, A big fan AOSP roms, turned back to Stock TW rom because of only this bug.
In meantime I was leaning self-compiling AOSP rom with help of @UtkarshGupta (Maintainer of Galaxy note 2 for Omnirom,).
After on he committed some audio hal updates to omni for n7100 and i9300..
in one of his commit I saw comment of @tdcfpp : javier Ferrer, He linked us to his own changes about audio hal..
So, I asked him test lib and he provided it.
In test we realized that this bug is fixed in his changes..
.
.
this bug is now fixed by Javier Ferrer, A silent developer who was working behind scene for our device.
his xda name is @tdcfpp.
so thank him as much as you can..
here is his change commit : https://github.com/javifo/android_d...mmit/65920ed03a8f87529f3d9f206ddfbcdb350753e7
.
explanation of cause :

check this : http://review.cyanogenmod.org/#/c/61...dio/audio_hw.c

At line no. 526, in if clause, there is ril_set_call_clock_sync(&adev->ril, SOUND_CLOCK_START);
When starting IN_CALL, RIL clock settings were set, but weren't reset when leaving IN_CALL.

Source : Javier Ferrer : @tdcfpp
.
So All AOSP devs, make this change as soon as possible....

download and flash through recovery.

Update v5 :
1. Speaker volume lowered bit, now perfect matching values to stock Samsung rom
2. Other i/o also calibrated to stock samsung rom's values like earpiece, front mic, back mic, headset output etc..

Update V4 :
1. Fix headset lower mic gain/ muffed sound to other party while in call maintaining changes from https://gerrit.omnirom.org/#/c/6110/ this commit.
2. Other minor volume adjustments.
.
Update V3 :
1. https://gerrit.omnirom.org/#/c/6110/ patchset 6.

Update V2 :
1. compiled with https://gerrit.omnirom.org/#/c/6110/ commit.
2. Backup scrip added. no more re-flashing after every rom update


Results :
1. Before applying this patch, after call battery drain=1%/1hr.

95dr.png


2. After applying this patch, after call battery drain is 0.1%/1hr

40ju.png
 

Attachments

  • After_Call_Battery_Drain_Fix_For_i9300.zip
    156.4 KB · Views: 911
  • After_Call_Battery_Drain_Fix_For_i9300_V2.zip
    157.5 KB · Views: 515
  • After_Call_Battery_Drain_Fix_For_i9300_V3.zip
    157.5 KB · Views: 814
  • After_Call_Battery_Drain_Fix_For_i9300_V4.zip
    157.6 KB · Views: 368
  • After_Call_Battery_Drain_Fix_For_i9300_V5.zip
    157.5 KB · Views: 3,386
Last edited:

ThunderBolt_BR

Senior Member
Mar 10, 2012
408
194
Itabira - MG
Amazing!

Can we flash this on devices running older AOSP ROMS such as CM10.2?
Thanks a lot for the fix!

Now all that is left is the working HWC!

[]'s
 

ayoubij

Senior Member
Jan 28, 2013
2,565
751
Tripoli
This is amazing. So will this officially be added in new omni and cm roms?

Also second best news i heard today was i9300 will be getting official 4.4.2 update.

One device that was conspicuously missing was the Galaxy S3. The S3 was omitted due to ‘having low memory’ and thus deemed unsuitable for the 4.4.2 update. This decision would appear to been reversed, with the international version of the *S3, model GT-I9300, featuring on a leaked document (as shown below) outlining the 4.4.2 update schedule, with the Galaxy S4 and Note 3 beginning to receive the KitKat update in February, and the Galaxy S3 (GT-I9300), Note 2 (SM-N7100) and the Galaxy Grand 2 (SM-G7102) due to receive the update in April-May 2014.

Owners of the S3 will no doubt be hoping that the 4.4.2 update will be as smooth as possible, without any of the problems that the*4.3 JellyBean update*caused for many users. Some of the Android 4.4.2′s features that Samsung will bring to the Galaxy Devices include such things as album art being displayed on the lock-screen whilst playing music, as well as a camera short-cut on the bottom right of the lock screen to reduce the amount of touches needed to access the camera app. The user can also choose which SMS and launcher apps should become the default apps via the settings. Touchwiz gets a few visual tweaks, one of which includes the use of white icons in the translucent notification bar.

All in all, it appears that Samsung has backtracked on its earlier decision to omit the S3 from its KitKat update schedule.



Sent from my GT-I9300 using XDA Premium 4 mobile app
 

Girish_J

Senior Member
Dec 6, 2012
118
15
Can it be flashed over temasek v50? As its something between cm and omni.. [emoji28][emoji15]

Update:
It's working amazingly [emoji106][emoji106][emoji106][emoji106] tried for whole day with noticeable difference.. Cheers
 
Last edited:

RohanAJoshi

Senior Member
Mar 17, 2011
2,454
1,671
Pune
OnePlus 8 Pro
Samsung Galaxy S22 Plus
@RohanAJoshi so is this patch ready to merge in omnirom? :p

yes, ready, but @UtkarshGupta aligning whole audio HAL with this patch included, this will be merged after that.
thaks to him.


https://gerrit.omnirom.org/#/c/6110/


Can it be flashed over temasek v50? As its something between cm and omni.. [emoji28][emoji15]




yes, you can use this on any aosp rom..
cm, omni, aokp, carbonn, slim..


Amazing!

Can we flash this on devices running older AOSP ROMS such as CM10.2?
Thanks a lot for the fix!

Now all that is left is the working HWC!

[]'s

you can try..
 

sevenshorseman

Senior Member
Jul 31, 2012
854
211
Düsseldorf
So after flashing this my device runs very hot.?

Sent from my GT-I9300 using XDA Premium 4 mobile app

---------- Post added at 06:13 AM ---------- Previous post was at 05:59 AM ----------

So after flashing this my device runs very hot.?

Sent from my GT-I9300 using XDA Premium 4 mobile app

?I forgot to say, I am at latest NeatSlim with latest boeffla omni kernel

Sent from my GT-I9300 using XDA Premium 4 mobile app
 

Buckycasuals

Senior Member
Oct 1, 2013
702
294
Bolton
Hello fellow i9300 users.
As we know all, the most nasty bug after call battery drain which affected our device and most of smdk4x12 varients..
.
this bug is now fixed by Javier Ferrer, A silent developer who was working behind scene for our device.
his xda name is @tdcfpp.
so thank him as much as you can..
here is his change commit : https://github.com/javifo/android_d...mmit/65920ed03a8f87529f3d9f206ddfbcdb350753e7
.
So All AOSP devs, make this change as soon as possible....

download and flash through recovery.


Will this fix survive rom update?
 

temasek

Senior Member
Feb 2, 2010
23,624
85,271
Singapore
thanks..
between I was in touch with him, he said that today he gonna commit..
but did it already.. :D:D

I added to my own repo so its just a minute job to submit to cm gerrit. Anyway the authorship is retained so doesn't matter who submitted. It is his credit :)

Those who had tested the patch pls try to review it in cm gerrit so that can push thru.
 
  • Like
Reactions: tdcfpp

RohanAJoshi

Senior Member
Mar 17, 2011
2,454
1,671
Pune
OnePlus 8 Pro
Samsung Galaxy S22 Plus
I added to my own repo so its just a minute job to submit to cm gerrit. Anyway the authorship is retained so doesn't matter who submitted. It is his credit :)

Those who had tested the patch pls try to review it in cm gerrit so that can push thru.

hey @temasek, I have one request :
will you also push following changes from omni to CM ?
1. https://gerrit.omnirom.org/#/c/5834/
2. https://gerrit.omnirom.org/#/c/6110/

for 2. this patch is working good if you removes MicBias lines from every file..
It wold be great if you do this commit with above changes, also update patchset at omni..
I self-compiled this change and it's working fine.
 

mtxx1

Senior Member
Aug 4, 2012
599
156
i was wondering, since now this is fixed,

can you guys (awesome devs) explain in a non dev language, what caused the bug in the first place? and what was changed to fix it?

i'm sure many normal users are very curious as well.
thanks alot :)
 
  • Like
Reactions: tdcfpp

Top Liked Posts

  • There are no posts matching your filters.
  • 95
    Hello fellow i9300 users.

    As we know all, the most nasty bug after call battery drain which affected our device and most of smdk4x12 varients..
    .
    Details About bug :
    On every AOSP build from android v4.0 / cm9, after making a call normally ie. without using headset or Bluetooth, we were getting heavy battery drain sleep, around ~1.5% / hr (depends upon your settings, for me it was 1% /hr ).
    But without normal call we were getting fair drain like around 0.4% / hr (depends upon your settings, for me it was 0.2% /hr ).
    Most of devs tried to fix this bug, but because of exynoss, many talented devs left maintaining this devices..
    So, we were lost, I myself, A big fan AOSP roms, turned back to Stock TW rom because of only this bug.
    In meantime I was leaning self-compiling AOSP rom with help of @UtkarshGupta (Maintainer of Galaxy note 2 for Omnirom,).
    After on he committed some audio hal updates to omni for n7100 and i9300..
    in one of his commit I saw comment of @tdcfpp : javier Ferrer, He linked us to his own changes about audio hal..
    So, I asked him test lib and he provided it.
    In test we realized that this bug is fixed in his changes..
    .
    .
    this bug is now fixed by Javier Ferrer, A silent developer who was working behind scene for our device.
    his xda name is @tdcfpp.
    so thank him as much as you can..
    here is his change commit : https://github.com/javifo/android_d...mmit/65920ed03a8f87529f3d9f206ddfbcdb350753e7
    .
    explanation of cause :

    check this : http://review.cyanogenmod.org/#/c/61...dio/audio_hw.c

    At line no. 526, in if clause, there is ril_set_call_clock_sync(&adev->ril, SOUND_CLOCK_START);
    When starting IN_CALL, RIL clock settings were set, but weren't reset when leaving IN_CALL.

    Source : Javier Ferrer : @tdcfpp
    .
    So All AOSP devs, make this change as soon as possible....

    download and flash through recovery.

    Update v5 :
    1. Speaker volume lowered bit, now perfect matching values to stock Samsung rom
    2. Other i/o also calibrated to stock samsung rom's values like earpiece, front mic, back mic, headset output etc..

    Update V4 :
    1. Fix headset lower mic gain/ muffed sound to other party while in call maintaining changes from https://gerrit.omnirom.org/#/c/6110/ this commit.
    2. Other minor volume adjustments.
    .
    Update V3 :
    1. https://gerrit.omnirom.org/#/c/6110/ patchset 6.

    Update V2 :
    1. compiled with https://gerrit.omnirom.org/#/c/6110/ commit.
    2. Backup scrip added. no more re-flashing after every rom update


    Results :
    1. Before applying this patch, after call battery drain=1%/1hr.

    95dr.png


    2. After applying this patch, after call battery drain is 0.1%/1hr

    40ju.png
    27
    thanks..
    between I was in touch with him, he said that today he gonna commit..
    but did it already.. :D:D

    No problem. Authorship is respected.

    Sent from my D5503 using XDA Premium 4 mobile app
    11
    Update v5 :
    1. Speaker volume lowered bit, now perfect matching values to stock Samsung rom
    2. Other i/o also calibrated to stock samsung rom's values like earpiece, front mic, back mic, headset output etc..
    8
    Submitted to cm gerrit

    i9300: audio: fix battery drain after phone call
    http://review.cyanogenmod.org/#/c/61102/

    Author: Javier Ferrer

    Pls review it in cm gerrit.
    6
    I wouldn't post this until the noise suppression is removed.

    download attached file and flash, you will get mic working with fix.