voorkant / voorkant-core

https://voorkant.org/
MIT License
2 stars 3 forks source link

display blanking #83

Open Habbie opened 6 months ago

Habbie commented 6 months ago

On toon1:

eneco-001-357535:~# echo 1 > /sys/class/graphics/fb0/blank  # blanks screen
eneco-001-357535:~# echo 0 > /sys/class/graphics/fb0/blank  # restores screen

I wonder if we can expose this portably, through LVGL perhaps.

Habbie commented 6 months ago

This is not optional; Toon's software might blank the screen before we ssh in to start voorkant, and sometimes it even blanks the screen while voorkant is running.

Habbie commented 5 months ago

This is not optional; Toon's software might blank the screen before we ssh in to start voorkant, and sometimes it even blanks the screen while voorkant is running.

this happens consistently on a 5.49.19. It does not happen on 5.5.7.

Habbie commented 5 months ago

this happens consistently on a 5.49.19. It does not happen on 5.5.7.

and just as i post that, it happens on the 5.5.7 too.

Habbie commented 5 months ago

restarting voorkant unblanks the screen, so it seems like LVGL's fbdev driver knows -something-

Habbie commented 5 months ago

sometimes it even blanks the screen while voorkant is running.

this turns out to be Linux doing console blanking, likely not instructed by Qt (found via SO inside Toon's software, but this shows how they manage (part of) blanking at least.

That Qt snippet, or https://www.man7.org/linux/man-pages/man4/console_codes.4.html (look for ESC [ 9 ; n ] ) shows us how to manage or disable console blanking. To unblock this for v0.1, I'll add the ESC[9 thing to our startup too and see if it manages to keep the screen on permanently.

restarting voorkant unblanks the screen, so it seems like LVGL's fbdev driver knows -something-

display/fbdev.c: if (ioctl(fbfd, FBIOBLANK, FB_BLANK_UNBLANK) != 0) {

the lv fbdev driver indeed does this on init.

Habbie commented 5 months ago

I wonder if we can expose this portably, through LVGL perhaps.

I don't see any entrypoints in LVGL for doing this in a portable way, but we can just do it ourselves then. The ioctl mentioned above might be easier than talking to /sys. Besides blanking after X time and waking up on touch, I kind of like the in between phase where the Toon software goes black background with somewhat minimalistic display of entities.

Habbie commented 5 months ago

Fun discovery: setting display brightness to 0 (echo 0 > /sys/devices/platform/ed2.0-bl.0/backlight/ed2.0-bl.0/ramp_brightness) blanks the screen, but recovering from it (10 or up is fine) is -immediate-.

Habbie commented 5 months ago

In the absence (I think) of an actual ambient brightness sensor, maybe we should emulate f.lux for brightness management? We could also expose our brightness setting to HA to be managed from there.

Habbie commented 1 month ago

Only somewhat related, I find our current UI, and also Toon's non-dimmed UI, quite bright/white. We should definitely have a dark mode.