after several hours of debugging and looking through the code I could have
I tried to connect my new scanner via usb, but it never showed up in lsusb.
First, it took me a while to realize that really is a libusb-issue: Some
programs showed the scanner, others did not. It turned out, that the kernel
found the scanner correctly, so /proc/bus/usb contained it and some programs
got their information from there directly. Therefore, it had to be libusb
loosing the information somewhere on the way.
After a long odyssey, I read the sources of libusb, found the switch
usb_debug, turned it on in testlibusb and finally found the solution: The
file /proc/bus/usb/004/003, which refers to my scanner is automatically set
to root:scanner (660), meaning that I, logged in as regular user, could not
read the file. libusb therefore silently ignored it, even though it could
have gotten all kinds of information from /proc/bus/usb/devices.
To save other unknowing users from similar frustrations, I have two
* Do not silently drop unreadable devices in usb_os_find_devices. Rather get
all the information you can get and simply flag the device as unusable
(possibly together with some detailed error information) That way, it is up
to client programs to decide about how to inform the user themselves.
* Add a "-d [n]" flag to lsusb that gives the user simple access to debugging
information. If I had only once seen the output with the usb_debug flag set,
I would probably immediately have understood what the problem is.
PS: Please CC me for replies
Bernhardstr. 2 ... D-93053 Regensburg
Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199
Get latest updates about Open Source Projects, Conferences and News.