From: Wander L. C. <wan...@gm...> - 2013-10-30 23:25:03
|
2013/10/30 Johannes Stezenbach <js...@si...>: >> >> >> > [2249737.372143] usb 1-1.1: usbfs: process 32478 (python) did not claim interface 0 before use >> >> >> > >> >> >> >> >> >> Interface claiming, in another hand, is handled internally by PyUSB, >> >> >> this might be a bug. >> >> > >> >> > usb.control.get_interface() does not claim the interface. >> >> > >> >> >> >> Ah, no because control requests against endpoint 0 does not need >> >> interface claiming. >> > >> > So I wonder what cause the kernel to complain. >> > >> >> Maybe it is just a debug info without real meaning... > > I tried again and the > alternate_setting = usb.control.get_interface(dev, interface_number) > line in the tutorial causes the Linux kernel warning (Linux 3.10.14). > > So it seems the Linux kernel disagrees with your assumption? > If the control request is for USB_RECIP_INTERFACE it checks if > the interface has been claimed: > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/core/devio.c#n765 > > I don't have time right now, but I need to look further into this, as it might be a problem with PyUSB. Thanks to pointing this out. For now, what if you explicitly claim the interface (with usb.util.claim_interface function) before calling get_interface? -- Best Regards, Wander Lairson Costa |