Re: gadgetfs isn't sending interrupt messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 29 Jun 2009, Adam Nielsen wrote:

> > Does usbmon show the interrupt URB being submitted?  If not then of 
> > course the responses won't be delivered.
> 
> No, according to usbmon then URB never gets submitted.  gadgetfs correctly
> receives the data for it though, because running my own app after the Windows
> one will receive the interrupts one message behind (since the first response
> was never read by the Windows app.)

So the URB got lost somewhere between Windows and the Linux kernel.  Or 
maybe didn't get generated in the first place.

> In this particular case I know that VirtualBox isn't to blame, because if I
> plug in the real hardware device then it works perfectly (this is how I was
> able to initially reverse engineer the communication protocol.)  It's only my
> gadgetfs device that isn't communicating properly.

It may be that the Windows app behaves differently because of the 
differences between your gadget and the real thing.  Have you compared 
usbmon traces for the two cases?

> > It might be possible to learn something by enabling the usbfs_snoop 
> > parameter for usbcore in the host.
> 
> I'll have a look at that, but since usbmon reports no URB, but the missing URB
> gets submitted later when my app next reads from the interrupt endpoint, I
> think it must be a problem related to dummy_udc or gadgetfs.
> 
> I don't know enough about USB to understand how interrupts work, but I imagine
> when data arrives on an interrupt endpoint the host needs to be notified that
> there is data waiting to be read.

"arrives on an interrupt endpoint" is a little misleading.  The data 
may be sitting in the device's buffer for that endpoint, but it won't 
arrive at the host until the host asks for it.

>  It's almost as if this notification never
> arrives, so the app sits there waiting to be notified before reading the data.
>  Since my own test program doesn't wait for any notifications and just blocks
> until interrupt data arrives, perhaps it doesn't matter that there is no
> notification?

Comparison of the usbmon logs should show the important differences.  
In fact, you've got four cases to look at, by varying the application 
(Windows app vs. your test program) and the device (real thing vs. your 
gadget).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux