Jump to content

Charging-sdl

From postmarketOS Wiki
Revision as of 23:09, 27 March 2018 by Drebrez (talk | contribs) (Created page with "This is an application developed by the postmarketOS community to display the charging status when the device is powered on in "charge mode". It is written in C and uses SDL2...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is an application developed by the postmarketOS community to display the charging status when the device is powered on in "charge mode".

It is written in C and uses SDL2/SDL_power to query the battery information. The charging-sdl package is part of postmarketOS's aports.

Reporting Issues

Issues with charging-sdl should be reported on the project github issues page.

Current implementation

If you connect the usb cable to the phone while it's powered off, it should start the device as usual and in the initramfs it should detect that it's started in "charge mode" and show the charging-sdl for 5 seconds.

Then you can show again the charging-sdl for another 5 seconds by pressing the power key.

If the charging-sdl shows a lightning icon in the top left of the screen, it means that the battery it's charging, if you unplug it, the icon should disappear.

Run charging-sdl manually

You first have to boot the device into the debug-shell. (See Inspecting_the_initramfs)

After you connected to the device using telnet, you can run:

$ source /init_functions.sh
$ mount_boot_partition
$ extract_initramfs_extra /path/to/initramfs-extra      (e.g. /boot/initramfs-samsung-i9070-extra)
$ setup_directfb_tslib
$ fontpath=$(awk '/^keyboard-font/{print $3}' /etc/osk.conf)
$ charging-sdl -pcf "$fontpath"

Troubleshooting

Charge mode not detected

In order to detect if the device has been powered on in "charge mode", the initramfs script looks for specific options in the kernel cmdline (e.g.: androidboot.mode=charger)

Compare your kernel cmdline when powered on normally and when you power on by connecting the usb cable only. If you find a specific option to distinguish the two boot modes, please update the initramfs script.

DirectFB/FBDev: No supported modes found in /etc/fb.modes and current mode not supported!

See osk-sdl troubleshooting page