From: Christopher Harvey <arbuckle911@gmail.com>
To: video4linux-list@redhat.com
Subject: select() problems with uvc drivers.
Date: Sun, 10 Feb 2008 15:58:12 -0500 [thread overview]
Message-ID: <47AF6564.6070602@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]
Hello,
I've created a small c program that uses pure v4l2 code to read from a
webcam on a uvc driver then copy that data into an SDL overlay. I've
posted the code here:
http://basementcode.com/serverMain.html
and I've attached a log file I created from the output of that program.
Overall the program works great except that after a few frames, about 35
(varies each run) in my case, the select() function that is supposed to
block until new data from the webcam is available stops working and
returns right away. This isn't a huge problem because the following
ioctl(fd, VIDIOC_DQBUF, &buf)
call simply fails and sets errno to EAGAIN, then my app simply tries
again and again until it works. I'd rather select worked for the entire
duration of the capture to save cpu time and make sure that I read the
frame asap each time. The relevant function in the code I posted above
is "mainLoop", however I can't be sure the error is actually in that
function. I hope I've posted enough information.
Thanks in advance,
Chris.
[-- Attachment #2: log --]
[-- Type: text/plain, Size: 1916 bytes --]
//The code for this log can been seen at:
// http://basementcode.com/serverMain.html
// Commandline = $./camTest /dev/video0 -w 640 -h 480
Device name: /dev/video0
Requested Width: 640
Requested Height 480
---------Device Capabilities---------
Driver: uvcvideo
Name: UVC Camera (046d:08ca)
Bus: 0000:00:02.1
Driver Version: 0.1.0
Video Capture: Yes
Read/write: No
Async IO: No
Streaming: Yes
-------------------------------------
----------Device Connections---------
Input #0
Name: Camera 1
Type: Camera
Video standard: 0
-------------------------------------
Set to input 0
-------Image format enumeration-----
Format #0
MJPEG
Pixel format id: 1196444237
Type: V4L2_BUF_TYPE_VIDEO_CAPTURE
Compressed: Yes
Format #1
YUV 4:2:2 (YUYV)
Pixel format id: 1448695129
Type: V4L2_BUF_TYPE_VIDEO_CAPTURE
Compressed: No
-------------------------------------
Default image format locked!
Current image format:
Width: 640
Height 480
PixelFormat: 1448695129
Bytes per line: 1280
Feild: V4L2_FIELD_NONE
Image code: YUYV
Colorspace: V4L2_COLORSPACE_SRGB
Got 20 buffers for memory map streaming.
OverLay has 1 planes.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Got image.
Again.
Again.
Again.
Again.
Again.
Again.
Got image.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Got image.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Got image.
...
...
...
... This output repeats until the program shuts down.
...
...
...
...
Again.
Again.
Again.
Again.
Again.
Again.
Again.
Got image.
Unmapped all 20 buffers.
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
next reply other threads:[~2008-02-10 20:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-10 20:58 Christopher Harvey [this message]
2008-02-13 8:12 ` select() problems with uvc drivers Brandon Philips
2008-02-13 9:17 ` Robert William Fuller
2008-02-13 16:07 ` Christopher Harvey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47AF6564.6070602@gmail.com \
--to=arbuckle911@gmail.com \
--cc=video4linux-list@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox