Giter VIP home page Giter VIP logo

Comments (7)

raisjn avatar raisjn commented on August 20, 2024 1

@plredmond: thank you so much for reporting this and the reliable repro steps! it looks like a file descriptor was going away when keyd is restarted. i put in some hacky code to re-open the file descriptors in d2e0387 and it looks like the infinite loop + CPU usage goes away. please try it out - you can use the latest build on the build servers: build.rmkit.dev/ and verify it fixes it

from rmkit.

Eeems avatar Eeems commented on August 20, 2024

Does it handle the folio connecting and disconnecting properly when keyd isn't running?

from rmkit.

plredmond avatar plredmond commented on August 20, 2024

Yes, it handles the type folio properly when keyd isn't running.


To answer your question I did the following:

(in type-folio, but "lying down"/disconnected)
(in "flight mode")

  • via ssh (over usb)
    1. systemctl disable keyd
    2. reboot
  • via ssh (over usb)
    1. htop (to monitor the behavior of remux)
  • by hand (after each step pausing 30s to observe htop in the ssh window on my laptop and confirm that remux is ok before continuing)
    1. xochitl onscreen: unlock xochitl
    2. xochitl onscreen: "stand up"/connect type folio 🧍‍♂️
    3. xochitl onscreen: "lie down"/disconnect type folio 🛌
    4. xochitl onscreen: remove rm2 from type folio 📤
    5. xochitl onscreen: swipe to summon remux (remux appears)
    6. xochitl+remux onscreen: tap to select yaft from remux (yaft appears)
    7. yaft portrait-mode onscreen: place rm in type folio 📥
    8. yaft portrait-mode onscreen: "stand up"/connect type folio 🧍‍♂️ (yaft changes to landscape-mode)
    9. yaft landscape-mode onscreen: "lie down"/disconnect type folio 🛌 (yaft changes to portrait-mode)

Throughout this sequence of actions, remux used negligible cpu and 1% of memory.

from rmkit.

Eeems avatar Eeems commented on August 20, 2024

Well that's good to know. I haven't looked closely at the code to see how it gets the key device(s) to work with. When keyd is not running, there will be a key input device for the power button, and one for the folio. The folio device will be removed and re-added every time it's disconnected and reconnected. With kyed running the same stuff happens, but there are now new virtual input devices provided by keyd, and it will grab all input on the other devices. Restarting keyd would remove and re-add these virtual devices, as well as ungrab, and then grab the other devices.

Depending on how the code is setup to handles these devices, it might not be happy with these input devices going away as they were the only ones not grabbed when remux started. And when keyd isn't running, it's just not an issue as it gets the power button input device and not the folio as the key input. So the folio device going away doesn't matter. @raisjn or someone else who has looked closer at the code would confirm.

from rmkit.

plredmond avatar plredmond commented on August 20, 2024

Ok, thanks for explaining that. I'll try looking at the code if I have time later to set up a build environment.

from rmkit.

Eeems avatar Eeems commented on August 20, 2024

Ok, thanks for explaining that. I'll try looking at the code if I have time later to set up a build environment.

If you aren't averse to using docker, using the docker version of the makefile targets does simplify setting up a build environment.

from rmkit.

plredmond avatar plredmond commented on August 20, 2024

Thanks @raisjn!

  • I downloaded remux with sha256 36ecc8e0625d2794e4b3741150a5e44928bfe75f4fd7cf466c6968fd0c1c7707 and also remux.service and placed them respectively at /opt/bin/remux and lib/systemd/system/remux.service
  • reboot
  • Confirm that the remux which is running has the above sha256
  • systemctl restart keyd
Jul 01 20:22:01 reMarkable remux[193]: OPENING /dev/input/event1 AS WACOM
Jul 01 20:22:01 reMarkable remux[193]: OPENING /dev/input/event2 AS TOUCH
Jul 01 20:22:01 reMarkable remux[193]: OPENING /dev/input/event3 : UNKNOWN EVENT DEVICE
Jul 01 20:22:01 reMarkable remux[193]: ERROR OPENING INPUT DEVICE /dev/input/event4
Jul 01 20:22:01 reMarkable systemd[1]: keyd.service: Main process exited, code=exited, status=15/n/a
Jul 01 20:22:01 reMarkable systemd[1]: keyd.service: Failed with result 'exit-code'.
Jul 01 20:22:01 reMarkable systemd[1]: Stopped key remapping daemon.
Jul 01 20:22:01 reMarkable systemd[1]: Started key remapping daemon.
Jul 01 20:22:01 reMarkable kernel: input: keyd virtual keyboard as /devices/virtual/input/input7
Jul 01 20:22:01 reMarkable keyd[337]: CONFIG: parsing /opt/etc/keyd/default.conf
Jul 01 20:22:01 reMarkable kernel: input: keyd virtual pointer as /devices/virtual/input/input8
Jul 01 20:22:01 reMarkable keyd[337]: Starting keyd v2.4.3 ()
Jul 01 20:22:01 reMarkable systemd-logind[237]: Watching system buttons on /dev/input/event4 (keyd virtual keyboard)
Jul 01 20:22:01 reMarkable keyd[337]: DEVICE: ignoring 0fac:1ade  (keyd virtual pointer)
Jul 01 20:22:01 reMarkable keyd[337]: DEVICE: match    2edd:0001  /opt/etc/keyd/default.conf        (rM_Keyboard)
Jul 01 20:22:01 reMarkable keyd[337]: DEVICE: ignoring 056a:0000  (Wacom I2C Digitizer)
Jul 01 20:22:11 reMarkable systemd[1]: [email protected]: Succeeded.
Jul 01 20:22:11 reMarkable systemd[1]: [email protected]: Scheduled restart job, restart counter is at 1.
Jul 01 20:22:11 reMarkable systemd[1]: Stopped Getty on tty1.
Jul 01 20:22:11 reMarkable systemd[1]: Started Getty on tty1.

load average stays low and remux seems happy at 0.0% cpu usage! i guess this is fixed 🙂 thank you!

from rmkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.