rsora / luncher

lunch proposals
0 stars 1 forks source link

Tweaking screen refresh to trigger refreshes at each change #19

Open rsora opened 2 years ago

rsora commented 2 years ago

following https://forum.xda-developers.com/t/tweaking-the-screen-refresh.1241419/

I'll go with Method 2 (also good to know that /system/bin/clrbootcount.sh is executed when the boot is completed)

sys/class/graphics/fb0/, there are some interesting options :

  • epd_percent (default: 85) "EPD Flushing Update percentage for AUTO Mode" is the percentage of the screen that has to change to trigger a full refresh of the screen

  • epd_delay (default 100) "EPD Flush elimination window (ms) for AUTO Mode" is the time before a full refresh apply.

  • pgflip_refresh (default 0) If you set it to 1, it disables the full refresh when reading a book (with the stock app) There are other options in this directory but I don't know what they do.

Disclaimer : I'm not responsible if anything happen when editing these files. (It is possible that some values are dangerous for your nook, I don't know)

Increasing the value of epd_percent can be useful to have less flashes or to increase the speed of page scrolling in the web browser. (but you may have more ghosting) Decreasing the value of epd_delay allow faster full refresh (but if you decrease it too much when you scroll a page, you will have several full refresh instead of only one) epd_percent and epd_delay have no effect in the stock reading app

How to modify these options ? Method 1: with adb Example :

adb shell
# cd /sys/class/graphics/fb0/
# echo -n 90 > epd_percent
# echo -n 60 > epd_delay

(With this method, these values will be reset at each boot)

Method 2: adding the previous commands at the end of /system/bin/clrbootcount.sh (this file is executed when the boot is completed)

adb pull /system/bin/clrbootcount.sh
//Now you can edit this file and add at the end a command (like echo -n 95 > /sys/class/graphics/fb0/epd_percent for instance)
//Then
adb shell mount -o remount,rw /dev/block/mmcblk0p5 /system
adb push clrbootcount.sh /system/bin/clrbootcount.sh
adb shell chmod 755 /system/bin/clrbootcount.sh

Method 3 Modifying the init.rc in the uRamdisk (untested)

# Set EPD Flushing Update percentage for AUTO Mode.
    write /sys/class/graphics/fb0/epd_percent 85
# Set EPD Flush elimination window (ms) for AUTO Mode.
    write /sys/class/graphics/fb0/epd_delay 100
rsora commented 2 years ago

seems like /system/bin/clrbootcount.sh is actually executed!, it could be interesting to launch an auto-reboot script to remove my cronjob in the rpi that reboots the nook every night.

Another interesting thing that I discovered is that you can force a refresh that deletes all the ghosting with the following command:

echo -n 1 > /sys/class/graphics/fb0/epd_refresh

I need to think about having it refreshing sometimes the screen, via script or ssh from RPI.

Unfortunately, seems like setting

echo -n 1 > epd_percent
echo -n 100 > epd_delay

seems like having no particular effect.... maybe I'll tweak it more in the next weeks