|
From: Kustaa N. <Kus...@pl...> - 2009-10-11 17:59:47
|
Hi Alan,
thanks for responding.
Below is some output/code.
Before that I think I should mention that I'm no longer able
to get back to the "device busy" error situation, now all
I get is "no such file or directory" when I try to claim
the interface. Yesterday it was very consistent:
I plug out/in the device, try the code and get "device
busy", then I unbind or detach (via my code/libusb)
the driver and then i got "no such file".
Alas that does not happen today.
My Linux is Ubuntu 9.04, cleanly installed from CD
and I've done the following in my desperation:
in file: /lib/udev/rules.d/10-wmr100.rules
SUBSYSTEM=="usb",ATTRS{idVendor}== "0fde", ATTRS{idProduct}=="ca01", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0666", OPTIONS = "last_rule"
in file: /etc/modprobe.d/wmr100.conf
options usbhid quirks=0x0fde:0xca01:Ox0004
in file: /etc/modprobe.d/blacklist.conf
blacklist usbhid
in file: /etc/modules
lp
wmr100
usbhid
Now I've undone all those except the 10-wmr100.rules but
still can't get back to the situation I had yesterday.
Needless to say today and yesterday I've rebooted
dozens of times.
Why I'm mention this? I don' think that is relevant
except that I would have liked to show you the
dmesg of yesterday that said 'java tried to claim
interface while it was being claimed by usbhid'.
Alas, that does not happen, so I guess usbhid is
no longer grabbing the device but still I cannot
claim the interface although I find it, so the original
problem remains.
Thus here is some of the things you wanted to see:
-------------------------------------------------------------------------------------------
here is the code (this is Java accessing libusb via JNA
but I don't think it makes a difference):
USB_device findDevice(int vendor, int product, int device) {
int busses = usb_find_busses();
int devices = usb_find_devices();
USB_device thedev = null;
for (USB_bus bus = usb_get_busses(); bus != null; bus = bus.next) {
for (USB_device dev = bus.devices; dev != null; dev = dev.next) {
System.out.println(dev);
if (vendor >= 0 && vendor != (dev.descriptor.idVendor & 0xFFFF))
continue;
if (product >= 0 && product != (dev.descriptor.idProduct & 0xFFFF))
continue;
if (device >= 0 && device != (dev.descriptor.bcdDevice & 0xFFFF))
continue;
System.out.println((dev.descriptor.idVendor & 0xFFFF) + " " + (dev.descriptor.idProduct & 0xFFFF) + " " + (dev.descriptor.bcdDevice & 0xFFFF));
return dev;
<snip>
void main() {
usb_init();
int ret;
usb_set_debug(10);
USB_device device = findDevice(0x0FDE, 0xCA01, -1); //Ohio scientific
assertOk(device != null ? 0 : NON_STD_ERR, "findDevice");
USB_dev_handle dev = usb_open(device);
assertOk(dev != null ? 0 : NON_STD_ERR, "usb_open");
//ret = usb_detach_kernel_driver_np(dev, 0);
//assertOk(ret, "usb_detach_kernel_driver_np");
ret = usb_set_configuration(dev, 0);
assertOk(ret, "usb_set_configuration");
//ret = usb_claim_interface(dev, 0);
assertOk(ret, "usb_claim_interface");
-------------------------------------------------------------------------------------------
And here is what the code outputs, the libusb debug
prints are intermingled with the find_device output
but you see that the find_device is able to find
the device but the claiming fails:
usb_set_debug: Setting debugging level to 10 (on)
usb_os_find_busses: Found 001
usb_os_find_busses: Found 004
usb_os_find_busses: Found 003
usb_os_find_busses: Found 002
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 001
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 002 on 004
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 004
error obtaining child information: Operation not permitted
error obtaining child information: Operation not permitted
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 003
error obtaining child information: Operation not permitted
usb_os_find_devices: Found 003 on 002
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: couldn't get connect info
usb_os_find_devices: Found 001 on 002
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Operation not permitted
USB_device 1D6B 0002
USB_device 044E 3001
USB_device 1D6B 0001
USB_device 1D6B 0001
USB_device 0FDE CA01
4062 51713 770
usb_claim_interface failed, ret val -2 = could not claim interface 0: No such file or directory
USB error: could not claim interface 0: No such file or directory
-------------------------------------------------------------------------------------------
and here is the dmesg output after plugging the device out/in twice, note that
nothing appears there if I run my code:
<snip>
[ 43.877320] [drm:i915_getparam] *ERROR* Unknown parameter 6
[ 83.084049] Clocksource tsc unstable (delta = -264973564 ns)
[ 208.277009] ipw2100: Fatal interrupt. Scheduling firmware restart.
[ 208.277655] ipw2100: eth1: firmware fatal error
[ 441.360114] usb 2-1: USB disconnect, address 2
[ 444.824066] usb 2-1: new low speed USB device using uhci_hcd and address 3
[ 444.992362] usb 2-1: configuration #1 chosen from 1 choice
[ 445.035431] generic-usb 0003:0FDE:CA01.0002: hiddev96,hidraw0: USB HID v1.10 Device [Universal Bridge] on usb-0000:00:1d.0-1/input0
[ 513.528102] usb 2-1: USB disconnect, address 3
[ 524.252062] usb 2-1: new low speed USB device using uhci_hcd and address 4
[ 524.422276] usb 2-1: configuration #1 chosen from 1 choice
[ 524.470237] generic-usb 0003:0FDE:CA01.0003: hiddev96,hidraw0: USB HID v1.10 Device [Universal Bridge] on usb-0000:00:1d.0-1/input0
so any ideas on how to get further would be more than welcome!
br Kusti
|