#(!SOLVED)Are there any working versions of the plato reader and remux that I could run on rm2 v3.20?

1 messages · Page 1 of 1 (latest)

placid relic
#

I’m looking for a way to run a minimal reader and launcher (to switch between reader, notes) on rm2 v3.20.0.92. I already have xovi and appload installed, currently using koreader, but koreader does a bit too much for my liking and I’m looking for something minimal that ideally lets me browse books, purchase/download them directly on device and lets me read them with minimal distractions — similar to a kindle.

I know one way would be to customize koreader, but I would ideally like to avoid that if possible.

I ran into plato reader (https://github.com/darvin/plato) and remux (https://rmkit.dev/apps/remux) while looking for a solution, but am not sure if they can be run on my current setup.

Do you have any recommendations on how to achieve this?

GitHub

Document reader. Contribute to darvin/plato development by creating an account on GitHub.

tribal sierra
#

plato is not OS specific, so any working build of it would work with any rm2fb server that is properly compliant

tribal sierra
#

as for remux, I don't believe it's compatible with appload

onyx locust
#

Plato as most other rm2fb stuff works fine with xovi etc. The only problem is that in the precompiled binaries you'll find in toltec there is a system call to kill the xochitl service (rm's software) which then also kills xovi and thus kills plato....
So you'll need to grap the source, remove that call and compile it.
Plato works fine if you run it through xovi/debug (as that does not use the xochitl service)

tribal sierra
#

The binaries in toltec will depend on the official rm2fb client library, which can be removed with patchelf.

#

but yes, you'll need to remove the code to kill xochitl.

#

Although looking at the codebase that toltec uses for plato, it seems to have some of the code about handling xochitl being killed, but I don't see the code that actually kills it. It helps if I expand the hidden matches.

onyx locust
tribal sierra
#

You do need to remove the dependency otherwise it'll refuse to start because the library cannot be found.

#

Unless you are saying the dependency is missing, or that you have the client library installed?

onyx locust
# tribal sierra Unless you are saying the dependency is missing, or that you have the client lib...

No, I'm saying that with appload you cheat the program into believing that it is working against the dependency - that's one of the beauties of appload and qtfb that you can throw an old binary against it, and with the right settings it just works (well the current state is broken for some other reason but it's true for the June version of appload). So if only the old binary for Plato had an env switch or actually checked that oxide or similar was running to avoid turning off xochitl, then it would work with no extra modifications. Just like it will work if you change the name of the xochitl service to something else.

tribal sierra
#

I don't believe @glad mirage adding handling to appload to override library loading

#

As I'm not talking about an environment variable, or something the binary is doing at runtime. Toltec adds a library dependency to the executable which means that it will fail to even start running the code if it doesn't exist.

#

Which is why you have to remove the dependency with patchelf.

onyx locust
#

I know, that you know much more about this than I do. What I am claiming is: You can run the binary from toltec without using patchelf, I am doing it right now on my rm2 on 3.20.
I am using the following env:
"LD_PRELOAD": "/home/root/shims/shim.so",
"PRODUCT": "remarkable",
"LD_LIBRARY_PATH": "./libs",
"PLATO_DISABLE_BUILTIN_SWTFB_CLIENT": "yes"
And I guess the last line might be what you could also do with patchelf (and that might be a much better solution, I have no idea).

orchid sphinx
#

I'm joining, I'd like to try it too. Koreader is useless and overall plato looks better. Plus, I couldn't get koreader to start.

tribal sierra
tribal sierra
#

As it's not a single binary that runs, but various lua scripts and other dependencies

#

But that is interesting that plato works for you and you are using the toltec version. I would not expect it to work as it does patch in the rm2fb dependency.

#

and I didn't see anything in the shim that would override that.

#

I wonder when the last time the package was rebuilt.

orchid sphinx
tribal sierra
#

Complicated doesn't mean unnecessary, as that has a negative connotation

#

It means it's not what you need, but there are many people who want the larger set of features it provides

#

Especially on the other devices it targets

dreamy elm
#

for example, plugins are nice for people like me

#

I can read new mangas from the web without leaving my device

orchid sphinx
dreamy elm
orchid sphinx
#

Maybe I'll give it another chance.

cedar tendon
orchid sphinx
#

Also please.
Koreader is working but I would like PLATO.
What version did you install?
Thank you.

cedar tendon
#

I am trying to build plato (with no luck) so would also request a way to install and run from appload (please)

cedar tendon
orchid sphinx
#

I think we need to wait for instructions from @onyx locust 🙂

onyx locust
#

It's been so long time since i tried for the fun of it - I really think you should just make koreader behave like you want - it's a great ereader and actively developed.
But roughly I took the binary from https://toltec-dev.org/stable/, made a plato library on my rmpp with binary and the required files and used a manifest with the above environment variables.
As long as nobody recompiles it without the s´xochitl-killing, I don't think I'll be more specific, because the guide would always end with a non working plato (as mentioned it only works with xovi/debug).

placid relic
placid relic
#

(!SOLVED)Are there any working versions of the plato reader and remux that I could run on rm2 v3.20?

grizzled meteor
# onyx locust It's been so long time since i tried for the fun of it - I really think you shou...

Not too sure, but my plato fork didn't kill xochitl out-right or was configurable (long time ago, so excuse me having forgotten the specifics).
I just updated it and there shouldn't be any killing of xochil left.
https://github.com/LinusCDE/plato (see releases).
I've not updated my tablet to OS 3.X yet and have not yet familiarized with appload yet. But if plato doesn't display anything, setting the environment variable LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB to "1" might fix that.

GitHub

Document reader. Contribute to LinusCDE/plato development by creating an account on GitHub.

cedar tendon
grizzled meteor
#

I probably gotta add an option to disable checking for it. no clue why it would not work. Battery does just check one file.

onyx locust
#

Yes, but that file path is different from system to system, so if the app just tries to open it without checking if it is there, it would crash ? (Didn't notice this myself, so I'm not sure if it the battery path that causes the crash.) A better solution would be to enable the path to the battery to be overridden (environment or argument) - that way battery status could work across systems.

grizzled meteor
#

On plato, it uses libremarkable to get the expected battery path (hardcoded per detected model) and tried to open the "status" and "capacity" files to continue to read values from it to display on the battery icon in the top bar.

If it failed to open any of these files, the startup of the application failed (probably logging can't create battery or something like ~File not found).

Since the existing 2 models were rock solid and not expected to change soon, that solution was fine at the time. There was also only oxide that did any kind of sandboxing and that was not an issue.
So any kind of sandboxing/containerization that does not cover the battery endpoint or a new model (where libremarkable gets fooled it's an old model) would cause the battery to fail ig.


Made a change where the battery base directory missing is fine and just reading states will always fail (result in showing up as discharging at 0.0%) in commit 3bf17d63 (commits).

Here is the binary of the current state of the master branch. Try replacing the existing one. It should fix the issue:

onyx locust
#

I can confirm it works (also without the battery fix version) - but only for pen input for me (just launched didn't try to get it to work).
For rm2 you should not shim model and set mode to rm2fb @cedar tendon

cedar tendon
#

default [AppLoad]: Starting external binary "./plato"
12:56:08.699 default [QTFB]: FB Repaint triggered for 4139402 . Status: false
[QTFB]: Awaiting incoming connections to/tmp/qtfb.sock
[QTFB]: Connection established from client. Sock FD is 4
[QTFB]: Defined SHM size5256576at
[QTFB]: Associated connection <==> framebuffer 4139402
12:56:08.899 default [QTFB]: FB Repaint triggered for 4139402 . Status: true
Changed Framebuffer-Rotation (SW-Based) to 3
Error: can't build context

Caused by:
0: can't create standard frontlight
1: No such file or directory (os error 2)
[QTFB]: The client requested closing the connection.
[QTFB]: Disassociating framebuffer 4139402
[QTFB]: Closing client socket 4
12:56:08.994 default [AppLoad]: Process for "./plato" finished with exit code 1 and status QProcess::NormalExit

#

I'm on rM2

#

my external.manifest.json....

#

{
"name": "Plato",
"application": "plato",
"environment": {
"LD_LIBRARY_PATH": "/home/root/xovi/exthome/appload/plato/libs",
"LD_PRELOAD": "/home/root/shims/qtfb-shim.so"
},
"qtfb": true
}

onyx locust
#

I think you need to also add either LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB or PLATO_DISABLE_BUILTIN_SWTFB_CLIENT and PRODUCT=remarkable

#

And, then it will act like an rm1, so you might also want to add QTFB_SHIM_MODE=RM2FB and QTFB_SHIM_MODEL=false

#

Ah, yes, I forgot to set shim input.. this is working for me on rm2:

        "LD_PRELOAD": "/home/root/shims/qtfb-shim.so",
        "PRODUCT": "remarkable",
        "LD_LIBRARY_PATH": "./libs",
        "LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB" : "1",
        "QTFB_SHIM_MODE": "RM2FB",
        "QTFB_SHIM_MODEL": false,
        "QTFB_SHIM_INPUT": false
    },
    "qtfb": true```
Edit: only for fullscreen mode, see messages below
cedar tendon
#

Working great 👍🏼

orchid sphinx
#

What? Plato on rm2? Amazing.
I need it 😉

cedar tendon
#

Thank you @grizzled meteor 🙏🏼

dreamy elm
#

WARNING: disabling QTFB input shim will have some problem with autosleep/auto shutdown. You must disable those in xochitl settings.

onyx locust
cedar tendon
#

Does wifi work for you ?

onyx locust
cedar tendon
#

Can fetch Wallabag articles
Not working for me (yet)

onyx locust
#

You should probably try the article-fetcher binary without plato - sounds like it's just a background process, so it shouldn't have anything to do with xovi, qtfb etc.

orchid sphinx
#

Do you have history, papers, design, samples, etc???

orchid sphinx
#

Can you try in window?

glad mirage
#

Build latest shim and appload from github, set input shim mode to "NATIVE"

orchid sphinx
#

My manifest:{ "name": "Plato", "application": "plato", "environment": { "LD_PRELOAD": "/home/root/shims/qtfb-shim.so", "LD_LIBRARY_PATH": "./libs", "PRODUCT": "remarkable", "LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB" : "1", "QTFB_SHIM_MODEL": false }, "qtfb": true }

#

Working with window is OK / Battery is OK

cedar tendon
orchid sphinx
#

From github.

cedar tendon
#

ahh, okay, you made a screenshot from gh, not a pic from your rM2. The reason I ask (I know rM2 has no backlight) but there seems to be a menu when you tap that sun

orchid sphinx
# glad mirage Build latest shim and appload from github, set input shim mode to "NATIVE"
[QTFB]: Unregistered framebuffer controller ID: -1
[QTFB]: Registered framebuffer controller ID: 4499636
17:38:39.196 default                  [AppLoad]: Starting external binary "./plato"
No such mode supported: NATIVE
17:38:39.229 default                  [QTFB]: FB Repaint triggered for  4499636 . Status:  false
17:38:39.332 default                  Process error for "./plato" : QProcess::Crashed
17:38:39.332 default                  [AppLoad]: Process for "./plato" finished with exit code 6 and status QProcess::CrashExit
[QTFB]: Unregistered framebuffer controller ID: 4499636```
#

Latest appload and shim from github now.

glad mirage
orchid sphinx
#

OK, sorry.

glad mirage
#

Also, the envvar is QTFB_SHIM_INPUT_MODE

glad mirage
onyx locust
# glad mirage Also, the envvar is QTFB_SHIM_INPUT_MODE

It's always a question if we should use manifests for current releases or for future releases of appload in a support thread like this - but you are obviously right, that when using the soon to come appload, then native input is a better setting in the manifest.

grizzled meteor
#

cool it works!

#

I have not yet upgraded to 3.X, nor used appload.
Besides maybe adding e.g. an env to by default ignore the power button is there anything i could do to improve compatibility?
E.g. i could maybe send somd kind of trigger on input, to perhaps feed a watchdog and prevent sleep through xochitl/appload perhaps?

Plato indeed does it's own input handling and even sleep/resume. When it runs standalone that is kinda needed. But perhaps I should add a way to improve compatibility when it runs as part of appload.

Also keep in mind, plato, nor libremarkable were never designed with a changing resolution. So plato always assumes fullscreen anyway.

grizzled meteor
#

Also keep in mind that libremarkable only knows about the remarkable 1 and 2 still (contributions for the rmpp/rmppm very welcome btw!).
Model detection is done here: https://github.com/canselcik/libremarkable/blob/d9125f136ed34926c2528c34722aa3494611d644/src/device/mod.rs#L23
Input device detection (/dev/input/...) was somewhat modularized a while ago. So that might just work on newer models. But there are probably still some hard assumptions based on the model (e.g. input device roations, screen sizes)

grizzled meteor
# grizzled meteor Not too sure, but my plato fork didn't kill xochitl out-right or was configurabl...

looking into it more. since xovi seems to directly extend from xochitl and xochitl.service (if i understand it right), yes plato did probably try to kill xochitl, seeing it running as a service.

launchers like remux and oxide would not start xochitl.service and had their own, distinct services. So I made plato only kill xochitl, if it detected the service (as xochitl, the binary, could be running, just being suspended).
In the most recent upgrade, i think i kinda yeeted the killing logic on accident (lots of merge conflicts and changes over a long time). so this works out well here.

Are launchers like oxide, remux, draft, etc. still in use btw? Just curious.
I think there will still be no need to revive the xochtil-killing logic anyways. It was mostly a convenience thing, if people automated launching the plato binary, it would offer them a way to go back to xochitl.

onyx locust
#

At one point, there was an argument: --spare-xochitl which then did not kill xochitl - just putting that back, would give the best of both worlds.

The idea behind qtfb, xovi etc. is actually that the rmpp and rmppm can disguise themselfes as rm2's and then still work with old software - but yes, you are right, we could also port plato to newer hardware.

dreamy elm
#

plato for rMPP(M) would be interesting

#

but does plato support color rendering?

grizzled meteor
grizzled meteor
# dreamy elm but does plato support color rendering?

It always somewhat did, but most calls assumed gray-only.
That changed though: in the last merge, they changed that assumption of gray to a Gray OR Rgb type. I'd assume because the Kobo family likely also received some color eink devices.
So color should now be supported.

dreamy elm
#

that sounds promising

#

rMPP uses RGB internally anyways

grizzled meteor
#

All devices technicially do

#

The rM 1 was 2 bytes per pixel (5R6G5G afaik) and the rM 2 went full rgb afaik. But when using the shim, it still gotta use the rM 1 pixel format as a base.

#

Not too sure, but I believe that even with the native swtfb/rm2fb client, it's still using rgb565 to preserve compatibility with the rM 1 FB.

So rgb will be somewhat limited. But hopefully that will not be noticable anyway. Libremarkable got solid color conversion to make sure screenshots look correct.

onyx locust
#

Actually on rm1 at least on 3.10 and 3.11, when you did screenshots (hidden setting) the screenshots would always be in color - so the rm1 also renders the colors internally (but of course, you're probably right, that it translates into fewer bits before sending the the fb)

grizzled meteor
#

Yeah. Thats kinda what i meant. Screenshots/The internal framebuffer always had color. It's just in that reduced RGB565 format. Pretty sure you were even able to see color within xochitl (e.g. previews/icons of pdfs).

Most programs making screenshots will just have to upsample rgb565 to rgb888 before saving/compressing it to a file.

Any many applications (e.g. plato, many of my apps) would just use only grayscale anyway, because it's just one color component to process then. so they're often just writing grayscale pixels into the internal rgb656 framebuffer.

#

Btw the color conversion is also why some screenshots have a yellow-tint where white would be.

cedar tendon
#

@grizzled meteor when I try get Wallabag, Plato says “bringing up WiFi” in a pop and the nothing syncs/downloads.
I have the correct username and password and client/secret in fetcher settings.toml
There are no WiFi settings in the app.
Does WiFi piggyback off the existing rM2 WiFi connection and network settings?
In essence, does connectivity work in this rM2 Plato ?
The identical Wallabag settings work in KOReader for me.
I tried to just test the binary but failed to execute on my Linux (Arch)

onyx locust
#

Test the binary on your device...

grizzled meteor
#

Maybe I should try to integrate with oxide here. Afaik there was also some cli for it. would probably be the quickest. No clue what plato does for checking wifi connectivity rn

onyx locust
#

When run with xovi, xochitl still runs and does all wifi related stuff, so as long as the scripts are disabled things are fine.

grizzled meteor
#

as long as internet-related things work it should be fine ig.
being able to control wifi would still be cool ofc

onyx locust
#

I don't agree when running with xovi on a new software version - you can just use the quicksettings to turn wifi on and off - it would be a bit like having your windowed texteditor turning off wifi on your desktop - I would hate that it even could do that.

cedar tendon
# onyx locust Test the binary on your device...

so I ran the binary from device....
./article_fetcher /home/root/xovi/exthome/appload/plato/libs /home/root/xovi/exthome/appload/plato/articles true true

worked great. - synced my Wallabag unread items to the device 👍 if I run the above manually.
Now I gotta figure how to trigger from the app, and where to put those paths (above) for "libs path", "save to path", "wifi status string", "online status string" respectively.
I tried adding to Settings.toml but not working .... below is an excerpt from my Settings.toml

#

[[libraries]]
name = "Articles"
path = "/home/root/xovi/exthome/appload/plato/articles"
mode = "filesystem"
sort-method = "added"
first-column = "title-and-author"
second-column = "progress"
thumbnail-previews = true

[[libraries.hooks]]
path = "Articles"
program = "bin/article_fetcher/article_fetcher"
sort-method = "added"
first-column = "title-and-author"
second-column = "progress"
library-path = "/home/root/xovi/exthome/appload/plato/libs"
save-path = "/home/root/xovi/exthome/appload/plato/articles"
wifi = true
online = true

#

any guidance appreciated, but at least we know wallabag and wifi working, now just gotta get the paths and config / trigger correct

grizzled meteor
#

not sure on that either. i mostly used plato to read some manga on my rM 1 (which is why I poured hours into refresh modes to make it as perfect as possible) and read 1 or 2 books (as epubs/pdfs) on it. not much else.

#

This might help ↑

onyx locust
#

To me it looks weird that you have
program = "bin/article_fetcher/article_fetcher"
(releative) and
library-path = "/home/root/xovi/exthome/appload/plato/libs"
(absolute) - so, what is your working directory, do you need to hardcode the paths, or don't you?
Does ./article_fetcher give any output?
Do you see that output it you run xovi/debug, and invoke the method in plato?
Or is the problem, that you don't know how to invoke that in plato?

cedar tendon
#

If I just do ./article_fetcher... it gives
"Error: missing argument: library path"

If I do ./article_fetcher /home/root/xovi/exthome/
appload/plato/libs, it gives
"Error: missing argument: save path"

If I do ./article_fetcher /home/root/xovi/exthome/appload/plato/libs /home/root/xovi/exthome/appload/plato/articles , it gives
"Error: missing argument: wifi status"

If I do ./article_fetcher /home/root/xovi/exthome/appload/plato/libs /home/root/xovi/exthome/appload/plato/articles true
"Error: missing argument: online status"

If I do ./article_fetcher /home/root/xovi/exthome/appload/plato/libs /home/root/xovi/exthome/appload/plato/articles true true
works, and grabs the articles

#

so now, I just got to figure out how to get that last command done, by using the Settings.toml in the actual app

cedar tendon
#

Hooks are defined in Settings.toml.

Here's an example hook, that launches the default article fetcher included in Plato's release archive:

[[libraries.hooks]]
path = "Articles"
program = "bin/article_fetcher/article_fetcher"
sort-method = "added"
first-column = "title-and-author"
second-column = "progress"
The above chunk needs to be added after one of the [[libraries]] section.

path is the path of the directory that will trigger the hook. program is the path to the executable associated with this hook. The sort-method, first-column and second-column keys are optional. When specified, they will override the home's settings of the same name, while path is being selected.

The Toogle Select sub-menu of the library menu can be used to trigger a hook when there's no imported documents in path. Otherwise, you can just tap the directory in the navigation bar. When the hook is triggered, the associated program is executed as a background process. It will receive the library path, directory path, wifi and online statuses (true or false) as arguments.

onyx locust
#

Great, so it will be fun to hear, what output you get when you "The Toogle Select sub-menu of the library menu can be used to trigger a hook when there's no imported documents in path."

cedar tendon
#

When I do that, it says "Waiting for the network to come up" and then ...... nothing.

#

I believe the article_fetcher binary is being started but it is not receiving the library path, directory path and the 2 x "true" arguments

onyx locust
#

I mean in the output of xovi/debug

#

If it doesn't recieve the arguments then you will see: "Error: missing argument: wifi status"

#

or something

cedar tendon
#

from running the command manually in terminal

#

Let me see if xovi/debug gives any clues
I looked earlier and nothing but I’ve made some changes since

onyx locust
#

Perhaps a nice solution for you would be a shell script that forward the first two arguments and then true true to article_fetcher - then you don't need to worry about wifi - and then just call that script instead from the hook.

cedar tendon
#

That's what I was starting to lean towards

#

17:59:50.701 default [QTFB]: FB Repaint triggered for 556655 . Status: true
[QTFB]: Awaiting incoming connections to/tmp/qtfb.sock
[QTFB]: Connection established from client. Sock FD is 58

That's all xovi/debug gives when toggling the button

cedar tendon
#

BINGO !! - working Wallabag

onyx locust
#

Yes,something like that... I guess you wont see output from the fetcher since that output is caught by plato and displayed in the ui... I think the "waiting for" meant that wifi was just false (or online).

cedar tendon
#

The fetcher gives notifications. “1 new article, syncing” in top right hand corner 👍🏼

#

It’s working now as it should.
As I suspected, it wasn’t getting the arguments

#

Thanks for your help and guidance 🙏🏼

onyx locust
#

I think the fetcher only works with two true arguments at the end, so if plato thinks one of them was false, it would never sync anything. But nice that the workaround works. Did you try setting wifi to true in settings, before you changed to the script?