Announcement

Collapse
No announcement yet.

Ambarella Hack Development Kit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ambarella Hack Development Kit

    This is just a fun little project I've been working on for a while. It's basically a CHDK/Magic Lantern clone for Ambarella cameras.
    At the moment, it is very hacky and unstable.

    Currently, I have only tested it on 1 camera, but I'm looking into getting another one that I can port it to.
    Feel free to recommend any.

    Here's a simple demonstration: https://www.youtube.com/watch?v=8iN3dRujXYc

    And of course, it is completely free and open-source: https://github.com/petabyt/ahdk
    Last edited by petabyte; 03-30-2021, 04:51 AM.

  • #2
    Very impressive! Thanks for sharing!

    Quite useful AE/AWB locks can be added with this:
    t ia2 -ae off
    t ia2 -awb off

    BTW, what is the 'a.ash' file for?
    Donate here if you want to support my efforts and this site.

    Email me if you have any offers, requests or ideas.

    Comment


    • #3
      Thanks. With a.ash, I was going to try to spit a command into a file, then run it.
      This turned out to be a headache, so I just tracked down the "t ai2 -exp" function
      and called it within the program.

      Comment


      • #4
        petabyte Tried to compile it and run with my DX cam: ahdk.zip

        But no luck. It hangs when I'm taking the card out. What can be wrong?
        Donate here if you want to support my efforts and this site.

        Email me if you have any offers, requests or ideas.

        Comment


        • #5
          Originally posted by nutsey View Post
          petabyte Tried to compile it and run with my DX cam: [ATTACH]n19611[/ATTACH]

          But no luck. It hangs when I'm taking the card out. What can be wrong?
          You are running firmware version 3.03 right? Sometimes it crashes unless I run it from the "View Photo/Video" menu.

          Comment


          • nutsey
            nutsey commented
            Editing a comment
            Yes, 3.03ao. And it actually crashes during bootup even in the "Playback/View" mode.

          • nutsey
            nutsey commented
            Editing a comment
            I did not modify anything in your sources except a couple of things like my path to gcc in makefile and commenting a string in order to get the 'font.bin' compiled.

          • petabyte
            petabyte commented
            Editing a comment
            The zip file you gave me worked on my end. And just to make sure: ahdk.bin and font.bin are in the "ahdk" folder right?
            Here are my files if you want to test them: https://petabyte.heb12.com/filedump/ahdk.zip

            If you want, you can give me a memory dump:
            savebin d:\memdump.bin 0xC0000000 l 134217728

            Also some other debug information would help:
            sleep 1
            touch foo
            ps > foo
            t disp >> foo
            t disp info >> foo
            t disp csc_info >> foo
            dmesg dsp_debug -100 >> foo
            dmesg dsp -100 >> foo
            dmesg rtos -100 >> foo

          • nutsey
            nutsey commented
            Editing a comment
            "ahdk.bin and font.bin are in the "ahdk" folder right?"
            Oh, I forgot about it. Thanks for the tip! Now it works!

        • #6
          Here is my DX cam adjustment script when I tried to get more image quality and more flat/log looking picture: autoexec.zip

          Hope it can be useful.
          Donate here if you want to support my efforts and this site.

          Email me if you have any offers, requests or ideas.

          Comment


          • petabyte
            petabyte commented
            Editing a comment
            Thanks. This will be very useful.

        • #7
          Also, I've been wanting to port it to a second camera. I'm looking for something cheap and popular. I'm open to any recommendations.

          I'd be happy to help anybody port their camera to AHDK. Sending me this info would help:

          Code:
          savebin d:\memdump.bin 0xC0000000 l 134217728
          sleep 1
          touch log
          ps > log
          t disp >> log
          t disp info >> log
          t disp csc_info >> log
          dmesg dsp_debug -100 >> log
          dmesg dsp -100 >> log
          dmesg rtos -100 >> log
          Last edited by petabyte; 04-05-2021, 08:30 PM.

          Comment


          • nutsey
            nutsey commented
            Editing a comment
            What about Amba A12 based cams? Do you think it is possible to port your hack to them?

          • petabyte
            petabyte commented
            Editing a comment
            Probably. I don't have any ram dumps or information to know for sure.
            Last edited by petabyte; 03-31-2021, 11:37 PM.

          • petabyte
            petabyte commented
            Editing a comment
            I searched the forums some more and found somebody's RAM dump.
            https://www.goprawn.com/forum/ambare...a-4k#post12003
            I already started finding some of the functions:
            https://github.com/petabyt/ahdk/blob...form/mijia4k.h

            From what I see, it should definitely be possible.

          • nutsey
            nutsey commented
            Editing a comment
            Here is the Hawkeye Firefly 8SE (Ambarella A12) memory dump: https://www.dropbox.com/s/s06c1o6eq8...-dump.zip?dl=1

          • petabyte
            petabyte commented
            Editing a comment
            Any idea on what the start address was?

          • nutsey
            nutsey commented
            Editing a comment
            0xA0000000 for A12

          • petabyte
            petabyte commented
            Editing a comment
            I opened it and looked around. Seems very similar to the other dump.

          • nutsey
            nutsey commented
            Editing a comment
            So, what's your verdict about A12 cams?

          • petabyte
            petabyte commented
            Editing a comment
            90% sure I will be able to port all of AHDK to it. It won't be easy though.

        • #8
          Click image for larger version

Name:	IMG_20210402_174418.jpg
Views:	433
Size:	841.2 KB
ID:	19633

          A quick Fractal demo. Took around 1 hour to render. (stopped it halfway)
          I just used a quick BrainF*ck interpreter and mandelbrot.bf

          Comment


        • #9
          OP, if I understand this correctly it is some kind of firmware mod/hack for Ambarela cams, something similar to CHDK firmware for Canon cameras like my old and trusty Canon A720 IS? If so it would be awesome!

          Comment


          • petabyte
            petabyte commented
            Editing a comment
            Yes, that is exactly what it is.

        • #10
          Astak Action cam 3 (Amba A5 + MT9P401) memory dump: http://u.pc.cd/gpO
          Donate here if you want to support my efforts and this site.

          Email me if you have any offers, requests or ideas.

          Comment


          • #11
            OJOcam (Amba A7 + MT9T002) memory dump: http://u.pc.cd/b4jrtalK
            Donate here if you want to support my efforts and this site.

            Email me if you have any offers, requests or ideas.

            Comment


            • #12
              Ambarella Tetris:

              Comment


              • #13
                I got C running on the GoPro Hero 3+.
                I also reverse engineered the front panel display function.

                Obviously, the most natural thing to do was a Rickroll:
                https://www.youtube.com/watch?v=MjIZWVXumpk

                I also got "Bad Apple" running at a high FPS.
                https://www.youtube.com/watch?v=VXMllZHdrso
                Last edited by petabyte; 05-28-2021, 07:55 PM.

                Comment


                • #14
                  AHDK can now communicate with the Busybox/Linux part of the Ambarella SoC.
                  I set up a simple demo where I could send text via WiFi and it would appear on the camera's screen.

                  Soon, I may be able to have live code testing and other interesting things.

                  Comment


                  • #15
                    I would be interested to help. I worked 12 years ago with CHDK to port a new camera, and it was pretty fun.
                    ARM assembly is not my favorite (I used to do x86 assembly) but I can understand the code.

                    So basically what is needed is a function finder, right? I mean, this would be the first step. Something to look through the RAM and find the address of useful functions. Once that is done, they can be bound to some scripting language, and the camera should be able to run real scripts.

                    Comment

                    Working...
                    X