[Q] msm_battery_s7 holds wakelock when AC charging to battery - Ideos S7 Android Development

Have a question about what Huawei did in msm_battery_s7 from the kernel.
It appears that Huawei holds a wakelock whenever the battery is charged with AC connected.
Any idea why something like this would have been implemented and if it can be safe to remove?
wake_lock name batt_charging_active, in /drivers/power/msm_battery_s7.c
The comment in msm_battery_slim says:
'added by w00163571 2010-6-18 for while charging ap not sleep'

I think that is there for the time when you use the device without battery because this is possible with this tablet.
Sent from my GT-N7100

goodoane said:
I think that is there for the time when you use the device without battery because this is possible with this tablet.
Sent from my GT-N7100
Click to expand...
Click to collapse
The wakelock only takes place when there is a battery present in the device AND it is being charged via AC. It create the wakelock when there is no battery in the device because this code is inside the work function of the battery driver.

xaueious said:
Have a question about what Huawei did in msm_battery_s7 from the kernel.
It appears that Huawei holds a wakelock whenever the battery is charged with AC connected.
Any idea why something like this would have been implemented and if it can be safe to remove?
wake_lock name batt_charging_active, in /drivers/power/msm_battery_s7.c
The comment in msm_battery_slim says:
'added by w00163571 2010-6-18 for while charging ap not sleep'
Click to expand...
Click to collapse
Um, this is standard behavior on every Android device in existence. Charging holds a wakelock, always. (Exception being mako LPM - but only LPM, aka charging while "off")

Entropy512 said:
Um, this is standard behavior on every Android device in existence. Charging holds a wakelock, always. (Exception being mako LPM - but only LPM, aka charging while "off")
Click to expand...
Click to collapse
Actually I have worked in a reference platform that didn't have this wakelock in its kernel. I never realized that it was typical behavior.
Thanks
The S7 runs off AC only, so there's some differing behavior if the battery is not inserted at boot, and inserted+removed activating the battery driver. If the battery is never inserted, the device can go into deep sleep on AC only mode.

Related

Battery charging software toggle?

Hi!
Question: When an XDA is placed in the cradle (w/ charging) or car mount it starts charging and the LED goes orange. After the battery is full the LED turns green. So far so good. What actually happens in the device when it decides it is full? Is the battery "disconnected" by some means? I mean if the device is working (navigation) is it drawing power from the battery which in turn gets instantly replaced from the charger or is the battery left alone and the device just draws power from the charger?
I was wondering if it is possible to turn off "charging" by some little tool or hack. Reason is that I use my XDA for navigation and I hate the feeling of allowing memory effect when I put the device in at 70% battery power, drive somewhere, take it out at 100% and then put it back in at 90% for the way home. My navikit unfortunately does not allow disabling charging, because there is only one button that powers GPS mouse, charging and speaker.
I know that playing with this is potentially dangerous, but I am just wondering. If there is no way I think I should take the navikit to some who can solder...
Any ideas?
Li-ion batteries don't suffer from the lazy battery or memory effect like Ni-Cd or Ni-Mh batteries do. I would surmise that the charging circuitry is deactivated once another primary power source is detected. According to battery-university.com , Li-ion batteries used in cell phone chargers don't enter the so-called "trickle charge" mode as Ni-Cd and Ni-MH batteries do.
http://www.batteryuniversity.com/partone-21.htm
Hope this helps,
Triband81 said:
Li-ion batteries don't suffer from the lazy battery or memory effect like Ni-Cd or Ni-Mh batteries do.
I'd really love to believe this. But check out this. When I run low on power I usually "discharge" as good as possible before recharging. Like disabling auto-off for device and backlight and giving the CPU some stupid load. At some point the device just gives up and turns off. That should mean "battery empty", right. Turning it back on after this gives me only a minute or a few seconds of idle runtime. Battery empty, one thinks. One day when I considered the battery discharged I exited a program which locked the device completely. The backlight was on but there was absolutely no reaction to ANY button or digitizer tap. Not even the power button worked. Fine I thought, perfect battery drain mode. The XDA ran for another 45mins with backlight blazing. 45 minutes of backlight. That's 6 hours of standby or 30mins of usage.
So maybe there is a memory effect which is not quite as high. Or maybe the XDA circuitry is designed to be so "secure" (as not allowed complete drain) by default.
Whatever. Thanks for your input and time. Will check out the link now.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
no it's not memory it's because the cpu and everything apart from the screen is off
but the tool reporting the % calc with the current being used when it's running and thats with cpu gsm and everything on
also all li-ion die after about 2 years and in the end of their life they start to act pretty funny

[Q] Satnav and battery life

(I thought I asked this recently but can't find the post)
OK ... first off GPS / Nav works.
The issue is first off in car use cigarette plug charger, when as a phone only (or playing music via BT) all OK .. battery keeps topped up.
However if I use SatNav the battery cannot keep up .... even though it says charging it slowly discharges ..
I read here some car adapters don't give out full mA current, (that SGS can take) to be 100% sure, I went and bought a 1.5A USB adapter and still the same ... no problem until I switch on SatNav ... then it starts draining ... a couple of % every 15min.
I assume this is simply down to screen taking so much current .... but in very simple terms the phone should be able to keep up via charge when SatNav is enabled.
Anybody got a fix for this ? (screen dimming is enabled)
Ok seems that I am not the only one that is seeing this.
I've owned the S2 for a week and it feels very weird coming from HTC products.
It charges sloooooooow. Also I noticed that battery monitor shows weird values were on the Desire HD it was giving rock solid logical numbers in aspect of Voltage and current.
The s2 sometimes gives me 80% at 3,952 Volts and after a 40min drive 78% and ... 4,012 Volts. It is not stable at all
Just checking the stats in the batt monitor tool.
23:21 at 70% and 3,986 Volts while at 9:00 at 82% and 3,981 Volts.
It doesn't make any sense at all to me
From what I have read is that the charging controller of the S2 is only capable to charge up to a rate of 650mA while the HTC charged at 1000mA (0,65A vs 1A).
Now today I switched off wifi while driving and then it seemed to be very slowly charging. Give that a try and let us know.
Different types of chargers charge at different rates. Mains charges at 650mA, but USB and misc are around 450/550mA. If you're rooted you can change the charging currents in ExTweaks/Voltage Control/setCPU/whatever, however USB is limited as to what it can output anyway, and if you try and force too high a current through, things start to fry.
Sent from my GT-I9100 using XDA
You would not use a Mains charger when using SatNa
It would be a basic requirement that SatNav use in car would be able to keep charged with a USB charger.?
As the same micro USB port is used, how does, phone know its not on Mains?
In answer to above Q ..Wifi is off, I always turn it off when I enable BT.
Sargan said:
You would not use a Mains charger when using SatNa
It would be a basic requirement that SatNav use in car would be able to keep charged with a USB charger.?
As the same micro USB port is used, how does, phone know its not on Mains?
In answer to above Q ..Wifi is off, I always turn it off when I enable BT.
Click to expand...
Click to collapse
OK, that is an 'easy' one. The chargers 'shorten' the 2 data lines.
I've placed shorten between brackets because it doesn't do any harm at all.
I've you install battery monitor you can actually see 'usb connected' or 'ac charging'
As always using waze on my trip to work which takes about 50min.
Started at 58% and went up to 65% when I arrived.
lukesan said:
OK, that is an 'easy' one. The chargers 'shorten' the 2 data lines.
I've placed shorten between brackets because it doesn't do any harm at all.
I've you install battery monitor you can actually see 'usb connected' or 'ac charging'
As always using waze on my trip to work which takes about 50min.
Started at 58% and went up to 65% when I arrived.
Click to expand...
Click to collapse
Here is a simple Q then (maybe I'm naive) .. I am not using USB data port to charge, but a car USB charger point (no chance of any data)
Would charger manufacturers not have this 'short; in place as they are making chargers only ?
If not can you provide any details how to do this ... chargers have plenty of current, be good to get phone to use what it can of this.
dont know how to fix your issue but just to let you know its normal for the phone. Im always on my sat nav with a car charger and never been issues with losing any power. Quite often it comes off charge with more than it was plugged in with.
Hmmm.... I'm using original Blackberry car charger for both BB 9700 and SGS 2.
Yes, it charges slow, but with BT and GPS on it does gain on charge/percentage.
Sargan said:
Here is a simple Q then (maybe I'm naive) .. I am not using USB data port to charge, but a car USB charger point (no chance of any data)
Would charger manufacturers not have this 'short; in place as they are making chargers only ?
Click to expand...
Click to collapse
They should have but unfortunately they often seem to 'forget' it
If not can you provide any details how to do this ... chargers have plenty of current, be good to get phone to use what it can of this.
Click to expand...
Click to collapse
I have attached two photos showing an adapter I fixed myself. Look at the image 'charger-bottom-side.jpg' and notice the red circle. Within this circle you can see the short between the two data lines (D+ and D-). The short is simply a drop of tin-solder.
Sargan said:
Here is a simple Q then (maybe I'm naive) .. I am not using USB data port to charge, but a car USB charger point (no chance of any data)
Would charger manufacturers not have this 'short; in place as they are making chargers only ?
If not can you provide any details how to do this ... chargers have plenty of current, be good to get phone to use what it can of this.
Click to expand...
Click to collapse
As I said in my post. Install battery monitor and see if it says 'usb charging' or ac charging
lukesan said:
As I said in my post. Install battery monitor and see if it says 'usb charging' or ac charging
Click to expand...
Click to collapse
Which app is this (devleoper name ?)... and I'll get it ... just looked on market ... and there are 5 apps with this name.
Sargan said:
Which app is this (devleoper name ?)... and I'll get it ... just looked on market ... and there are 5 apps with this name.
Click to expand...
Click to collapse
3C
Sargan said:
Which app is this (devleoper name ?)... and I'll get it ... just looked on market ... and there are 5 apps with this name.
Click to expand...
Click to collapse
I have now purchased a new lead and charger (to be sure)
Running the App it shows "Charging AC Plugged"
It cannot keep up with current demand when Bluetooth & GPS active ... slowly discharges.
I have had the S2 for about a month now.
Seems like Sygic is the only GPS soft which I tried that doesn't hit the cpu 100% all the time.
I did a test over the weekend and with everything 'on' it slowly charged the phone.
yes
yeah, battery monitor will let you know that.
also suffered from this in the past
I have had the discharge problem using sat nav (Copilot live premium) and a car charger (various car chargers actually). Stock S2 with generic UK firmware. The problem exists on 4.03 and 4.04 - not sure about previous GB as updated to ICS as soon as I bought the phone.
I have found that if I apply battery save mode and turn down the screen brightness the charge just about holds station.
But the strangest thing I have found, although reading around I have not seen it mentioned elsewhere, is that if I enable mobile data the phone charges just fine whilst using sat nav. The problem only arises when I disable the data connection. This came to my attention whilst abroad where I deactivated data to avoid preposterous roaming charges.
This rather implies to me that something is trying to use the mobile data connection when it is deactivated and is causing battery drain when it can't. This could be any app of course, but the problem only rears its head when I use the sat nav (power hungry) with the mobile data turned off.
Has anyone else noticed this? Any advice on narrowing down which app/process this might be would be welcome.
Sargan said:
I have now purchased a new lead and charger (to be sure)
Running the App it shows "Charging AC Plugged"
It cannot keep up with current demand when Bluetooth & GPS active ... slowly discharges.
Click to expand...
Click to collapse
Sorry for bumping into this thread but I think I can help.
Correct me if I'm wrong, but I think your question is:
-Battery charging cannot keep up with discharging rate while using GPS and Bluetooth.
Reason for this problem:
-This occurs because usb charging further is lower than charging via wall charger, hence the battery heroes discharging when the demand is higher than the charging rate.
Solution:
-we need to increase usb charging current to equals the Ac charging current
How is that possible:
1.Root access is needed. If you don't already have root access key me know
2.custom kernel needed.
-You need to flash one of, Siyah, Dorimanx or dream kernel.
-Any of these kernels has the option to increase usb charging current
-move to 3. If you are already running any of the listed kernels.
3.after flashing the custom kernel, install extweaks from market.
-open extweaks
-under "misc", change the charging current to option 3.
Done
lukesan said:
I have had the S2 for about a month now.
Seems like Sygic is the only GPS soft which I tried that doesn't hit the cpu 100% all the time.
I did a test over the weekend and with everything 'on' it slowly charged the phone.
Click to expand...
Click to collapse
Swyped from my Samsung Galaxy SII
Jokesy said:
Reason for this problem:
-This occurs because usb charging further is lower than charging via wall charger, hence the battery heroes discharging when the demand is higher than the charging rate.
Click to expand...
Click to collapse
Wrong. Just read your own quote from Sargan's post:
Sargan said:
Running the App it shows "Charging AC Plugged"
Click to expand...
Click to collapse
Jokesy said:
Solution:
-we need to increase usb charging current to equals the Ac charging current
How is that possible:
1.Root access is needed. If you don't already have root access key me know
2.custom kernel needed.
-You need to flash one of, Siyah, Dorimanx or dream kernel.
-Any of these kernels has the option to increase usb charging current
-move to 3. If you are already running any of the listed kernels.
3.after flashing the custom kernel, install extweaks from market.
-open extweaks
-under "misc", change the charging current to option 3.
Done
Click to expand...
Click to collapse
I advise not to do that because:
It will not solve this problem as charging from AC is already detected by the device (see above).
The option is dangerous and will enable (if working at all) charging with the higher current limits from any USB port.
good to know
Jokesy said:
Sorry for bumping into this thread but I think I can help.
Correct me if I'm wrong, but I think your question is:
-Battery charging cannot keep up with discharging rate while using GPS and Bluetooth.
Click to expand...
Click to collapse
Actually in my case when using sat nav it will charge with mobile data enabled, but will discharge (whilst connected to the car charger/wall charger) without data enabled.

Charging Question

does anyone know if its possible to find out if the s3 is really charging or not? ive been plugged in and it's still discharging. I need to know if its hardware or software related. when plugged in it has a lightning on the battery and it has red led when display is off but its really slow on charging
anthony001 said:
does anyone know if its possible to find out if the s3 is really charging or not? ive been plugged in and it's still discharging. I need to know if its hardware or software related. when plugged in it has a lightning on the battery and it has red led when display is off but its really slow on charging
Click to expand...
Click to collapse
same here!
anthony001 said:
does anyone know if its possible to find out if the s3 is really charging or not? ive been plugged in and it's still discharging. I need to know if its hardware or software related. when plugged in it has a lightning on the battery and it has red led when display is off but its really slow on charging
Click to expand...
Click to collapse
The battery does not charge to 100 %, this is not a defect in the phone but rather a sort of internal protection so as to not damage the battery. Indeed, it happens many times to leave the phone connected to the charger much more time necezzario.
The battery by doing so you may receive a surplus of energy than necessary, and in the long run, deteriorate more quickly. Samsung has inserted inside the Galaxy S3 a limiter that operates in the following way: while the phone is charging, you download slightly of 2-3% for then recharge automatically up to 100 %. This process is repeated automatically from your phone until it is removed from the charger.
Use this app.for monitoring battery ; https://play.google.com/store/apps/...ch_result#?t=W251bGwsMSwxLDEsImNjYzcxLmJtdyJd
If necessary make a battery calibration uses these applications ; https://play.google.com/store/search?q=calibration&c=apps
While plugged in go to settings/battery and see if it is ac charging or usb charging....I've had this problem with the new cable and plug, it only charges at usb rate, use my old S1 charger now, BlackBerry one worked for me as well
devid801 said:
The battery does not charge to 100 %, this is not a defect in the phone but rather a sort of internal protection so as to not damage the battery. Indeed, it happens many times to leave the phone connected to the charger much more time necezzario.
The battery by doing so you may receive a surplus of energy than necessary, and in the long run, deteriorate more quickly. Samsung has inserted inside the Galaxy S3 a limiter that operates in the following way: while the phone is charging, you download slightly of 2-3% for then recharge automatically up to 100 %. This process is repeated automatically from your phone until it is removed from the charger.
Use this app.for monitoring battery ; https://play.google.com/store/apps/...ch_result#?t=W251bGwsMSwxLDEsImNjYzcxLmJtdyJd
If necessary make a battery calibration uses these applications ; https://play.google.com/store/search?q=calibration&c=apps
Click to expand...
Click to collapse
Hmm, im not talking about when it charges at 100 % im talking about when it charges in mid ranges like 50 or 80. It shows charging but an hour passed but it didnt even increase to 2 percent
Are you on an original rom or a custom / leaked one?
Have you tried another charger or computer?
It may take some time to charge on slower chargers (the ones only outputting 0.5Amp) but it definitively should not be discharging when connected to a charger with the screen off.
Im on stock firmware. Using the wall outlet ti charge the phone

Is the sudden death coming for me?

So guys what Im afraid of is that my phone is showing symptoms of sudden death (or at least I think so). For some time now I observed a prolonged charging cycle (15%-100% in over 5h) with my original charger and cable from Samsung. The other thing is that in the battery graph is shown that my phone is practically always awake, when charging. I tried with my Nexus 7 charger and it does charge faster, but maybe thats because its 2A and samsungs - 1. Im giving you the link to the screenshot with the battery graph. Am I beeing paranoid or is this really a sudden death symptom?
https://www.dropbox.com/s/p91pnm2kw3mzsmy/Screenshot_2013-06-25-21-22-50.png
Charging and wakelocks are nothing to do with sds
1) samsung usb cable is poor. S3 has usb stability detection. Detects unstable connection - lowers charge. Samsung usb cable often unstable. Replace
2) get betterbattery stats (read xda thread) to work out what wakelock you have.
Btw, phone is awake whilst charging by standard
Sent from my GT-I9300 using Tapatalk 2
read the SDS thread in General because it seems like you don't know what you're talking about

How do I know if phone is fast charging?

My previous phone was saying on the lock screen "Fast charging" and I was able to see two lightnings on battery icon in a same time so I knew immediately when fast charging was engaged.
How is Nokia 7.1 ?
It will display rapid charging.
Well, I don't see rapid charging anywhere using original charger
luckyluc81 said:
Well, I don't see rapid charging anywhere using original charger
Click to expand...
Click to collapse
My bad that's weird mines displays rapid changing under the fingerprint symbol on Lockscreen
Ok I got it as well, it doesn't say rapid charging all the time though. Thanks for the hint
is the original charger fast charger?
When you plug the charger it takes some time for the phone to detects if it is fast charging. Then it displays charging rapidly. And after a certain percent of battery charged it quit the rapid charging i thing (50-60% i think but i could be wrong). As of my knowledge of how lithium battery is charged this is usually done to prevent overcharging and popping the battery as a popcorn. I am not sure if this is exactly the case just an assumption based on my very few times observing the charging (im new with the phone). Never payed much of attention on that on my previous quick/fast/rapid or whatever charging phones.
Sent from my LG-H870 using XDA Labs
Nokia 7.1 does not fast charge when screen is on.
luckyluc81 said:
My previous phone was saying on the lock screen "Fast charging" and I was able to see two lightnings on battery icon in a same time so I knew immediately when fast charging was engaged.
How is Nokia 7.1 ?
Click to expand...
Click to collapse
Use Ampere.

Categories

Resources