Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for Remarkable Paper Pro #122

Merged

Conversation

alexander-akhmetov
Copy link
Contributor

@alexander-akhmetov alexander-akhmetov commented Dec 20, 2024

A lot of it is thanks to the incredible work of many contributors from #117, including @owulveryck, @cristiannobili, @danielealbano, @To-Si, @Jayy001, @hegzploit and more 😄

What currently does not work

  1. RLE is not supported
  2. The Rotate button in the UI
  3. The Colors button

At least this, maybe something else.

Main changes

Because RLE isn't supported, I added optional zstd compression middleware alongside the existing gzip. It’s faster and should use less cpu.

ARM64 support

  • Added const_arm64.go with device-specific constants for the Remarkable Paper Pro.
  • fb_arm.go renamed to fb_rm.go and the build tags updated to support both arm and arm64.

Framebuffer pointer calculation for RMPP

The logic is taken from #117 (comment) and #117 (comment).

Client side (JS) changes

  • Passing screenWidth, screenHeight, UseRLE, etc. from the backend to the JS client.
  • Fixes for the texture coordinates and the color format if the device is RMPP.

Input devices

RMPP uses /dev/input/event2 and /dev/input/event3, so added these to the device-specific constants.


To run the app on Paper Pro you need to disable the RLE and you can optionally enable the compression:

ZSTD_COMPRESSION=true RLE_COMPRESSION=false ./goMarkableStream

There's also a good possibility that the Remarkable 2 is broken. I'd appreciate it if someone could check.

@alexander-akhmetov alexander-akhmetov marked this pull request as ready for review December 20, 2024 21:00
@Jayy001
Copy link

Jayy001 commented Dec 21, 2024

This is some impressive work! Well done.

I've tried to run it on my own device, but unfortunately I'm having some issues.

I ran make build-remarkable-pro which generated me the binary with md5 1fe7dba1b23a936c244097be9744462a and general info goMarkableStream: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go, BuildID=pGPbavxPhEahbbmycnBO/KOuQ8CHlRzAuYsZNSJGr/7B5fNzvlIaUfr6NS1KT8/K2a6oZVCN8UYHf06abdl, stripped.

My device is on the beta version 17. When running, it displays the IP address but nothing else

root@imx8mm-ferrari:~# ZSTD_COMPRESSION=true RLE_COMPRESSION=false ./goMarkableStream
Local IP address: 10.11.99.1
Local IP address: 192.168.0.244

No service is running on port 2001.

Are there any debugging options to generate some useful output to help rectify this issue?

@hegzploit
Copy link

This is some impressive work! Well done.

I've tried to run it on my own device, but unfortunately I'm having some issues.

I ran make build-remarkable-pro which generated me the binary with md5 1fe7dba1b23a936c244097be9744462a and general info goMarkableStream: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go, BuildID=pGPbavxPhEahbbmycnBO/KOuQ8CHlRzAuYsZNSJGr/7B5fNzvlIaUfr6NS1KT8/K2a6oZVCN8UYHf06abdl, stripped.

My device is on the beta version 17. When running, it displays the IP address but nothing else

root@imx8mm-ferrari:~# ZSTD_COMPRESSION=true RLE_COMPRESSION=false ./goMarkableStream
Local IP address: 10.11.99.1
Local IP address: 192.168.0.244

No service is running on port 2001.

Are there any debugging options to generate some useful output to help rectify this issue?

Works fine on my device which is running 3.16.2.3.

@Jayy001
Copy link

Jayy001 commented Dec 21, 2024

That's good, what output does it give?

@Jayy001
Copy link

Jayy001 commented Dec 21, 2024

I've just downgraded my device to 3.16.1.0 and I can confirm it spins up the webserver, looks like potentially something on the beta is breaking it. If anybody else is on v17, would appreciate the test.

root@imx8mm-ferrari:~# ZSTD_COMPRESSION=true RLE_COMPRESSION=false ./goMarkableStream
Local IP address: 192.168.0.244
Local IP address: 10.11.99.1
2024/12/21 16:20:05 listening on [::]:2001

Here's the output it should give.

@Jayy001
Copy link

Jayy001 commented Dec 21, 2024

Animation
The output is...quite slanted, though.

No custom hacks have been applied.

@alexander-akhmetov
Copy link
Contributor Author

That's me, in the last commit I broke it by changing the screen size constants. Can you check again please? I pushed the fix.

@Jayy001
Copy link

Jayy001 commented Dec 21, 2024

Whooo, that worked!

@owulveryck
Copy link
Owner

Awesome;
I will test on my RM2 by next week, and it it works I will merge and release a new version.
Many thanks.

Copy link
Owner

@owulveryck owulveryck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good work!

let flip = getQueryParam('flip');
flip = flip !== null ? flip === 'true' : false;

defaultFlip = true;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On RM2 the defaultFlip should be false as well (otherwise the image is upside down)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it

@owulveryck owulveryck merged commit 12f39d1 into owulveryck:main Dec 24, 2024
1 check passed
@ArthurHlt
Copy link

ArthurHlt commented Dec 30, 2024

I've just downgraded my device to 3.16.1.0 and I can confirm it spins up the webserver, looks like potentially something on the beta is breaking it. If anybody else is on v17, would appreciate the test.

root@imx8mm-ferrari:~# ZSTD_COMPRESSION=true RLE_COMPRESSION=false ./goMarkableStream
Local IP address: 192.168.0.244
Local IP address: 10.11.99.1
2024/12/21 16:20:05 listening on [::]:2001

Here's the output it should give.

I've tested also on v17 and it is blocked after giving local ip address (but this information is very early in the code). So, for now i don't know what is blocking

anyway, thanks for the great work here

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.

5 participants