• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » OMAP™ Applications Processors » OMAP 4 Forum » Not seeing expected frame rate on sensor attatched to CSIA on 4460
Share
OMAP™ Applications Processors
  • Forums
Options
  • Subscribe via RSS

Not seeing expected frame rate on sensor attatched to CSIA on 4460

Not seeing expected frame rate on sensor attatched to CSIA on 4460

This question is answered
Jeff Hane1
Posted by Jeff Hane1
on Dec 20 2012 18:23 PM
Intellectual350 points

We are using a 4460 with an OV5640 sensor attached to CSIA and are not seeing the expected frame rate.  Even when I increase the speed of the MIPI clock I do not see a change in the frame rate.  First,  I would like to verify that we are programming the PLLs in the sensor correctly to achieve the expected frame rate but I'm not sure how to make that calculations.

  I am capturing YUV 422(2 bytes per pixels), VGA data using 2 MIPI data lanes.  If I want to capture 30fps, what is the clock speed should I see if I measure it on the MIPI clock lane?

  Second, can somebody tell me what the DDRCLK is when reference in the TRM in regards to how to program the ths_term and ths_settle fields in the CSI2 Phy REGISTER0 register.  The TRM makes these references

ths_term = ceil(12.5 / DDR clock period) –1
ths_settle = ceil(90 ns / DDR clock period) + 3

thank you,

jeff





Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • sweta bhatt
    Posted by sweta bhatt
    on Dec 21 2012 02:26 AM
    Expert2205 points

    Hi Jeff,

    Can you please tell me which kernel release you are using ? Is it V4L2 based capture ?

    What is the frequency from OV5640 sensor, which you see when you probe the clock lane ?

    What value do you see in ov5640_s_fmt() function for ov5640->pixel_rate->cur.val64 variable ?

    If you are using V4L2 based kernel, can you tell me what is the value of DDR clock frequency ?

    Please refer to omap4iss_csiphy_config function of "drivers/media/video/omap4iss/iss_csiphy.c" for the calculation.

    Regards,
    Sweta

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jeff Hane1
    Posted by Jeff Hane1
    on Dec 21 2012 12:13 PM
    Intellectual350 points

    Hello,

      Yes, doing v4l with a 2.6.30 kernel.  The mipi_pclk is 112000000(this is the value returned by get_pclk) so what I see on the bus is 56000000.  The cur.val64 is 7000000 and the ddr_clk is 28000.  This is for 16bit per pixel VGA using 2 data lanes.

    jeff

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mayank Mangla
    Posted by Mayank Mangla
    on Dec 21 2012 14:31 PM
    Expert4095 points

    which sensor are you using and have you verified that the sensor is outputting at 30fps?

    ------------------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jeff Hane1
    Posted by Jeff Hane1
    on Dec 21 2012 15:36 PM
    Intellectual350 points

    OV5640.   We can't access the h/v sync pins on the sensor so cannot verify it on the sensor.  That's why I'm trying to determine if the mipi clock is running fast enough to achieve the data rate I want.  If yes, then I can look at other possibilities. 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mayank Mangla
    Posted by Mayank Mangla
    on Dec 22 2012 14:23 PM
    Expert4095 points

    A rough calculation says you need at least 73MHz MIPI clock for VGA 30, 16bpp. This is assuming no H and V blanking, The clock you have set is too low.

    ------------------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jeff Hane1
    Posted by Jeff Hane1
    on Dec 26 2012 18:54 PM
    Intellectual350 points

    I got some feedback from the sensor vendor and have modified the registers settings such that the clock rate is 114MHz.   However, on the OMAP's side it seems to think it is running at 15fps.  We are not dropping any incoming frames in the driver.  When I get back in the office I will connect a scope to a gpio that is being toggled in the CSI's ISR to actually measure what the chip is seeing.   Is there anything that I should be looking at to determine why I am not getting the expected frame rate?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mayank Mangla
    Posted by Mayank Mangla
    on Dec 27 2012 09:23 AM
    Expert4095 points

    Please validate frame rate using the scope. From SW standpoint here is something you can try:

    1. Run camera_test from /system/bin. Usage is camera_test f

    2. Press 'E' to print capabilities. Make sure that 30fps is supported.

    3. If supported, adjust camera fps range to [30, 30] and start preview using camera_test menu options.

    4. Measure the frame rate

    ------------------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jeff Hane1
    Posted by Jeff Hane1
    on Dec 27 2012 12:12 PM
    Intellectual350 points

    Just to clarify.  Is camera_test an android/openMAX application? Is the source for this somewhere in android tree?

    thank you,

    jeff

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mayank Mangla
    Posted by Mayank Mangla
    on Dec 27 2012 12:16 PM
    Expert4095 points

    It is a native (C++) app which uses Android CameraService APIs just like an android app will do. It is a little easier to debug and modify than Java code.

    You can find the source in the folder hardware/ti/omap4xxx/test/CameraHal/

    ------------------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jeff Hane1
    Posted by Jeff Hane1
    on Dec 27 2012 18:18 PM
    Intellectual350 points

    I am unable to run the camera test:

    /system/bin/camera_test -f                    
    openCamera(camera_index=0)
    Unable to connect to CameraService
    Retrying...
    Giving up!!
    Camera initialization failed
    Application closed after: 1014502 ms

    I'm guessing this is because of these android logs:

    logcat -d |busybox grep -i camera
    I/CameraService(  108): CameraService started (pid=108)
    E/CameraHal(  108): (40079630)   hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXDCC.cpp:99 initDCC - No DCC files found, switching back to default DCC
    E/CameraHal(  108): (40079630)   hardware/ti/omap4xxx/camera/OMXCameraAdapter/OMXDCC.cpp:44 loadDCC -  Error in DCC Init
    E/CameraHal(  108): (40079630)   hardware/ti/omap4xxx/camera/BaseCameraAdapter.cpp:2682 CameraAdapter_Capabilities - supportedCameras= 0
    E/CameraHal(  108): (40079630)   hardware/ti/omap4xxx/camera/CameraProperties.cpp:108 loadProperties - camera busy. properties not loaded. num_cameras = 0
    E/CameraHal(  108): (40079630)   hardware/ti/omap4xxx/camera/CameraHal_Module.cpp:750 camera_get_number_of_cameras - Unable to create or initialize CameraProperties
    W/PackageManager(  280): Package com.ti.omap4.android.camera desires unavailable shared library com.google.android.media.effects; ignoring!
    E/CameraService(  108): CameraService::connect X (pid 805) rejected (invalid cameraId 0).
    E/CameraService(  108): CameraService::connect X (pid 805) rejected (invalid cameraId 0).
    E/CameraService(  108): CameraService::connect X (pid 818) rejected (invalid cameraId 0).

    And the ducati logs indicate that it is looking for a OV5650:

    [      0.884] [ERR=22] src/sensor_detect_MSP.c:[303]:0>>:OV5650 Socket:0
     

    and since we are using a 5640 there is no sensor detected.   There is a OV5640 driver in the ducati source so I don't understand why it does not see it.  We are using the pre-built ducati firmware that comes with the 4AJ.2.1 release:

    [      0.000]  ***DUCATI VERSION INFO***
    [      0.000] Compile DATE Sep 27 2012 TIME 16:29:43
    [      0.000] GIT ducati_mmlegacy
    [      0.000]     BRANCH:(no branch) TAG:TI-MM-DUCATI_RLS_2.x.15.2
    [      0.000]     COMMIT-ID:36d0068

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mayank Mangla
    Posted by Mayank Mangla
    on Dec 27 2012 20:03 PM
    Expert4095 points

    Have you been using a non Ducati driver so far? camera_test works only with OMX Camera Adapter.

    ------------------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jeff Hane1
    Posted by Jeff Hane1
    on Jan 02 2013 14:55 PM
    Intellectual350 points

    That is correct, we are using a V4L driver.  When I disable the v4l driver and try to use the ducati firmware, it does not recognized the 5640 sensor.  However, the ducati source code does have a driver for the 5640.   Do I need to compile my own ducati firmware to recognize the OV5640 sensor?

     Also, during the course of debugging, I plugged in a HDMI monitor and the camera will run at the expected frame rate.  In fact, I can unplug/plug the HDMI cable and the camera frame rate will change between 15/30).   Is the image subsystem connected to the display subsystem in some manner?   Again, this is just with linux running, android has not been started yet.

    jeff

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jeff Hane1
    Posted by Jeff Hane1
    on Jan 02 2013 18:14 PM
    Verified Answer
    Verified by Jeff Hane1
    Intellectual350 points

    Investigating the changes in behavior with a HDMI monitor connected let to the discover that the HDMI driver is changing the priority of the dma latency via  pm_qos_add_request and PM_QOS_CPU_DMA_LATENCY.   Adding calls to this function in the v4l driver at start stream resolved the issue

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mayank Mangla
    Posted by Mayank Mangla
    on Jan 03 2013 18:00 PM
    Expert4095 points

    Congratulations. Please mark this post as closed.

    ------------------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use