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.

AM5728: Camera use in Android SDK

Guru 10235 points
Part Number: AM5728
Other Parts Discussed in Thread: TMDSCM572X, TMDSEVM572X

Hello, TI Experts,

 

We have an additional question about TMDSCM572X(www.ti.com/.../tmdscm572x) from E2E thread as below;

http://e2e.ti.com/support/arm/sitara_arm/f/791/p/607525/2309889#2309889

 

We can get new Camera(revC) by RMA process.

And we can success to run Camera app in Linux-SDK on TMDSEVM572X with a lillte modification to dts files.

Thank you!

 

Now, we try to run camera app. in PROCESSOR-SDK-ANDROID-AM57X 04_03_00_05 on TMDSEVM572X-EVM.

We can success to run ANDROID by writing prebuild files to eMMC on the EVM by following Processor SDK Android Software Developers Guide.

http://software-dl.ti.com/processor-sdk-android/esd/docs/latest/android/index.html

 

But we failed to run camera App. with the new Camera(revC).

(Please refer an attached pdf.)

 

We would appreciate if you tell us how to solve this problem.

Best regards,

 

camera_fail.pdf

  • Hello there,

    Is this statement correct? - when you were running on Linux you made changes to the DTS files, but when you are running on Android you are using the prebuilt software without any modifications.

    Regards,
    Nick
  • Hi,

     

    Thank you for your prompt reply.

    Yes. This is correct.

     

    We cannot find any dts files for revC camera(OV10635) in the folder as below;

    "ti-processor-sdk-android-am57xx-evm-04.03.00.05/board-support/linux-4.4.117+gitAUTOINC+eb496200ef-geb496200ef/arch/arm/boot/dts"

     

    We would appreciate if you tell us how to solve this problem.

     

    Best regards,

  • Hello,

    Short answer:
    TI does not support the AM57xx camera module in Android SDK 4.3. It might be possible for you to make changes to get the camera working. If you want to try to implement the changes yourself (I cannot guarantee the changes will work), I can get you a little more background information to help. The camera module device tree files should be added in Android SDK 5.0, but there is not a timeline to officially support the camera module and camera apps.

    Long answer:
    There seem to be two software hurdles: 1) updating the device tree files to match the camera module updates in the Linux Processor SDK, and 2) potential changes needed in the Hardware Abstraction Layer (HAL).

    1) As of Android/Linux SDK 4.3, Android is based on Linux kernel 4.4 and Linux is based on kernel 4.9. Both will get updated to kernel 4.14 in the summer 2018 SDK 5.0 release, and at that point the Android dts files are expected to be updated to allow you to select which camera module you are using.

    If you want to apply changes to the Android SDK 4.3 device tree files (kernel 4.4) to try to get those working now, I can point you to the major Linux SDK commits where the camera modules were added to the device tree (kernel 4.9).

    Once the device tree is correct, you may be able to test the camera through the command line. The camera app probably would not work, because the HAL might need additional updates.

    2) The HAL might need changes to get the camera app working. I do not know what those changes are, and I do not think we have a timeline for implementing those changes. However, if you are interested in trying to figure this out on your side, I can try to get some more information from the engineer looking into the HAL.

    Regards,
    Nick
  • Hello,

     

    Thank you very much for your kindness.

    I really appreciate your help.

     

    I understand current Android SDK doesn't support AM57xx camera module.

    We'd like to continue to investigate how to modify dts & HAL related files.

     

    We would appreciate if you tell us any update/clue for modification of SDK files to use the camera modules.

     

    Best regards,

     

  • Hello there,

    1) Updating the Device Tree:
    Most of the changes to add the new camera module in the Linux SDK 4.9 kernel are in commits
    git.ti.com/.../787ca747231dd0419f474619c430461985e40485
    git.ti.com/.../9ca69167d1bcf3ecf58d3e0dcdca331e2099c1a6

    2) HAL changes:
    I'm still looking into this for you. Once the device tree changes are made, it is worth trying the default camera app or other camera apps that you sideloaded onto the board to see if the old HAL issues have been addressed.

    Regards,
    Nick
  • Hello,

    Thank you very much for your kindness.

    I really appreciate your help.

    I tried to run camera App. in Android-SDK with modified dts like below.

    But  the camera App. seemed to be fail.  

    The result was same as attached camera_fail.pdf in previous E2E-thread.

    <Detail>

    http://git.ti.com/ti-linux-kernel/ti-linux-kernel/commit/787ca747231dd0419f474619c430461985e40485

    1:From this site,

    - modify "arch/arm/boot/dts/Makefile" 

    - create dts files

      - am57xx-evm-reva3-cam-ov10635.dts

      - am57xx-evm-cam-ov10635.dts

      - am57xx-evm-common-cam-ov10635.dtsi

    http://git.ti.com/ti-linux-kernel/ti-linux-kernel/commit/9ca69167d1bcf3ecf58d3e0dcdca331e2099c1a6

    2: From this site,

     - modify am57xx-evm-common.dtsi

    3: Then build dts & copy

     - make ARCH=arm CROSS_COMPILE=arm-linux-androideabi- dtbs

     - cp am57xx-evm-reva3-cam-ov10635.dtb

        ~/ti-processor-sdk-android-am57xx-evm-04.03.00.05/board-support/prebuilt-images/am57xx-evm-reva3.dtb

    4: To flash the prebuilt images to the onboard eMMC by running ./setup.sh

    I also attached Makefile & dts files for reference.

    We would appreciate if you tell us any update/clue for modification of SDK files to use the camera modules.

    Best regards,

    6354.dts_files.zip

  • Hello,

    I've heard you may be able to test camera functionality with omapdrmtest (so you don't have to rely on a camera app which might not work with your board's current Android settings). The below are another engineer's notes that I have not verified myself, so there may be some errors:

    "dmabuftest and capturevpedisplay tests are used for verifying vip and vpe function respectively.

    omapdrmtest is a small test suite, located at git.ti.com/.../omapdrmtest
    To build for Android, use the mm build system, and then rebuild and reflash the system image

    INSTALLING OMAPDRMTEST
    Retrieve the code base from git:
    Move into mydroid/external folder or export TOP=<mydroid>
    mm to build
    From mydroid:
    make snod rebuilds just the system.img
    Flash the new system.img


    RUNNING OMAPDRMTEST TESTS
    In order to run these tests, Android must be stopped. Use the following command sequence:
    su
    stop
    stop media

    If you need to restart Android afterward, just run:
    su
    start
    start media

    In general, run tests as root.

    VERIFY VIP OUTPUT
    Use dmabuftest to verify the output of the VIP drivers directly. Run as superuser

    dmabuftest options:
    -s <connector_id>:<mode> set a mode
    -c WxH@fourcc set capture dimensions/format
    -d is not listed in the help, but appears to give the device node

    Example run command and explanation on DRA74x:
    dmabuftest -c 720x240@YUYV -d /dev/video1 -s 32:1920x1200
    The -c is 720x240 since we're taking interlaced 720x480 video, which means each frame is vertically halved.
    -d gives the video device node (vip1-s0)
    -s sets the output.
    32 is taken from parsing the results of running modetest and looking under Connectors. Knowing the Rev-H board has a 1920x1200
    display, we just look for the Connector id associated with the having a 1920x1200 mode.

    1920x1200 is the output resolution we're using. This sets it to full screen on the Rev H boards.


    In the process of testing, we found no errors, especially none resembling the issue we were seeing from Android Camera, allowing us to eliminate the VIP drivers as the source of the issue.

    VERIFY VPE OUTPUT
    The next stage of the analog camera path is using the VPE's deinterlacing block to deinterlace the analog stream. We use capturevpedisplay to verify the output of the VPE drivers directly.

    capturevpedisplay usage:
    capturevpedisplay <SRCWidth> <SRCHeight> <SRCFormat> <DSTWidth> <DSTHeight> <DSTformat> <interlace> <translen> -s <connector_id>:<mode>

    Example run command and explanation:
    capturevpedisplay 720 240 yuyv 720 480 uyvy 1 1 -s 32:720x480
    Source and destination width and height are fairly simple, source height is 240 for the same reason as with dmabuftest.
    Formats and translen settings were taken from processors.wiki.ti.com/.../Processor_SDK_Linux_Automotive_Software_Developers_Guide
    Set interlacing true for analog camera
    The -s is the same as for dmabuftest, but the resolution is more or less ignored. "

    Regards,
    Nick
  • Hello,

    Thank you very much for your detail information.
    I really appreciate your help.

    I'd like to check the behavior from your advice.

    Best regards,
  • Update: As of SDK 6.0, TI still does not support the AM57xx camera module in Android SDK. At this time, there are no plans to support the AM57xx camera module on Android.

    Regards,

    Nick