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.

OV5640 Camera Issue on custom board

Other Parts Discussed in Thread: 4460

Hi

We are developing a custom board to use OV5640 camera module. On this board we run android 4AI.1.4 release. Now camera can't work, CameraHal can't find camera. I attach the ducati log in the post.  Logcat's output is:

I/CameraService(   99): CameraService started (pid=99)
D/DOMX    (   99): hardware/ti/domx/domx/omx_proxy_common/src/omx_proxy_common.c:1253   __PROXY_SetParameter()
D/DOMX    (   99): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001001 - Error returned from Oi
D/DOMX    (   99): hardware/ti/domx/omx_proxy_component/omx_camera/src/omx_proxy_camera.c:415   CameraSetParam()
D/DOMX    (   99): ERROR:  CameraSetParam: Error in SetParam 0x80001001
E/CameraHal(   99): num_cameras = 0

We use only one data lane and one clock lane on CSI2A, does ducati firmware care one data lane or two data lanes?

In omap-rproc.1 trace1 output:

[      2.541] [ERR=47] src/new_sensor_MSP.c:[1323]:Sen Read ID: 22080, expected ID:22080
[      2.541]
[      2.542] [ERR=48] src/sensor_detect_MSP.c:[265]:0>>:OmniVision_OV5640_2 Socket:2
[      2.542] [ERR=49] src/sensor_detect_MSP.c:[265]:1>>:CSI2A_2 Socket:2
[      2.542] [ERR=50] src/camera_fw_core.c:[208]:
[      2.542] Error in src/camera_fw_core.c, line:208

It seem that ducati find the camera module but somewhere of camera_fw_core.c has trouble. What's camera_fw refers to? Is it ducati.bin self or others?

Please give some direction how to do next.

Thanks and Best Regards,

Paul

  • Hi Paul,

    If you built 4AI.1.4 probably you are using a ducati binary with missing components. Please try installing the ducati-m3.bin from this link: https://gforge.ti.com/gf/download/user/9221/5635/4AI.1.4_Blaze_ducati-m3.bin and let me know what happen.

  • Israel,

    Ducati version looks correct because sensor detect is working.

    Paul,

    Number of lanes is important. Ducati OV5640 driver uses this sensor in 2 lane mode. To make it work for your board, please modify Ducati driver source.

    Also, check in Android why number of cameras is being returned 0. Thye code you need to be looking at is:

    1. CameraAdapter_Capabilities : OMXCameraAdapter.cpp

    2. OMXCameraAdapter::getCaps : OMXCapabilities.cpp

    Check if any of these functions return an error.

    Also, make sure that DCC files for ID 1042 are copied in /data/misc/camera folder.

  • Mayank,

    After enable CameraHal debug message output, I get more info and I attach complete logcat session around CameraHal, CameraService, DOMX. I paste some of them as the following:

    D/CameraHal(   99): (4009c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3841 fetchCapabilitiesForSensor - Disabling a
    ll ports... DONE
    D/CameraHal(   99): (4009c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3855 fetchCapabilitiesForSensor - Selecting s
    ensor 0...
    D/CameraHal(   99): (4009c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3858 fetchCapabilitiesForSensor - Selecting s
    ensor 0... DONE
    D/CameraHal(   99): (4009c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3877 fetchCapabilitiesForSensor - Camera mode
    : MONO
    D/DOMX    (   99): hardware/ti/domx/domx/omx_proxy_common/src/omx_proxy_common.c:1253   __PROXY_SetParameter()
    D/DOMX    (   99): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001001 - Error returned from OM
    X API in ducati
    D/DOMX    (   99): hardware/ti/domx/omx_proxy_component/omx_camera/src/omx_proxy_camera.c:415   CameraSetParam()
    D/DOMX    (   99): ERROR:  CameraSetParam: Error in SetParam 0x80001001
    D/CameraHal(   99): (4009c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3887 fetchCapabilitiesForSensor - Error while
     configuring camera mode in CameraAdapter_Capabilities 0x80001001

    From the debug output, we can see that ducati return error when executing the following code:

            {
                CAMHAL_LOGDA("Camera mode: MONO");
                camMode.eCamOperatingMode = OMX_CaptureImageHighSpeedTemporalBracketing;
            }

            const OMX_ERRORTYPE eError =  OMX_SetParameter(component(),
                               ( OMX_INDEXTYPE ) OMX_IndexCameraOperatingMode,
                               &camMode);

    Because the license signing with TI is in progress, we still do not have ducati driver code now. I can't change ducati driver to adapt to single data lane. If the error does cause by single data lane, I have to change my camera daughter board and select a new two data lanes camera module.  But before doing that, can I have some workaround without modify ducati driver source code?

    Thanks and Best Regards,

    Paul

  • why is the app setting camera to OMX_CaptureImageHighSpeedTemporalBracketing mode? I think this is the problem.

    Try using a simpler test app which can be found in hardware/ti/omap4xxx/test/CameraHal. This would be already built in system/bin/camera_test. Please try starting camera with this app.

  • Dear Mayank,

    Previously, My board wrongly use only one data lane of OV5640 camera module. Now I have modified my board to use two data lanes of OV5640 module. But CameraHal still have error after getting sensor's capabilities. I attach logcat and can you have a look at it and give  some advices?  After getCaps, fetchCapabilitiesForSensor try to call switchToState() to switch state to stateLoaded, but timeout. what will causing this? Thanks,

    D/CameraHal(  100): (4012c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3792 switchToState - .
    D/CameraHal(  100): (4012c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3795 switchToState - .
    D/CameraHal(  100): (4012c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3801 switchToState - Switching to state 0x1...
    D/CameraHal(  100): (4012c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3804 switchToState - Switching to state 0x1... DONE
    D/CameraHal(  100): (4012c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3813 switchToState - Waiting...
    D/CameraHal(  100): (4012c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3815 switchToState - Waiting... DONE
    E/CameraHal(  100): (4012c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3822 switchToState - Timeout triggered while switching to state 0x1
    E/CameraHal(  100): (4012c488)         hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXCameraAdapter.cpp:3904 fetchCapabilitiesForSensor - Failed to switch to Loaded state, error: -110

  • what are the contents of /data/misc/camera in your A9 side file system?

  • Hi Mayank,

    I re-attach logcat and /d/remoteproc/omap-rproc.1/trace1

    shell@android:/data # ls /data/misc/camera -la
    drwxrwx--t media    media             2012-01-24 18:51 R12_MVEN001_LD1_ND0_IR0_SH0_FL0_SVEN001_DCCID43
    drwxrwx--t media    media             2012-01-24 18:51 R12_MVEN002_LD2_ND0_IR0_SH0_FL0_SVEN002_DCCID42
    drwxrwx--t media    media             2012-01-24 18:51 R8_MVEN002_LD2_ND0_IR0_SH0_FL1_SVEN003_DCCID1042

    from trace1 output:

    [      4.252] [ERR=67] OV5640/src/OV5640.c:[484]:!!! Sensor active!
    [      4.390] [ERR=68] OV5640/src/OV5640.c:[595]:Set Sensor configuration:SEN_MODE_PREVIEW
    [      4.395] [ERR=69] src/msp_camera_api.c:[1437]:COLOR Pattern: 8
    [      4.395]
    [      4.395] [ERR=70] src/new_csi_MSP.c:[450]:Default complex IO configuration for CSI:0
    [      4.395] [ERR=71] src/csi2rx_api.c:[502]:number = 0, imagebuf = @b49000a0
    [      4.395] [ERR=72] src/new_csi_MSP.c:[450]:Default complex IO configuration for CSI:0
    [      4.395] [ERR=73] src/csi2rx_api.c:[502]:number = 1, imagebuf = @b5c38ea0
    [      4.396] [ERR=74] OV5640/src/OV5640.c:[778]:
    [      4.396] !!! Startting preview!
    [      4.396]
    [     12.911] [ERR=75] omx_base_comp/src/omx_base_internal.c:[1397]:Failed check: tStatus == TIMM_OSAL_ERR_NONE
    [     12.911] [ERR=76] omx_base_comp/src/omx_base_internal.c:[1397]:Returning error: OMX_ErrorUndefined
    [     12.912] [ERR=77] src/msp_pipe_mngr.c:[1729]: PipeMngr: Wrong state
    [     12.912] [ERR=78] src/msp_pipe_mngr.c:[1730]:
    [     12.912] Error in src/msp_pipe_mngr.c, line:1730

    It seems that ducati has some errors when starting preview. But I'am sure the hardware is working. Do you have further advice? Thanks.

  • Try with a different test app. There is a command line app camera_test. Usage is

    camera_test f

    After this follow menu printed on the console. You can try changing preview resolution and see if it works.

  • Hi, dear TI employee, can you tell me how to disable ducati?

    Because we have a custom FPGA camera device and seems not to be compatible with the system.(omap 4460 blaze_tablet)

  • I am not sure which OS and which kernel you are using, the exact steps depend on that. But in a nutshell it can be done in 2 ways:

    1. Remove ducati firmware binary from /system/vendor/firmware and reboot

    2. Remove RPMSG driver for kernel (modify defconfig). Build and flash the kernel.