v4l and threads?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi all,

I've tried to do some threading magic in lavrec... Basically, sync
(VIDIOCSYNC) and queue (VIDIOCMCAPTURE) calls go in different threads.
Problem: I queue all buffers, then sync on each of them, give the buffer
to a different thread and let it re-queue it. After some time (testing,
100% CPU load, so I can't keep up and have to lose frames...), when my
number of queued buffers starts to decrease to zero and I'm about to
sync on yet-unqueued buffers, I get a -EINV return value ("invalid
argument") on my next VIDIOCSYNC.

How threadsafe is v4l supposed to be? Can I sync on unqueued buffers
(assuming, of course, that they'll be queued later on - i.e. I'm losing
frames)? Does anyone have a clue on what might be going wrong?

The kernel log doesn't tell me anything useful... The card is a winTV
(Bt848 chip) from Hauppauge. The only modprobe argument I'm using is
"gbuffers=32".

Ronald

-- 
-   .-.
-   /V\    | Ronald Bultje <rbultje@xxxxxxxxxxxxxxxxxxx>
-  // \\   | Running: Linux 2.4.14-XFS and OpenBSD 2.8
- /(   )\  | http://ronald.bitfreak.net/
-  ^^-^^





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux