ddvk / remarkable2-framebuffer

remarkable2 framebuffer reversing
MIT License
284 stars 22 forks source link

Error, unknown message type / Error recv msgbuf: Invalid argument #88

Closed LoganDark closed 2 years ago

LoganDark commented 2 years ago

I'm having a weird issue with rm2fb where it only works for one application after being started. Once that application's ended, the rm2fb server completely stops functioning. Starting the same app again, or starting a different app doesn't work - and the log of rm2fb shows this:

reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument
reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument
reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument
reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument
reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument

Restarting rm2fb fixes the issue temporarily (i.e. I can run an app once and then it starts spitting out those errors on subsequent runs).

It looks like the messages originate from these locations:

https://github.com/ddvk/remarkable2-framebuffer/blob/fce890ec527dca821536e0abdd5f1ab47bf3c23b/src/server/main.cpp#L166

https://github.com/ddvk/remarkable2-framebuffer/blob/fce890ec527dca821536e0abdd5f1ab47bf3c23b/src/shared/ipc.cpp#L188

Unfortunately as the messages don't include any other information and I'm not too familiar with this, I don't know what's going on.

I've tried both using libremarkable's built-in client and using LD_PRELOAD=/opt/rm2fb/librm2fb_client.so.1.0.1, both of them work the first time but then the server stops working. Therefore I'm pretty sure this is an issue with rm2fb-server and not the clients.

Codex version 2.11.0.442 reMarkable 2 model RM110 rm2fb server invocation: /usr/bin/env LD_PRELOAD=/opt/rm2fb/librm2fb_server.so.1.0.1 /usr/bin/xochitl (using the libraries from latest GitHub release)

LoganDark commented 2 years ago

Whoops looks like this is a libremarkable client issue