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

Not able to add device/event to watch list of systemd-logind #32590

Open
spikerguy opened this issue Apr 30, 2024 · 4 comments
Open

Not able to add device/event to watch list of systemd-logind #32590

spikerguy opened this issue Apr 30, 2024 · 4 comments
Labels
login needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer

Comments

@spikerguy
Copy link

systemd version the issue has been seen with

255.4-1

Used distribution

Manjaro Linux

Linux kernel version used

6.8.5-1-MANJARO

CPU architectures issue was seen on

x86_64

Component

systemd-logind

Expected behaviour you didn't see

Watching system buttons on /dev/input/event16 8BitDo 8BitDo Ultimate wireless Controller for PC

Unexpected behaviour you saw

This device and event does not get added to the watch list.

I have added the required ENV and TAG to the device which can be seen in the udev log below.

Steps to reproduce the problem

Added ENV{ID_INPUT_KEY}=="1", TAG+="power-switch" to the device Product and Vendor ID.

Additional program output to the terminal or log subsystem illustrating the issue

udevadm info /dev/input/event16
P: /devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb3/3-2/3-2:1.0/input/input31/event16
M: event16
R: 16
U: input
D: c 13:80
N: input/event16
L: 0
S: input/by-path/pci-0000:04:00.4-usb-0:2:1.0-event-joystick
S: input/by-id/usb-8BitDo_8BitDo_Ultimate_wireless_Controller_for_PC_E417D8568335-event-joystick
S: input/by-path/pci-0000:04:00.4-usbv2-0:2:1.0-event-joystick
E: DEVPATH=/devices/pci0000:00/0000:00:08.1/0000:04:00.4/usb3/3-2/3-2:1.0/input/input31/event16
E: DEVNAME=/dev/input/event16
E: MAJOR=13
E: MINOR=80
E: SUBSYSTEM=input
E: USEC_INITIALIZED=5696426700
E: ID_INPUT=1
E: ID_INPUT_JOYSTICK=1
E: ID_BUS=usb
E: ID_MODEL=8BitDo_Ultimate_wireless_Controller_for_PC
E: ID_MODEL_ENC=8BitDo\x20Ultimate\x20wireless\x20Controller\x20for\x20PC
E: ID_MODEL_ID=3106
E: ID_SERIAL=8BitDo_8BitDo_Ultimate_wireless_Controller_for_PC_E417D8568335
E: ID_SERIAL_SHORT=E417D8568335
E: ID_VENDOR=8BitDo
E: ID_VENDOR_ENC=8BitDo
E: ID_VENDOR_ID=2dc8
E: ID_REVISION=0114
E: ID_TYPE=generic
E: ID_USB_MODEL=8BitDo_Ultimate_wireless_Controller_for_PC
E: ID_USB_MODEL_ENC=8BitDo\x20Ultimate\x20wireless\x20Controller\x20for\x20PC
E: ID_USB_MODEL_ID=3106
E: ID_USB_SERIAL=8BitDo_8BitDo_Ultimate_wireless_Controller_for_PC_E417D8568335
E: ID_USB_SERIAL_SHORT=E417D8568335
E: ID_USB_VENDOR=8BitDo
E: ID_USB_VENDOR_ENC=8BitDo
E: ID_USB_VENDOR_ID=2dc8
E: ID_USB_REVISION=0114
E: ID_USB_TYPE=generic
E: ID_USB_INTERFACES=:ff5d01:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=xpad
E: ID_PATH_WITH_USB_REVISION=pci-0000:04:00.4-usbv2-0:2:1.0
E: ID_PATH=pci-0000:04:00.4-usb-0:2:1.0
E: ID_PATH_TAG=pci-0000_04_00_4-usb-0_2_1_0
E: ID_FOR_SEAT=input-pci-0000_04_00_4-usb-0_2_1_0
E: LIBINPUT_DEVICE_GROUP=3/2dc8/3106:usb-0000:04:00.4-2
E: ID_INPUT_KEY=1
E: DEVLINKS=/dev/input/by-path/pci-0000:04:00.4-usb-0:2:1.0-event-joystick /dev/input/by-id/usb-8BitDo_8BitDo_Ultimate_wireless_Controller_for_PC_E417D8568335-event-joystick /dev/input/by->
E: TAGS=:power-switch:seat:uaccess:
E: CURRENT_TAGS=:power-switch:seat:uaccess:
@spikerguy spikerguy added the bug 🐛 Programming errors, that need preferential fixing label Apr 30, 2024
@github-actions github-actions bot added the login label Apr 30, 2024
@poettering
Copy link
Member

hmm, this is a joystick?

we generally only watch for keyboards that have a poweroff/suspend/… key. Does your device even have that?

@poettering poettering added needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer and removed bug 🐛 Programming errors, that need preferential fixing labels May 2, 2024
@spikerguy
Copy link
Author

spikerguy commented May 3, 2024

hmm, this is a joystick?

we generally only watch for keyboards that have a poweroff/suspend/… key. Does your device even have that?

No the device does not have those keys.

I was following rule you mentioned in one of your post.

#14825 (comment)

Also would like to know what is ListenSpecial as per your comment?

pid1 is not opening any input device (except if there's some .socket unit that uses ListenSpecial=/dev/input/event

poweroff/suspend/… key
Can we just add poweroff key to the controller to get it added to the watch list or powerkey and suspend both are needed ?

@poettering
Copy link
Member

No the device does not have those keys.

hmm, so why do you care about the power-switch then? i don't follow?

What are you trying to do?

@spikerguy
Copy link
Author

spikerguy commented May 6, 2024

No the device does not have those keys.

hmm, so why do you care about the power-switch then? i don't follow?

What are you trying to do?

I want to make the host pc wake up from sleep using a button on the controller. I am in talk with the vendor of the controller to see if they can add POWER_KEY on long press for 5s of the home button on the controller. That is the reason I asked if we can get Power_key mapped to the firmware of the controller then will that be enough to get this added to the watch list where we can wake up the host from sleep, or does it need Power_key and Suspend both ?

Without this approach the wake up method would be to use usb wakeup where it detected device activity and wakes up the host but it is not very smooth and not very precise.

Example Video here
With this method the host wakes up even when the device is powered down by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
login needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer
Development

No branches or pull requests

2 participants