This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Beagleboard XM V4L2 subdev driver port

Hi Guys,

We're trying to adapt the existing mt9v022 sub-dev driver to our sensor for Beagleboard XM.

Could you, please, give us some directions what should be the key steps in our attempt to port it the way it will fit current frameworks and what git tree is meant to be used as good starting point.
We may try to do it the way it is done for mt9v113.

Thanks,

Sergei & Hristo

  • Hi Sergei & Hristo,

    Thanks for posting it to e2e forum.

     

    I have MT9V113 (VGA sensor) working with Media-controller framework on BeagleXM board, but currently it is in my local development tree which I have to push it to Arago repository (http://arago-project.org/git/people/?p=vaibhav/ti-psp-omap-video.git;a=summary).

    I am currently on travel so updating Arago might get delayed.

     

    Some background (may help to get you started) -

    Media-Controller repository - http://linuxtv.org/git/pinchartl/media.git

    My older development supporting MT9V113 on BeagleXM - http://arago-project.org/git/people/?p=vaibhav/ti-psp-omap-video.git;a=shortlog;h=refs/heads/omap3cam-mc-devel

     

    Thanks,

    Vaibhav

  • In fact as we understand, we need a simple and at the same time a special thing ;-)

    At the same time to have full Beagleboard XM support and V4L2-subdev OMAP ISP host driver.

    In the arago repository you simply do not have Beagleboard XM support.

    I'm also not seeing an V4L2 - subdev support neither.

    So we tried to choose something different - from the http://linuxtv.org/git/pinchartl/media.git repository (V4L project)

    wee took the "media-0006-sensors" branch - there a mt9v032 sensor driver for V4L2 was just added. Naturally this branch

    does not work with nay beagleboard as far as it is not customized for it. We added 27 patches addapted by Koen Kooi

    for the Angstrom beagleboard kernel - they resolve such things as kernel muxing, DVI pins etc etc.

    Now one has:

    - kernel which has V4l2 subdev omap ISP driver

    - it works for beagleboard XM just fine,

    - we rely on a good u-boot muxing and some patches provided by Koen Kooi in the Angstrom repository,

    - the i2c driver detects the 0x58 address specified by our camera board (Leopard image board with mt9v034 sensor - similar to mt9v032)

    - it links it to the mt9v032 driver (we added just small chunks of code into the board-omap3-beagle.c file and the mt9v032.c driver).

    Now the big problem is: why we have not /dev/video0 device created???

    Second problem is the famous PAD's from the Media Controller (yes in this branch one has also such framework in progress of development ;-) )

    where the flags MEDIA_PAD_FLAG_INPUT  and MEDIA_PAD_FLAG_OUTPUT seems to be important,

    but we do not know to which extent these links between media entity work already.

    We simply want to put the sensor working and then, later to try to use the mighty power ot the OMAP ISP through

    Media Controler pipeline adjusting.

    So please if you can - help us!

     

     

     

    For people (as me 2 months ago) which read for the first time such discussion I suggest to read the following links:

    http://www.linuxtv.org/downloads/presentations/ - where the presentations give a good look on the current system architecture of V4L2.

    But also an amazing mailing discussion from where one sees how difficult is to choose wisely now what sub-framework of V4L structure

    one can use for device driver development:

    http://www.mail-archive.com/linux-media@vger.kernel.org/msg19084.html

     

     

     

     

  • Hi,

     

    >> In fact as we understand, we need a simple and at the same time a special thing ;-)

    I do understand your concern, but looking towards the complexity of OMAP3 ISP subsystem it may not be possible and also we can customize the software only for one use-case of requirement.

    >> In the arago repository you simply do not have Beagleboard XM support.

    That's not completely true, as mentioned I do have VGA sensor (MT9V113) working on BeagleXM board. But yes its on older version of media-controller implementation, I have migrated to latest version, which I need to push it to Arago.

    >> wee took the "media-0006-sensors" branch - there a mt9v032 sensor driver for V4L2 was just added. Naturally this branch

    >> does not work with nay beagleboard as far as it is not customized for it.

    Yes thats correct, we need to have board initialization and hookup implementation for BeagleXm board.

     

    >> We added 27 patches addapted by Koen Kooi for the Angstrom beagleboard kernel - they resolve such things as kernel muxing, DVI pins etc etc.

    If they are not camera interface related, then it's ok. But please note that Koen's repository is based on older framework called V4L2-Int (support added for MT9T111 and MT9V113), so you shouldn't be mixing any of these patches with media-controller.

    >> Now the big problem is: why we have not /dev/video0 device created???

    Under media-controller framework, we have various device nodes (subdev and video) based on capability of each entity inside given media. Just to give and example,

    on BeagleXm + MT9V113 sensor I have 16 device nodes (including both subdev and video), where the streaming video device node is based on the links you create as per your requirement. In my case where sensor configured in YUV output mode and the data directly goes to memory via CCDC, I use following command to set link and format -

    ./media-ctl -l '16:0 -> 5:0 [1]'
    ./media-ctl -l '5:1 -> 6:0 [1]'
    ./media-ctl -f '5:0 [UYVY 640x480]'
    ./media-ctl -f '5:1 [UYVY 640x480]'

    Then start streaming on /dev/video2, which is pointing to CCDC output pad.

     

    I would suggest you to go through documentation available with the patch series to understand more about this.

     

    Thanks,

    Vaibhav

  • We already changed properly (I hope) our board-omap3beagle.c file. (thank you Stan for the help!)

    Now:

    We found our i2c address (in the case of our Leopardboard it is 0x58), it registers mt9v032 as
    i2c device and we see it in sys/bus/i2c, everything is it must be.
    The XCLKA clock which must be between 13Mhz and 27MHz is OK during kernel probes, then disappears.
    I suppose that this is because of the Smartreflex functions.

    Why I think so? - When one starts ucview (video capture program) this clock appears once again.
    When one stops it disappears. Is it OK that? With our small capture test code (written with opencv) the clocks behaves the same.
    One has all the needed nodes in /dev:
    video0 - video7
    v4l-subdev0 ... v4l-subdev7
    But one receives in dmesg two messages which i do not understand:

     … omap3isp omap3isp: hist: DMA channel = 0
    [    4.438262] i2c i2c-2: Failed to register i2c client mt9v032 at 0x58 (-16)
    [    4.445526] isp_register_subdev_group: Unable to register subdev mt9v032
    [    4.454620] vpfe_init

    How i2c registration fails when everything is ok in sys/dev and i2cdetect shows the right address appears on the
    second channel (where it must be).

    the problems now:

    I try to install media-ctl to configure the pipeline - not successful.
    Where to find some discussion on this point?
    I know the git, I try to install this on my PC - the configure script does not likes the include/linux/media.h header,
    on the Angstrom distribution some perl files are missing and i do not know where to find them.

    What is our kernel? :

    It comes from the git - linux-tv-pinchart, media-0005-omap3isp branch, merged 
    with the kernel.org kernel of Linus Torvalds - v2.6.38-rc5
    we add mt9v032 from the media-0006-sensors branch of the Pinchart's repository and
    then 18 patches from Koen Kooi which corrects some special (not camera related) features of the beagleboard.
    Then, we change our board-omap3beagle, also a little bit the mt9v032.c - it seems
    s_config field is deprecated in the last version of media-0005-omap3isp, and also
    file_ops are removed (this part of ISPdriver may be not ready yet for mainstream participation?).
    If somewhere media-ctl installation discussion is available - it will help.
    Thanks in advance.
    Hristo