Inserting power supply resumes from suspend
#1
I'm currently running my pinebook on the default Ubuntu Mate installation with updated kernel/bootloaders.
I did replace the Mate window manager with something more light weight.

And I noticed the other day that my battery had discharged beyond my expectations. Some testing later I noticed that whenever I plug in or remove the power supply it leaves "suspend" mode. And thus causes a lot more battery drain. Anyone know why this happens and if we can prevent it?
#2
Just had a quick chat with Olliver Schinagl, who is assisting in part of the Mainline linux kernel work for the Allwinner A20, and the Olimex Lime2 board. Very closely related to the A64. As they are both using the same power management IC.

Long story short, this behaviour is part of the AXP power management IC, and is configurable. The power management IC can give an interrupt depending on various conditions. The mainline kernel most likely configures this correct while our Pine64 kernel doesn't setup this properly. Didn't investigate beyond this yet.
#3
It's typical behavior for Android devices to wake up when the charger is plugged in. It seems like the Ubuntu Pinebook kernel is still using the same configuration as Android.

BTW, are you the Daid from Ultimaker?
#4
Noticed today that the screen turns on a short while with a "charging" image and then turns off again when the laptop is off and you plugin in a charger. (Maybe the bootloader responding differently to this startup "event"?)


Yes, that's me. Pinebook sparked my interest due to the similar CPU as in the Ultimaker 3. (Allwinner A20 -> A64)
#5
Perhaps because its essentially a tablet SOC - and the tablets I have used in the past behave in a similar fashion when plugged into mains.
You can find me on IRC, Discord and Twitter


#6
Yah, you can actually find the battery charging graphics on the /boot partition (/boot/bat/battery_charge.bmp). All Android devices seem to have a charging mode they boot into when plugged in. In our case it's part of the bootloader, but I've seen others where they actually boot the kernel and the init.rc script decides what to do.

Another weird thing is that the charging light does not come on when the laptop is off and you plug it in.

Daid, I'm from MatterHackers. We're big Ultimaker fans.
#7
For now, I've just added the simple hack of responding to the "left sleep" event on DBus, and when this happens and the lid is closed (can also be queried by DBus) then my script requests to suspend again. Seems to work for my use case.

(Everyone is big Ultimaker fans Tongue )
#8
(08-10-2017, 02:36 PM)daid Wrote: For now, I've just added the simple hack of responding to the "left sleep" event on DBus, and when this happens and the lid is closed (can also be queried by DBus) then my script requests to suspend again. Seems to work for my use case.

(Everyone is big Ultimaker fans Tongue )

Dont be a tease, share the script :Tongue
You can find me on IRC, Discord and Twitter


#9
It's part of my work in progress AwesomeWM pinebook configuration. As part of the battery monitoring & power management:
https://github.com/daid/awesome-pinebook...ry.lua#L51
I'm not recommending this over the default Mate setup yet. It requires Awesome4 (Default Ubuntu install can only deliver Awesome3) and it lacks functionality for WiFi configuration. If you are not afraid of a terminal however, and have no problem configuring your WiFi with "nmtui", and want to run a Tiling window manager. Then you can run my config. But expect problems and bugs :-)


Could also be adapted to run stand alone. You do need to run the glib main loop with "gli.GLib.MainLoop():run()" at the end of a lua script to make the dbus updating running. And just have the relevant functions in there.
Pretty sure you can also hack something together with bash and dbus-monitor.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pinebook wont turn on. Keeps blinking power light Taelsdoll 13 19,993 03-07-2020, 03:02 AM
Last Post: hoyd
  Can I Replace A Broken Power Plug? jschall 2 3,303 07-21-2019, 10:00 AM
Last Post: jschall
  No Power Supply? data_generating_event 5 7,656 05-29-2019, 08:22 AM
Last Post: soupbowl
Photo Pinebook micro USB power input mod phuzy 4 5,944 05-20-2019, 09:17 PM
Last Post: phuzy
  Power supply replacement, but shipping is expensive kurai021 3 4,389 12-20-2017, 08:44 PM
Last Post: Siliconserf
  UK Power Suggestions soupbowl 10 14,390 06-19-2017, 10:58 AM
Last Post: soupbowl

Forum Jump:


Users browsing this thread: 2 Guest(s)