[Kwintv] Re: v4l fix

Koos Vriezen koos.vriezen at xs4all.nl
Sun Dec 14 22:33:35 CET 2003


Dirk wrote:
> I'm familiar with races and locking concepts, but I currently have no idea 
> _why_ the qApp->lock() fixes the v4l plugin. All painting is now done in the 
> grabber thread with the event loop waiting. But what's the difference between 
> posting events (thread-safe) and copying a permanent buffer into a widget 
> from the event loop? And where is a race condition in there???

Note that in both cases painting is done while the event loop is waiting.

My analyses was that the fatal io error occurs while doing
a ioctl in V4LDev::grab or V4LDev::initGrabbing by the grabber thread and
the main thread doing XvPutImage in KXvDevice::displayImage at the same
time. I guess that the race is in accessing XVideo or v4l kernel module.
(to really track this down would be to add a mutex on these I suppose and
see if it helps - if so, async grabbing and painting will never work)

Koos



More information about the kwintv mailing list