Skip to content

Weird behavior with stylus on Linux #500

@CleyFaye

Description

@CleyFaye

Hi,

I'm facing a weird issue, and I'm not even sure how I could debug this.
I'm using Weylus on a Linux PC with X, with the browser being chrome on a lenovo Android tablet.

The version I run was built an hour ago, from the GIT repository, using the provided docker container, and installed as a .deb.

I have properly configured uinput, and most of the time, things works extremely smoothly: low latency video on the tablet, almost immediate stylus action on the PC, pressure work, position is correct, window/screen selection works fine, etc.

But SOMETIMES, when approaching the stylus to the tablet's screen, a set of spurious input will be thrown on the PC.
On Krita, this results in the layers being ALL flattened, the de-saturate effect being applied, and the grid showing up. This would translate to something like ctrl+shift+E, ctrl+shift+U, ctrl+shift+' being sent in quick sequence, or something similar.

A similarly weird behavior can be seen, sometimes, when using photopea on the PC, where it will de-saturate dozens of times.

Unfortunately, I'm not sure if the PC gets all these inputs or something else. I tried running xev, but it segfault immediately:

MappingNotify event, serial 40, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248
^]^]^\Quitter (core dumped)

Weylus itself doesn't give out much details:

2025-11-21T01:21:06.379522Z  INFO weylus::gui: Found more than one IP address for browsers to connect to,
2025-11-21T01:21:06.379540Z  INFO weylus::gui: other urls are:
2025-11-21T01:21:06.379544Z  INFO weylus::gui: http://10.8.0.34:1701
2025-11-21T01:21:06.379550Z  INFO weylus::gui: http://10.11.42.7:1701
2025-11-21T01:21:06.379554Z  INFO weylus::gui: http://172.17.0.1:1701
2025-11-21T01:21:06.379559Z  INFO weylus::gui: http://172.18.0.1:1701
2025-11-21T01:21:20.473477Z  INFO weylus::log: Video: 1920x540@h264_nvenc pix_fmt: cuda (bgr0)
2025-11-21T01:21:26.105082Z  INFO weylus::log: Video: 780x290@h264_nvenc pix_fmt: cuda (bgr0)
2025-11-21T01:22:17.537343Z  INFO weylus::log: Video: 1920x1080@h264_nvenc pix_fmt: cuda (bgr0)
XRequest.130: BadAccess (attempt to access private resource denied) 0x8a00004
XRequest.130: BadShmSeg (invalid shared segment parameter) 0x8a00005
2025-11-21T01:27:16.844524Z  INFO weylus::web: Webserver is shutting down.
XRequest.131: XI_BadDevice (invalid Device parameter) 0x17

I have no idea what's happening. And after this happens, the program works fine for a while, before doing that again, seemingly at random.
If I disable uinput, the issue goes away, but so does the pressure (obviously). But I'm not sure what else I could do.

Is there anything obvious I'm missing, or something else I can try to investigate? I'm not familiar at all with Rust or its tools, so I'm not too sure. If there's an easy way to build the deb in debug mode, I could start with that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions