[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-usb-devel
Subject:    Re: [linux-usb-devel] usb bulk transfer error
From:       Alan Stern <stern () rowland ! harvard ! edu>
Date:       2006-09-29 16:19:46
Message-ID: Pine.LNX.4.44L0.0609291203470.25378-100000 () netrider ! rowland ! org
[Download RAW message or body]

On Fri, 29 Sep 2006, Rumjantsev Egor wrote:

> Hello.
> I develop driver for USB 2.0 camera. It has 2 IN endpoints with 
> MaxPacketSize 512 bytes.
> I need to read stream of video data about 28 Mb/s. I use 4 urb in queue 
> for each endpoint's stream. The main trouble is that if the amount of 
> data which i need to read in one URB divide on 512 without any rest then 
> data transfer works fine. But if a size of URB not divide on 512 without 
> rest part i receive EOVERFLOW error.
> for example - size of URB was 1854 and in URB's callback function i see 
> that urb->actual_length = 1536.
> Are there some ideas about this trouble ?

Do you know the size of the packets the camera sends?  Are they all 512 
bytes?

EOVERFLOW means that a packet was received and was too large to fit in
your URB's buffer.  For example, if you URB's size if 1854 then it can
hold three 512-byte packets plus a fourth packet with <= 318 bytes.  But
if the camera sends four packets each with 512 bytes then the last one
will overflow your URB.

To be safe, make your URB's size always a multiple of 512.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic