Isochronous transfer missing frames on USB4?

Engineering ee at athyriogames.com
Wed Apr 29 15:18:40 UTC 2009


Hello all. I am having an odd problem getting a UVC webcam to work on
FreeBSD

Little background:
This is for an arcade game - needs to be able to run for weeks unattended at
a bar
Running of Intel D945PLNM board, nVidia 9500GT series video card. Storage is
compact flash, with a CF-IDE adapter
Webcam is no-name Chinese, which is supposed to conform to UVC spec - no
other documentation

'Driver' is modified ugen with Hans Petter's newest stack. Running
high-speed isochronous transfers.

We've been running for months with no problems, but now that production
motherboards and cameras are coming in, something is cropping up.

The webcam is locked at 160x120, 30fps

At this rate, it always gives me 39 frames of data per video frame
37 frames of 1024, 1 frame of 968, 1 frame of 12
Minus the 12 bytes of header on each packet, that is 37*1012+956 = 38400
bytes, which is exactly correct
The last 12 byte header contains no data, but contains the end of frame bit

Cannot confirm, but it only seems to happen when webcam is plugged into the
USB port directly underneath the etherNet jack.

Timing issue? Priority? Any suggestions on where to look?

Thanks,
Sam

I have _tons_ of logs and source, but I'll snip what seems relevant for
now...


Apr 28 17:09:04  kernel: FreeBSD 7.0-RELEASE #9: Wed Mar 18 08:04:55 CDT
2009
Apr 28 17:09:04  kernel: usb4: EHCI version 1.0
Apr 28 17:09:04  kernel: usb4: <Intel 82801GB/R (ICH7) USB 2.0 controller>
on ehci0

Apr 28 17:09:04  kernel: usb0: 12Mbps Full Speed USB v1.0
Apr 28 17:09:04  kernel: uhub0: <Intel UHCI root HUB, class 9/0, rev
1.00/1.00, addr 1> on usb0
Apr 28 17:09:04  kernel: uhub0: 2 ports with 2 removable, self powered
Apr 28 17:09:04  kernel: usb1: 12Mbps Full Speed USB v1.0
Apr 28 17:09:04  kernel: uhub1: <Intel UHCI root HUB, class 9/0, rev
1.00/1.00, addr 1> on usb1
Apr 28 17:09:04  kernel: uhub1: 2 ports with 2 removable, self powered
Apr 28 17:09:04  kernel: usb2: 12Mbps Full Speed USB v1.0
Apr 28 17:09:04  kernel: uhub2: <Intel UHCI root HUB, class 9/0, rev
1.00/1.00, addr 1> on usb2
Apr 28 17:09:04  kernel: uhub2: 2 ports with 2 removable, self powered
Apr 28 17:09:04  kernel: usb3: 12Mbps Full Speed USB v1.0
Apr 28 17:09:04  kernel: uhub3: <Intel UHCI root HUB, class 9/0, rev
1.00/1.00, addr 1> on usb3
Apr 28 17:09:04  kernel: uhub3: 2 ports with 2 removable, self powered
Apr 28 17:09:04  kernel: usb4: 480Mbps High Speed USB v2.0
Apr 28 17:09:04  kernel: uhub4: <Intel EHCI root HUB, class 9/0, rev
2.00/1.00, addr 1> on usb4
Apr 28 17:09:04  kernel: uhub4: 8 ports with 8 removable, self powered
Apr 28 17:09:04  kernel: ugen0: <Vimicro Corp. Sirius USB2.0 Camera, class
239/2, rev 2.00/1.00, addr 2> on usb4
Apr 28 17:09:04  kernel: make_dev uvc.1

// My debug messages follow
Apr 28 17:09:19  kernel: set config 0
Apr 28 17:09:19  kernel: make_dev uvc.1
Apr 28 17:09:19  kernel: set config 1
Apr 28 17:09:19  kernel: make_dev uvc.1
Apr 28 17:09:19  kernel: make_dev uvc.2
Apr 28 17:09:19  kernel: ugen_get_cdesc -1
Apr 28 17:09:19  kernel: usbd_find_idesc 0 0
Apr 28 17:09:19  kernel: UVC Start read uvc returned 0
Apr 28 17:09:19  kernel: High speed 64 frames
Apr 28 17:09:19  kernel: ugen_open_pipe_read: isoc open done

// Megabytes of this stuff...  Shows the raw byte count of each of the 64
frames coming back on iso_read_callback


Apr 28 17:09:19  kernel: 
 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 968 12 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 
Apr 28 17:09:19  kernel: 
 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0
0 0
 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0
0 0 
Apr 28 17:09:19  kernel: 
 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0
0 0
 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0
1024 0 
Apr 28 17:09:19  kernel: 
 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0
1024
 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0

Apr 28 17:09:19  kernel:
 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0
0 0
 0 0 1024 0 0 0 968 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

37 frames of 1024, 1 frame of 968, 1 frame of 12
Minus the 12 bytes of header on each packet, that is 37*1012+956 = 38400
bytes, which is exactly correct
The last 12 byte header contains no data, but contains the end of frame bit
	
After time - problems cropping up - a complete packet goes missing - easiest
to see if the 968 or 12 goes, but it happens to the 1024s too
When missing, the packet is completely gone - 0 bytes

Apr 29 13:40:25  kernel: 
 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 968 12 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 
Apr 29 13:40:25  kernel: 
 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0 1024
0 0
 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 0 0
1024 
Apr 29 13:40:25  kernel: 
 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0
1024 0
 0 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0

Apr 29 13:40:25  kernel: 
 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0
0 0
 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0
0 0 

NOTE HERE THE '12' PACKET IS GONE:
Apr 29 13:40:25  kernel:
 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0
0 0 
 0 0 0 0 1024 0 0 0 968 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

Apr 29 13:40:25  kernel: 
 0 0 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0
 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0
0 0 
Apr 29 13:40:25  kernel:
 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0
1024 0
 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0
1024 
Apr 29 13:40:25  kernel:
 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0
1024
 0 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0

Apr 29 13:40:25  kernel: 
1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0
0
0 1024 0 0 0 0 0 0 1024 0 0 0 0 0 1024 0 0 0 0 0 0 0 1024 0 0 0 0 968 12 0 0
0



More information about the freebsd-usb mailing list