We've had charging-sdl in pmaports for over 3 years, which is also the same time where the last actual code commit was committed.
Unfortunately it's not working well or at all for many devices. It's also a very basic application which does nothing to actually help the charging process, like switching everything to low-power modes to charge as quickly as possible.
Additionally our main device, the PinePhone is not supported at all by charging-sdl due to the bootloader not adding a cmdline argument that we could use.
In my opinion there is no advantage to keeping charging-sdl in the initfs, due to the aforementioned reasons. Removing it will also solve various downsides where the boot would hang at charging-sdl because the device was booted from a charger which can be quite annoying.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Hi, thanks for point me here. I think charging-sdl as a concept is definitely something that is useful for postmarketOS. However I'd agree that the current implementation is far from ideal.
Unfortunately it's not working well or at all for many devices.
For most Android devices, this is simply due to some issues in the initramfs, these could be fixed with a quick rewrite to apply the same codepath used for osk-sdl, that would allow charging-sdl to work on all devices that currently support osk-sdl.
It's also a very basic application which does nothing to actually help the charging process, like switching everything to low-power modes to charge as quickly as possible.
I think it would be nice to add a few lines to do things like disable CPU cores, reduce display brightness and enable other powersaving features when booting in charging mode. This again is most likely not too difficult to implement, although it would perhaps be sensible to only attempt these things if some deviceinfo variable is set in case some devices don't play nice. I don't personally think these things are too important, if the display is off then we should be charging at the kind of rate people would expect.
Additionally our main device, the PinePhone is not supported at all by charging-sdl due to the bootloader not adding a cmdline argument that we could use.
Do you think it would be possible to implement this? Either in bootloader or even in the kernel, if the PMIC reports the boot reason then we could just read that.
In general, I think charging-sdl has the potential to be a really useful tool for Android devices, whilst no devices that can use it currently exist in main, that may change in the future. I think it would be possible to make charging-sdl a much better experience for the user, when working properly it should be a better user experience than simply booting the system normally.
A few ideas
Get rid of triggerhappy and have charging-sdl be always running
Use a separate application or script to blank the display (by setting brightness to zero) and wake it when the power button is pressed, it would also be nice to have an option to keep the display always on at a low brightness for OLED devices (I can see a deviceinfo var for OLED devices being generally quite useful). Currently on my device, when charging-sdl exits after 5 seconds the device just displays the splash screen, this is obviously not desired behaviour.
Allow the device to exit charging-sdl and continue booting
Use a key combination, or something like holding the power button for 3 seconds to exit charging-sdl and continue booting the device, this should not involve having to reboot. Tying into the point above, if charging-sdl is always running when in boot-charging mode, we should always continue booting when it exits, this would at least prevent annoying hangs on device where charging-sdl doesn't work.
Display more information
Like charging rate, temperatures, etc.
Going forward
If the ideas I've explained above seem reasonable, I'd be happy to implement what changes are possible in initramfs. Properly fixing the checks required to run charging-sdl on devices that support osk-sdl, as well as looking into having charging-sdl be always running, hooking the power button up to the backlight instead. I think charging-sdl does have a place, and more than anything else is actually not very far off from being an application that improves the user experience, rather than hindering it as it does currently.
I believe @DolphinChips has done some work on rewriting charging-sdl, although I'm not sure how complete that is.