"handler_add event handler open failed: No such file or directory" upon detecting mouse

Bug #196659 reported by Cassiano Leal
2
Affects Status Importance Assigned to Milestone
btnx-config
New
Undecided
Olli Salonen

Bug Description

I have installed btnx-config and btnx versions 0.4.6 and installed through "./configure && make && sudo make install" for btnx-config and "make && sudo make install" for btnx on a Debian/Lenny PC.

I ran "sudo btnx-config" to make it run with root permissions.

When detecting the mouse, I wait the 5 seconds and move the mouse when told to do so. It is then when I get the message:

"No settings file at /etc/btnx/btnx_settings
Error: handler_add event handler open failed: No such file or directory
Error: moused_add_handler failed at handler addition."

on the terminal I used to run the config from.

Additional info:

"$ ls /dev/input
by-id by-path event0 event1 event3 event4 mice mouse0 uinput
$ lsmod | grep uinput
uinput 9728 0"

from xorg.conf:

"Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-mouse"
 Option "Emulate3Buttons" "no"
 Option "Protocol" "auto"
 Option "Buttons" "10"
 Option "ZAxisMapping" "4 5"
EndSection"

I have also tried the "Device" to be "/dev/input/mice" and "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse".

The mouse is a 10-button Logitech Trackman Optical.

Revision history for this message
Cassiano Leal (cbl-via-rs) wrote :

Just to add up. The trackball is correctly detected, but none of the buttons are.

Revision history for this message
Olli Salonen (daou) wrote :

This is an interesting error, because the event file has been opened for detection, but when handler_add attempts to open it, it complains that the file doesn't exist.
You can find out which event file is causing the problem by modifying line 38 in handlers.c to:
fprintf(stderr, "Error: handler_add event handler open failed: %s: %s\n", path, strerror(errno));

Recompile and install. This is just to make sure that there is nothing wrong with the path variable itself.

Revision history for this message
Cassiano Leal (cbl-via-rs) wrote :

This is what I get:

"Error: handler_add event handler open failed: dev/input/event0: No such file or directory"

Seems like I'm missing the leading slash before dev, right?

Revision history for this message
Olli Salonen (daou) wrote :

Yes, that is the problem. I'm surprised that this hasn't surfaced before. It has to do with the interprocess communication. The implementation is far from ideal and I haven't worked on it in months. It will take me a while to try to reproduce the bug and fix it. I will have time in about two weeks to take a closer look at it.

Thanks for reporting the bug. Hopefully you will be available later when I am able to fix it to confirm the fix.

Changed in btnx-config:
assignee: nobody → daou
Revision history for this message
Olli Salonen (daou) wrote :

For your case, you can probably make a temporary fix. Change line 294 in moused.c to

moused_add_handler(&(buffer->data[1]));

Somewhat of a hack, but hopefully it will let you use the software until I have time to get to the bottom of the problem. Note that the same problem could surface during button detection, where there the data received from detection is offset by one byte on your system.

Revision history for this message
Cassiano Leal (cbl-via-rs) wrote :

The hack didn't work either... Here's what I get now:

"Error: handler_add event handler open failed: /dev/input/event1: No such file or directory" (there's a strange character before the /)

Now the scroll gets detected, though, but that may be just because I set "lomoco --no-sms"... But don't worry, I'll wait for the fix.

Just to mention, I also use btnx at home and it has allowed me to use my mouse buttons without messing around with xmodmap's somewhat awckward configurations. It is a great piece of software and very welcome in the Linux desktop. Keep up!

Revision history for this message
Olli Salonen (daou) wrote :

The strange character is part of the protocol of the IPC. For some reason, the event0 path gets shifted by 1 and event1 does not. Or then I am completely wrong, and the IPC works. It might be a boundary condition bug because it affects event0, which is opened in the first iteration of a loop at the start of detection. (Ok maybe I'm talking to myself here, but it does help me think of the problem ;) ).

And thanks for the encouragement. I'm happy to hear you find btnx useful.

Revision history for this message
Olli Salonen (daou) wrote :

One way to confirm if it only affects event0 is to try to get the mouse to start using an event handler with a different number. I'm not sure if unplugging and plugging the mouse changes the order, but you could try that. Or you could try switching the mouse to different USB port.

Revision history for this message
Cassiano Leal (cbl-via-rs) wrote :

Nope.

Managed to bind it to event1 by plugging in the USB keyboard first, then the mouse, but still got the same error.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.