yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Q&A, Help & Troubleshooting] AuronnBE:
Do you guys also have very slow charges and the phone getting hot?
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
Hi,

you have a lower battery usage than us, so either you are lucky or you might not have the same issue.

can you provide us with a BBS dump in flight mode so we can confirm you have the same issue ?

also, since when do you have this issue ? did you do anything in particular ?

Did you buy a new battery to confirm your battery is not defective ?
[Galaxy S II Q&A, Help & Troubleshooting] olyloh6696:
Hi,

How can you tell my drainage is not that bad? Do the stats show that? Mine still drains around 3% an hour too.

I posted at the start of the thread already. :D

I have 2 Anker batteries and 1 Stock Samsung one.

1 Anker faulty, but my other one is fine. I haven't used my Stock Samsung one since Christmas Day, but I'll charge it up and do a test.

How can I show the BBS dump? It doesn't work all the time for me, sometimes it just shows a blank screen.

Galaxy SII • Stock XWLSN • Dorimanx Kernel
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
But your last screenshot shows 1.3%/h :confused:

About BBS dump, read the instructions (carefully!) in BBS thread (in the first post(s)) and make sure that your phone is in airplane mode when you collect the dump data.
[Galaxy S II Q&A, Help & Troubleshooting] olyloh6696:
Galaxy SII • Stock XWLSN • Dorimanx Kernel
[Galaxy S II Q&A, Help & Troubleshooting] olyloh6696:
Ah, I see I got the hang of this. Those screenshots are wrong, ignore those please, the screen was on.

I'll leave my phone idle and carry out the test.

Cheers.

Galaxy SII • Stock XWLSN • Dorimanx Kernel
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Ok, this looks already different. But nevertheless, you have some pretty high wakelocks. Please read instructions in BBS thread on how to collect data for a valid dump and how to extract the dump file, only when we have the complete dump, we can evaluate your problem. Screenshots are not much use as they do not draw the complete picture.
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
Hi Pixel,

I tried something else yesterday, airplane mode without any sim card... but no changes...

I have opened a case with Samsung support, maybe they know about this issue...
[Galaxy S II Q&A, Help & Troubleshooting] sakindia123:
erm..just out of curiosity..what "revision" of i9100 u have?

i have I9100LKAINU
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
where do you find this ?
[Galaxy S II Q&A, Help & Troubleshooting] sakindia123:
it's printed on the box..somewhere near the barcode
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Some more input, somehow I triggered the AudioOut_2 wakelock again. What I did before setting a custom ref in BBS was calling another phone and while calling setting the call volume to 0. Dunno whether this was the trigger, but it could be related.

I guess especially the logcat is interesting, unfortunately I had to truncate it as it would have exceeded XDA's file size limitations :)
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
The dmesg looks quite weird to me.. I object the camera, which app do you use? It throws a lot of errors.

Try to force close it and see if the wl is gone.

Tapatalked from my Galaxy SII
[Galaxy S II Q&A, Help & Troubleshooting] olyloh6696:
Okay thanks for that, I will take a look.

Anyway, I left my phone idle for a bit, and from these screenshots can you diagnose my problem similar to yours at all?

Galaxy SII • Stock XWLSN • Dorimanx Kernel
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Using the standard camera app included in latest rootbox nightly, will check later which one it is exactly. May I ask what makes you think that it is related to camera?
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
I'm not sure I know enough to properly read you logcat and your dmesg...

what I wonder is why don't we always see AudioOut_2 wakelock in BBS ?

if it is the cause of our battery drain, it should show consistently in the dumps.
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Thanks for the in-depth analysis. Will try to follow it in detail now. Just the following first observations / comments:

- I did not plug in my phone to charger / USB throughout all the time

- It could be that logcat is disabled by Dori kernel when screen is off. At least I know such an option exists in Stweaks. Will check this. At 16:02, I activated my screen again.

- Regarding the question whether the AudioOut_2 wakelock should be there all the time if it is really the problem: Did you notice that in BBS dump the count for this wakelock is 0? This seems inconsistent to me. Just a shot in the blue: Do you know how a dual core is handled by BBS / kernel in general? What happens if one core is active and the other is sleeping? How is this reflected in BBS? Or could the wakelock count of 0 be due to the fact that the wakelock was already there before I set custom ref?
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
very interesting to learn how to read the dmesg, thanks :)

@pixel: have you thought of sending your phone to warranty ?
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
Hi,

not sure I still have the box... but I checked the back of the phone and I see:

I9100GSMH

or maybe A3LGTI9100 ?

is it what we were looking for or not really ? :/

anyway of seeing it from a software ?

what about you pixel ?
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Where on the back of your phone do you see this? I can't find this anywhere.
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
just behind the battery, there is a big white sticker with imei and serial number.
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Ah ok. Currently doing another experiment, thus cannot remove battery right now. Will check it later :)
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
which one ? which one ?? :)
[Galaxy S II Q&A, Help & Troubleshooting] olyloh6696:
OK sorry for posting here again.

But I just want to confirm now whether I have the same problem or not.

I left my phone idle on flight mode from 1:30 to 3:30pm. It dropped from 62% to 59%. Would you say this is normal behaviour?

Galaxy SII • Stock XWLSN • Dorimanx Kernel
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
ok, one last time :)

you never showed us your BBS dump file, only some screenshots.

install the latest version of BBS,

go to BBS settings and tick the root features (kernel and alarms wakelock if I remember correctly).

then do the following:

Before posting a dump please make sure that the references for kernel wakelocks and alarms were processed correctly. Reading a dump takes a few minutes and it would be great if you could not waste the time of whowver studies in, aiming at helping you.

Generally a dump "since unplugged" is better than "since charged". When you start your analysis make sure to follow following procedure:

- plug/unplug the charger

- leave the phone alone 1-4 hours

- save a dump and check that the chapters "Kernel wakelocks" and "alarms" (if you have root) are populated

- Post the dump as attachment

to save a dump, you need to go to (options/Share, SAVE the TXT, JSON, dmesg and logcat)
[Galaxy S II Q&A, Help & Troubleshooting] SPBoss:
Have you guys tried a full format? Using hawkers romnuke and also formatting internal SD.

Maybe someone can flash ICS to confirm it is a software problem and not a hardware defect. I don't have this issue myself but I will be glad to offer suggestions:)
[Galaxy S II Q&A, Help & Troubleshooting] sakindia123:
Flashed stock GB,ICS,jb via heimdall

..no change
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
Hi Sakindia,

you didn't show us your BBS dump :)

just curious to know if you have the exact same issue (because you have a I9100G and we have a I9100)
[Galaxy S II Q&A, Help & Troubleshooting] sakindia123:
I dont have an i9100G :D

i have an i9100
[Galaxy S II Q&A, Help & Troubleshooting] AuronnBE:
No improvements here yet I see.

I'm using my Galaxy S1 again, but normally my girlfriend would start using it this week.

Think I'm gonna have to sent it back to Samsung, I don't see any other option. Drain keeps persisting...
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
yes... I'm wondering if I should do it too...

but last time I sent my S2 to the repair center, they kept it for more than 6 weeks.... they fixed an emmc brick bug, and it came back with this battery drain issue... isn't it great ? :)
[Galaxy S II Q&A, Help & Troubleshooting] sakindia123:
Can anyone upload bootloader from a gingerbread rom for GT-i9100 odin flashable rom?

PS: anyone contacted someone like Entropy512 about this rather strange issue?he did a some good research during the "brick bug" era
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
If entropy responds you will get a solution, but don't bother him!

GB bootloader can be found in every three part Gb firmware.

Tapatalked from my Galaxy SII
[Galaxy S II Q&A, Help & Troubleshooting] sakindia123:
I flashed GB secondary boot loader with heimdall,and didnt loose a single % of battery in 90 min of flight mode!

Galaxys2 : Powered by Exynos4 Dual ™
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
somehow this is what I've expected. I hope this solves the issue for the others too, please post a brief description what steps you performed, Thx.

Congrats!

Tapatalked from my Galaxy SII
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
Hi,

Do you still confirm ? Did you fix it ?

Can you share the solution with us ?

Thanks
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
I flashed GB new bootloader and cannot confirm any better battery life.
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
btw, what does he mean by secondary?

Tapatalked from my Galaxy SII
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Ok, forgot to check "Phone Bootloader Update" checkbox in ODIN, retesting. Will report back tomorrow.

---------- Post added at 11:29 PM ---------- Previous post was at 11:28 PM ----------

I guess he means the "new" GB bootloader. AFAIK there is an old and a new one.
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
Thx mate good luck, cross my fingers!

Tapatalked from my Galaxy SII
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
and does it mean you need to keep the GB bootloader to fix the drain ?? or can you revert back to JB bootloader afterward and the drain is still fixed ??

I'm lost Oo
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Thanks :)

Let's first wait for the confirmation that this fixes our drain before we discuss what can be done afterwards. We still don't know whether sakindia123 suffers from the same issue we do and whether his drain is really fixed (1.5h might be too short to have some final results).
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
Assuming he is not kidding and he didn't unplug the charger at 90%...

We will know in the morning.

Tapatalked from my Galaxy SII
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
yes... in the end, we never saw its BBS dump (I don't like saying just "his dump").

Looking forward to knowing your results pixel, please go to bed early and report early :)

see you tomorrow ^^
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Ok, unfortunately I cannot confirm sakindia123's results, drain is still the same. Btw. when I flash a different bootloader, should I see *any* difference (eg. different bootscreens (the one with the yellow triangle))?
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Right now downloading an old GB rom, will report back later about my results.
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
If it doesn't help, then sakindia123 can't have the same issue we have :(

we would need to see the dump to be sure, and I find it weird he cannot hear the sound from the ear speaker.
[Galaxy S II Q&A, Help & Troubleshooting] edda123:
Hello fellow S2 users.

I've been having awful sleep battery drain for the last couple of months and I've been trying alot to solve it without any success.

I can confirm hearing interference from the speaker when doing the disable/enable test. Also when browsing the web I hear the noice.

I'm on RootBox nightly 03-25 and Dorimanx 9.13 with the eMMC chip VYL00M, 0x19 insane.

I have also installed the rom after flashing a romnuke script. And also I have seen the AudioOut_2 wakelock in BBS, but it's not always there. I will provide with Logs and screenshots later when available.

But I guess I'm in the club!
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
it really looks like you are in the club... sorry for that ! but the more, the merrier, and it also gives us more chance to find the cause/solution !

would you know since when did it start ? anything special you did ?

have you tried a new battery to confirm it is not the battery ?

how much do you lose / hour ?

again, a warm welcome :)
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Welcome as well from my side :)

Just flashed GB (CM 7.2.0 stable) and clicking sound is still there. Will now try to create a BBS dump and check how battery life evolves here.
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Alright, lost 5% in 1.5h with a good deep sleep ratio, problem seems to persist no matter on which rom. Looks more and more like a hardware issue to me...
[Galaxy S II Q&A, Help & Troubleshooting] Ahmad-6:
hi

i faced the same problem maybe !!

i'm not sure !?

but here is my dump file can you check it and see if it's like your's problem ?

http://xdaforums.com/showthread.php?p=40050805
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Yes, you seem to be in the correct thread (at a first glance on your dump at least). Can you please do the speaker test from post 1 and give us your results?

---------- Post added at 09:53 PM ---------- Previous post was at 09:52 PM ----------

Btw. I'm currently doing a last desperate test: Opened my phone and disconnected the earpiece speaker / 2nd mic / vibrator unit. Now testing battery life with those units detached. Will report back later.
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
You're a badass guy in a good way ;) I would suggest the same to you but i was afraid you are going to kill me if i would have done ;)

But .. i think its a symptom, not the cause, maybe its just samsungs way to make us buy a new phone... cheap resistors or whatever, good luck mate!

wait..

Maybe one of you guys could manage to leave the phone a night without battery.. maybe if all parts are loosing all currency... just thinking..
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
:)

Will try your suggestion over night (if it really turns out that the speaker is draining battery), good idea!

Btw. I went through all BBS dumps from this thread again and noticed that at least me and megosu (who experience the clicking sound) have AudioOut_2 wakelocks (even though the count is small). I personally have all system sounds disabled and never installed Viber. Could it be that there is a wakelock, speaker is turned on, the task gets killed somehow (or hits an exception) and does not turn off speaker before exiting?
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
Disconnecting the speaker is a great idea !! Removing the battery for a while is smart too.

Very curious to know the results.

What about warranty? None of you still has one ?

I might send back mine... Not very happy to lose the phone for 2 weeks++ but it might be the only solution...

Well, we will see tomorrow, we will know more thanks to pixel.

Good night.

PS: I never installed viber, don't even know what it is :)
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
Good morning,

any good news ?
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Ok, I have some news, although I don't know how meaningful they are. With speaker disconnected, I got ~1.1/h in 4h with 98.5% deep sleep. BUT:

- I think I had a drop in battery level when I rebooted after disconnecting the speaker, this could (or rather should) make the results useless

- If the speaker were the main problem, 1.1%/h still seems a bit high to me for 98.5% deep sleep and a 2000mAh battery...

Currently recharging my phone in order to test it again with no battery level drops.
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
question: when the speaker is disconnected, just wondering if the phone can still use the battery trying to send "sound" or current to the speaker.

Can it do it even in "deep sleep" ??
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Yes, I think you are right. Don't think that the speaker is self-managing, thus the real problem would not be that the speaker is constantly on, but that the audio chip is active all the time, which in turn turns on the speaker as a side effect.

Maybe we could ask someone to build us a kernel for testing on which audio is disabled by default (I have tried to build Dori kernel from sources, but have some trouble with that on my system (file is too large compared to flashable zip and it always hangs on Dori boot screen)). Does anyone here have some experience with kernels?
[Galaxy S II Q&A, Help & Troubleshooting] Ahmad-6:
yup i hear sound :(
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
and why can't we see it in BBS ? if the audio chip is active, we should see some activity in BBS.
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
If it's hardware, it's hardware, to see anything in bbs it must be handled by the kernel / a software layer, if the issue happens somewhere before any software can take notice it cannot be shown by another software, imho.

like bypassing the display power source with another battery, it will light up but your device will not take notice. Got my point?

Tapatalked from my Galaxy SII
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
Yes, right, so I guess we are stuck :(

If it is hardware then it can't be change with a new kernel...
[Galaxy S II Q&A, Help & Troubleshooting] pi-xel:
Ok, I got some new input. And it's interesting. It seems that even when speaker is disconnected, that drainage does not change (much).

Therefore I think that the turned on speaker is only a side effect, but not the main source of drainage. And as I can't imagine that the audio chip consumes so much power, my guess is that the whole system does not go to deep sleep properly.

Therefore 2 questions:

- Can we verify somehow that both cores are *really* deep sleeping and are not active?

- Might it be that the screen is not turned off, but just turned black and still on all the time? Can we verify this somehow?

PS: Attached event, radio and main log. Main log is truncated in the beginning as it exceeds file limits.
[Galaxy S II Q&A, Help & Troubleshooting] Karpfenhai:
Mate, this is one of your sleep cycles:

<6>PM: noirq suspend of devices complete after 1.202 msecs
<4>Disabling non-boot CPUs ...
<1>PM: SLEEP

.....sleeping.....

<1>ARM_COREx_STATUS CORE1[0x00070000], CORE2[0x00000000], CORE3[0x00000000]
<6>WAKEUP_STAT: 0x80000001
<6>WAKEUP_INTx_PEND: 0x80, 0x0, 0x0, 0x0
<6>Resume caused by IRQ 359, max8997-irq

Everything what happens between these two events is completely invisible to the system.

During this time only the gsm module and the irq for the hardware buttons remain active, plus the real time clock for alerts like alarm clock or scheduled events, quasi some kind of crontab.

Afaik...

Tapatalked from my Galaxy SII
[Galaxy S II Q&A, Help & Troubleshooting] megosu:
I went back to stock 4.0.4 just to be 100% sure. I removed my external SD and formatted/wiped everything.

I did 2 tests, 1 with the new Anker battery 1900mAh, in airplane mode:

- lost around 1%/h (can't tell the exact number as I didn't install anything, not even BBS).

1 with the original Samsung battery (1650mAh if I remember correctly):

- lost around 1.3%/h

and I can still here the speaker sound with 4.0.4.

so stock ICS is not the answer for me either.
[HTC Sensation] extrem0:
did you try the slice of paper fix? try to put a slice of paper between the battery and the phone's back cover to avoid battery bad contact.
[HTC Sensation] TheKaser:
I did try, even though my anker battery is thicker than the original and so I am certain that it is not loose
[Android Q&A, Help & Troubleshooting] nikwen:
I am currently trying to write a root app.

I know that I can execute shell commands in a root shell like this.

However, I also want to execute some commands that way:

su -c[command]

But I can't get it to work if I use commands with parameters like ls -l or mkdir <path>. Executing something like su -c reboot works fine.

According to this it should work. :confused:

If I execute these commands using an adb shell or the Terminal Emulator app, they work fine.

This is my code:

package de.nikwen.sutest;

import java.io.IOException;

import android.os.Bundle;
import android.app.Activity;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Runtime runtime = Runtime.getRuntime();
try {
runtime.exec("su");
runtime.exec("su -c 'mkdir /data/data/abcdef'");
runtime.exec("su -c \"print asdf\"");

//However, this works:
//	runtime.exec("su -c 'reboot'");
} catch (IOException e) {
e.printStackTrace();
}
}

}

I get this logcat:

04-02 21:03:14.509: D/su(3620): su invoked.
04-02 21:03:14.519: E/su(3624): Unknown id: /data/data/abcdef'
04-02 21:03:14.519: E/su(3624):
04-02 21:03:14.529: D/su(3623): su invoked.
04-02 21:03:14.539: D/su(3625): su invoked.
04-02 21:03:14.559: E/su(3626): Unknown id: asdf"
04-02 21:03:14.559: E/su(3626):
04-02 21:03:14.639: D/su(3629): 10079 de.nikwen.sutest executing 0 /system/bin/sh using shell /system/bin/sh : sh

Does anybody have an idea to solve my problems?

Could anybody please test this code on his device? I would really appreciate this as it could be ROM related. (http://xdaforums.com/showthread.php?t=2180669)
[Android Q&A, Help & Troubleshooting] RoberGalarga:
Well, as far I know if you already used su you don't need to use it in the other commands, like this:

runtime.exec("su");
runtime.exec("mkdir /data/data/abcdef");

Anyway, to run commands as root easily, I recommend you RootTools ;)
[Android Q&A, Help & Troubleshooting] nikwen:
First of all: Big thanks for your answer. :) :good:

Well, it doesn't work if I do not use

runtime.exec("su");

And not using the su command again works, but only if you write the commands into the OutputStream of the process which is returned.

You have to call it at least once after installation to make the SU app ask the user for permission. Then the other lines should work on its own.

The advantage of using su -c [command] is that the user isn't shown all these annoying Toasts like "App x has been granted Su permissions", just the first time when it requests su rights after each launch of the app. My app has to call these functions very often and all these Toasts are VERY annoying. If you look at apps like file managers, there is also just one Toast at launch time and then they execute all commands without any Toast.

According to this you should execute everything like this:

My question is just if this works on other devices or ROMs. I will really appreciate if you try it. :)

And if it doesn't, then my question will be why it doesn't. :p

EDIT: And I don't want to use any libraries, even though it would be much easier.