rmkit-dev / rmkit

| remarkable app framework | https://rmkit.dev
https://build.rmkit.dev
365 stars 32 forks source link

[remux] default xochitl service not being stopped #156

Closed murchu27 closed 2 years ago

murchu27 commented 2 years ago

UPDATE: this issue was originally about changing installation instructions to tell users to disable the xochitl service themselves, but @raisjn says this is not the intended way of operating. The xochitl service should be stopped automatically by remux

Description below line no longer relevant


On the rmkit.dev website, the Installation section for remux currently reads:

installation

use the toltec package (see downloads page) or install manually:

place remux binary in /opt/bin/remux get remux.service file and place in /etc/systemd/system run systemctl enable --now remux on the tablet

However, when enabling the remux service (last line of instructions), the user ends up with two instances of xochitl - the one started by the xochitl service, and the one started by the remux service. This causes issues with the screen glitching, and WiFi occasionally bombing until the tablet is rebooted.

Presumably the intended way to run remux is by disabling the xochitl service so that only one instance of xochitl is running?

If so, the last line of the installation instructions above should be changed to:

run systemctl disable --now xochitl && systemctl enable --now remux on the tablet

Would you agree with this? Or am I missing something?

murchu27 commented 2 years ago

This would also apply to the instructions printed after installing with toltec

raisjn commented 2 years ago

remux stops systemd's xochitl when it runs, I'm not sure how you have two versions running. it's specifically setup this way so that people don't accidentally soft brick their remarkable by disabling xochitl

murchu27 commented 2 years ago

Well that's not happening for me, when my tablet launches (rM2 v2.10.3.379) I end up with both services running. I can see in the journal logs that they're trying to do the same operations at almost the exact same time, but not exactly:

[[0;1;32m●[[0m xochitl.service - reMarkable main application
     Loaded: loaded (/lib/systemd/system/xochitl.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/xochitl.service.d
             └─toltec-wrapper.conf
     Active: [[0;1;32mactive (running)[[0m since Fri 2021-11-19 14:29:26 UTC; 47s ago
   Main PID: 296 (xochitl)
     CGroup: /system.slice/xochitl.service
             └─296 /usr/bin/xochitl --system

Nov 19 14:29:36 reMarkable xochitl[296]: 14:29:36.253 rm.wifi                  Scanning: true
Nov 19 14:29:36 reMarkable xochitl[296]: 14:29:36.255 rm.wifi                  Already have this address: QHostAddress("fe80::ce4b:73ff:feb2:cbf2")
Nov 19 14:29:37 reMarkable xochitl[296]: 14:29:37.463 rm.wifi                  wlan0: Address added: 192.168.0.31
Nov 19 14:29:37 reMarkable xochitl[296]: 14:29:37.472 rm.wifi                  Got gateway: 192.168.0.1
Nov 19 14:29:37 reMarkable xochitl[296]: 14:29:37.474 rm.wifi                  We probably have Internet
Nov 19 14:29:38 reMarkable xochitl[296]: 14:29:38.685 rm.syncthirdparty        integration data is not an object
Nov 19 14:29:38 reMarkable xochitl[296]: 14:29:38.692 rm.syncthirdparty        integration data is not an object
Nov 19 14:29:38 reMarkable xochitl[296]: 14:29:38.697 rm.updates               Request finished. Was dispatched at: 2021-11-19T14:29:27.542
Nov 19 14:29:39 reMarkable xochitl[296]: 14:29:39.298 rm.wifi                  Scanning: false
Nov 19 14:29:46 reMarkable xochitl[296]: 14:29:46.536 rm.syncthirdparty        integration data is not an object

[[0;1;32m●[[0m remux.service - App launcher that supports multi-tasking applications
     Loaded: loaded (/lib/systemd/system/remux.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/remux.service.d
             └─rm2fb-preload.conf
     Active: [[0;1;32mactive (running)[[0m since Fri 2021-11-19 14:29:21 UTC; 52s ago
   Main PID: 199 (remux)
     CGroup: /system.slice/remux.service
             ├─199 /opt/bin/remux
             └─270 /usr/bin/xochitl --system

Nov 19 14:29:33 reMarkable remux[270]: 14:29:33.958 rm.wifi                  wlan0: Address added: fe80::ce4b:73ff:feb2:cbf2
Nov 19 14:29:35 reMarkable remux[270]: 14:29:35.698 rm.wifi                  Scanning: true
Nov 19 14:29:37 reMarkable remux[270]: 14:29:37.463 rm.wifi                  wlan0: Address added: 192.168.0.31
Nov 19 14:29:37 reMarkable remux[270]: 14:29:37.470 rm.wifi                  Got gateway: 192.168.0.1
Nov 19 14:29:37 reMarkable remux[270]: 14:29:37.473 rm.wifi                  We probably have Internet
Nov 19 14:29:38 reMarkable remux[270]: 14:29:38.677 rm.updates               Request finished. Was dispatched at: 2021-11-19T14:29:23.766
Nov 19 14:29:38 reMarkable remux[270]: 14:29:38.689 rm.syncthirdparty        integration data is not an object
Nov 19 14:29:38 reMarkable remux[270]: 14:29:38.694 rm.syncthirdparty        integration data is not an object
Nov 19 14:29:39 reMarkable remux[270]: 14:29:39.297 rm.wifi                  Scanning: false
Nov 19 14:29:46 reMarkable remux[270]: 14:29:46.538 rm.syncthirdparty        integration data is not an object

One easy example of how this looks: if I turn off the tablet, both xochitls will try to update the screen to the "powered off" screen, but whenever the first one finishes, the tablet gets powered off before the second can finish. Sometimes I end up with a wonky screen which looks like a mix of the "powered off" and the "would you like to power off?" screens

I installed via toltec if that makes a difference, can try installing manually

murchu27 commented 2 years ago

Notice for example, the remux logs have this line when the IPv6 address gets assigned:

Nov 19 14:29:33 reMarkable remux[270]: 14:29:33.958 rm.wifi                  wlan0: Address added: fe80::ce4b:73ff:feb2:cbf2

But then a few seconds later, the xochitl logs show the below, since the address is already assigned:

Nov 19 14:29:36 reMarkable xochitl[296]: 14:29:36.255 rm.wifi                  Already have this address: QHostAddress("fe80::ce4b:73ff:feb2:cbf2")
raisjn commented 2 years ago

are you using toltec stable or testing?

please look at the source in launcher.cpy and you will see the call to stop xochitl service. I will not change the instructions to tell people to disable xochitl, but perhaps we can figure out what is going wrong.

in the meanwhile, try using oxide

raisjn commented 2 years ago

it's expected that xochitl will boot first, but once remux starts it still stop xochitl service and run xochitl directly. if you have multiple xochitl running at same time, then there is some circumstance that caused xochitl.service to not be stopped or it restarted somehow

murchu27 commented 2 years ago

Using toltec testing as stable rm2fb doesn't support my version yet.

Yes I can see the part in the source that should be stopping the service. How should I go about testing? Build from source?

murchu27 commented 2 years ago

If it's useful, I tried build from source, and got the below error. Maybe there's a missing dependency?

reMarkable: ~/bin/rmkit/ make remux
mkdir src/build > /dev/null || true
cd src/rmkit && make
make[1]: Entering directory '/home/root/bin/rmkit/src/rmkit'
make compile_arm
make[2]: Entering directory '/home/root/bin/rmkit/src/rmkit'
mkdir ../build 2> /dev/null || true
arm-linux-gnueabihf-g++ -c ../vendor/stb/stb.cpp -o ../build/stb.arm.o -fPIC -Os
make[2]: arm-linux-gnueabihf-g++: No such file or directory
make[2]: *** [../actions.make:54: ../build/stb.arm.o] Error 127
make[2]: Leaving directory '/home/root/bin/rmkit/src/rmkit'
make[1]: *** [../actions.make:11: compile] Error 2
make[1]: Leaving directory '/home/root/bin/rmkit/src/rmkit'
make: *** [Makefile:66: rmkit.h] Error 2
raisjn commented 2 years ago

you need to have a cross compiler installed, see the last section of https://github.com/rmkit-dev/rmkit/blob/master/docs/BUILDING.md for the ubuntu/arch packages

if you are using the remarkable toolchain, i think you can do: CXX_BIN=<path to compiler> make remux


i just updated toltec testing and installed the latest remux/display/rm2fb packages and am not running into the behavior you describe. systemctl status xochitl shows the service as stopped. it sounds like there is something unique going on here, i'm curious what it is. is remux the only thing you've installed from toltec? are there other services you added?

murchu27 commented 2 years ago

Let me uninstall as much as I can and try again, but the main thing that I can't stop is the proxy service used to run ddvk/rmfakecloud

murchu27 commented 2 years ago

Here's a list of packages I've installed for different reasons, let me know which ones you want me to try removing:

coreutils-date coreutils-install column make pcal ghostscript # for koenvervloesem/remarkable-calendar-creator
git-https # for building packages from source
rm2fb-client display
ddvk-hacks
murchu27 commented 2 years ago

And the non-standard services running are rm2fb and proxy

murchu27 commented 2 years ago

Okay, I tried removing ddvk-hacks since that obviously messes with the xochitl binary, just in case that was doing anything. I uninstalled and reinstalled remux / display / rm2fb-client for good measure. Then I get the below journal logs for xochitl and remux:

[[0;1;31m●[[0m xochitl.service - reMarkable main application
     Loaded: loaded (/lib/systemd/system/xochitl.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/xochitl.service.d
             └─toltec-wrapper.conf
     Active: [[0;1;31mfailed[[0m (Result: signal) since Fri 2021-11-19 16:05:20 UTC; 2min 39s ago
    Process: 201 ExecStart=/opt/bin/xochitl --system [[0;1;31m(code=killed, signal=SEGV)[[0m
   Main PID: 201 (code=killed, signal=SEGV)

Nov 19 16:05:19 reMarkable xochitl[201]: rm2fb server is not running: starting without rm2fb client
Nov 19 16:05:20 reMarkable xochitl[201]: 16:05:20.194 default                  2021-11-02T14:32:00Z h
eads/releases/dimpley 3488b5c4e3 (int main(int, char**) /usr/src/debug/xochitl/override+gitAUTOINC+34
88b5c4e3-r0/git/src/main.cpp:306)
Nov 19 16:05:20 reMarkable xochitl[201]: Registering exit handlers
Nov 19 16:05:20 reMarkable xochitl[201]: 16:05:20.196 default                  we're running on an ep
aper device (int main(int, char**) /usr/src/debug/xochitl/override+gitAUTOINC+3488b5c4e3-r0/git/src/m
ain.cpp:313)
Nov 19 16:05:20 reMarkable xochitl[201]: Shutting down...
Nov 19 16:05:20 reMarkable systemd[1]: Stopping reMarkable main application...
Nov 19 16:05:20 reMarkable systemd[1]: [[0;1;38;5;185m[[0;1;39m[[0;1;38;5;185mxochitl.service: Main p
rocess exited, code=killed, status=11/SEGV[[0m
Nov 19 16:05:20 reMarkable systemd[1]: [[0;1;38;5;185m[[0;1;39m[[0;1;38;5;185mxochitl.service: Failed
 with result 'signal'.[[0m
Nov 19 16:05:20 reMarkable systemd[1]: Stopped reMarkable main application.
Nov 19 16:05:20 reMarkable systemd[1]: xochitl.service: Triggering OnFailure= dependencies.

[[0;1;32m●[[0m remux.service - App launcher that supports multi-tasking applications
     Loaded: loaded (/lib/systemd/system/remux.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/remux.service.d
             └─rm2fb-preload.conf
     Active: [[0;1;32mactive (running)[[0m since Fri 2021-11-19 16:05:19 UTC; 2min 40s ago
   Main PID: 202 (remux)
     CGroup: /system.slice/remux.service
             ├─202 /opt/bin/remux
             └─256 /usr/bin/xochitl --system

Nov 19 16:05:36 reMarkable remux[256]: 16:05:36.253 rm.updates               Request finished. Was di
spatched at: 2021-11-19T16:05:21.360
Nov 19 16:05:36 reMarkable remux[256]: 16:05:36.254 rm.updates               Network error: QNetworkR
eply::HostNotFoundError Payload: ""
Nov 19 16:05:36 reMarkable remux[256]: 16:05:36.254 rm.telemetry             Device is offline
Nov 19 16:05:36 reMarkable remux[256]: 16:05:36.254 rm.telemetry             HTTP reply status: 0
Nov 19 16:05:37 reMarkable remux[256]: 16:05:37.556 rm.wifi                  wlan0: Address added: fe
80::ce4b:73ff:feb2:cbf2
Nov 19 16:05:40 reMarkable remux[256]: 16:05:40.698 rm.wifi                  wlan0: Address added: 19
2.168.0.31
Nov 19 16:05:40 reMarkable remux[256]: 16:05:40.705 rm.wifi                  Got gateway: 192.168.0.1

Nov 19 16:05:40 reMarkable remux[256]: 16:05:40.711 rm.wifi                  We probably have Interne
t
Nov 19 16:05:40 reMarkable remux[256]: 16:05:40.736 rm.syncthirdparty        integration data is not
an object
Nov 19 16:05:40 reMarkable remux[256]: 16:05:40.738 rm.syncthirdparty        integration data is not
an object

It says that the service "failed" rather than just being dead, is that intended? After a reboot, it seems like the xochitl service isn't even trying to start again; the timestamps are the same.

I reinstalled ddvk-hacks and it works fine, xochitl still says failed - not sure what happened at all. I guess I'll leave this open in case there's anything you want me to test?

raisjn commented 2 years ago

are you saying it works now?

xochitl also says killed for me when remux stops it

murchu27 commented 2 years ago

Yep, seems to work fine now, not seeing any of the weird screen glitches. I will gradually readd packages to see if anything breaks it

murchu27 commented 2 years ago

I've installed everything I had on it before opening the issue, and the system xochitl service stays dead. So it seems like everything is fine now. No idea what it was about my setup before that was stopping it from working.

I'll leave the issue open in case I start seeing screen glitches again. I'll come back and close it if all is okay for a few days

raisjn commented 2 years ago

closing out (since it's been 3 weeks)

murchu27 commented 2 years ago

Fair enough. FWIW I stopped using remux because I was still having the issue but didn't have time to dig into it. I'll try find time over the holidays

raisjn commented 2 years ago

So it seems like everything is fine now.

i thought it was fixed :'(

murchu27 commented 2 years ago

Sorry, should have said something for sure. I saw #158, the fix there may well fix my issue too. I'll try let you know ASAP

murchu27 commented 2 years ago

Okay, I think safe to close this issue because the system xochitl service is being stopped. I'm still having issues, but I think more related to #158, so I'll post there.

UPDATE: my issue is with the WiFi breaking, but I've noticed the suggested fix in #157, will try that