Tough question for v4l2 know-it-all

*nix specific usage questions
kozz
New Cone
New Cone
Posts: 4
Joined: 29 Dec 2009 09:17

Tough question for v4l2 know-it-all

Postby kozz » 29 Dec 2009 09:55

working on a webcam... driver (ov534, compiled separately not as kernel module) loads fine, parameters set fine, apps detect fine, but all fail to demux due to "select timeout."

VLC reports the following:

Code: Select all

[00000405] qt4 interface debug: New item: v4l2:// [00000405] qt4 interface debug: New Option: :v4l2-dev= [00000405] qt4 interface debug: New Option: :v4l2-adev= [00000405] qt4 interface debug: New Option: :v4l2-standard=0 [00000370] main playlist debug: adding item `v4l2://' ( v4l2:// ) [00000370] main playlist debug: rebuilding array of current - root Playlist [00000370] main playlist debug: rebuild done - 3 items, index 0 [00000370] main playlist debug: starting new item [00000370] main playlist debug: processing request item v4l2:// node null skip 0 [00000370] main playlist debug: resyncing on v4l2:// [00000370] main playlist debug: v4l2:// is at 2 [00000370] main playlist debug: creating new input thread [00000458] main input debug: Creating an input for 'v4l2://' [00000458] main input debug: thread started [00000458] main input debug: waiting for thread initialization [00000458] main input debug: `v4l2://' gives access `v4l2' demux `' path `' [00000458] main input debug: creating demux: access='v4l2' demux='' path='' [00000459] main demux debug: looking for access_demux module: 1 candidate [00000459] v4l2 demux debug: ALSA input support available [00000459] v4l2 demux debug: Trying direct kernel v4l2 [00000459] v4l2 demux debug: opening '/dev/video0' as video [00000459] v4l2 demux debug: V4L2 device: USB Camera-B4.04.27.1 using driver: ov534 (version: 2.5.0) on usb-0000:00:1f.4-1 [00000459] v4l2 demux debug: the device has the capabilities: (X) Video Capure, ( ) Audio, ( ) Tuner [00000459] v4l2 demux debug: supported I/O methods are: (X) Read/Write, (X) Streaming, ( ) Asynchronous [00000459] v4l2 demux debug: video input 0 (ov534) has type: External analog input * [00000459] v4l2 demux debug: device supports chroma YUY2 [YUYV, YUYV] [00000459] v4l2 demux warning: Unable to query for frame sizes [00000459] v4l2 demux debug: device supports chroma YUYV [YUYV, YUYV] [00000459] v4l2 demux warning: Unable to query for frame sizes [00000459] v4l2 demux debug: Extended control API supported by v4l2 driver [00000459] v4l2 demux debug: Available control: Red Balance (98090e) [00000459] v4l2 demux debug: integer control [00000459] v4l2 demux debug: valid values: 0 to 255 by steps of 1 [00000459] v4l2 demux debug: default value: 128 [00000459] v4l2 demux debug: current value: 128 [00000459] v4l2 demux debug: Available control: Blue Balance (98090f) [00000459] v4l2 demux debug: integer control [00000459] v4l2 demux debug: valid values: 0 to 255 by steps of 1 [00000459] v4l2 demux debug: default value: 128 [00000459] v4l2 demux debug: current value: 128 [00000459] v4l2 demux debug: Available control: Exposure (980911) [00000459] v4l2 demux debug: integer control [00000459] v4l2 demux debug: valid values: 0 to 255 by steps of 1 [00000459] v4l2 demux debug: default value: 255 [00000459] v4l2 demux debug: current value: 255 [00000459] v4l2 demux debug: Available control: Autogain (980912) [00000459] v4l2 demux debug: boolean control [00000459] v4l2 demux debug: default value: 1 [00000459] v4l2 demux debug: current value: 1 [00000459] v4l2 demux debug: Available control: Main Gain (980913) [00000459] v4l2 demux debug: integer control [00000459] v4l2 demux debug: valid values: 0 to 63 by steps of 1 [00000459] v4l2 demux debug: default value: 20 [00000459] v4l2 demux debug: current value: 20 [00000459] v4l2 demux debug: Available control: HFlip (980914) [00000459] v4l2 demux debug: boolean control [00000459] v4l2 demux debug: default value: 0 [00000459] v4l2 demux debug: current value: 0 [00000459] v4l2 demux debug: Available control: VFlip (980915) [00000459] v4l2 demux debug: boolean control [00000459] v4l2 demux debug: default value: 0 [00000459] v4l2 demux debug: current value: 0 [00000459] v4l2 demux debug: Available control: Sharpness (98091b) [00000459] v4l2 demux debug: integer control [00000459] v4l2 demux debug: valid values: 0 to 63 by steps of 1 [00000459] v4l2 demux debug: default value: 0 [00000459] v4l2 demux debug: current value: 4 [00000459] v4l2 demux debug: added new video es YUY2 640x480 [00000458] main input debug: selecting program id=0 [00000458] main input debug: thread 2935516048 (input) created at priority 10 (input/input.c:370) [00000405] qt4 interface debug: Updating the stream status: 3 [00000459] v4l2 demux debug: opening '(null)' as audio [00000459] v4l2 demux debug: opened adev=`hw' stereo 47040Hz [00000459] v4l2 demux debug: new audio es 2 channels 47040Hz [00000459] main demux debug: using access_demux module "v4l2" [00000459] main demux debug: TIMER module_Need() : 366.550 ms - Total 366.550 ms / 1 intvls (Avg 366.550 ms) [00000460] main decoder debug: looking for decoder module: 30 candidates [00000460] main decoder debug: using decoder module "rawvideo" [00000460] main decoder debug: TIMER module_Need() : 0.586 ms - Total 0.586 ms / 1 intvls (Avg 0.586 ms) [00000460] main decoder debug: thread started [00000460] main decoder debug: thread 2902760336 (decoder) created at priority 0 (input/decoder.c:217) [00000461] main decoder debug: looking for decoder module: 30 candidates [00000461] araw decoder debug: samplerate:47040Hz channels:2 bits/sample:16 [00000461] main decoder debug: using decoder module "araw" [00000461] main decoder debug: TIMER module_Need() : 0.863 ms - Total 0.863 ms / 1 intvls (Avg 0.863 ms) [00000461] main decoder debug: thread started [00000461] main decoder debug: thread 2911153040 (decoder) created at priority 5 (input/decoder.c:217) [00000458] main input debug: `v4l2://' successfully opened [00000405] qt4 interface debug: New Event: type 1103 [00000405] qt4 interface debug: Updating the stream status: 3 [00000459] v4l2 demux error: Failed to wait (VIDIOC_DQBUF) [00000458] main input debug: control type=1 [00000459] v4l2 demux error: Failed to wait (VIDIOC_DQBUF) ... ...
nothing bad in dmesg:

Code: Select all

[14912.389677] gspca: main v2.5.0 registered [15954.997612] gspca: probing 1415:2000 [15955.060794] ov534: sensor is ov7721 [15955.453722] ov534: set_videomode set to: 1 [15955.518960] gspca: probe ok [15955.519044] usbcore: registered new interface driver ov534 [15955.519057] ov534: registered
other apps like mplayer:

Code: Select all

Playing tv://. get_path('sub/') -> '/home/dan/.mplayer/sub/' STREAM: [tv] tv:// STREAM: Description: TV Input STREAM: Author: Benjamin Zores, Albeu STREAM: Comment: s->pos=0 newpos=0 new_bufpos=0 buflen=0 TV file format detected. Selected driver: v4l2 name: Video 4 Linux 2 input author: Martin Olschewski <olschewski@zpr.uni-koeln.de> comment: first try, more to come ;-) v4l2: video fd: /dev/video0: 3 Selected device: USB Camera-B4.04.27.1 Capabilites: video capture read/write streaming supported norms: inputs: 0 = ov534; Current input: 0 Format YUYV (16 bits, YUYV): Packed YUY2 Current format: YUYV v4l2: set format: YVU420 v4l2: set input: 0 tv.c: norm_from_string(pal): Bogus norm parameter, setting default. Selected norm : pal v4l2: ioctl enum norm failed: Invalid argument Error: Cannot set norm! v4l2: set width: 320 v4l2: set height: 240 Selected input hasn't got a tuner! ==> Found video stream: 0 v4l2: get format: YUYV v4l2: get fps: nan v4l2: get width: 640 v4l2: get height: 480 Using a ring buffer for maximum 2 frames, 1 MB total size. v4l2: ioctl set mute failed: Invalid argument v4l2: ioctl query control failed: Invalid argument v4l2: ioctl query control failed: Invalid argument v4l2: ioctl query control failed: Invalid argument v4l2: ioctl query control failed: Invalid argument [V] filefmt:9 fourcc:0x32595559 size:640x480 fps:30.00 ftime:=0.0333 get_path('sub/') -> '/home/dan/.mplayer/sub/' X11 opening display: :0.0 vo: X11 color mask: FFFFFF (R:FF0000 G:FF00 B:FF) vo: X11 running at 1280x720 with depth 24 and 32 bpp (":0.0" => local display) [x11] Detected wm supports NetWM. [x11] Detected wm supports FULLSCREEN state. [x11] Detected wm supports ABOVE state. [x11] Detected wm supports BELOW state. [x11] Current fstype setting honours FULLSCREEN ABOVE BELOW X atoms Disabling DPMS DPMSDisable stat: 1 xscreensaver_disable() xscreensaver_disable: Could not find XScreenSaver window. GNOME screensaver disabled [xv common] Drawing colorkey manually. [xv common] Using colorkey from Xv (0x0505fe). [xv common] Maximum source image dimensions: 2048x2048 ========================================================================== Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 640 x 480 (preferred colorspace: Packed YUY2) Trying filter chain: vo vo_debug: query(Packed YUY2) returned 0x437 (i=0) VDec: using Packed YUY2 as output csp (no 0) Movie-Aspect is undefined - no prescaling applied. VO Config (640x480->640x480,flags=0,'MPlayer',0x32595559) VO: [xv] 640x480 => 640x480 Packed YUY2 VO: Description: X11/Xv VO: Author: Gerd Knorr <kraxel@goldbach.in-berlin.de> and others Xvideo image format: 0x41424752 (RGBA) packed Xvideo image format: 0x54424752 (RGBT) packed Xvideo image format: 0x32424752 (RGB2) packed Xvideo image format: 0x0 ( ) packed Xvideo image format: 0x32595559 (YUY2) packed Xvideo image format: 0x59565955 (UYVY) packed Xvideo image format: 0x32315659 (YV12) planar Xvideo image format: 0x30323449 (I420) planar using Xvideo port 57 for hw scaling [xv] dx: 0 dy: 0 dw: 640 dh: 480 Selected video codec: [rawyuy2] vfm: raw (RAW YUY2) ========================================================================== Audio: no sound Freeing 0 unused audio chunks. Starting playback... v4l2: going to capture v4l2: select timeout *** [vo] Exporting mp_image_t, 640x480x16bpp YUV packed, 614400 bytes (imgfmt: 32595559, planes: (nil),(nil),(nil) strides: 0,0,0, chroma: 0x0, shift: h:0,v:0) get_path('subfont.ttf') -> '/home/dan/.mplayer/subfont.ttf' Unicode font: 5009 glyphs. OSD chg: 6 V: no pb:-1 OSD chg: 3 V: no pb:-1 OSD chg: 2 V: no pb:-1 [xv] dx: 5 dy: 23 dw: 640 dh: 480 OSD chg: 6 V: no pb:-1 ?,?% 0 0 v4l2: select timeout ??% ??,?% 0 0 OSD chg: 6 V: no pb:-1 OSD chg: 6 V: no pb:-1 ?,?% 0 0 v4l2: select timeout ??% ??,?% 0 0 OSD chg: 6 V: no pb:-1 v4l2: select timeout ??% ??,?% 0 0 OSD chg: 6 V: no pb:-1 OSD chg: 6 V: no pb:-1 ?,?% 0 0 v4l2: select timeout ??% ??,?% 0 0 OSD chg: 6 V: no pb:-1 OSD chg: 6 V: no pb:-1 ?,?% 0 0 V: 0.0 9/ 9 ??% ??% ??,?% 0 0 ...
I've looked through the controls of v4l2 and the driver and haven't found how to pass them a debug parameter. But the function blamed by VLC (VIDIOC_DQBUF) sits in v4l2_ioctl.c, and according to what I can find online, "select()" is used by v4l2 to combat freeze-framing on device startup, and gives up after a specified "timeout" constant, as according to this:

http://v4l2spec.bytesex.org/spec/r14390.htm

What I suspect is that my cam (ps eye) is taking too long to start up... and that if I could tweak the select-timeout value, it might give it a chance to start up before v4l2 quits on it. So my questions are

1) how can I get v4l2 to debug more thoroughly
2) can the timeout used by select() be tweaked, or does it have to be changed in source? Or does it depend on the device driver?
3) where is the mysterious "select() manual page" referred to in the above link... can't find hide nor hair of it.

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Tough question for v4l2 know-it-all

Postby dionoea » 04 Jan 2010 16:32

What VLC version are you using? A bunch of bugs have been fixed in Git master (1.1.0) but they haven't all been backported to the current stable version (1.0.*).
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

kozz
New Cone
New Cone
Posts: 4
Joined: 29 Dec 2009 09:17

Re: Tough question for v4l2 know-it-all

Postby kozz » 04 Jan 2010 19:19

thanks for answering... version 1.02 goldeneye

I uprooted the problem, though, it wasn't a v4l2 issue at all, but a defect in the usb controller, which I've since worked around

now if I can figure out how to make vlc recognize and transcode its own "stream.yuv" file output, created without the yuv4mpeg headers which drastically slow down the output.

when I show it the giant 5 gigabit egg it laid from 10 minutes of capture, it insists it's a 2-hour, low-res video of squiggly lines.

ffmpeg and mencoder do better, but they can't properly set the frames horizontally and the error is different for all 3 elements. Resulting in 3 different frames, all cycling horizontally to the right at different rates. But it looks great otherwise.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 8 guests