[Obsolete] Yoga Tab 3 Plus no more Flickering/CABC [ROOT] - Lenovo Yoga Tab 3 Plus Questions & Answers

Update
Lenovo fixed the issue in the latest update with my initial method which was switching off the CABC in the backlight controller which gives us a brightness boost. So obviously it is not dangerous.
Old Message:
So having achieved root, I was looking into the easiest of the issues. Some call it flickering. The "feature" is called CABC and is supposed to save battery. But obviously this comes at a cost of the display constantly adapting the brightness to the content which can cause flickering depending on what you have on the screen.
With root this can be switched off. Alternatively a new kernel could solve this without root. In both cases an unlocked bootloader is still required.
Instructions:
Use a build.prop editor form the Playstore
Edit the variable "ro.qualcomm.cabl=2" and set it to 0. CAUTION this modifies the system partition. If you want to receive OTAs in the future you will have to flash the system partition with an original image or backup.
Reboot
Technical details:
There are three places where CABC can be switched off:
In the build.prop
In the device tree blob in the boot image/kernel. Specifically the DSI switch on commands in the LCD panel description contain the enabling of CABC
In the LCD backlight driver /sys/devices/soc.0/78b6000.i2c/i2c-2/2-002c -> could be dangerous because it increases brightness and the voltages in the backlight controller

matshias said:
So having achieved root, I was looking into the easiest of the issues. Some call it flickering. The "feature" is called CABC and is supposed to save battery. But obviously this comes at a cost of the display constantly adapting the brightness to the content which can cause flickering depending on what you have on the screen.
With root this can be switched off. Alternatively a new kernel could solve this without root. In both cases an unlocked bootloader is still required.
I attached an Automate flow which disables CABC and guess what we get a brightness bump of about 20%. Now the maximum brightness of the display is even a bit brighter than my old Yoga Tab 2 and should be on par with the 3 pro
Make sure that Automate runs on system startup and has root enabled.
Technical details:
There are two places where CABC can be switched off:
In the device tree blob in the boot image/kernel. Specifically the DSI switch on commands in the LCD panel description contain the enabling of CABC
In the LCD backlight driver /sys/devices/soc.0/78b6000.i2c/i2c-2/2-002c
It turns out that if you disable the latter CABC is off even without modifying the former. Of course this requires ROOT to change. This could also be done in the kernel, but would need either a recompile or modifying the init.rd
Click to expand...
Click to collapse
Thanks Now only audio sync issues left for me and tablet will be perfect.

Have you compared the battery performance with and without CABC disabled?

Ashili said:
Have you compared the battery performance with and without CABC disabled?
Click to expand...
Click to collapse
No, these battery life tests take a long time, which I don't have Time is better spent looking into the other issues. It shouldn't be too much of a difference.

matshias said:
No, these battery life tests take a long time, which I don't have Time is better spent looking into the other issues. It shouldn't be too much of a difference.
Click to expand...
Click to collapse
Yap, I think so. The battery life is long enough. Thank you.

I would think as long as you manually adjust brightness to match your content, you'd get similar results.

I modified the thread to use a less invasive method. I am having issues with my tablet. I am not sure it was caused by this mod but just to be safe I recommend everyone not to use it any longer.

what kind of problem?

chuwq1038 said:
what kind of problem?
Click to expand...
Click to collapse
Everything works (also the display) but the battery drains and the back of the tablet gets warm even when the tablet is switched off. Could be completely unrelated to the mod, but who knows.

With latest official update I have a battery drain issue too. 15% down overnight...

Related

[FIX] Yoga tablet 2 10" display sharpness fix (UPDATE for Lollipop)

Why Yoga tablet 2 screen looks so blurred and sharpened at the same time
Have you been wondering why your screen on the 10" Yoga tablet 2 with KitKat doesn't look really crisp even with some obvious sharpening applied? Here is why!
Lenovo screwed up twice!
1. Blur filter is applied. (KitKat ONLY) The BIOS/bootloader defines wrong display resolution. The Intel graphics driver (i915) gets confused and switches on panel fitting which includes a blur filter (fuzzy filter). Normally this is used if the display resolution is different from the frame buffer resolution to scale the image. Here the device just scales 1:1 and applies the filter. Luckily the driver is open source and it turns out there is a way to overwrite this feature No longer true for Lollipop. Thanks Lenovo
2. Sharpen filter is applied. (KitKat and Lollipop) The panel is not programmed correctly. When disabling the CABC feature (/sys/lcd_panel/cabc_onoff) the sharpening effect is gone. But CABC should have nothing to do with sharpen. Unfortunately the specs of the display (AUO B101UAN01.E) are not public so I cannot verify if the correct MIPI DSI commands are sent to the panel.
So our display is softened then sharpened again! What a waste!
Both workarounds are only temporary. After each screen off/screen on sequence the old values are restored by the system. So we need an app which sets the values after the screen is switched on. Or a new kernel. Or Lenovo cares to fix it in a future release
Fix (Root partially required)
I wrote an app which can disable CABC / sharpness filter (requires ROOT) and can disable the blur filter (KitKat, no root required) . Of course I am not held responsible if you brick or burn your tablet. I tested this on my 1050F with rooted firmware S000143_150105.
1. Copy app to device and install
2. Start app and select your setting
3. The settings may apply only after switching screen off and on again.
Source on Github:
http://github.com/Matshias/yoga2sharpness
Bugs / issues
- may not work directly after reboot, only after screen on/off
- fullscreen video may switch on CABC/sharpness filter again
Any suggestions? I'd be really happy if you could test and report
Cheers!
Matt
Update Jan 21
make more reliable and add complete source
Update Jan 26
Reliable implementation as app which automates this process.
Update Jan 30
new version 1.1 (please uninstall old version!):
- add option to start at boot and enable/disable applying the settings at screen on for manual operation
- add little delay after screen on for more reliable operation
- app should be harder to kill by the system
Update Feb 2
new version 1.1.1:
- Fix occasional reboot issue when using the setting on display on. Turns out Android sends screen on broadcasts sometimes even if the display is off. This causes a crash if the filter settings are applied.
Update Feb 11
new version 1.1.2 (please uninstall old version):
- hopefully ultimately fix reboot issues by using different method to start on boot
Update Apr 30
tested with new firmware S000198_150422. Same as before. Lenovo has not fixed the issue, but the app works like before
Update June 3
New version 1.1.3:
- fix full screen video playback re-enabling CABC/sharpness filter. As for CABC itself root is required.
Update June 17
Update for Lollipop version 1.2.0:
- blur filter disable no longer needed
- sharpness filter is still present. If root becomes available for Lollipop this should work there too
Update June 19
Fix for rooted Lollipop - version 1.2.1:
- the mechanism for sharpness filter disable from 1.2.0 didn't work, probably due to SE Linux restrictions
Matshias, you are a legend!
I bought a Yoga 2 10" a couple of weeks ago and the odd blurred and sharpened effect ruins what is otherwise a great little tablet. I'd always suspected it was some kind of odd scaling issue, but I haven't had time or sufficient Android knowledge (or root access on my device) to properly investigate it, beyond making up some test images with alternate 1 pixel wide black/white lines - which were rendering as grey on the Yoga 2.
I had a support ticket raised with Lenovo about the issue, so I've referred them to this post and one on the Lenovo Community forums.
Thanks for your hard work, hopefully Lenovo will implement the fix in a software update soon!
Cheers,
Richard
Thank you!
matshias: Thank you.
The blur filter disable makes a HUGE difference. I really appreciate you taking the time to post your results, hopefully Lenovo will take note and implement a permanent fix.
workes
Hi!
I have just started using your app with the latest firmware on a 1050L.
0) Unrooted device
1) installed your app and applied the non-root part of the fix - worked after screen on/off
2) rooted device with temporary cwm solution from this parent thread (- which worked as well)
3) applied the root-required part of the fix from your app - works as well
Thank you for this!
Great great great! Like the others here I was looking for a solution to this Problem since I bought the tablet.
I am really satisfied with your APP, now everything is way sharper.
BUT: When I test the screens resolution with a screen test APP, only the horizontal ( long sides) resolution seems to be right now. The vertical resolution (short sides) is still just grey, when testing single pixel lines.
Do you have the same Problem, what could cause this?
fanatictentacle said:
Great great great! Like the others here I was looking for a solution to this Problem since I bought the tablet.
I am really satisfied with your APP, now everything is way sharper.
BUT: When I test the screens resolution with a screen test APP, only the horizontal ( long sides) resolution seems to be right now. The vertical resolution (short sides) is still just grey, when testing single pixel lines.
Do you have the same Problem, what could cause this?
Click to expand...
Click to collapse
I see the same if the sharpness filter/CABC is still switched on. If you have root then try disabling the sharpness filter as well and then the screen test look fine. Obviously the sharpness filter in the panel is not uniform in all directions and seems to prefer horizontal resolution (in landscape mode).
Thanks again for the advice!
I just had to enable root, really cant look at that horrid screen anymore! But now it really looks as sharp as an 240ppi Display should look like!
problem
After installing the app I have problems.
In 10 minutes my tablet rebooted 3 times . Android not asked to reboot.
It was crash of sistem. My system is rooted.
After uninstalling I had no problems.
Regurds
Yosef said:
After installing the app I have problems.
In 10 minutes my tablet rebooted 3 times . Android not asked to reboot.
It was crash of sistem. My system is rooted.
After uninstalling I had no problems.
Regurds
Click to expand...
Click to collapse
Did you use the start on boot feature? This might cause it. I uploaded new version 1.1.2 which should fix that problem. Let me know if it works for you.
this is a fantastic fix, one that Lenovo should have implemented themselves
actually when i just got the tablet over christmas, it was running older firmware in which the blur filter was actually not enabled. yes i now realize the text was "over sharp" but it was clear, and what i expected for the price (i.e. not double the price for a galaxy tab S) but i was fine with the sharpness, it looked good, and the tablet otherwise suits my needs perfectly, and gotta love that built in stand. i didn't even know what people meant about the image quality, considering the mid-range target audience of the tablet.
anyway, i recently got the OTA firmware update to the current S000143_150105 and that's when it messed everything up. it enabled the blur filter, and it looked HORRIBLE. i tried to accept it because at 1 ft from the tablet, the text actually looked all right, perhaps even a slight improvement because it was slightly softer. but the blur filter is applied to EVERYTHING, so all the images and everything on the screen was blurred....it was like looking at an HD monitor with a state of the art GeForce video card but using the standard windows video drivers...everything stretched and totally blurry.
this is a great fix, i don't have my tablet rooted and don't want to take the potential battery hit to disable the sharpening filter (since i think it looks good just with the blur filter disabled). it might be in my head though, but i feel like the system is a little more sluggish...maybe due to the update, maybe because of this (great) app...i wish lenovo would fix this, seems easy enough. sours me to an otherwise great tablet for the price.
speaking of battery, i noticed in the last day after installing the fix that my tablet powered off sometime during the day, and when i restarted, the battery had drained about 30%. and it continued to drain faster than before. i previously got well over 10 hours of usage time playing movies and web browsing, in addition to up to several days of standby....today i had to charge it within 24 hours and only got about 7 hours use time and 13 hours standby...any chance it's related to the fix, or has anyone experienced it after the firmware update?
@digitalatlas: Thanks for testing the app.
Regarding your observations, I don't think sluggishness can be attributed to the app. After all it doesn't do much. Only when the screen is switched on or you manually start the app it changes the kernel setting. So it really shouldn't have any impact on performance.
The battery life should also not be affected by the app itself. It does not have any background tasks other than the kernel setting mentioned above and it shouldn't wake up the device as well. Although I saw occasionally that my app gets informed that the screen was switched on even though the screen was not switched on. That caused some reboot issues. But that was fixed with version 1.1.1 and 1.1.2 and I didn't see a reboot since I use 1.1.2. Also there are reports of hangs/reboots by other users unrelated to my app. Anyways it might be the case that changing the kernel setting has some other effect on the hardware, kernel and battery life. According to Intel documentation the filter is not meant to be switched on or off while the display is active. However, it is the only time it is possible to change it in our system. So to be sure we have to test and disable/uninstall the app and see if the battery life improves.
Hopefully Lenovo fixes this with an upcoming update!
Thanks!
Just got this tablet in the mail today and was disappointed by its display. So grateful for your fix, its like night and day with the blur gone. Guess I have a good reason to root now to get rid of the sharpness too. Mind me asking what method you used to root for this firmware?
Falv said:
Just got this tablet in the mail today and was disappointed by its display. So grateful for your fix, its like night and day with the blur gone. Guess I have a good reason to root now to get rid of the sharpness too. Mind me asking what method you used to root for this firmware?
Click to expand...
Click to collapse
I used the temporary CWM method [GUIDE] CWM & Root Lenovo Yoga 2 (8/10/13)
It is easy enough and works fine, but keep in mind that there might be issues with OTAs.
I'll keep track of the battery over the next little while, hopefully it was just an aberration that first charge. I'm getting better results with this second charge since the update and your fix.
Could you or someone post a picture shoeing the effect of turning the sharpening filter off? Might help some of us decide it rooting is in fact worthwhile. Thanks!
digitalatlas said:
I'll keep track of the battery over the next little while, hopefully it was just an aberration that first charge. I'm getting better results with this second charge since the update and your fix.
Could you or someone post a picture shoeing the effect of turning the sharpening filter off? Might help some of us decide it rooting is in fact worthwhile. Thanks!
Click to expand...
Click to collapse
I tried taking pictures but it doesn't really show the effect. Instead I made two screenshots and recreated the filter with GIMP. It should be very close to what the panel does.
Does anybody have any info from Lenovo? I think that this is preposterous! How can someone do that and have it go through testing? Unless there were no tests at all.
Buying Lenovo was a mistake.
v1.2 tested on my new 1050F. Awesome. I was disapointed by the screen but now it's perfect. Thank you so much to have done this patch!
+1
AMAZING PICTURE QUALITY!!.
Without blur picture is good, but witchout blur and sharpness image quality is FU…NG AWSOME!!
THANKS!!!!!
saupiquet said:
v1.2 tested on my new 1050F. Awesome. I was disapointed by the screen but now it's perfect. Thank you so much to have done this patch!
Click to expand...
Click to collapse
+1
Great app, thank you
Are you all running this with rooted devices? Mine is not yet rooted but notice a big difference with this app. How much better is it if I was to root the device? Thank you so much for this fix. I recieved my tablet today and was very disappointed with the display.

[HOW-TO][NEWBIE GUIDE] Optimize & proper set up your Galaxy S6 Edge (stock firmware)

[HOW-TO][NEWBIE GUIDE] Optimize & proper set up your Galaxy S6 Edge (stock firmware)
As I've read across this forum and on several specific threads related to usage, battery life and so on, as well as discussing with some of my friends having a S6 or S6 Edge, I realized that most of the people don't really know how to properly set up their phones or how to use them efficiently.
OK, I get it, this is a fancy phone, not every owner is a developer or tech guy so it might be that many choose it based on the looks and don't really know how to optimize it...then they start complaining about different things like lag or battery drain not knowing that most of the problems are caused by miss-usage or improper setup. Of course there are bugs too, nothing is perfect. Of course there are many firmwares available and some are market or carrier dependent so some features or settings might be missing from some of them or even work differently.
What I will try here is to provide some guidelines and tips for setting up various things on the phone in order to maximize it's battery life and for a better usage. I will also make some recommendations based on my experience, tests and usage that might not apply to everyone. Use common sense and logic to apply similar settings in your particular case. Don't come screaming that you made that or that and now something is not working.
And YES, I know there are similar guides like this posted over the Internet and I'll probably make similar recommendations here too but I couldn't find such a guide here on XDA that is particular to this phone (if there is a better one than you might as well ignore mine).
All these things I'll describe below are applicable to any STOCK, NON-ROOTED 5.1.1 firmware and won't break warranty or your phone.
Now that was a long (and maybe unneeded introduction) but I thought to write this for everyone...let's start.
Model No.: SM-G925F
Android: 5.1.1 r2 (LMY47X)
Baseband: G925FXXU2QOI7
Kernel: 3.10.61-5672012
Build date: Fri Sept 4 2015
Carrier: Orange RO
DISPLAY
First I would like to say some words about the display. We have a great display, high resolution and it is most likely the biggest battery drain factor. There are two major things about it that you should keep in mind and will help you to get a better battery:
1. It's AMOLED...that means that the black pixels on it will consume no power because are not lit. Studies showed that even if not completely black, AMOLED displays use less energy if the displayed picture is darker compared to a lighter one.
2. The brightness level. Most people use it on "auto" or high level settings and this will be a major drain factor.
You can drastically lower the battery drain caused by your screen by selecting as much as possible dark (black) backgrounds and/or themes. There are some nice ones available in the Theme Store (my favorite is the Dalkomm Coffee Theme), that make most screens and menus dark/black. Also choosing a dark wallpaper for lockscreen/homescreens will help.
Don't use screen brightness at maximum...never. You don't need that in 99% of the cases. Also you won't probably need the automatic setting either since most of the people are spending most of the time indoors (either at work or home). A low manual setting will be fine most of the time, I have it set up at about 20% and only need a brighter one when going out. At that time I just tap on "auto" and it'll increase based on ambient light level. So you don't even need to tweak it alot every time. Find a low manual setting that's fine for your eyes and just tap on "auto" when you go out in sunlight.
CONNECTIVITY
Another battery drain factor is your multiple connection/radios features. In most cases you use just several: Mobile Data, WiFi, GPS/location and BT (when applicable). That means you should turn off all the others you don't use...NFC or BT (when not connected to a headset or car-kit or not listening to music). I don't listen to music and don't have a BT headset so I mostly not using BT (just when I'm in my car) and almost never use NFC so I have both disabled and I enable them only when needed via the Quick Settings.
WiFi
WiFi should also be properly setup otherwise it'll have impact on battery. It was incorrectly assumed or considered that keeping WiFi on all the time will drain battery faster. That was proven in different tests that's not true and in fact keeping WiFi on all the time won't make a big difference and in some cases was even better than to turn it off/on. I think is something similar with the car engines that suck more fuel when started that when running at idle. The major power drain is not when WiFi is running while is not connected to any network, but when the WiFi radio is powered up. When is on and not connected, it's going into a lower power state so the battery consumption is negligible.
I had a case with one of my friends that had WiFi setup to turn off when display was off...wrong choice, he got about 30% battery drain overnight because instead of having it connected to his home WiFi, the phone was using his 4G/LTE connection to make all the background sync/updates. That was eating his battery and also his data plan. After setting WiFi to "always" his overnight drain lowered to as little as 2-3%.
In some regions/carriers there are 2 other settings that were proven to help battery life: WiFi calling and VoLTE. I don't have either of them but based on different articles and what people say, they surely help with that so don't forget to turn them off if you don't use these features.
You might also want to try turning off "Always allows scanning" and "Smart network switch". I have the second turned off but I keep on the first one. Basically the first option tell the Location service to use WiFi for locating the device even if WiFi is switched off (by the on/off switch) so that means the radio is active. Second option should make you switch faster from WiFi to mobile data in case the WiFi signal is not strong enough or fluctuating. In my country there are plenty of WiFi hot-spots and they have mostly good connections so I don't use this feature.
GPS
Well here the opinions are split but I am currently having it ON all the time and Location Service is set to "high accuracy". I personally haven't noticed such a major difference with or without it so I preferred to let it on as it is used by many apps or services. You can try to set Location to "wifi and cell only" but don't think that will bring you a major benefit.
RUNNING APPS/PROCESSES
Well this is an important one. I've initially started to turn off/disable/uninstall everything I don't need or use. This can be done mostly from the Settings - Applications - Application Manager or if you want to go further, you can install Package Disabler Pro from PlayStore, about which I'll detail later.
Now why we should do that? There are lots of apps, processes and background services running on our devices that take care about all the things we do on the device. The problem is that ALL are using resources: processor time, memory, space and so on. In the end these are translated for a user in LAG or battery drain. Of course we cannot kill everything and I learned long time ago that installing Task or memory managers on Android it's the worst thing you can do. Android it's smart enough to take care better about it's resources and processes (at least to a certain point) and keep killing a certain process won't give you more battery life but will eat more of it in the end,
What I wanted to say is you shouldn't start disabling, killing or blocking everything cause you might end up with an unstable or not properly working phone (case in which only a factory reset might help). First of all look at the ALL tab in Application Manager and try to identify what you don't need or use. For example I'm certainly not using some things like: music, books, news feeds, Samsung's keyboard (I use SwiftKey), the TouchWiz launcher (I use Nova), health services or whatever, S-Voice, S-Health, S-Finder, I don't have any smartwatches so I don't use any Gear processes, fancy device wake-up functions (like wave gestures) or animated wallpapers either.
So after all considerations above, you decided that you can safely disable some apps/processes. All good but you'll quickly learn that some of them cannot be disabled via Application Manager (the "disable" button is grayed out). Now what? Well here comes handy that Package Disabler Pro that I've told you about in the beginning. That app is able to disable ANY apps/processes on your phone, including those that are protected and cannot be disabled via the normal way (and yes it can do that without being rooted). The downside of it is that you must be careful what you choose to disable not to have something that is needed for the normal functionality or the apps you're currently using. The app has also a backup/restore function (via an xml file) for saving the list with apps you have disabled and easily import them back after a factory reset for ex. I've added to this thread my list of disabled apps as it is exported by the application (just unzip and copy the file on the root of your internal memory and it can then be imported in the Package Disabler app)
Another important thing is WHAT apps you're using. I know that socializing and social networking are some of today's most trendy things but keep in mind that some of the apps used for that are not so well made. An example could be the Facebook app/messenger which are reported to drain alot of battery. RSS feeds, news feeds, multiple weather apps or widgets, all contribute to battery drain and lag. Don't install several apps/widgets for the same purpose (like several calendar apps or weather apps). Each will take resources and won't have an added value. Want to use another weather app/widget than the one coming with the phone? Fine, install it...but don't forget to uninstall/disable the built in one or others that do the same thing. Same goes for keyboard for ex; I use SwiftKey for years and got used with it. For me it's better than any keyboard that Samsung might put on the device, therefore I've disabled the standard Samsung keyboard. I also don't like TouchWiz launcher and use Nova that offers me much more flexibility so...I've disabled both the "easy" and "regular" TouchWiz launchers. I went to the point that I've even disabled the different embedded font types, you have 5 of them and I doubt someone uses more than one at a time.
So as you all can see it's not only a matter of setup but also a matter of usage. When you have a device you have to use it properly otherwise it'll not perform as you expect. Imagine a car that has a manufacturer fuel consumption value of 5.5 liters/100 Km....that's under certain conditions not on ANY type of driving. Fly with 200+ km/hr on a highway and I'll guarantee you won't have 5.5 liters/100 km consumption. That doesn't mean the manufacturer has lied or mislead you. Same goes with a phone, if you don't know how to use it and optimize it, you'll have a bad experience.
I work in the IT industry for years and I mostly laugh when I hear someone advising somebody to reinstall the operating system to solve a problem. Same goes for "factory reset" for a phone. Yes, this method works some times but that won't solve the root cause of an issues if you're using it the same way. After several days it'll perform as bad as before and you'll just say that "factory reset" did nothing. Of course it didn't...YOU have to do something different, not the phone.
Now I apologize for the long post and I do hope that at least some will learn to better manage their devices and to understand what they're doing not just running certain commands or procedures blind. Both S6 and S6e are great devices but we should learn how to properly use them in order to benefit the most from them...otherwise we just come here asking for help or mumbling about what crap devices they are.
Thank you, I will check to see if I get an improvement on the standby battery drain.
Your part about not setting the screen to Auto is flawed. You mention that we are mostly indoors, and you don't need a brighter screen for that. Auto mode also knows that and sets the brightness lower. It already does automatically what you do manually.
Tnx. And yes....keeping screen at 20% brightness and just switching to auto when in outdoors works great for the battery life.
ArmedandDangerous said:
Your part about not setting the screen to Auto is flawed. You mention that we are mostly indoors, and you don't need a brighter screen for that. Auto mode also knows that and sets the brightness lower. It already does automatically what you do manually.
Click to expand...
Click to collapse
Not quite, I've tested it. If you're on "auto" and use a lower setting on the slidebar, in a dark room the screen is too dark, you'll have to turn off "auto" and the manual brighteness set on the same level will be much higher than on auto.
Now if you have such good eyes and you're able to use "auto" in all cases with the slider at 20% that's good for you...unfortunately I am not so that's why I use it as I've described. The point is that "auto" mode consumes MORE battery regardless of how it's set, than a lower 'manual' mode. So I preffer to have it like this than to use auto all the time.
Thanks for the awesome guide. I'll start disabling some useless processes and see how my battery life is working. Anyway without much editing the battery of S6Edge is pretty good. I can use it a whole day and still 19% remaining. As a comparison I wasn't able to do it with my S3 having to recharge it 2 or even 3 times at day.
Again, thanks for the guide!
Enviado desde mi SGS6e mediante Tapatalk

Yoga 2 830/1050 high wakelocks - cause and workaround (root only)

Got to play with a Yoga 2 1050F for the past few days and was absolutely horrified how wakelocks kept the Yoga awake for about 30-50% of the time when it was supposed to be in deep sleep.
The wakelock in question is battery_wake_lock. It's not so much that it is triggered unusually often; rather, deep sleep is prevented by how long the wakelock is held with each trigger.
Lenovo implements the wakelock in the BQ27x00 battery driver that is shipped with the kernel of their Lollipop distribution. In the KitKat distribution, while it was initialized in the source code, it was never actually triggered. In fact, I have looked at multiple other source distributions, and not a single one uses wakelocks in the BQ27x00 battery driver. Thanks Lenovo.
In short, whenever there is a brief resume from deep sleep, for example triggered by an alarm from com.google.android.gms, the battery driver runs the bq27x00_battery_suspend_resume() function, which creates the battery_wake_lock wakelock and adds the battery polling task bq27x00_battery_poll to the kernel workqueue:
Code:
if (suspend_resume == RESUME_STR){
wake_lock(&di->wake_lock);
schedule_delayed_work(&di->work, 0);
}
The polling function bq27x00_battery_poll() would call bq27x00_update() to get new information about the battery, which would then also clear the wakelock.
Since the queued polling task is supposed to be run as soon as possible (delay = 0), the wakelock should be released immediately as well. No problem, right? Well, this would be only true if the polling task wasn't already active in the queue from a previous wakeup!
The person who added the battery_wake_lock didn't consider that bq27x00_battery_poll() adds itself to the kernel workqueue and is then triggered on a defined poll interval (default is 60 seconds as hardcoded in the Lenovo source). What does this mean? It means that it's possible, and highly likely, that when the Yoga briefly resumes from deep sleep, that there is still a queued battery polling job in the kernel workqueue. As a result, the code from above, even though it's meant to be triggered immediately, has to wait until the existing queued job has been executed. And that can take up to 60 seconds or to whatever the polling interval is defined. And that is why we are seeing those nasty long battery_wake_lock wakelocks that keep the device from deep sleep half the time.
Tldr: Each time the Yoga briefly resumes from deep sleep (which is normal and happens frequently - albeit it should be only briefly), the battery drivers adds a wakelock which prevents the device from going back to deep sleep for up to 60 seconds. If you have a total of 20 alarms per hour (not unusual - see com.google.android.gms - and normally not an issue since they are meant to be very brief), it means that Lenovo's battery wakelock keeps your device awake for up to 20 minutes or about 30% of the time!
Why did Lenovo add this wakelock? I am not sure, as I haven't seen it anywhere else implemented. In fact, Lenovo removed all wakelocks again from the battery driver in the Android 5.1 release for the Yoga Tab 3 series.
So what's the workaround?
If you have root, you can reduce the polling interval by modifying the poll_interval driver parameter. For example, I reduced the interval to 20 seconds:
Code:
$ cat /sys/module/bq27x00_battery_x8/parameters/poll_interval
60
$ echo 20 > /sys/module/bq27x00_battery_x8/parameters/poll_interval
$ cat /sys/module/bq27x00_battery_x8/parameters/poll_interval
20
While it seems counterproductive at first to reduce the interval and thus increase the number of battery polls, it makes perfect sense if you consider that it also allows the kernel queue to clear faster. Before it could take up to 60 seconds for the wakelock to be released; now it takes only up to 20 seconds. Ideally, when you have the device on, you'd want to set the interval parameter to a higher number again (your battery status is updated every 20 seconds now instead of every 60 seconds), although I haven't noticed any difference in performance or battery life so that's probably not an issue.
Speaking of battery life, attached you see how well my device was doing over last night. The battery charge went down by 1% - from 73% to 72% - in 8 hours! Not bad, is it?
Lastly, I am currently using the YT2-1050F-USR-S100067_1507101258_WW52_ROW firmware and haven't upgraded to the latest OTA yet. It's possible that Lenovo has fixed the issue, although I highly doubt it judging from the lack of discussions in this regard in the Lenovo forums.
Please Lenovo, fix this.
An interesting read, but for the majority of uses including myself- what does it mean in simple language and how can we put it to use.
Most uses do not have the technical knowledge to use this and even those whose tablets are rooted,will probably not know where to look or even make the changes suggested..
Please remember we are not all competent in programming or technical language,help us by keeping it simple,with easy to follow instructions.
@corasman, first and foremost I hope someone from Lenovo will read this thread and forward it to the team responsible for doing the Yoga firmware upgrades.
Meanwhile, in a practical manner, it all depends if you have root access to your device. If you don't, then I am afraid you cannot do anything to workaround this issue. If you do have root, there are multiple ways. The easiest way is to use an automation app like Automagic or Tasker, and have it dynamically adjust the poll_interval parameter depending on whether the screen is on or off. If anyone is interested I can attach my Automagic "flows" here that will do the job. Again - you need root for this.
doctorow said:
@corasman, first and foremost I hope someone from Lenovo will read this thread and forward it to the team responsible for doing the Yoga firmware upgrades.
Meanwhile, in a practical manner, it all depends if you have root access to your device. If you don't, then I am afraid you cannot do anything to workaround this issue. If you do have root, there are multiple ways. The easiest way is to use an automation app like Automagic or Tasker, and have it dynamically adjust the poll_interval parameter depending on whether the screen is on or off. If anyone is interested I can attach my Automagic "flows" here that will do the job. Again - you need root for this.
Click to expand...
Click to collapse
I'll have a go at this and report back,I am rooted and also have TWRP installed and backed up,If you can attach you "flows" please, I grabbed Automagic- where do I add the flows and execute them.
corasman said:
I'll have a go at this and report back,I am rooted and also have TWRP installed and backed up,If you can attach you "flows" please, I grabbed Automagic- where do I add the flows and execute them.
Click to expand...
Click to collapse
Sounds good! Attached you find the Automagic flows. Make sure in the Automagic preferences to have it "start after boot" and also enable "Root functions (Experimental)".
Btw, my overnight awake time is now ~1%.
doctorow said:
Sounds good! Attached you find the Automagic flows. Make sure in the Automagic preferences to have it "start after boot" and also enable "Root functions (Experimental)".
Btw, my overnight awake time is now ~1%.
Click to expand...
Click to collapse
Sorry, that is way over my head, I have had a look in system\power\wakelock and it is empty so assuming it's not doing anything. I am on the latest update,so could be the reason.
corasman said:
Sorry, that is way over my head, I have had a look in system\power\wakelock and it is empty so assuming it's not doing anything. I am on the latest update,so could be the reason.
Click to expand...
Click to collapse
Where did you see this? As far as I know the default system power manager doesn't show wakelocks. Uhm, the flows should be easy to import. Copy the XML file attached in my post above to your device. Then. when you start Automagic, click on its menu (top right button) -> Manage -> Import Flows/Widgets. There you can point to the xml file. It should be imported and the rest should go automatic. What's important is that you enable root in Automagic, which you can do in menu -> Manage -> Preferences.
doctorow said:
Where did you see this? As far as I know the default system power manager doesn't show wakelocks. Uhm, the flows should be easy to import. Copy the XML file attached in my post above to your device. Then. when you start Automagic, click on its menu (top right button) -> Manage -> Import Flows/Widgets. There you can point to the xml file. It should be imported and the rest should go automatic. What's important is that you enable root in Automagic, which you can do in menu -> Manage -> Preferences.
Click to expand...
Click to collapse
I have saved as an XML file,but when I try to import to Automagic it says invalid file.
I have sorted it,used a different XML programming.
Hopefully have it running---yoga battery fix(2 files running)off and on,is that right.
Thanks for the tip, I implemented it in Tasker. I'm on the latest firmware and confirm that the default timer is still 60 seconds btw.
Though I noticed that the first post's code snippet sets the timer to 20 seconds and the Automagic flow sets it to 1. I assume you tested with both timer settings and the 1 second performed better?
My overnight usage of seven and a half hours is one percent.
That's just shutdown to sleep and nothing else turned off.
iampanis said:
Thanks for the tip, I implemented it in Tasker. I'm on the latest firmware and confirm that the default timer is still 60 seconds btw.
Click to expand...
Click to collapse
Thanks for checking. I will update to the latest firmware eventually but what you could check is if the duration of kernel wakelocks decreases with your firmware when the display is switched off after applying the fix (the total "awake" should go down considerably) . The poll interval itself is not the problem - it's the wakelock that they added to the battery driver which is directly influenced by the polling interval. The fix doesn't remove the wakelock or reduce the number of wakelocks. It reduces the duration because it makes sure that the kernel queue is quickly cleared. It was obviously something the Lenovo developer didn't consider.
I have added the same logic to Tasker and attached the Tasker profiles to this thread. Tested only briefly but seems to do the trick.
Though I noticed that the first post's code snippet sets the timer to 20 seconds and the Automagic flow sets it to 1. I assume you tested with both timer settings and the 1 second performed better?
Click to expand...
Click to collapse
This is correct. It was before I decided to dynamically switch the polling interval depending on whether the device is on or off, and depending on whether it is charging or not. A charging device btw is always awake due to safety issues (you want the battery driver to catch an overheating battery...), meaning there are no suspend/resume calls to the battery driver, meaning the wakelock won't even be initiated.
corasman said:
My overnight usage of seven and a half hours is one percent.
That's just shutdown to sleep and nothing else turned off.
Click to expand...
Click to collapse
Nice.
Hello,
I had the same problem on my 1050F, rooted the tablet, installed Tasker and used your project - it works flawlessly However, I am wondering what are the long-term effects of lowering the poll interval for the battery (if any), do you have any conclusions after testing this workaround for a prolonged amount of time? Is lowering the poll interval to 1 safe or some sort of buffer value (10-20s) should be used instead?
I am no developer, just a regular user, but I'd be happy to get some feedback regarding this issue, especially that Lenovo seems to be non-responsive about the problem.
Anybody knows if this issue has been fixed in the lasts updates?
No, not fixed. I am having issues with Tasker not running the profiles correctly, and it's frustrating to wake up and find the battery flat in the morning given it's not the fastest device to charge !
I had this working fine in tasker until recently and now my yoga in on 30% awake and not sure why the tasker profiles dont seem to be working anymore, nothing else short of a few app updates has changed
Hi to all,
I do not know why, but the script don't work for me, it is in "execute" in automagic but the battery continues to discharge during the night.
I set everything up as described, does anyone know how to solve it?
Thanks

[Guide] All battery saver tips

In this thread I'll write (and add later) all the possible and effective ways to save more battery with this device, which has a pretty disappointing sot and doesn't last all the day. My aim is, though, to try explaining what's going on.
Since this is my very first guide thread expect a lot of changes in a short time.
Missing something? PM me or leave a reply here. You can discuss the various methods here as long as you're posting true tips
Let's start!
Little test
Can I hide text here? Nice
Battery Related Tips
Make sure your battery isn't dying Tip popularity: ultra Works: probably
All those tips won't really help you if your battery is faulty!
If you're like "I used to have 6 hrs SOT but suddenly I get 2 hrs on a 5 total" (extreme case) then you should directly buy a new battery (possibly the s7 Edge one) and replace it with the help of your friends
Click to expand...
Click to collapse
Replace your battery with an s7 Edge one Tip popularity: not so much Works: possibly
Just by installing an original S7 Edge battery you're theoretically improving your device's long lasting capacity by 41% (because their size is 2550mAh vs 3600mAh)
Then you'll need to calibrate it. Please refer to this telegram group if you are in need.
Click to expand...
Click to collapse
Display Related Tips
Decrease Brightness more and more Tip popularity: ultra Works: how not!
You'll understand this more when you'll read the next 2 tips! Decrease your screen's brightness and install an app to go even further. Also, enable auto brightness at minimum. It's ok saving power but it isn't if this means having a black screen
Click to expand...
Click to collapse
Black Themes Tip popularity: high Works: of course
This device features an AMOLED display.
If you didn't know, this technology gives you true black by shutting down the pixels on your screen!
Given this, you're actually saving power when your device is displaying pure black
Click to expand...
Click to collapse
Grayscale Display Tip popularity: medium Works: possibly
By setting your device in grayscale mode you're removing colors (wow) and since our device still features that AMOLED technology you're more likely to save power because of darker colors forcing pixels to be almost black.
Don't think you're really shutting down the RGB leds! In fact you're lighting up them all, but with decreased brightness. This won't work well if you use apps with bright/white themes!
It could also save power because of the less data to process(not confirmed)
Click to expand...
Click to collapse
Disable Always On Display Tip popularity: medium Works: yes Explained by: Nikx97
You can't use AOD for long. That's true and Samsung knew why (other than marketing purposes) when our community asked louly for having it on our device.
Behind that, our display is different from the one mounted on s7.
What's different then?
Our display requires the cpu to be awake everytime, updating the screen or not, because there's no memory this display could use to just keep showing an image. From s7 and later, there's this memory that gets updated by the cpu every minute.
This surely ends up with a huge drain
Click to expand...
Click to collapse
Software Related Tips
Reduce your CPU usage
Enable UPSM if you really need it Tip popularity: medium Works: of course
If your phone isn't rooted (I'd ask why are you even here) it will set up for you a black theme and set your device in grayscale mode, while decreasing brightness and disabling most apps. Then is up to you disabling wifi, bluetooth and setting it in airplane mode. I'd rather shut down my phone directly in this particular case
Click to expand...
Click to collapse
Don't play intensive games Tip popularity: Ultra Works: overkill
If you're not playing games your CPU will be grateful to you and your battery too. There's not much to be explained.
Of course you can still play games. Just try to prefer simple ones instead of PUBG Fortnite Asphalt 9 The Sims Minecraft Gta Online etc
Click to expand...
Click to collapse
Set up your CPU governors Tip popularity: suggested only by developers Works: Overkill if set properly
First of all for this you'll probably need a good kernel. Not necessarily a battery kernel, a fairly customizable one would fit nicely (If you're using an S7 Edge battery and you're on Android 7.0, feel free to try my kernel, ask for LKernel here).
Here are the best settings from what I've tried so far (I'm going to explain also why)
You'll need to set (perhaps with the aid of Kernel Adiutor or MTweaks) POWERSAVE governor for LITTLE and CONSERVATIVE for BIG.
The aim of this is to force LITTLE to work more than BIG, because it uses less power and it is enough for off screen processes and whatsapp, telegram and also some games (such as 1010 or sudoku or 2048). If you want to go further with this configuration limit your frequencies: the lowest you can to 600/800mhz for LITTLE and the lowest to 1800mhz for BIG.
With this configuration, when LITTLE can't handle some tasks BIG comes in rescue and solves the problem.
Lazily but it does his work and, of course, use less power.
It is advisable going further with kernel adiutor's settings to save more battery. I'm probably going to post my settings file later
Click to expand...
Click to collapse
That's all I got time for today, maybe I'll add more in a week
Reserved. Just because I don't want people commenting "first!"

Adaptive power saving - Apps randomly changing text size?

Recently it appears that some apps of mine have been randomly changing the text size on the screen. I use the normal size text, haven't adjusted it in settings on my phone or in the apps. My screen resolution is WQHD+. The issue goes away when I completely close the app then reopen it. Most of the time the text becomes much smaller but there are some occasions where the screen text increases in size.
So far this has happened in Facebook, Facebook Messenger, as well as the XDA app (not labs, I don't have that installed).
Anyone else seen similar issues? I think it's due to adaptive power saving but not entirely sure so I decided to ask. I believe it is that setting because when I have it enabled I cannot change my screen resolution, making me believe it may be changing automatically while I'm using the app. I also primarily only use the above mentioned apps, so I don't believe it's localized to those apps.
Disable "adaptive power saving". Samsung has not addressed the bug yet (along with others).
Ace42 said:
Disable "adaptive power saving". Samsung has not addressed the bug yet (along with others).
Click to expand...
Click to collapse
Obviously I already have, it's one of my troubleshooting steps. I am giving it 24 hours because I cannot recreate the issue on demand and cannot predict when it will occur.
Have you seen it mentioned elsewhere?
Outbreak444 said:
Obviously I already have, it's one of my troubleshooting steps. I am giving it 24 hours because I cannot recreate the issue on demand and cannot predict when it will occur.
Have you seen it mentioned elsewhere?
Click to expand...
Click to collapse
Yes... Samsung Community, and other tech communities. 99% sure this bug was dragged from pre release. E: sure it has been mentioned on XDA but I don't spend much time on the S10 sections.
Decided to dig into this issue further and adaptive power saving is NOT the culprit. A convenient scapegoat, but the feature is disabled on my S10+. Anyway, look carefully at these screenshots. Notice anything?
Ace42 said:
Decided to dig into this issue further and adaptive power saving is NOT the culprit. A convenient scapegoat, but the feature is disabled on my S10+. Anyway, look carefully at these screenshots. Notice anything?
Click to expand...
Click to collapse
Medium power saving mode is the culprit (turning it on, or turning it off).
Ace42 said:
Decided to dig into this issue further and adaptive power saving is NOT the culprit. A convenient scapegoat, but the feature is disabled on my S10+. Anyway, look carefully at these screenshots. Notice anything?
Click to expand...
Click to collapse
JoeFCaputo113 said:
Medium power saving mode is the culprit (turning it on, or turning it off).
Click to expand...
Click to collapse
I think it was the combination of both in my case. I try to run on optimised but when adaptive power save was enabled I would find that medium was enabled. Needless to say, the issue has not occurred since disabling adaptive power saving as well as selecting optimised. I appreciate the assistance guys.
There are two problems:
Adaptive power saving used to still change resolution in background, even if it stated it wouldn't do so, it is(was?) a bug and to fix it you had to:
Enable Optimal
Go in the Home screen, pull down the Quickpanel and press on Power mode
It will ask you what settings to change when switching to Medium power mode, select the resolution you want, you might want to disable background data restricting too since it doesn't help
Now enable Optimal again, go to settings and turn Adaptive battery on
This way no matter when adaptive switches to medium power saving, it will follow the settings you saved for that profile.
The next bug is completely random and I don't really have it anymore, I just remember text randomly becoming super small or huge when checking recent apps from certain apps, DPI bug and the only fix was to hit home multiple times.

Categories

Resources