On Fri, 2005-02-11 at 17:37, David Brownell wrote:
> On Friday 11 February 2005 9:14 am, Steve Hosgood wrote:
> > On Fri, 2005-02-11 at 16:36, Alan Stern wrote:
> > > > Meanwhile, I ran my driver with detailed debugging of its own and what I
> > > > see is like this:
> > > > 
> > > > ....
> > > > Receive 32768 bytes from camera: add it to the image-buffer
> > > > Resubmit URB
> > > > Receive 32768 bytes from camera: add it to the image-buffer
> > > > Resubmit URB
> > > > Receive 20667 bytes from camera: add it to the image-buffer (that marks
> > > > the end of frame). This URB has been composed from 41 full 512 byte
> > > > bulk-packets plus one half-filled 512 byte bulk-packet.
> 
> Your diagnostics don't do the math right, possibly suggestive of
> some other problem.  20667 = (40 * 512) + 197 ... so you may be
> assuming an extra packet, as well as extra bytes (197 != 512/2).
> Or maybe you just paraphrased them wrongly.
> 

No, I'm a twit! I wrote down the wrong number from a scribble pad. It
should have been 21248 which *is* 41.5 packets of 512 bytes!


> 
> > > > Resubmit URB
> 
> And the resubmit succeeded -- no error returned?
> 

That's right. I wouldn't be wasting your time on this if it was *that*
easy! Also, when my timebomb goes off after 0.1 seconds of inactivity,
it unregisters the endpoint, at which point the IRQ routine gets called
8 times (correctly) as each submitted URB reports itself deallocated.

The URBs are certainly in there and ready to fill.

> 
> > > > [no more IRQs hit my callback function over the next tenth of a second]
> > > > 
> > > > The timebomb goes off.
> > > > Tell the camera to stop streaming.
> > > > Release all URBs.
> > > > 
> > > > This is as close as I can get to diagnostics, since I don't have useful
> > > > access to the next layer down.
> 
> What, you don't have the source code?  :)
> 

I meant my *driver* doesn't have access any further down!

And anyway, no I don't have source code to this Microsoft Linux 2.6.10
that I'm using here :-) :-)

> 
> > I was rather hoping that the driver's maintainer might wade in here with
> > suggestions as to how we might home in on this problem.
> 
> The debug files are in /sys/class/usb_host/usb1 if this bus is
> currently labeled "usb1", and the files of interest for bulk
> transfers are "async" (showing the URBs the EHCI knows about)
> and "registers" (showing register state).
> 

Brilliant. Thank you for that. Now I can contribute some dumps from
there (trouble is, it's a snapshot, not a running log). However, for the
case that works (1600x1200 images @ 10fps), I get reports like this for
'async' and 'registers' on bus 1 (the camera is device 2 on bus 1):

qh/cf49c100 dev2 hs ep2 42002202 40000000 (ae002d80* data1 nak4)
        da98f4e0*in len=20480 50000d80 urb ca525a00
        da98f600+in len=12288 b0008d80 urb ca525a00
        da98f5a0#in len=20480 50000d80 urb d6243780
        da98f6c0 in len=12288 b0008d80 urb d6243780
        da98f660#in len=20480 50000d80 urb c791ab00
        da98f720 in len=12288 b0008d80 urb c791ab00
        da98f300#in len=20480 50000d80 urb d6189b00
        da98f120 in len=12288 b0008d80 urb d6189b00
        da98f060#in len=20480 50000d80 urb d4452680
        da98f1e0 in len=12288 b0008d80 urb d4452680
        da98f180#in len=20480 50000d80 urb d6189900
        da98f2a0 in len=12288 b0008d80 urb d6189900
        da98f240#in len=20480 50000d80 urb c2609480
        da98f3c0 in len=12288 b0008d80 urb c2609480
        da98f360#in len=20480 50000d80 urb d0a5aa80
        da98f480 in len=12288 b0008d80 urb d0a5aa80

bus pci, device 0000:02:0a.2 (driver 26 Oct 2004)
EHCI 1.00, hcd state 1
structural params 0x00002293
capability params 0x0000e806
status a008 Async Recl FLR
command 010b29 park=3 ithresh=1 Async period=256 RUN
intrenable 37 IAA FATAL PCD ERR INT
uframe 2cea
port 1 status 001000 POWER sig=se0 
port 2 status 001005 POWER sig=se0  PE CONNECT
port 3 status 001000 POWER sig=se0 
irq normal 169294 err 0 reclaim 14043 (lost 0)
complete 169373 unlink 7433


...and again:

qh/cf49c100 dev2 hs ep2 42002202 40000000 (8a00ad80* data1 nak0)
        da98f360 in len=0 00004d00 urb d6189b00
        da98f480*in len=12288 b0008d80 urb d6189b00
        da98f420+in len=20480 50000d80 urb d4452680
        da98f540 in len=12288 b0008d80 urb d4452680
        da98f4e0#in len=20480 50000d80 urb d6189900
        da98f600 in len=12288 b0008d80 urb d6189900
        da98f5a0#in len=20480 50000d80 urb c2609480
        da98f6c0 in len=12288 b0008d80 urb c2609480
        da98f660#in len=20480 50000d80 urb d0a5aa80
        da98f720 in len=12288 b0008d80 urb d0a5aa80
        da98f300#in len=20480 50000d80 urb ca525a00
        da98f120 in len=12288 b0008d80 urb ca525a00
        da98f060#in len=20480 50000d80 urb d6243780
        da98f1e0 in len=12288 b0008d80 urb d6243780
        da98f180#in len=20480 50000d80 urb c791ab00
        da98f2a0 in len=12288 b0008d80 urb c791ab00

bus pci, device 0000:02:0a.2 (driver 26 Oct 2004)
EHCI 1.00, hcd state 1
structural params 0x00002293
capability params 0x0000e806
status a008 Async Recl FLR
command 010b29 park=3 ithresh=1 Async period=256 RUN
intrenable 37 IAA FATAL PCD ERR INT
uframe 0c94
port 1 status 001000 POWER sig=se0 
port 2 status 001005 POWER sig=se0  PE CONNECT
port 3 status 001000 POWER sig=se0 
irq normal 171100 err 0 reclaim 14074 (lost 0)
complete 171179 unlink 7433

Here endeth the lesson.
Now for the non-working situation of 800x600 images @ 40fps:

qh/cf49c100 dev2 hs ep2 42002202 40000000 (0400ad80* data0 nak3)
        da98f360 in len=0 00004d00 urb d6189b00
        da98f480*in len=12288 b0008d80 urb d6189b00
        da98f420+in len=20480 50000d80 urb c2609a80
        da98f540 in len=12288 b0008d80 urb c2609a80
        da98f4e0#in len=20480 50000d80 urb d6189a00
        da98f600 in len=12288 b0008d80 urb d6189a00
        da98f5a0#in len=20480 50000d80 urb d6189900
        da98f6c0 in len=12288 b0008d80 urb d6189900
        da98f660#in len=20480 50000d80 urb cdb43d00
        da98f720 in len=12288 b0008d80 urb cdb43d00
        da98f1e0#in len=20480 50000d80 urb d2615100
        da98f120 in len=12288 b0008d80 urb d2615100
        da98f0c0#in len=20480 50000d80 urb c280bc80
        da98f240 in len=12288 b0008d80 urb c280bc80
        da98f180#in len=20480 50000d80 urb c2609080
        da98f300 in len=12288 b0008d80 urb c2609080

bus pci, device 0000:02:0a.2 (driver 26 Oct 2004)
EHCI 1.00, hcd state 1
structural params 0x00002293
capability params 0x0000e806
status a008 Async Recl FLR
command 010b29 park=3 ithresh=1 Async period=256 RUN
intrenable 37 IAA FATAL PCD ERR INT
uframe 2bf7
port 1 status 001000 POWER sig=se0 
port 2 status 001005 POWER sig=se0  PE CONNECT
port 3 status 001000 POWER sig=se0 
irq normal 190248 err 0 reclaim 16197 (lost 0)
complete 190328 unlink 8480

..and again:

qh/cf49c100 dev2 hs ep2 42002202 40000000 (12009d80* data0 nak3)
        da98f660 in len=0 80004d00 urb c2609080
        da98f720*in len=12288 b0008d80 urb c2609080
        da98f1e0+in len=20480 50000d80 urb d6189b00
        da98f120 in len=12288 b0008d80 urb d6189b00
        da98f0c0#in len=20480 50000d80 urb c280bc80
        da98f240 in len=12288 b0008d80 urb c280bc80
        da98f180#in len=20480 50000d80 urb c2609a80
        da98f300 in len=12288 b0008d80 urb c2609a80
        da98f2a0#in len=20480 50000d80 urb d6189a00
        da98f3c0 in len=12288 b0008d80 urb d6189a00
        da98f360#in len=20480 50000d80 urb d6189900
        da98f480 in len=12288 b0008d80 urb d6189900
        da98f420#in len=20480 50000d80 urb cdb43d00
        da98f540 in len=12288 b0008d80 urb cdb43d00
        da98f4e0#in len=20480 50000d80 urb d2615100
        da98f600 in len=12288 b0008d80 urb d2615100

bus pci, device 0000:02:0a.2 (driver 26 Oct 2004)
EHCI 1.00, hcd state 1
structural params 0x00002293
capability params 0x0000e806
status 8008 Async FLR
command 010b29 park=3 ithresh=1 Async period=256 RUN
intrenable 37 IAA FATAL PCD ERR INT
uframe 2aa0
port 1 status 001000 POWER sig=se0 
port 2 status 001005 POWER sig=se0  PE CONNECT
port 3 status 001000 POWER sig=se0 
irq normal 194047 err 0 reclaim 16739 (lost 0)
complete 194127 unlink 8736

Statistics would indicate that the latter two dumps will have happened
whilst the camera driver was twiddling its thumbs waiting for a URB to
kindly report back with data. Which it never does.

The dumps are separated in time by how long it took me to type "cat
async > /tmp/xxx1" followed by "cat registers > /tmp/yyy1". Just a
couple of seconds apart therefore.

> Somewhere along I missed seeing what kernel you're using.  It
> should be at least 2.6.10, ideally with the EHCI patch that
> I submitted yesterday (but from what I've gleaned so far, that
> may not matter for you).  How many bulk endpoints are you
> using concurrently?

Stock Fedora core 2.6.10-1.12_FC2 kernel source RPM (with
CONFIG_USB_DEBUG turned on), compiled by me. No it doesn't have the EHCI
patch, but if you want it added in, I can do that.

I just use one bulk endpoint.

Steve.



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to