AnsweredAssumed Answered

v4l2 capture driver with mt9v032 sensor - ENOIOCTLCMD

Question asked by on Jun 14, 2012
Latest reply on Jul 20, 2012 by ScottJiang

Hey everyone!


I've got another problem:


I'm trying to port the MT9V032 in the 2011R1 dist to work with the blackfin_video_capture driver (and the MT9V034 sensor, the predeccesor of the 032), but, in short, everything works fine until i try to open the /dev/video0, which returns "Unknown error 515" which stands for ENOIOCTLCMD.

As that's v4l2 for "no ioctl available" and the mt9v032 sensor driver is a pad based driver, I don't really know what's necessary to implement or if that's really the issue.


But here's the details:

2011R1 kernel on a custom board with a bluetechnix CM-BF548, config:

[*]   Media Controller API (EXPERIMENTAL)

<M>   Video For Linux

[*] V4L2 sub-device userspace API (EXPERIMENTAL)

[*]   Video capture adapters  --->



Encoders, decoders, sensors and other helper chips  --->

      <M> Micron MT9V032 sensor support

       <M>   Blackfin Video Capture Driver


I also changed the Chip-ID in the driver itself for correct identification and added to the board config in arch/...

The board config:


What happens is the following:



root:/> modprobe i2c-bfin-twi

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller,


i2c-bfin-twi i2c-bfin-twi.1: Blackfin BF5xx on-chip I2C TWI Contoller,


root:/> modprobe mt9v032

Linux video capture interface: v2.00

mt9v032_init: init

root:/> modprobe bfin_video_capture

ppi probe success

bfin_capture bfin_capture.0: v4l2 device registered

bfin_capture bfin_capture.0: video device registered as: video0

mt9v032_probe: probing

mt9v032 1-005c: Probing MT9V032 at address 0x5c

mt9v032 1-005c: MT9V032 detected at address 0x5c

bfin_capture bfin_capture.0: v4l2 sub device registered

root:/> ffmpeg -f video4linux2 -s 752x480 -i /dev/video0 /mnt/test.avi

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

  built on Jun  6 2012 14:35:09 with gcc 4.3.5

  configuration: --prefix=/usr


--target-os=linux --arch=bfin
--extra-ldflags=' -mcpu=bf548-any' --enable-static --enable-shared
--enable-gpl --enable-postproc --disable-ipv6 --disable-stripping
  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 @ 0x25f6010]Cannot open video device /dev/video0 :
Unknown error 515

/dev/video0: I/O error occurred
Usually that means that input file is truncated and/or corrupted. 

the log message gets posted in lib/ffmpeg/ffmpeg-svn-

<number>/libavdevice/v4l2.c in line 130 (rev 11114) or line 142 (rev

20344) as a response to an open


static int device_open(AVFormatContext *ctx, uint32_t *capabilities)


    struct v4l2_capability cap;

    int fd;

    int res;

    int flags = O_RDWR;


    if (ctx->flags & AVFMT_FLAG_NONBLOCK) {

        flags |= O_NONBLOCK;


    fd = open(ctx->filename, flags, 0);

    if (fd < 0) {

        av_log(ctx, AV_LOG_ERROR, "Cannot open video device %s : %s\n",

                 ctx->filename, strerror(errno));


        return -1;



What's the driver missing?

The open-ioctrl?


Thanks for your help,