ddvk / remarkable2-framebuffer

remarkable2 framebuffer reversing
MIT License
272 stars 22 forks source link

Cannot use on 3.1.0.1346 #118

Open Jayy001 opened 1 year ago

Jayy001 commented 1 year ago

https://github.com/toltec-dev/toltec/pull/656 https://github.com/toltec-dev/toltec/actions/runs/3894744429 <- Installed from these two .ipkg files

ReMarkable2, Version 3.1.0.1346

Apps installed:

The device starts successfully and displays a blank white screen for around ~1 minute, then restart and repeats this cycle.

Log from xochitl attempting to start:

● xochitl.service - reMarkable main application
     Loaded: loaded (/lib/systemd/system/xochitl.service; disabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/xochitl.service.d
             └─toltec-wrapper.conf
     Active: inactive (dead) since Wed 2023-01-11 19:02:16 UTC; 11s ago
    Process: 292 ExecStart=/opt/bin/xochitl --system (code=killed, signal=TERM)
   Main PID: 292 (code=killed, signal=TERM)

Jan 11 19:02:15 reMarkable xochitl[292]: 19:02:15.004 qt.qpa.input             evdevtouch: /dev/input/event2: min Y: 0 max Y:
 1871
Jan 11 19:02:15 reMarkable xochitl[292]: 19:02:15.006 qt.qpa.input             evdevtouch: /dev/input/event2: min pressure: 0
 max pressure: 0
Jan 11 19:02:15 reMarkable xochitl[292]: 19:02:15.007 qt.qpa.input             evdevtouch: /dev/input/event2: device name: pt
_mt
Jan 11 19:02:15 reMarkable usermod[318]: change user 'root' password
Jan 11 19:02:15 reMarkable xochitl[292]: 19:02:15.236 rm.network.settings      can't tell QPA plugin about selected input fla
vor, shortcuts won't change (updateInputFlavorQPA /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/settings/s
rc/settings.cpp:280)
Jan 11 19:02:15 reMarkable xochitl[292]: 19:02:15.265 rm.batterymanager        Setting timeout idle timer interval to  687194
76796
Jan 11 19:02:15 reMarkable xochitl[292]: shutdown called
Jan 11 19:02:15 reMarkable systemd[1]: Stopping reMarkable main application...
Jan 11 19:02:16 reMarkable systemd[1]: xochitl.service: Succeeded.
Jan 11 19:02:16 reMarkable systemd[1]: Stopped reMarkable main application.

Running with rm2fb-client xochitl gives a segment fault,

Sourcing /opt/etc/xochitl.env.d/rm2fb-preload.env
Replacing 'update' (at 0x52d90c): OK
Replacing 'create' (at 0x530a90): OK
Replacing 'shutdown' (at 0x530a20): OK
Replacing 'wait' (at 0x52f938): OK
missing notify function, screenshare won't work
19:03:49.241 default                  QSocketNotifier: Can only be used with threads started with QThread
19:03:49.242 default                  2022-12-19T10:05:42Z heads/releases/oddoldman 5fbf07c716 (int main(int, char**) /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/main.cpp:166)
Registering exit handlers
19:03:49.242 default                  we're running on an epaper device (int main(int, char**) /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/main.cpp:173)
19:03:50.245 rm.framebuffer.swtcon    Failed to lock epframebuffer. Is there another EPFramebuffer instance?
REPLACING THE IMAGE with shared memory
create threads called
wait clear func called
19:03:50.253 default                  Unable to write to file: "/usr/share/remarkable/speedy-gonzales.csv"
Unable to load waveform from file: /usr/share/remarkable/speedy-gonzales.csv
19:03:50.253 default                  Unable to export waveform table.
19:03:50.263 default                  EPD platform plugin loaded!
19:03:50.267 default                  QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
19:03:50.275 qt.qpa.input             evdevtouch: Using device discovery
19:03:50.280 qt.qpa.input             evdevtouch: Adding device at /dev/input/event2
19:03:50.281 qt.qpa.input             evdevtouch: Using device /dev/input/event2
19:03:50.282 qt.qpa.input             evdevtouch: /dev/input/event2: Protocol type B  (multi), filtered=no
19:03:50.282 default                  Lock in temp location (static void 
DocumentFiles::storeLockFilesInTemp(bool) /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/worker/include/worker/documentfiles.h:201)
19:03:50.282 qt.qpa.input             evdevtouch: /dev/input/event2: min X: 0 max X: 1403
19:03:50.283 qt.qpa.input             evdevtouch: /dev/input/event2: min Y: 0 max Y: 1871
19:03:50.283 qt.qpa.input             evdevtouch: /dev/input/event2: min pressure: 0 max pressure: 0
19:03:50.283 qt.qpa.input             evdevtouch: /dev/input/event2: device name: pt_mt
19:03:50.377 rm.network.settings      can't tell QPA plugin about selected input flavor, shortcuts won't change (updateInputFlavorQPA /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/settings/src/settings.cpp:280)
19:03:50.417 rm.batterymanager        Setting timeout idle timer interval to  68719476796
19:03:50.757 rm.batterymanager        Deep sleep delay is getting set to  9600000
19:03:50.758 rm.batterymanager        Setting timeout idle timer interval to  68719476796
19:03:50.759 rm.batterymanager        Light sleep delay is getting set to  0
19:03:50.759 rm.batterymanager        Setting timeout idle timer interval to  13229525771943994
19:03:50.760 rm.batterymanager        Power off delay is getting set to  43200000
19:03:50.760 rm.batterymanager        Setting timeout idle timer interval to  43200000
19:03:50.764 rm.batterymanager        set sleep delay timer to 12000 (setSyncBeforeSleep /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/deviceinfo/src/batterymanager.cpp:90)
Segmentation fault
Jayy001 commented 1 year ago

Running toltecctl uninstall does not get rid of the issue,

missing notify function, screenshare won't work
19:35:41.423 default                  QSocketNotifier: Can only be used with threads started with QThread
19:35:41.424 default                  2022-12-19T10:05:42Z heads/releases/oddoldman 5fbf07c716 (int main(int, char**) /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/main.cpp:166)
Registering exit handlers
19:35:41.425 default                  we're running on an epaper device (int main(int, char**) /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/main.cpp:173)
19:35:42.428 rm.framebuffer.swtcon    Failed to lock epframebuffer. Is there another EPFramebuffer instance?
REPLACING THE IMAGE with shared memory
create threads called
wait clear func called
19:35:42.436 default                  Unable to write to file: "/usr/share/remarkable/speedy-gonzales.csv"
Unable to load waveform from file: /usr/share/remarkable/speedy-gonzales.csv
19:35:42.437 default                  Unable to export waveform table.
19:35:42.447 default                  EPD platform plugin loaded!
19:35:42.449 default                  QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
19:35:42.457 qt.qpa.input             evdevtouch: Using device discovery
19:35:42.463 qt.qpa.input             evdevtouch: Adding device at /dev/input/event2
19:35:42.464 qt.qpa.input             evdevtouch: Using device /dev/input/event2
19:35:42.464 qt.qpa.input             evdevtouch: /dev/input/event2: Protocol type B  (multi), filtered=no
19:35:42.464 qt.qpa.input             evdevtouch: /dev/input/event2: min X: 0 max X: 1403
19:35:42.465 qt.qpa.input             evdevtouch: /dev/input/event2: min Y: 0 max Y: 1871
19:35:42.465 qt.qpa.input             evdevtouch: /dev/input/event2: min pressure: 0 max pressure: 0
[19:36]
19:35:42.465 default                  Lock in temp location (static void DocumentFiles::storeLockFilesInTemp(bool) /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/worker/include/worker/documentfiles.h:201)
19:35:42.465 qt.qpa.input             evdevtouch: /dev/input/event2: device name: pt_mt
19:35:42.589 rm.network.settings      can't tell QPA plugin about selected input flavor, shortcuts won't change (updateInputFlavorQPA /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/settings/src/settings.cpp:280)
19:35:42.619 rm.batterymanager        Setting timeout idle timer interval to  68719476796
19:35:42.949 rm.batterymanager        Deep sleep delay is getting set to  9600000
19:35:42.949 rm.batterymanager        Setting timeout idle timer interval to  68719476796
19:35:42.950 rm.batterymanager        Light sleep delay is getting set to  0
19:35:42.950 rm.batterymanager        Setting timeout idle timer interval to  13229525771943994
19:35:42.951 rm.batterymanager        Power off delay is getting set to  43200000
19:35:42.951 rm.batterymanager        Setting timeout idle timer interval to  43200000
19:35:42.955 rm.batterymanager        set sleep delay timer to 12000 (setSyncBeforeSleep /usr/src/debug/xochitl/override+gitAUTOINC+5fbf07c716-r0/git/src/deviceinfo/src/batterymanager.cpp:90)
Segmentation fault

I had to manually downgrade using @ddvk update hack which fixed the issue

Eeems commented 1 year ago

Fixed the issue, but not with rm2fb right? You are no longer blocked, but no longer using rm2fb.

Jayy001 commented 1 year ago

You are no longer blocked, but no longer using rm2fb.

Yes that is correct, should have been more specific - it fixed the issue of being blocked / Xochitl crashing but does not allow me to use rm2fb

ddvk commented 1 year ago

it seems xochitl is crashing

X-Ryl669 commented 1 year ago

On the official 3.0.4.1305 version, it doesn't work either, but doesn't crash, only a white screen and this in the terminal output:

# LD_PRELOAD=/opt/lib/librm2fb_server.so.1 /usr/bin/xochitl
STARTING RM2FB
getInstance() at address: 0x549674
REPLACING THE IMAGE with shared memory
Reading waveforms from /usr/share/remarkable/320_R299_AFC421_ED103TC2U2_VB3300-KCD_TC.wbf
Unable to write to file: "/usr/share/remarkable/speedy-gonzales.csv"
Unable to load waveform from file: /usr/share/remarkable/speedy-gonzales.csv
Unable to export waveform table.
1404 1872 16
WAITING FOR SEND UPDATE ON MSG Q

I'm using the 0.0.29 version, I've manually installed in /opt/lib over the toltec's 0.0.27 version. I've tried to write in "/usr/share/remarkable" and it worked, so I don't understand the reported error.

Jayy001 commented 1 year ago

Yup in both cases here the root problem seems to be unable to access the usr/share/remarkable/speedy-gonzales.csv file

Eeems commented 1 year ago

@Jayy001 @X-Ryl669 are either of you using Oxide?

Jayy001 commented 1 year ago

I'm not, no - the list of packages I'm using are in my first comment (no ddvk hacks either)

X-Ryl669 commented 1 year ago

I am/was. And now, after a reboot, I'm in a reboot loop (Remarkable is starting / Remarkable / Remarkable is restarting)

I can connect via SSH but my root password isn't accepted, nor is the ssh key I've installed previously. I only have 13s between each boot and I can only connect to the tablet via USB-C/CDC Ethernet, not WIFI.

So I'm unable to fix/uninstall oxide (I think if I could get a hand on it, I think I would just need to disable rm2fb service to make it work).

I've ordered a USB-C breakout board to be able to connect the SBU2 pin to a 10k pulldown, but this will take 3 weeks to reach me.

Eeems commented 1 year ago

I'm not, no - the list of packages I'm using are in my first comment (no ddvk hacks either)

Well, it does have tarnish in the list, which is the system service for oxide.

Cyclic3 commented 1 year ago

On the official 3.0.4.1305 version, it doesn't work either, but doesn't crash, only a white screen and this in the terminal output:

# LD_PRELOAD=/opt/lib/librm2fb_server.so.1 /usr/bin/xochitl
STARTING RM2FB
getInstance() at address: 0x549674
REPLACING THE IMAGE with shared memory
Reading waveforms from /usr/share/remarkable/320_R299_AFC421_ED103TC2U2_VB3300-KCD_TC.wbf
Unable to write to file: "/usr/share/remarkable/speedy-gonzales.csv"
Unable to load waveform from file: /usr/share/remarkable/speedy-gonzales.csv
Unable to export waveform table.
1404 1872 16
WAITING FOR SEND UPDATE ON MSG Q

I'm using the 0.0.29 version, I've manually installed in /opt/lib over the toltec's 0.0.27 version. I've tried to write in "/usr/share/remarkable" and it worked, so I don't understand the reported error.

It works alright on my chroot system on 3.0.4.1305 reMarkable 2, but I do occasionally get the white screen issue. However, I used to get it all the time in my chroot, until I bind mounted /dev/shm across.

I have no issues outside of the chroot though, and I have an (otherwise) stock install of the remarkable firmware (no toltec).

Eeems commented 1 year ago

For those of you not in the discord: image It seems a lockfile was added that doesn't play nice with rm2fb yet. Some development will need to be done to properly handle this.

X-Ryl669 commented 1 year ago

I was able to escape the reboot loop by deleting rm2fb.service file. Now it starts xochitl by itself on boot. Will probably wait until it's solved here before reinstalling it.

Eeems commented 1 year ago

It should probably be easy enough to add some extra handling on the client side to catch attempts to open/lock /tmp/epframebuffer.lock and just noop the calls to get it working.

gordol commented 1 year ago

for what it's worth...

3.2.3.1595 works fine here. i upgraded from 2.15, run toltecctl reenable and use updated offsets.

!20230227165950
version str 3.2.3.1595
update addr 0x557c34
updateType str QRect
create addr 0x55ae98
shutdown addr 0x55ae28
wait addr 0x559d40
getInstance addr 0x54e414

ssh in, then run remux for example, and you'll see that it works fine, the lock file log entry doesn't matter, it's just a warning it seems... no segfault.

maybe the offsets for 3.1 are incorrect?

speedy-gonzales.csv is also a red herring it seems, because i also have that log entry, but have no problems otherwise.

no segfaults, everything appears to work fine otherwise.

X-Ryl669 commented 1 year ago

No, it doesn't work either. You might have rm2fb to run with the updated offsets, but it'll fail later on.

Try with tarnish and oxide for example. They will run and display. But at soon as you want to trigger xochitl from their launcher, the screen is garbage. There's no way to get it to refresh correctly (except by systemctl stop tarnish / oxide / rm2fb, and restart xochitl)

I don't know what's wrong, but it's unusable as is.

Eeems commented 1 year ago

No, it doesn't work either. You might have rm2fb to run with the updated offsets, but it'll fail later on.

Try with tarnish and oxide for example. They will run and display. But at soon as you want to trigger xochitl from their launcher, the screen is garbage. There's no way to get it to refresh correctly (except by systemctl stop tarnish / oxide / rm2fb, and restart xochitl)

I don't know what's wrong, but it's unusable as is.

So it works with remux, but not oxide? Could this just be an issue with the chroot? Could you try turning off the chroot to see if that fixes it? You just need to remove the chroot flag from /opt/use/share/applications/xochitl.conf

X-Ryl669 commented 1 year ago

Indeed, that was it. I've removed the "chroot" in the flags key of /opt/usr/share/applications/xochitl.oxide then re-enabled tarnish (systemctl enable tarnish then systemctl start tarnish) and it works correctly!

Eeems commented 1 year ago

Indeed, that was it. I've removed the "chroot" in the flags key of /opt/usr/share/applications/xochitl.oxide then re-enabled tarnish (systemctl enable tarnish then systemctl start tarnish) and it works correctly!

Interesting, so that means there is something that it needs to access that's missing from the bind mounts.

A warning, without the chroot, if xochitl tries to suspend or power off the device, oxide can't intercept that, which can cause some issues.

Would someone be able to verify this on 3.1 as well? If the oxide chroot is the issue, we can close this and open a new issue on Oxide to resolve it.

Eeems commented 8 months ago

Would someone be able to verify this on 3.1 as well? If the oxide chroot is the issue, we can close this and open a new issue on Oxide to resolve it.

Has anybody had a chance to verify this?

X-Ryl669 commented 8 months ago

Unfortunately, not anymore. I've updated my firmware and the usual hooking procedure doesn't work because they changed the way xochitl is built, so I'm not using it anymore. Hopefully someone will sort it out.

Eeems commented 2 months ago

Looking at the update files I have copies of, I don't see a stable 3.1 for either the rM1 or rM2. Was it ever released to stable? If so, it appears to have been pulled before I ever got it.

If that's the case, I don't think it's worth keeping this open anymore as we don't support beta versions, especially ones this old.