T100TAM: When device is locked, screen does not turn off completely (+ workaround patch)

169 views
Skip to first unread message

Дмитрий Карих

unread,
Aug 20, 2017, 11:31:05 AM8/20/17
to Android-x86
Hello everyone!

First of all, thank you for this awesome project. After all that pain with Ubuntu I couldn't imagine it would be so easy to build a working Android image.

I have a small problem with intel_backllight. When I press power button or lock the device in other ways, screen goes black but still glowing at a minimum brightness. It is very hard to notice in daylight, but the problem exists.


I tried to workaround this problem with Tasker and found this way to disable the backlight:

1) Lock:
  1.1) Secure Settings: Lock
  1.2) chvt 1  # Switch to tty1
  1.3) echo 1 > /sys/class/graphics/fb0/blank
2) Unlock:
  2.1) echo 0 > /sys/class/graphics/fb0/blank
  2.2) chvt 7
  2.3) Secure Settings: Wake

This method is not very reliable: If you try to blank the framebuffer from tty7, this command does nothing even after switching to tty1. It also randomly breaks after some tries.


After that I started to dig into the intel_backlight sources and found a function that sets brightness level.
I added a code to disable backlight when brightness is set to 0 and to enable it back on any other value.

if (user_level == 0 && panel->backlight.enabled) {
    intel_panel_disable_backlight(connector);
} else if (!panel->backlight.enabled) {
    intel_panel_enable_backlight(connector);
}

Now display is not glowing in dark, but I suspect that GPU is still draining battery (-9% per hour). 

You can find this patch in the attachments. It was tested on kernel 4.12, but also applies to 4.9 without any conflicts.


Is that a proper way to fix this issue? Or maybe there is a fix that doesn't require the modification of kernel?
0001-HACK-drm-i915-Turn-off-display-completely-when-brigh.patch

youling 257

unread,
Aug 20, 2017, 11:50:42 AM8/20/17
to Android-x86
BYT and BYTCR only support “suspend to idle” ,suspend to idle will closed backlight,your hack patch is bad !

在 2017年8月20日星期日 UTC+8下午11:31:05,Dmitry Karikh写道:

youling 257

unread,
Aug 20, 2017, 11:51:20 AM8/20/17
to Android-x86
locked and enter suspend to idle


在 2017年8月20日星期日 UTC+8下午11:31:05,Dmitry Karikh写道:
Hello everyone!

youling 257

unread,
Aug 20, 2017, 11:53:35 AM8/20/17
to Android-x86
when you locked and wakeup,please you provide dmesg.txt,
alt+f1 or Android terminal,dmesg > /sdcard/dmesg.txt


在 2017年8月20日星期日 UTC+8下午11:31:05,Dmitry Karikh写道:
Hello everyone!

Dmitry Karikh

unread,
Aug 20, 2017, 11:54:09 AM8/20/17
to Android-x86
I had to disable suspend in build.prop because it caused freezes. Device enters suspend normally and can't leave it.
Also without suspend the device is much easier to use. I can close lid and open it back within seconds.

воскресенье, 20 августа 2017 г., 18:51:20 UTC+3 пользователь youling 257 написал:

youling 257

unread,
Aug 20, 2017, 11:59:02 AM8/20/17
to Android-x86
it is exactly “echo freeze > /sys/power/state” ,OK ?


[ 54.719594] CPU2: update max cpu_capacity 1024
[ 54.722920] Cannot set affinity for irq 87
[ 54.724147] smpboot: CPU 1 is now offline
[ 54.740561] CPU0: update max cpu_capacity 1024
[ 54.743900] smpboot: CPU 2 is now offline
[ 54.761541] smpboot: CPU 3 is now offline
[ 54.772290] PM: suspend entry 2017-08-19 22:53:41.705121022 UTC
[ 54.772296] PM: Syncing filesystems ... done.
[ 54.789944] PM: Preparing system for sleep (freeze)

[ 54.791524] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 54.793407] Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done.
[ 54.794344] PM: Suspending system (freeze)
[ 54.794347] Suspending console(s) (use no_console_suspend to debug)
[ 54.888203] sst-mfld-platform sst-mfld-platform: Enter: enable=0 port_name=media-cpu-dai
[ 54.888351] sst-mfld-platform sst-mfld-platform: Enter: enable=0 port_name=ssp0-port
[ 54.892587] serial 00:02: disabled
[ 54.892719] rtc_cmos 00:00: suspend, ctrl 02
[ 54.892819] rtc_cmos 00:00: System wakeup disabled by ACPI
[ 54.896809] RTL8723BS: suspend start
[ 54.896982] RTL8723BS: rtw_cmd_thread(wlan0) stop_req:1, break
[ 54.897760] RTL8723BS: rtw_dev_unload: driver not in IPS
[ 54.907197] RTL8723BS: rtw suspend success in 11 ms
[ 55.404685] PM: suspend of devices complete after 515.318 msecs
[ 55.435550] PM: late suspend of devices complete after 30.850 msecs
[ 55.451315] PM: noirq suspend of devices complete after 15.736 msecs
[ 55.451326] PM: suspend-to-idle
[ 56.645282] Suspended for 1.193 seconds
[ 56.645476] PM: resume from suspend-to-idle
[ 56.672545] PM: noirq resume of devices complete after 27.007 msecs
[ 56.814546] PM: early resume of devices complete after 141.691 msecs
[ 56.887185] RTL8723BS: resume start
[ 56.895618] rtl8723bs: acquire FW from file:rtlwifi/rtl8723bs_nic.bin
[ 57.135069] rtc_cmos 00:00: Could not get RTC status
[ 57.135073] rtc_cmos 00:00: resume, ctrl 22
[ 58.381990] RTL8723BS: rtw_resume_common:0 in 1495 ms
[ 58.382242] PM: resume of devices complete after 1567.680 msecs
[ 58.383045] sst-mfld-platform sst-mfld-platform: Enter: enable=1 port_name=media-cpu-dai
[ 58.383226] sst-mfld-platform sst-mfld-platform: Enter: enable=1 port_name=ssp0-port
[ 58.384174] PM: Finishing wakeup.
[ 58.384180] Restarting tasks ... 
[ 58.396361] sst-mfld-platform sst-mfld-platform: Enter: enable=0 port_name=ssp0-port
[ 58.399589] intel_sst_acpi 80860F28:00: Free for str 1 pipe 0x90
[ 58.399821] intel_sst_acpi 80860F28:00: FW sent error response 0x4000e
[ 58.399835] intel_sst_acpi 80860F28:00: free stream returned err -1
[ 58.418167] done.
[ 58.447752] PM: suspend exit 2017-08-19 22:53:45.380588989 UTC

在 2017年8月20日星期日 UTC+8下午11:54:09,Dmitry Karikh写道:

youling 257

unread,
Aug 20, 2017, 12:00:33 PM8/20/17
to Android-x86
if you can't wakeup from suspend freeze on Android x86 7.1 rc1 4.9 kernel,the 4.12 kernel no problem for you.


在 2017年8月20日星期日 UTC+8下午11:54:09,Dmitry Karikh写道:
I had to disable suspend in build.prop because it caused freezes. Device enters suspend normally and can't leave it.

youling 257

unread,
Aug 20, 2017, 12:07:21 PM8/20/17
to Android-x86
but,if you don't want sleep enter suspend,want to play music and background download,your hack patch is necessary


在 2017年8月20日星期日 UTC+8下午11:31:05,Dmitry Karikh写道:
Hello everyone!

Dmitry Karikh

unread,
Aug 20, 2017, 12:19:06 PM8/20/17
to Android-x86

Tried "echo freeze > /sys/power/state" on 4.12 a minute ago.


At first time it did nothing. dmesg wrote this: "PM: Wakeup pending, aborting suspend" (see dmesg.1.txt for full log).

I executed it again and device entered suspend (screen turned off). I tried to wake it back without any success. Had to hold the power button for hard reset.

After reboot I executed this command one more time and device rebooted immediately.


Three different results at the same device...


P.S. Still figuring out how Google Groups work. So I had to repost a reply here.

воскресенье, 20 августа 2017 г., 19:00:33 UTC+3 пользователь youling 257 написал:

youling 257

unread,
Aug 20, 2017, 12:24:52 PM8/20/17
to Android-x86
did you use Hans patches ? https://github.com/jwrdegoede/linux-sunxi/commits/v4.12-footrail


CONFIG_PMIC_OPREGION=y
CONFIG_CRC_PMIC_OPREGION=y
CONFIG_XPOWER_PMIC_OPREGION=y
CONFIG_BXT_WC_PMIC_OPREGION=y
CONFIG_CHT_WC_PMIC_OPREGION=y


在 2017年8月21日星期一 UTC+8上午12:19:06,Dmitry Karikh写道:

Dmitry Karikh

unread,
Aug 20, 2017, 12:37:20 PM8/20/17
to Android-x86
Will try to build it now, thanks!
Currently I use maurossi's kernel with some patches for T100TA (cstate, touchpad, etc.) and custom config (-CONFIG_ASUS_WMI, +CONFIG_INV_MPU6050_IIO).

воскресенье, 20 августа 2017 г., 19:24:52 UTC+3 пользователь youling 257 написал:

Povilas Staniulis

unread,
Aug 20, 2017, 12:40:38 PM8/20/17
to andro...@googlegroups.com
Didn't notice that branch on Hans's git.
Please report your success with these patches.

On 2017.08.20 19:37, Dmitry Karikh wrote:
> Will try to build it now, thanks!
> Currently I use maurossi's kernel with some patches for T100TA
> (cstate, touchpad, etc.) and custom config (-CONFIG_ASUS_WMI,
> +CONFIG_INV_MPU6050_IIO).
>
> воскресенье, 20 августа 2017 г., 19:24:52 UTC+3 пользователь youling
> 257 написал:
>
> did you use Hans patches ?
> https://github.com/jwrdegoede/linux-sunxi/commits/v4.12-footrail
> <https://github.com/jwrdegoede/linux-sunxi/commits/v4.12-footrail>
>
> https://groups.google.com/d/msg/android-x86/OOdwiY9XRKU/hKrVyguzBwAJ
> --
> You received this message because you are subscribed to the Google
> Groups "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to android-x86...@googlegroups.com
> <mailto:android-x86...@googlegroups.com>.
> To post to this group, send email to andro...@googlegroups.com
> <mailto:andro...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/android-x86.
> For more options, visit https://groups.google.com/d/optout.


youling 257

unread,
Aug 20, 2017, 12:47:06 PM8/20/17
to Android-x86
must revert the rtc patch,
https://groups.google.com/d/msg/android-x86/OOdwiY9XRKU/puQlBxbPBAAJ

#!/system/bin/sh
# Wifi
echo "on" > /sys/bus/platform/drivers/sdhci-acpi/INT33BB:00/power/control 
# eMMC
echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:00/power/control
echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:01/power/control 
# MicroSD
echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:02/power/control

在 2017年8月21日星期一 UTC+8上午12:37:20,Dmitry Karikh写道:

Dmitry Karikh

unread,
Aug 20, 2017, 2:28:47 PM8/20/17
to Android-x86
Test results don't seem to make any sense. Looks like they are still random.

Test command: cat /proc/kmsg & echo freeze > /sys/power/state

1. jwrdegoede/linux-sunxi v4.12-footrail
CONFIG_PMIC_OPREGION=y
CONFIG_CRC_PMIC_OPREGION=y
CONFIG_XPOWER_PMIC_OPREGION=y
CONFIG_BXT_WC_PMIC_OPREGION=y
CONFIG_CHT_WC_PMIC_OPREGION=y

Result: instant reboot

--

2. Revert RTC patch a1e23a42f1bdc00e32fc4869caef12e4e6272f26

Result: complete freeze after "PM: Preparing system for sleep (freeze)"

--

3. sdhci-acpi
#!/system/bin/sh
# Wifi
echo "on" > /sys/bus/platform/drivers/sdhci-acpi/INT33BB:00/power/control
# eMMC
echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:00/power/control
echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:01/power/control
# MicroSD
echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:02/power/control # No such file or directory

Result: instant reboot

--

4. Combine 2 and 3

Result: instant reboot



воскресенье, 20 августа 2017 г., 19:47:06 UTC+3 пользователь youling 257 написал:

Chih-Wei Huang

unread,
Aug 20, 2017, 10:48:18 PM8/20/17
to Android-x86
You continue mentioning to revert the patch
“rtc: cmos: Do not assume irq 8 for rtc when there are no legacy irqs”
but it's NOT in our kernel-4.9 branch, only in the upstream.
So what's the exact problem of kernel-4.9 you think?

> https://bugzilla.kernel.org/show_bug.cgi?id=88061
> #!/system/bin/sh
> # Wifi
> echo "on" > /sys/bus/platform/drivers/sdhci-acpi/INT33BB:00/power/control
> # eMMC
> echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:00/power/control
> echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:01/power/control
> # MicroSD
> echo "on" > /sys/bus/platform/drivers/sdhci-acpi/80860F14:02/power/control

This looks like promising.
However I have lost my T100TA so
I'm unable to test.

I think it could be added to /etc/init.sh.
Welcome to send me a confirmed patch.



--
Chih-Wei
Android-x86 project
http://www.android-x86.org

youling 257

unread,
Aug 20, 2017, 11:20:19 PM8/20/17
to Android-x86
I saw many people BYT/CHT device auto reboot on 4.9 kernel when suspend,in Phoenix chinese forum,Phoenix os 2.1.0 used many your osdn 4.9 kernel patches,include my provide patches.
except kernel config lost pmic,
CONFIG_PMIC_OPREGION=y,CONFIG_CRC_PMIC_OPREGION=y,CONFIG_XPOWER_PMIC_OPREGION=y,CONFIG_BXT_WC_PMIC_OPREGION=y,CONFIG_CHT_WC_PMIC_OPREGION=y

youling 257

unread,
Aug 20, 2017, 11:24:44 PM8/20/17
to Android-x86
from this https://github.com/youling257/android-4.9/commits/update?after=cb2ce15d4a2b11dce73e22b7d8c7ef430eb63334+384 begin,no any more patches for suspend 

在 2017年8月21日星期一 UTC+8上午11:20:19,youling 257写道:

youling 257

unread,
Aug 20, 2017, 11:30:16 PM8/20/17
to Android-x86
a device success suspend/resume on 4.9 kernel,no auto reboot.

dmesg,TOSHIBA TOSHIBA WT10-A/Type2 

Chih-Wei Huang

unread,
Aug 20, 2017, 11:34:33 PM8/20/17
to Android-x86
2017-08-21 11:20 GMT+08:00 youling 257 <youli...@gmail.com>:
> I saw many people BYT/CHT device auto reboot on 4.9 kernel when suspend,in
> Phoenix chinese forum,Phoenix os 2.1.0 used many your osdn 4.9 kernel
> patches,include my provide patches.
> except kernel config lost pmic,
> CONFIG_PMIC_OPREGION=y,CONFIG_CRC_PMIC_OPREGION=y,CONFIG_XPOWER_PMIC_OPREGION=y,CONFIG_BXT_WC_PMIC_OPREGION=y,CONFIG_CHT_WC_PMIC_OPREGION=y
> i can't say clearly the reason.

OK. I'll add these configs.
I'll check these. Thanks!

youling 257

unread,
Aug 20, 2017, 11:40:30 PM8/20/17
to Android-x86
PM / sleep: System sleep state selection interface rework
PM / sleep: Fix test_suspend after sleep state rewor
ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers

ASoC: intel: Use vmalloc()/vfree() instead of kzalloc()/kfree(),because ASoC: intel: Use kvzalloc() for suspend buffers for 4.12+ kernel

在 2017年8月21日星期一 UTC+8上午11:34:33,Chih-Wei Huang写道:
Reply all
Reply to author
Forward
0 new messages