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.

Camera support on AM3517 EVM

Other Parts Discussed in Thread: AM3517, AM3715, DM3730, TVP5146

Hi all,

I read the Porting-Guide for MT9T111 and want to know are there any differences on MT9V032 Image Sensor?

I use the Gingerbread-dev-Kit with 2.6.37 Kernel on LogicPD AM3517 EVM, but I only find drivers for 3.0 Kernel and higher...

Does Anyone Drivers for 2.6.37 or give me a guide of patching the driver by myself?

If porting of the driver will be successfully can I Use the standard Camera-App from Android to see the Capture-stream?

Kindly regards,

Christian

  • Hi Christian,

    if you are successfull in porting of camera sensor driver ( one which you want to use), following are small changes for android HAL

    find out camera node name

    #cd /sys/class/video4linux

    #cd videoX

    #cat name

    Correct entry to V4L2Camera.cpp file

    #define ENTITY_MT9V113_NAME             "mt9v113 2-003c"

    replace with

    #define ENTITY_MT9V113_NAME             <your camera name>

    Rebuild and validate the same.

    BR,

    satish

  • Thx Satish,

    This will help, when I ported a driver, but know I hope someone can help me on porting a driver for this imagesensor...

    Every guide or hint will be helpful!

    Regards,

    Christian

  • Hello Christian

    The MT9T111 is a 1/4" image sensor whereas the MT9V032 is a 1/2" sensor. One is a 3M pixel and the other is a VGA sensor. There will be vast differences in the sensor aspects. The caspa from Gumstix features the MT9V032 image sensor. You can get more info from https://www.gumstix.com/store/product_info.php?products_id=254.

    A full level source code is also available for Linux and it works with the DM3730/AM3715. 

    By the way, the AM3517 is a processor that doesnt have a ISP inside. The MT9V032 is a raw sensor and needs good amount of ISP code to be written to make it work in color mode. IMHO, Now doing all these on software will be tough.

    You can try cameras with good low light sensitivity with YUV output like OV10633. Here is another link http://www.ti.com/tidn/docs/catalog/thirdpartydevtoolfolder.tsp?actionPerformed=productFolder&productId=9177. 

    Anitha

  • Thx for your post Anita...

    Anitha Jayaprakash said:
    By the way, the AM3517 is a processor that doesnt have a ISP inside. The MT9V032 is a raw sensor and needs good amount of ISP code to be written to make it work in color mode. IMHO, Now doing all these on software will be tough.

    Do you know if the missing ISP is also a problem in monochrome-mode? Cause we use the MT9V032C12STM which is a monochrome sensor... and raw-data will be enough for our captureanalysis...

  • Dear Christian,

    Yes, with monochrome you shouldnt face any issues. By the way, what is your application?

    Anitha

  • Hi Anita,

    the application analyses if a lightspot is central on the camera-image, so we just need to get an monochrome image into Memory, the rest is part of the analysisalgorithm ;-)

    So then I hope the Porting of the driver will be successfull...

  • Hi all,

    After first try of porting the driver, it seems, I need some additional help...

    There several steps of porting I don't know if I need tot do something?

    I am getting through the porting guide:

    Adding Module:

    1.-4.: Driver: I found a driver for the mt9v032 in the Kernel-Sources of the DevKit. They are also in the Makefile and in KconfigFile...

    5. Add board specific changes for camera sensor to the board file

        For the reference refer file - '<Kernel>/arch/arm/mach-omap2/board-omap3beagle-camera.c' : Don't know if I had to to something here, but for AM3517 there isn't any File like     that... Hope someone can Help me here?

    Driver Configuration:

    After configure the Kernel for AM3517 mt9v032 driver can't be choosen anymore by menuconfig, so I changed the Board-Config that mt9v032 can be choosen again by menuconfig (one line commented in) and I choose it. 

    I don't made any other changes by menuconfig... is that ok for AM3517 and MT9V032 Image Sensor?

    Android HAL Configuration:

    Do I have to change anything there?

    Compile Android System - Porting_Guide end

    Also some other hints for checking out if the porting was successfull, like checking /dev/video0 or something like that will be useful!!

    Regards,

    Christian

  • Hi Christian,

    1. If you are using kernel < 2.6.37 and rowboat source, then

    just find out which device has been initialized for your sensor. And cgange /dev/videoX in CameraHardware.cpp

    cat /sys/class/video4linux/videoX/name

    2. If you are using kernel >= 2.6.37 then,

    in the file V4L2Camera.cpp

    change the marcro name

    #define ENTITY_MT9V113_NAME " "

    to the device name that you made it.

    BR,

    satish

  • thx again Satish,

    but the problem is, I don't think porting until this point was successfully, cause I only get "omap_vout" for "video2" and "video1"...  and "vpfe-capture_V0.0.1" for "video0" for the "cat"-command...

    Or is this correct??

    So I hope someone can help me on the driver-porting-issue...

    What seems to be ok is that after compiling the Kernel I got a module "mt9v032.o" under "kernel/drivers/media/video/"

    But what can I check to validate the other steps?

    Could it be that I have to make changes on .../kernel/arch/arm/mach-omap2/board-am3517evm.c or create a file like board-omap3beagle-camera.c for the AM3517EVM?

    Or am I in need of changing "V4L2-camera.cpp"?

    Here is also a litlle LogCat On Boot-up and opening the Camera-App (as text-file), perhaps someone can help me after reading this...:

    2350.log.txt

    Regards,

    Christian

  • Hi all,

    sry for doubleposting...

    But I Editet my previous post and didn't get any E-mail validation for that...

    So I hope anyone now can answer my Questions and perhaps the Appended LogCat helps...

    Christian

    Christian Richter said:
    Or am I in need of changing "V4L2-camera.cpp"?

    I got that idea, cause the application can't open the ccdc-device which is defined as "OMAP3 ISP CCDC" and the AM3517 don't have an ISP or am I wrong?

    Also hints on how I could find the error will be helpful...

    Kindly regards,

    Christian

  • Hi Christian,

    1. Which kernel are you using ?

    2. I could see following logs from file that you have attached. It seems camera node is not created

    01-01 00:04:54.773: V/Camera(1748): connect
    01-01 00:04:54.773: D/V4L2Camera(968): 81: Open() ENTER
    01-01 00:04:54.773: E/V4L2Camera(968): Error opening ccdc device
    01-01 00:04:54.773: D/V4L2Camera(968): 175: Open_media_device() ENTER
    01-01 00:04:54.773: E/V4L2Camera(968): ERROR opening media device: No such file or directory

    Could you find out in sys entry, whether camera node has been created or not.

     

    BR,

    satish

  • thx Satish for reply,

    1. I am using Kernel 2.6.37...

    2. Do you mean /sys/class/video4linux entries?

    there I have video1(name=omap_vout) and video2 (name=omap_vout)

    If the node won't created, could it be a problem with the driver I used for porting? Or is there a problem by porting?

    Cause I found out the driver in the kernelsources for the mt9v032 is written for a processor with ISP, but the AM3517 has no ISP...

    Regards,

    Christian

  • Hi Christian,

    1. Check all the entries....most probably video8 or video9 should be your device.

    2. send your kernel logs.. want to check if camera sensor detected or not ?

    BR,

    satish

  • Hi Satish,

    under /sys/class/video4linux/ I only found video1 and video2

    Kernel logs in form of dmesg output is inserted as the following file:


    6874.kernellog.txt

    Regards,

    Christian

  • Hi Christian,

    From the logs, I could not find any capture sensor gets registered.

    1. Have you enable sensor in kernel config ?

    2. Is it getting intialized properly ? if yes, then video node must get created for the same.

    3. Is camera sensor connected over i2c ?

    BR

    satish

     

  • Hi Satish,

    1. I have enabled the sensor over menuconfig before compiling the uImage... for that I had to add the menuconfigentry in .../kernel/arch/arm/configs/am3517_evm_android_defconfig

    2. I don't know it, how can I find it out?

    3. Camera sensor is conected to the parallel Camera Interface,  and if we look at the I2C-Bus at the Camerasensor we can see the Bus (like I2C-commands adressed to the Display which is on the same I2C-Bus as the Camera Interface)

    How can I find out more about the first two steps?

  • Did you make the appropriate platform registration entries in the board-xxx.c file to enumerate your i2c device?

    You can see how the i2c camera sensor is registered in beagleboard for reference.

  • thx for your reply Vishveshwar,

    this is very helpful and hints to a problem we have here, as I described some posts earlier, I didn't have made any changes to that files before...

    But can u please give me some guidance on the changes I have to made?

    Cause I tried today to add

    I2C_BOARD_INFO("mt9v032",0xBA),

    .platform_data = &mt9v032_pdata

    to struct am3517evm_i2c3_boardinfo[] (at lines 530++) 

    But that wasn't enough...

    beagleboard reference is board-omap3beagle.c or board-omap3beagle-camera.c?

    And as I learned in this thread earlier it is not the same as on beagleboard, cause I have no ISP on AM3517, which is used very often in board-omap3beagle-camera.c...

    BR,

    Christian

  • Hi all,

    yesterday we're making one step forward... 

    After making some changes to struct am3517evm_i2c3_boardinfo[] :

    ...

    I2C_BOARD_INFO("mt9v032",0x5C),

    .platform_data = &mt9v032_pdata,

    we're getting a new i2c-device(with name mt9v032) under /sys/bus/i2c

    but still no /dev/media0 (which should be the ccdc-device I think) and no /dev/video/ which corresponds to our camera

    Now we need some help on how to adapt board-am3517evm.c to get a video-device-node for our camera!

    When I look at board-omap3beagle-camera.c there are some hints on what to do, but the main problem is they are using the omap3-ISP, we need to do it with VPFE!!

    Any support, examples or hints will be helpful!

    BR,

    Christian

  • You are missing important point here, in case of AM3517, we do not have (or need) media-controller framework and so we did not migrate to it. This means you are not going to have /dev/mediaX device nodes in AM3517.

    What is available and supported on AM3517 is standard V4L2 sub-dev framework (master-slave) interface, which will give you /dev/videoX device node for both control and streaming.

    Thanks,

    Vaibhav

  • thy Vaibhav,

    thats an really good point, but we still don't get an /dev/videoX device node for our image sensor either, we only get video0 (vpfe-capture...), video1 (omap_vout) and video2 (omap_vout) ...

    So the question is still, what do we have to do, to get this device node?

    I think, we have to adapt the board-am3517evm.c file, to get a V4L2 sub-dev for our image sensor, is that right? But I don't know how to do this...

    If it helps to analyze the problem, I also can post Code-Snippets of my changes I've done until now...

    BR,

    Christian

  • Christian,

    'X' is the variable, and varies based on devices registered under V4L2 framework. IN your system /dev/video0 is nothing but camera device node and you must run capture application on this device node.

    Thanks,

    Vaibhav

  • thx Vaibhav,

    /dev/video0 (name: vpfe-capture_V0.0.1) is there also without porting anything...

    and at the moment it doesn't seem to correspond to our camera, so how can I bind our camera to dev/video0 node? or how can I check, if it was successful?

    BR,

    Christian

  • Hi all,

    after reading a bit more through schematics and the board-am3517evm.c file, I found out the "tvp5146" uses the same interface to Baseboard as the parallel Camera Interface and is still implemented on VPFE the only difference will be one switch on the Applicationboard, so over I thought  I can test this implementation over composite-In and a digital Camera, so according to Vaibhav's reply, I changed CameraHardware.cpp to ever open /dev/video instead of /dev/media0 and /dev/video2 on Kernel-2.6.37 and made a try...

    But when I open the Camera.app of android, application still broke down with the error it can't open ccdc device...

    If this would have worked, I had integrated my ImageSensor in analogon to the tvp5146...

    But now I'm interessted in why this won't work and how can I get my Imagesensor ported and tested??

    Can I use the preinstalled Camera-App for this purpose? (I only want to get a preview-picture to validate the port)

    How can I find out where the problem lies exactly?

    BR,

    Christian

  • Hi Christian,

    kindly comment below line in CameraHardware.cpp

    Function:CameraHardware::CameraHardware()

    Put if 0

    #if 0 

    version = get_kernel_version();
        if(version <= 0)
            LOGE("Failed to parse kernel version\n");
        if(version >= KERNEL_VERSION(2,6,37))
        {
            mCamera->Open(VIDEO_DEVICE_2);
            mCamera->Open_media_device(MEDIA_DEVICE);
        }

    #endif

    version = 0

    This will take normal V4L2 framework path for your usecase.

    Br,

    satish

     

  • thx Satish,

    but that I still had changed before my last post...

    there are still many open questions on the portingprocedure note only the questions in my Quote...

    Christian Richter said:

    after reading a bit more through schematics and the board-am3517evm.c file, I found out the "tvp5146" uses the same interface to Baseboard as the parallel Camera Interface and is still implemented on VPFE the only difference will be one switch on the Applicationboard, so over I thought  I can test this implementation over composite-In and a digital Camera, so according to Vaibhav's reply, I changed CameraHardware.cpp to ever open /dev/video instead of /dev/media0 and /dev/video2 on Kernel-2.6.37 and made a try...

    But when I open the Camera.app of android, application still broke down with the error it can't open ccdc device...

    If this would have worked, I had integrated my ImageSensor in analogon to the tvp5146...

    But now I'm interessted in why this won't work and how can I get my Imagesensor ported and tested??

    Can I use the preinstalled Camera-App for this purpose? (I only want to get a preview-picture to validate the port)

    How can I find out where the problem lies exactly?

  • I am not an android expert, so I will let Satish help you on this. From Capture driver and TVP5146 interface perspective, I would recommend you to use PSP sample application attached here.

    NOTE: Make sure that you build it with CONGIG_AM3517

    Thanks,

    Vaibhav

  • Thanks Vaibhav,

    Can you give me some additional information on how to use the sample-application on PSP? Would you compile it as executable for userspace? And just run it from console?

    BR,

    Christian

  • Hi Christian,

    1. From the logs, it is clear that - V4L2 path is not being followed. Kindly refer V4L2Camera.cpp.

     if ((camHandle = open(device, O_RDWR)) == -1) {
                LOGE("ERROR opening V4L interface: %s", strerror(errno));
                if(version >= KERNEL_VERSION(2,6,37));
                    reset_links(MEDIA_DEVICE);
                return -1;
            }
            if(version >= KERNEL_VERSION(2,6,37))
            {
                ccdc_fd = open("/dev/v4l-subdev2", O_RDWR);
                if(ccdc_fd == -1) {
                    LOGE("Error opening ccdc device");
                    close(camHandle);
                    reset_links(MEDIA_DEVICE);
                    return -1;

    It should not display "Error opening ccdc device" as version is 0 - what I mentioned before. It should always go by first if condition.

    2. For the utility vaibhav has mentioned you can compile with the help of below link

    http://pundiramit.blogspot.in/2011/08/how-to-build-commom-linux-utils-for.html

    BR,

    satish