Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input devices lost when doing vt switch (FreeBSD) #223

Open
johalun opened this issue Jan 10, 2017 · 3 comments
Open

Input devices lost when doing vt switch (FreeBSD) #223

johalun opened this issue Jan 10, 2017 · 3 comments

Comments

@johalun
Copy link
Contributor

johalun commented Jan 10, 2017

Have anyone seen anything similar on Linux?

After resume (vt switch back) libinput_resume is called and /dev/input/event[0-4] is being re-opened as expected but each device is immediately closed again except for the last one which is neither kb or mouse so I lose input methods...

(sorry for the excessive udev output...)

log snippet from when switching back to vt9 where Sway is running.

01/09/17 20:52:04 - [main.c:43] [wlc] fd.c fd_open: Open path /dev/input/event4. Stored fd 4 to index 0
udev_device_get_udev(0x80d95d7a0(/dev/input/event3))
udev_device_get_syspath(0x80d849140) ukbd0
udev_device_get_syspath(0x80d95d980) /dev/input/event3
udev_device_get_devnode(0x80d95d980) /dev/input/event3
udev_device_get_udev(0x80d95d980(/dev/input/event3))
udev_device_get_syspath(0x80d849780) ukbd0
udev_device_get_syspath(0x80d95d7a0) /dev/input/event3
udev_device_get_syspath(0x80ba3b450) /dev/input/event4
udev_device_unref(0x80d95d7a0//dev/input/event3) 1
01/09/17 20:52:04 - [main.c:43] [wlc] fd.c wlc_fd_close 20
udev_device_unref(0x80ba3b450//dev/input/event4) 1
01/09/17 20:52:04 - udev_list_entry_get_name() /dev/kbdmux0
[main.c:43] udev_device_new_from_syspath(/dev/kbdmux0)
[wlc] fd.c handle_requestudev_device_get_syspath(0x80ba3b450) /dev/kbdmux0

udev_device_get_sysname(0x80ba3b450(/dev/kbdmux0)) kbdmux0
01/09/17 20:52:04 - udev_device_get_udev(0x80ba3b450(/dev/kbdmux0))
[main.c:43] udev_device_get_syspath(0x80d849680) kbdmux0
[wlc] fd.c handle_request: FD_CLOSEudev_device_get_sysname(0x80ba3b450(/dev/kbdmux0)) kbdmux0

udev_device_unref(0x80ba3b450//dev/kbdmux0) 1
01/09/17 20:52:04 - udev_list_entry_get_name() /dev/sysmouse
[main.c:43] udev_device_new_from_syspath(/dev/sysmouse)
[wlc] Close index 1, fd 6udev_device_get_syspath(0x80ba3b450) /dev/sysmouse

udev_device_get_sysname(0x80ba3b450(/dev/sysmouse)) sysmouse
udev_device_get_udev(0x80ba3b450(/dev/sysmouse))
udev_device_get_syspath(0x80d95a550) sysmouse
udev_device_get_sysname(0x80ba3b450(/dev/sysmouse)) sysmouse
udev_device_unref(0x80ba3b450//dev/sysmouse) 1
udev_list_entry_get_name() /dev/ukbd0
udev_device_new_from_syspath(/dev/ukbd0)
udev_device_get_syspath(0x80ba3b450) /dev/ukbd0
udev_device_get_sysname(0x80ba3b450(/dev/ukbd0)) ukbd0
udev_device_get_udev(0x80ba3b450(/dev/ukbd0))
udev_device_get_syspath(0x80d849780) ukbd0
udev_device_get_sysname(0x80ba3b450(/dev/ukbd0)) ukbd0
udev_device_unref(0x80ba3b450//dev/ukbd0) 1
udev_list_entry_get_name() /dev/ums0
udev_device_new_from_syspath(/dev/ums0)
udev_device_get_syspath(0x80ba3b450) /dev/ums0
udev_device_get_sysname(0x80ba3b450(/dev/ums0)) ums0
udev_device_get_udev(0x80ba3b450(/dev/ums0))
udev_device_get_syspath(0x80d849600) ums0
udev_device_get_sysname(0x80ba3b450(/dev/ums0)) ums0
udev_device_unref(0x80ba3b450//dev/ums0) 1
udev_enumerate_unref(0x80ba316f0) refcount=1
udev_unref(0x80ba39650) refcount=14
01/09/17 20:52:04 - [main.c:43] [wlc] fd.c wlc_fd_activate
01/09/17 20:52:04 - [main.c:43] [wlc] fd.c handle_request
01/09/17 20:52:04 - [main.c:43] [wlc] fd.c handle_request: TYPE_ACTIVATE
01/09/17 20:52:04 - [main.c:43] [wlc] Activate: Iterate fd 0, value 4
01/09/17 20:52:04 - [main.c:43] [wlc] Activate: FD_INPUT
01/09/17 20:52:04 - [main.c:43] [wlc] Activate: Iterate fd 1, value -1
01/09/17 20:52:04 - [main.c:43] [wlc] Activate: Iterate fd 2, value -1
01/09/17 20:52:04 - [main.c:43] [wlc] Activate: Iterate fd 3, value -1
01/09/17 20:52:04 - [main.c:43] [wlc] Activate: Iterate fd 4, value -1
01/09/17 20:52:04 - [main.c:43] [wlc] Activate: Iterate fd 5, value 10
01/09/17 20:52:04 - [main.c:43] [wlc] Activate: FD_DRM
01/09/17 20:52:04 - [main.c:43] [wlc] Set drm master

fd 1,2,3,4 should contain input devices (they do before vt switch).
As can be seen in the log, for some reason FD_CLOSE requests are coming in and closing the input devices....

Until doing vt switch Sway works fine with all input devices.

@johalun
Copy link
Contributor Author

johalun commented Jan 10, 2017

Cleaner log:

01/09/17 22:37:09 - [main.c:43] [wlc] SIGUSR2
01/09/17 22:37:09 - [main.c:43] [wlc] wlc_set_active 1
01/09/17 22:37:09 - [main.c:43] [wlc] udev.c activate_event: active 1
01/09/17 22:37:09 - [main.c:43] [wlc] libinput: resume
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_open /dev/input/event0
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_OPEN
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c fd_open: Open path /dev/input/event0. Stored fd 4 to index 0
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_open /dev/input/event1
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_OPEN
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c fd_open: Open path /dev/input/event1. Stored fd 6 to index 1
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_close 20
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_CLOSE
01/09/17 22:37:09 - [main.c:43] [wlc] Close index 0, fd 4
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_open /dev/input/event2
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_OPEN
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c fd_open: Open path /dev/input/event2. Stored fd 4 to index 0
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_close 20
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_CLOSE
01/09/17 22:37:09 - [main.c:43] [wlc] Close index 1, fd 6
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_open /dev/input/event3
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_OPEN
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c fd_open: Open path /dev/input/event3. Stored fd 6 to index 1
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_close 20
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_CLOSE
01/09/17 22:37:09 - [main.c:43] [wlc] Close index 0, fd 4
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_open /dev/input/event4
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_OPEN
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c fd_open: Open path /dev/input/event4. Stored fd 4 to index 0
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c wlc_fd_close 20
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: FD_CLOSE
01/09/17 22:37:09 - 01/09/17 22:37:09 - [main.c:43] [main.c:43] [wlc] fd.c wlc_fd_activate[wlc] Close index 1, fd 6

01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request
01/09/17 22:37:09 - [main.c:43] [wlc] fd.c handle_request: TYPE_ACTIVATE
01/09/17 22:37:09 - [main.c:43] [wlc] Activate: Iterate fd 0, value 4
01/09/17 22:37:09 - [main.c:43] [wlc] Activate: FD_INPUT
01/09/17 22:37:09 - [main.c:43] [wlc] Activate: Iterate fd 1, value -1
01/09/17 22:37:09 - [main.c:43] [wlc] Activate: Iterate fd 2, value -1
01/09/17 22:37:09 - [main.c:43] [wlc] Activate: Iterate fd 3, value -1
01/09/17 22:37:09 - [main.c:43] [wlc] Activate: Iterate fd 4, value -1
01/09/17 22:37:09 - [main.c:43] [wlc] Activate: Iterate fd 5, value 10
01/09/17 22:37:09 - [main.c:43] [wlc] Activate: FD_DRM
01/09/17 22:37:09 - [main.c:43] [wlc] Set drm master

@Cloudef
Copy link
Owner

Cloudef commented Jan 10, 2017

I've seen this in rare cases so there is probably race condition somewhere. Whole tty switching is flaky.

@johalun
Copy link
Contributor Author

johalun commented Jan 10, 2017

Some more debugging gave me this output:
[wlc] opening input device '/dev/input/event0' failed (Operation not permitted)

That would explain why they're closed again after opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants