Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2009 20:25:14 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        "Engineering" <ee@athyriogames.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Isochronous transfer missing frames on USB4?
Message-ID:  <200904292025.15728.hselasky@c2i.net>
In-Reply-To: <000f01c9c8dd$c4fdba20$4ef92e60$@com>
References:  <200903010045.44904.man@email.com.ua> <200903032243.31914.hselasky@c2i.net> <000f01c9c8dd$c4fdba20$4ef92e60$@com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 29 April 2009, Engineering wrote:
> 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.

Are you running stock -current code without any patches? And from which date?

Do you have more than 4GB of RAM?

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

Maybe an USB analyser (for example the Beagle Ones will give you an answer).

The same software works on one hardware but not the other?

Could you use the usbconfig tool to dump the descriptors of the USB webcam?

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

The new USB stack provides you with timing information about isochronous 
transfers, see "xfer->isoc_time_complete". This field is a 16-bit millisecond 
counter which tells exactly at which timeslot the isochronous transfer ended. 
You can use this field to figure out if you missed any frames when the frame 
rate is constant.

You might be aware about it: Isochronous transfers do not have any 
retransmission.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904292025.15728.hselasky>