Skip to content

Better kobo support#238

Open
pcouy wants to merge 9 commits intormkit-dev:masterfrom
pcouy:master
Open

Better kobo support#238
pcouy wants to merge 9 commits intormkit-dev:masterfrom
pcouy:master

Conversation

@pcouy
Copy link
Copy Markdown

@pcouy pcouy commented May 5, 2026

This branch contains a few tweaks I implemented after trying rmkit (more specifically remux) on my Elipsa 2E. The commits can be grouped into a few categories :

  • Build related changes : upgrade a docker image and add a missing CROSS_TC env var to a build script
  • Deal with some stability issues (remux going to stable 90% CPU use and not showing on gesture) by :
    1. Letting me manually restart remux by killing any previously running instance in the wrapper script
    2. Fixing an exception storm when using remux's API to show/hide it
  • Improve app switching by :
    1. Changing the interface of perform_redraw(...) to have an optional second boolean parameter to control screen flashing with FBInk, and using it when showing/hiding remux. This fixed ghosting for me
    2. Preventing nickel from grabbing inputs by grabbing them first, which let other apps detect rotation and power button presses on my Kobo Elipsa 2E (with this, I can have nickel and koreader running side by side, both working well with the remux flow)

This is a lot of different things, but I tried to make each commit as atomic as possible, and wrote detailed commit messages when the commit changed more than a couple of lines. I hope this helps with the review.

If needed, I can make a separate branch with only the commits you want to merge.

pcouy added 9 commits May 5, 2026 11:53
- Add kobo/ output dir to .gitignore
- Fix `make remux_docker` and other similar targets for kobo => Build
  is a lot faster than rebuilding everything everytime
Updated the kobo wrapper script. Before this, I would sometimes have 2
remux instances running at the same time when testing, which caused
weird issues. This is kind of a dirty hack that was quicker than finding
the root cause
Before this, when sending commands through the API, stdout would fill
with exceptions with the call eventually working. After a few calls,
remux would crash.

Changed the locking logic in `TaskQueue`, mainly by repurposing `task_m`
(which I could not find the purpose of, or anywhere in the code that
acquired this lock) to prevent having more than 1 task thread running at
a time.
Updated method signatures for all backends, only implemented it for
FBInk
Done by grabbing the inputs on first launch and releasing them only
after the nickel process is running.

Context :

I added a modified version of koreader.sh to my remux, which does not
kill nickel before launching koreader. The goal is to seamlessly switch
between nickel and koreader, and to use bluetooth on y Elipsa 2E without
fearing a wipe on my /mnt/onboard if I accidentaly restart nickel
instead of rebooting the e-reader. This introduced an issue where koreader
would not handle rotations or the power button because nickel grabs
these devices and never releases them.

WARNING :

I have only tested this on my Kobo Elipsa 2E (Condor), this may break
on other devices. Not sure why input grabbing was disabled by the
preprocessor for Kobo target, but disabling it did not break anything on
Condor.
I also needed to add the `gpio` device to inputs, which emits orientation
change events on my Condor. The `EV_MSC` + `MSC_RAW` filter might match
other input devices on other e-readers. I think this would be harmless
anyway, but is worth checking before merging
After commit 2fd7055 most apps would not build for the kobo target.
Example build output below :

```
$ TARGET=kobo DOCKERFILE=Dockerfile.kobo FBINK=1 make harmony_docker

CXX=arm-kobo-linux-gnueabihf-g++ okp -sh -ig "RMKIT_IMPLEMENTATION" -ns -ni -for -d ../.rmkit.h_cpp/ -o ../build/rmkit.h rmkit.cpy ../build/stb.arm.o -- -D"KOBO=1" -D"RMKIT_IMPLEMENTATION" -ldl -pthread -lpthread -fdata-sections -ffunction-sections -Wl,--gc-sections -L/rmkit/src/vendor/FBInk/Release -l:libfbink.a -D"RMKIT_FBINK=1" -O2 -static -static-libstdc++ -static-libgcc
compile flags: -DKOBO=1 -DRMKIT_IMPLEMENTATION -ldl -pthread -lpthread -fdata-sections -ffunction-sections -Wl,--gc-sections -L/rmkit/src/vendor/FBInk/Release -l:libfbink.a -DRMKIT_FBINK=1 -O2 -static -static-libstdc++ -static-libgcc
missing file: ../shared/proc.h
missing file: ../shared/string.h
generating single header /rmkit/src/rmkit/../build/rmkit.h
MISSING FILE! /rmkit/src/.rmkit.h_cpp/shared/proc.h
MISSING FILE! /rmkit/src/.rmkit.h_cpp/shared/string.h
compiled into /rmkit/src/.rmkit.h_cpp
missing file: ../shared/proc.h
missing file: ../shared/proc.h
missing file: ../shared/proc.h
missing file: ../shared/proc.h
missing file: ../shared/proc.h
missing file: ../shared/proc.h
missing file: ../shared/proc.h
missing file: ../shared/string.h
make[2]: Leaving directory '/rmkit/src/rmkit'
make[1]: Leaving directory '/rmkit/src/rmkit'
cd src/harmony && make
make[1]: Entering directory '/rmkit/src/harmony'
make compile_kobo
make[2]: Entering directory '/rmkit/src/harmony'
make[3]: Entering directory '/rmkit/src/vendor/FBInk'
make[3]: Nothing to be done for 'staticlib'.
make[3]: Leaving directory '/rmkit/src/vendor/FBInk'
CXX=arm-kobo-linux-gnueabihf-g++ okp -ig "RMKIT_IMPLEMENTATION" -ns -ni -for -d ../.harmony_cpp/ -o ../build/harmony main.cpy ../build/stb.arm.o -- -D"KOBO=1" -D"RMKIT_IMPLEMENTATION" -ldl -pthread -lpthread -fdata-sections -ffunction-sections -Wl,--gc-sections -L/rmkit/src/vendor/FBInk/Release -l:libfbink.a -D"RMKIT_FBINK=1" -Wno-psabi -O2 -static -static-libstdc++ -static-libgcc
compile flags: -DKOBO=1 -DRMKIT_IMPLEMENTATION -ldl -pthread -lpthread -fdata-sections -ffunction-sections -Wl,--gc-sections -L/rmkit/src/vendor/FBInk/Release -l:libfbink.a -DRMKIT_FBINK=1 -Wno-psabi -O2 -static -static-libstdc++ -static-libgcc
arm-kobo-linux-gnueabihf-g++ -c /rmkit/src/.harmony_cpp/main.cpp -o /rmkit/src/.harmony_cpp/main.o -DKOBO=1 -DRMKIT_IMPLEMENTATION -ldl -pthread -lpthread -fdata-sections -ffunction-sections -Wl,--gc-sections -L/rmkit/src/vendor/FBInk/Release -l:libfbink.a -DRMKIT_FBINK=1 -Wno-psabi -O2 -static -static-libstdc++ -static-libgcc
In file included from /rmkit/src/.harmony_cpp/main.cpp:3:
/rmkit/src/.harmony_cpp/../build/rmkit.h: In lambda function:
/rmkit/src/.harmony_cpp/../build/rmkit.h:22492:22: error: 'proc' has not been declared
22492 |         auto procs = proc::list_procs(bins);
      |                      ^~~~
missing file: stb_image.h
missing file: stb_image_resize.h
Couldn't compile /rmkit/src/.harmony_cpp/main.cpp aborting
compiled into /rmkit/src/.harmony_cpp
make[2]: *** [../actions.make:42: compile_kobo] Error 1
make[2]: Leaving directory '/rmkit/src/harmony'
make[1]: Leaving directory '/rmkit/src/harmony'
make[1]: *** [../actions.make:11: compile] Error 2
make: *** [Makefile:18: harmony] Error 2
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant