Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook > PocketBook Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-19-2026, 09:28 AM   #1
x3oo
Connoisseur
x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.
 
Posts: 59
Karma: 3656
Join Date: Feb 2009
Device: cybook
faster display inkpad 3 pro and others

# REAGL Mode for PocketBook — Activation Guide

REAGL is a ghost-compensated non-flashing EPD waveform mode built into the factory
waveform file. It delivers 16-gray quality at 2.1× the speed of GC16 (270 vs 576 frames
at room temperature), handling ghosting on every partial update so you no longer need
periodic full-screen flashes.

## What It Does

```
GC16 (stock): erase → black → white → target → 576 frames, visible flash
REAGL (mod): ghost-compensate → target → 270 frames, no flash
```

InkView (PocketBook's display server) only uses GC16 (mode 2). By telling the kernel
"when InkView asks for mode 2, use mode 8's waveform data instead", all updates become
REAGL. No files modified. No InkView patching. Survives until reboot.

## Prerequisites

- PocketBook device with Allwinner B288 SoC (InkPad 3, InkPad 3 Pro, InkPad 4, Touch HD 3, Color, Verse, Era)
- Root SSH access via pbjb jailbreak ([guide](https://www.mobileread.com/forums/sh...d.php?t=325185))
- KOReader installed and booting directly

## Activation (Runtime)

SSH into the device and run:

```sh
luajit -e '
ffi = require("ffi")
ffi.cdef[[int open(const char*,int); int close(int); int ioctl(int, unsigned long, ...);]]
require("ffi/mxcfb_pocketbook_h")
ffi.cdef[[struct mxcfb_waveform_modes { int mode_count; int modes[16]; };]]
wm = ffi.new("struct mxcfb_waveform_modes")
wm.mode_count = 11
for i = 0, 10 do wm.modes[i] = 8 end
wm.modes[14] = 8
fd = ffi.C.open("/dev/fb0", 2)
ffi.C.ioctl(fd, 0x4024462B, wm)
ffi.C.close(fd)
print("REAGL active")
'
```

Takes effect immediately. KOReader and native PocketBook UI both benefit.

### In KOReader — Disable Full Refresh

Gear menu → Screen → E-ink settings → Full refresh rate → Never (or 99).

With REAGL ghost-compensating each partial, periodic flashes are unnecessary.

## Making Permanent (Survives Reboot)

Add the luajit one-liner to `/mnt/secure/etc/init.d/03-koreader.sh` before the bind-mounts.
Replace `/path/to/koreader` with your KOReader build path:

```sh
#!/bin/sh
# Activate REAGL mode remap
/path/to/koreader/luajit -e '
ffi = require("ffi")
ffi.cdef[[int open(const char*,int); int close(int); int ioctl(int, unsigned long, ...);]]
require("ffi/mxcfb_pocketbook_h")
ffi.cdef[[struct mxcfb_waveform_modes { int mode_count; int modes[16]; };]]
wm = ffi.new("struct mxcfb_waveform_modes")
wm.mode_count = 11
for i = 0, 10 do wm.modes[i] = 8 end
wm.modes[14] = 8
fd = ffi.C.open("/dev/fb0", 2)
ffi.C.ioctl(fd, 0x4024462B, wm)
ffi.C.close(fd)
'

# Bind-mount KOReader over bookshelf
umount /ebrmain/cramfs/bin/bookshelf.app 2>/dev/null
mount --bind /mnt/secure/bin/bookshelf_koreader /ebrmain/cramfs/bin/bookshelf.app
```

## Verification

```sh
# Check waveform modes loaded (mode 8 should appear)
cat /sys/devices/platform/sw-epdc.0/waveform_info | grep Waveforms

# Send a test mode 2 update and check dmesg
luajit -e '
ffi = require("ffi")
ffi.cdef[[int open(const char*,int);int close(int);int ioctl(int,unsigned long,...);]]
require("ffi/mxcfb_pocketbook_h")
u = ffi.new("struct mxcfb_update_data")
u.update_region.top=500;u.update_region.left=500
u.update_region.width=200;u.update_region.height=2 00
u.waveform_mode=2;u.update_mode=0;u.temp=0x1000
fd = ffi.C.open("/dev/fb0",2)
ffi.C.ioctl(fd, ffi.C.MXCFB_SEND_UPDATE, u)
ffi.C.close(fd)
'
dmesg | grep "wf=2" | tail -1
# Shows wf=2 but uses REAGL internally — remap is transparent
```

## Recovery

Reboot. The remap is RAM-only. Or hot-load the original WBF:

```sh
cat /boot/default.wbf > /sys/devices/platform/sw-epdc.0/waveform_binary
```

## Speed Comparison (24°C)

| Mode | Frames | Relative |
|------|--------|----------|
| GC16 (mode 2) | 576 | 1.0× |
| GS16 (mode 14) | 435 | 1.3× |
| GL16 (mode 5) | 435 | 1.3× |
| **REAGL (mode 8)** | **270** | **2.1×** |
| DU (mode 1, B/W) | 247 | 2.3× |
x3oo is offline   Reply With Quote
Old 05-20-2026, 03:32 AM   #2
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 852
Karma: 694086
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
I was curious and tried it:
1) First attempt with a script on the PB 740 running luajit as root.
Quote:
#!/bin/sh
# Activate REAGL mode remap
/mnt/secure/su /mnt/ext1/applications/koreader/luajit -e '
ffi = require("ffi")
ffi.cdef[[int open(const char*,int); int close(int); int ioctl(int, unsigned long, ...);]]
require("ffi/mxcfb_pocketbook_h")
ffi.cdef[[struct mxcfb_waveform_modes { int mode_count; int modes[16]; };]]
wm = ffi.new("struct mxcfb_waveform_modes")
wm.mode_count = 11
for i = 0, 10 do wm.modes[i] = 8 end
wm.modes[14] = 8
fd = ffi.C.open("/dev/fb0", 2)
ffi.C.ioctl(fd, 0x4024462B, wm)
ffi.C.close(fd)
'
2) Second attempt via ssh in koreader.

Booth tries failed with some couldn't find error:

Quote:
/mnt/ext1$ /mnt/ext1/applications/koreader/luajit -e '
ffi = require("ffi")
ffi.cdef[[int open(const char*,int); int close(int); int ioctl(int, unsigned long, ...);]]
require("ffi/mxcfb_pocketbook_h")
ffi.cdef[[struct mxcfb_waveform_modes { int mode_count; int modes[16]; };]]
wm = ffi.new("struct mxcfb_waveform_modes")
wm.mode_count = 11
for i = 0, 10 do wm.modes[i] = 8 end
wm.modes[14] = 8
fd = ffi.C.open("/dev/fb0", 2)
ffi.C.ioctl(fd, 0x4024462B, wm)
ffi.C.close(fd)
'
/mnt/ext1/applications/koreader/luajit: (command line):4: module 'ffi/mxcfb_pocketbook_h' not found:
no field package.preload['ffi/mxcfb_pocketbook_h']
no file './ffi/mxcfb_pocketbook_h.lua'
no file '/usr/local/share/luajit-2.1/ffi/mxcfb_pocketbook_h.lua'
no file '/usr/local/share/lua/5.1/ffi/mxcfb_pocketbook_h.lua'
no file '/usr/local/share/lua/5.1/ffi/mxcfb_pocketbook_h/init.lua'
no file './ffi/mxcfb_pocketbook_h.so'
no file '/usr/local/lib/lua/5.1/ffi/mxcfb_pocketbook_h.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
(command line):4: in main chunk
[C]: at 0x00013ee1

Last edited by nhedgehog; 05-20-2026 at 04:15 AM.
nhedgehog is offline   Reply With Quote
Advert
Old 05-21-2026, 12:00 AM   #3
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,938
Karma: 12984859
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
I used this as reagl.sh:
Code:
#!/mnt/secure/su /bin/sh
cd /mnt/ext1/applications/koreader
luajit -e '
ffi = require("ffi")
ffi.cdef[[int open(const char*,int); int close(int); int ioctl(int, unsigned long, ...);]]
require("ffi/mxcfb_pocketbook_h")
ffi.cdef[[struct mxcfb_waveform_modes { int mode_count; int modes[16]; };]]
wm = ffi.new("struct mxcfb_waveform_modes")
wm.mode_count = 11
for i = 0, 10 do wm.modes[i] = 8 end
wm.modes[14] = 8
fd = ffi.C.open("/dev/fb0", 2)
ffi.C.ioctl(fd, 0x4024462B, wm)
ffi.C.close(fd)
'
And this as test_reagl.sh:
Code:
#!/mnt/secure/su /bin/sh
cd /mnt/ext1/applications/koreader
cat /sys/devices/platform/sw-epdc.0/waveform_info | grep Waveforms
luajit -e '
ffi = require("ffi")
ffi.cdef[[int open(const char*,int);int close(int);int ioctl(int,unsigned long,...);]]
require("ffi/mxcfb_pocketbook_h")
u = ffi.new("struct mxcfb_update_data")
u.update_region.top=500;u.update_region.left=500
u.update_region.width=200;u.update_region.height=200
u.waveform_mode=2;u.update_mode=0;u.temp=0x1000
fd = ffi.C.open("/dev/fb0",2)
ffi.C.ioctl(fd, ffi.C.MXCFB_SEND_UPDATE, u)
ffi.C.close(fd)
'
dmesg | grep "wf=2" | tail -1
Output from PBTerm running test_reagl.sh before and after reagl.sh:
Code:
/ $ /mnt/ext1/test_reagl.sh
Waveforms:      0 1 2 3 4 5 6 7 8 13 14 
[  125.060671] [epdc]  %%UPDATE: pid=1877 wf=2 mode=1 area=(0,0,1448,1072) FB[2:1448x1072] 10000000
/ $ /mnt/ext1/reagl.sh
/ $ /mnt/ext1/test_reagl.sh
Waveforms:      0 1 2 3 4 5 6 7 8 13 14 
[  163.820820] [epdc]  %%UPDATE: pid=1877 wf=2 mode=1 area=(0,0,1448,1072) FB[2:1448x1072] 10000000
/ $
There does not appear to be anything changed?

And from my other post...

For the bind-mount, what is:
/mnt/secure/bin/bookshelf_koreader
This write-up does not specify what this file is, how it is created.

I'm guessing the prerequisite:
- KOReader installed and booting directly
is the reason it isn't working??? But again, there is no explanation to what this implies.

On PocketBooks KOReader can be set as the default app to open ebook file-extensions and the device can be set to open the "last book read" automatically, therefore KOReader would boot directly... but I doubt this is what you are alluding to.

Last edited by neil_swann80; 05-21-2026 at 04:04 AM.
neil_swann80 is offline   Reply With Quote
Old 05-21-2026, 03:53 AM   #4
EastEriq
Addict
EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.
 
Posts: 204
Karma: 195502
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Quote:
Originally Posted by neil_swann80 View Post
There does not appear to be anything changed?
Haven't tried it yet myself, but OP stated

Quote:
Originally Posted by x3oo View Post
# Shows wf=2 but uses REAGL internally — remap is transparent
EastEriq is offline   Reply With Quote
Old 05-21-2026, 04:00 AM   #5
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,938
Karma: 12984859
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
@EastEriq - It may have worked I suppose, but then running the test is pointless as-is as its output is the same before and after making the change
neil_swann80 is offline   Reply With Quote
Advert
Old 05-21-2026, 10:11 AM   #6
EastEriq
Addict
EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.
 
Posts: 204
Karma: 195502
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Giving a go on pb631, having copied neil_swann80's reagl.sh as /mnt/ext1/applications/REAGL.app, but a)
Code:
/mnt/ext1/applications # ./REAGL.app 
./REAGL.app: line 15: luajit: not found
despite
Code:
/mnt/ext1/applications # ls -l koreader/luajit 
-rwxrwxrwx    1 root     root        350168 Mar 17 02:00 koreader/luajit

ETA: solved with
Code:
cd /mnt/ext1/applications/koreader
/mnt/ext1/applications/koreader/luajit -e '
and b), no /sys/devices/platform/sw-epdc.0 dir on my device

Last edited by EastEriq; 05-21-2026 at 10:21 AM. Reason: solved a)
EastEriq is offline   Reply With Quote
Old 05-21-2026, 10:46 AM   #7
x3oo
Connoisseur
x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.
 
Posts: 59
Karma: 3656
Join Date: Feb 2009
Device: cybook
this method is likely display specific only will work on carta screen devices. koreader isn't necessary thats a mistake in my documentation.
It's changing parameters in the display driver.
With some considerable coding you could implement even faster display changes. speak 3 times faster.
x3oo is offline   Reply With Quote
Old 05-21-2026, 11:18 AM   #8
EastEriq
Addict
EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.EastEriq can program the VCR without an owner's manual.
 
Posts: 204
Karma: 195502
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
I though the old pb631 has a Carta display. Maybe sw-epdc.0/ is a FW6 thing?
EastEriq is offline   Reply With Quote
Old 05-21-2026, 11:48 AM   #9
x3oo
Connoisseur
x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.x3oo can teach chickens to fly.
 
Posts: 59
Karma: 3656
Join Date: Feb 2009
Device: cybook
Quote:
I though the old pb631 has a Carta display. Maybe sw-epdc.0/ is a FW6 thing?
i activated a hidden mode in the driver. i used firmware 6.7, i didnt check if earlier versions have also this hidden mode.

REGARDLESS you simply write faster modes for any firmware that exposes enough of the hardware and you can even rewrite the driver to make the display faster.

so in theory i could make almost every old display 3 times faster. its just work.
anybody would be willing to donate for the effort?
x3oo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
inkpad 3 pro x3oo PocketBook 4 07-07-2023 04:02 PM
PocketBook Inkpad 3 Pro display issue acmobi PocketBook 1 08-07-2021 04:00 PM
Inkpad 3 vs. Inkpad 3 pro - HW differences brudigia PocketBook 4 08-06-2020 01:13 PM
Inkpad 3 and Inkpad 3 Pro Pale Which one should I buy? 2 02-04-2020 12:16 PM
Looking for Inkpad 3 display ChriChri PocketBook 0 11-13-2019 04:44 PM


All times are GMT -4. The time now is 11:50 PM.


MobileRead.com is a privately owned, operated and funded community.