timower / rM2-stuff

Collection of reMarkable related apps, utilities and libraries.
GNU General Public License v3.0
125 stars 10 forks source link

Advice on how to build your application from source #24

Closed erlingrj closed 10 months ago

erlingrj commented 10 months ago

Hi.

First of all, thanks for you super-cool work! I have installed yaft with opkg install yaft and it works great. But I would like to build the latest changes on the dev branch to get more control over the keymapping from the type folio. I have downloaded the docker image with the toltec toolchain and I am able to build:

  1. A yaft2 executable
  2. a rm2stuff.ipk package.

However when I copy this over to my remarkable I am running into some issues.

The rm2stuff.ipk package has a conflict with my already installed rm2fb-client:

root@reMarkable:~# opkg install rm2stuff.ipk 
Installing rm2-stuff (0.0.1) to root...
Collected errors:
 * check_conflicts_for: The following packages conflict with rm2-stuff:
 * check_conflicts_for:     display * check_conflicts_fo

When I copy over the yaft2 executable directly and try executing it I get the following error:

root@reMarkable:~# ./yaft2 
yaft2: /home/erling/tools/remarkable/rM2-stuff/libs/rMlib/FrameBuffer.cpp:49: static ErrorOr<rmlib::fb::FrameBuffer::Type> rmlib::fb::FrameBuffer::detectType(): Assertion `false' failed.
Aborted

I realize that these are probably issues arising from my limited understanding of what is going on here. I am posting an issue here hoping someone could help me out.

  1. What is in the rm2-stuff.ipk package? Is it only the yaft2 app that I built?
  2. What is this conflict between rm2-stuff rm2fb-client? and the one I have installed? That one was installed by opkg when doing opkg install yaft. Should I uninstall it and let opkg find a new version of rm2fb-client?
  3. How does the firmware version of my remarkable come into play here? I did not enter that anywhere when building from sources. I am at 3.2.3.1595 which I believe is the latest version with rm2fb support

Again, thanks for your really cool work. I hope someone could help me out with some info or some pointers to where I can read up on cross-compiling for rm2 with toltec, opkg, ipk etc etc

timower commented 10 months ago

Hi.

First of all, thanks for you super-cool work! I have installed yaft with opkg install yaft and it works great. But I would like to build the latest changes on the dev branch to get more control over the keymapping from the type folio. I have downloaded the docker image with the toltec toolchain and I am able to build:

1. A yaft2 executable

2. a rm2stuff.ipk package.

However when I copy this over to my remarkable I am running into some issues.

The rm2stuff.ipk package has a conflict with my already installed rm2fb-client:

root@reMarkable:~# opkg install rm2stuff.ipk 
Installing rm2-stuff (0.0.1) to root...
Collected errors:
 * check_conflicts_for: The following packages conflict with rm2-stuff:
 * check_conflicts_for:   display * check_conflicts_fo

When I copy over the yaft2 executable directly and try executing it I get the following error:

root@reMarkable:~# ./yaft2 
yaft2: /home/erling/tools/remarkable/rM2-stuff/libs/rMlib/FrameBuffer.cpp:49: static ErrorOr<rmlib::fb::FrameBuffer::Type> rmlib::fb::FrameBuffer::detectType(): Assertion `false' failed.
Aborted

I realize that these are probably issues arising from my limited understanding of what is going on here. I am posting an issue here hoping someone could help me out.

The assert is triggering because you're launching yaft without having rm2fb_client.so in LD_PRELOAD. If you start it with:

> LD_PRELOAD=/opt/lib/librm2fb_client.so.1 ./yaft2

It should work.

1. What is in the rm2-stuff.ipk package? Is it only the yaft2 app that I built?

It's everything in the repo, so both rm2fb, tilem, yaft and all other apps. I use it for development, but if you just want yaft I'd recommend not using the ipk.

2. What is this conflict between rm2-stuff rm2fb-client? and the one I have installed? That one was installed by opkg when doing `opkg install yaft`. Should I uninstall it and let opkg find a new version of rm2fb-client?

It's because my rm2-stuff packages replaces the upstream opkg one and I haven't set the REPLACES correctly.

3. How does the firmware version of my remarkable come into play here? I did not enter that anywhere when building from sources. I am at 3.2.3.1595 which I believe is the latest version with rm2fb support

If you're not using my version of rm2fb (I recommend you don't, I havent verified on 3.2.3) then it shouldn't matter. So just don't install the rm2-stuff.ipk file, as that would include my rm2fb.

Again, thanks for your really cool work. I hope someone could help me out with some info or some pointers to where I can read up on cross-compiling for rm2 with toltec, opkg, ipk etc etc

erlingrj commented 10 months ago

Thats great! Thanks alot, I am now running yaft2 on my remarkable. To launch it with remux I put:

#!/bin/sh
LD_PRELOAD=/opt/lib/librm2fb_client.so.1 /home/root/tools/yaft2

In /home/root/apps/yaft2 and the executable in /home/root/tools/yaft2

erlingrj commented 10 months ago

Btw. I am noticing some performance issues with yaft2 which is not there in yaft. The problem arises when the screen is filled up. It means that each terminal command will cause everything to be shifted. This is sort of expected and yaft also has this increased latency. What is not expected is there is a large latency, around 1s, also from pressing keys until they appear. That is strange as this is not causing any other text to move, this also does not appear in yaft only in yaft2

vim still works nice since we dont move the entire screen up and down. But if I add relative line numbers then it is very slow again

timower commented 10 months ago

Interesting, I've tried to fix that in https://github.com/timower/rM2-stuff/commit/54ce98a2407a92b870e8fe4dbfb1b9485577654d Which commit are you on? Also, maybe make a new issue for this.

For me it's fast, but I'm using my own rm2fb, which might affect things like this.