Web lists-archives.com

Re: ibv4l2: error requesting 4 buffers: Device or resource busy

On 02/20/2010 03:50 PM, Guilherme wrote:
Guilherme wrote:
Hi all!

As I tried to migrate an applications that I had it working in another
computer, I struggled to have it working here.
It is a video capture application.
The following error occurred:

libv4l2: error requesting 4 buffers: Device or resource busy
read error 16, Device or resource busy
Press [Enter] to close the terminal ...

The code is attached to this e-mail, plz can I get some help from here.
Thanks a lot

P.S. My webcam works just fine on amsn.. so I guess its not a hardware
dependant issue... Looking online for help, people say that the drive
might be in use something related to this that is not my case.


First of all, this list is no longer in active use, linux-media (in the CC now)
is the correct list to use.

The problem you are seeing is caused by the app first doing a select() on the fd
before it does anything else which signals the driver what kind of IO the app
(mmap or read) is going to use. At this point the driver has to decide
which kind of IO it will use, as it needs to setup its internal buffers to
handle the select. when this happens, it assumes the app will use read() IO.

Then it does a read() call, which libv4l tries to emulate using mmap (for drivers
which don't implement read() themselves, and because using mmap is faster when
libv4l needs to do conversion). This fails, as libv4l cannot allocate the buffers
as the driver has already allocated buffers internally for read() based IO.

The current libv4l releasE: 0.6.4 has a fix for this.



video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe