2011-04-16 09:11:11     interfacing usb webcam

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-04-16 09:11:11     interfacing usb webcam

Chandrashekhar Lavania (INDIA)

Message: 99922   

 

Hi,

 

I am trying to interface logitech quickcam E3500 with my BF527 based board.

 

I am using 2010R1-RC5.

 

I followed the instructions given at   docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:usb_video_device_class&s[]=uvc

 

 

 

The camera gets detected and a /dev/video0 node gets created.

 

But I run into some issues:

 

1. When I try to capture video using ffmpeg I get the following messages:

 

 

 

root:/> ffmpeg -r 20 -f video4linux2 -s 320x240 -i /dev/video0 -an -f avi /var/test.avi

 

FFmpeg version SVN-r9998, Copyright (c) 2000-2009 Fabrice Bellard, et al.

 

  built on Apr 16 2011 17:34:14 with gcc 4.3.5

 

  configuration: --prefix=/usr --source-path=/home/shekhar/2010R1/uClinux-dist/lib/ffmpeg/build/../ffmpeg-svn-20344 --target-os=linux --arch=bfin --sysinclude=/home/shekhar/2010R1/uClinux-dist/staging/usr/include --extra-ldflags=' -mcpu=bf527-0.2' --enable-static --enable-shared --enable-gpl --enable-postproc --disable-ipv6 --disable-stripping --cross-prefix=bfin-linux-uclibc-

 

  libavutil     50. 3. 0 / 50. 3. 0

 

  libavcodec    52.37. 0 / 52.37. 0

 

  libavformat   52.39. 2 / 52.39. 2

 

  libavdevice   52. 2. 0 / 52. 2. 0

 

  libswscale     0. 7. 1 /  0. 7. 1

 

  libpostproc   51. 2. 0 / 51. 2. 0

 

[video4linux2 @ 0x699010][3]Capabilities: 4000001

 

[video4linux2 @ 0x699010]mmap: No such device

 

/dev/video0: I/O error occurred

 

Usually that means that input file is truncated and/or corrupted.

 

 

 

 

2. I get a similar error when I try to execute the V4L2 example given at   v4l2spec.bytesex.org/spec/capture-example.html

 

I get the error:

 

mmap error 19, No such device

 

This comes from the line

 

 

 

 

 

 

 

 

 

mmap (NULL /* start anywhere */,

                              buf.length,

                              PROT_READ | PROT_WRITE /* required */,

                              MAP_SHARED /* recommended */,

                              fd, buf.m.offset);

 

When I change MAP_SHARED to MAP_PRIVATE I get the error:

 

mmap error 22, Invalid argument

 

 

 

I was able to get the 'current' frame  information of the camera (width, height, V4L2 field) using  ioctl with VIDIOC_G_FMT , for the type V4L2_BUF_TYPE_VIDEO_CAPTURE in the form

 

type = 1, width = 320, height = 240, field = 1

 

 

 

This happened when I tried to set the frame to QVGA (320x240).

 

 

Any idea a to how this can be rectified?

 

 

 

Regards,

 

Shekhar

 

PS: the v4l_test seems to be written for V4L and not V4L2. Is there a similar test program using V4L2, as uvc only supports V4L2 ?

QuoteReplyEditDelete

 

 

2011-04-17 23:02:56     Re: interfacing usb webcam

Sonic Zhang (CHINA)

Message: 99931   

 

This bug is tracked at   blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=6494&start=0 . It is fixed on kernel SVN trunk by commit 9703.

Attachments

    Outcomes