2013/10/30 Johannes Stezenbach <j...@sig21.net>:

>> >> >> > [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

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to