Author Topic: Chronos Cam App open source build discussion  (Read 1348 times)

tretee

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Chronos Cam App open source build discussion
« Reply #15 on: December 24, 2017, 03:57:46 AM »
As far as I can see the SD card has 2 partitions. One EXT3 with volume name "ROOTFS" and one called BOOT. I copied the content of the ROOTFS partition.
I assumed that all files might not have come across in the copy operation (tar the rootfs and then untar on host is the way it should be done but is normally only necessary if you want to use it as a NFS for the camera during development)
So when I look for the missing header files (OMX_Types.h is the first one reported as missing) I am looking both on the SD card and the copy on my host.

Delivering the file system as a tar ball will not help if the required files are not there. Based on your response it sounds like you know they are there. So where on the SD card can I find for example the "OMX_Types.h" file?
E.g. either we need to modify the project to remove that dependency or include the files.

tesla500

  • Krontech
  • Full Member
  • *****
  • Posts: 160
    • View Profile
    • krontech.ca
Re: Chronos Cam App open source build discussion
« Reply #16 on: December 24, 2017, 12:17:52 PM »
I have those files in mine, we did change the SD card image after serial number 00049, I believe those older cameras may not have the include files on them. I've attached a tar with all the includes, extract it to /targetfs/usr/

Let me know if this works.

tretee

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Chronos Cam App open source build discussion
« Reply #17 on: December 24, 2017, 03:55:13 PM »
Thanks David, (getting replies from the main dev around Christmas is unheard of, so an extra thanks for that and Merry Christmas)

That's it!
Quick hack to remove the annoying warning message about unsaved data in RAM. Built the app and tested it on the camera.
Works as expected. 

Now need to figure out a way to develop app and test without the SD card in and out copy. That works fine for a quick test but for any more advanced development I need either the camera to mount rootfs over NFS or a way to have the debugger load the executable directly to the camera.
Never used QT before but that looks fairly easy to learn. How do you develop/debug?

Best Regards
Davor
« Last Edit: December 24, 2017, 03:57:09 PM by tretee »

foobar

  • Krontech
  • Newbie
  • *****
  • Posts: 4
    • View Profile
Re: Chronos Cam App open source build discussion
« Reply #18 on: December 26, 2017, 04:54:09 PM »
The README in the github repository has been updated with a description of how to get the debug environment working under Ubuntu 16.04. Unfortunately I haven't been able to get debugging working from anything newer (ie: Ubuntu 17.04 and beyond) due to some issues in newer versions in QT creator. There process is roughly broken down as:
  • Install a cross debugger and configure the camera kit to use it.
  • Add the Camera as a device in QT creator using SSH.
  • Kill the camApp daemon via SSH to gracefully shutdown the video pipeline.
  • Start your debug build of the camApp from QT creator.

SSH access to the Camera is provided through the mini-USB port labelled "OTG". When you connect your laptop to this port it will come up as a USB network adapter. The Camera has a static IP address on this interface of 192.168.12.1, and your laptop will get an IP address assigned to it via DHCP (this should be familiar if you've worked with Beaglebones before). By default there is no root password, and SSH will accept anything you type for a password until a password is configured.
« Last Edit: December 27, 2017, 11:51:07 AM by foobar »

tretee

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Chronos Cam App open source build discussion
« Reply #19 on: December 27, 2017, 07:41:41 AM »
Hi foobar, thanks for the update.

The deploy/debug part does not work.
- Setup device -> works fine and "test" shows.
Connecting to host...
Checking kernel version...
Linux 2.6.37+ armv7l

Checking if specified ports are available...
All specified ports are available.

Device test finished successfully.

-> Deploy/debug generates following error. (yes i did first kill the running camApp)
16:32:53: The process "/usr/bin/make" exited normally.
16:32:53: Unexpected output from remote process: "Available"
16:32:53: Deploy step failed.
Error while building/deploying project camApp (kit: Camera)
When executing step "Check for free disk space"
16:32:53: Elapsed time: 00:00.

PS.
As far as I can see the Ethernet port works fine and actually better than the USB/ETH connection. E.g. I can use WinSCP and Putty/ssh when camera is connected to my local network with ethernet cable. As you already explained that will not work with the USB/ETH.
I tried both ETH port & USB/ETH for the debug and the result is the same.

foobar

  • Krontech
  • Newbie
  • *****
  • Posts: 4
    • View Profile
Re: Chronos Cam App open source build discussion
« Reply #20 on: December 27, 2017, 11:50:37 AM »
The failure in the Deploy step sounds very similar to some of the issues I encountered when trying to get QT creator working on Ubuntu 17.04, what I found was that newer versions of QT were getting some paths wrong and trying to find the free space of a directory that didn't exist on the target. Rather than trying to figure out why, I simply switched my development machine back to Ubuntu 16.04 LTS, which seemed to work just fine. Can you check which version of Ubuntu and QT creator you're using?

tretee

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Chronos Cam App open source build discussion
« Reply #21 on: December 27, 2017, 01:26:57 PM »
host = Ubuntu 16.04LTS. QT creator ver = 3.5.1.

In the .pro project file there is a target.path = /home/root/qt. that path does not exists so I fixed that by adding the qt folder.
That unfortunately did not help.
Googling the problem I found a post suggesting QT will try to load to /root.
So I created a /root folder, that did not work either.
Change install folder permission to rw access for everybody. Did not help.

Running out of ideas to try but I will continue ...

tesla500

  • Krontech
  • Full Member
  • *****
  • Posts: 160
    • View Profile
    • krontech.ca
Re: Chronos Cam App open source build discussion
« Reply #22 on: December 27, 2017, 03:37:07 PM »
Try removing the Check for Free Space before deployment, I recall that not working. See screenshot of my Run configuration, see if yours is the same.

tretee

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Chronos Cam App open source build discussion
« Reply #23 on: December 27, 2017, 07:30:55 PM »
That was it.
Removed "check for free space" and changed path in .pro file to target.path = /opt/camera
Deploy/Debug works fine now.

Code deep dive is up next. Need to figure out how to grab the preview video data and push that via Ethernet so I can view it on a PC and control the camera from there.

Once it's working I will be happy to show what I have and share if anybody is interested.   

tesla500

  • Krontech
  • Full Member
  • *****
  • Posts: 160
    • View Profile
    • krontech.ca
Re: Chronos Cam App open source build discussion
« Reply #24 on: December 27, 2017, 09:58:17 PM »
Code deep dive is up next. Need to figure out how to grab the preview video data and push that via Ethernet so I can view it on a PC and control the camera from there.

Once it's working I will be happy to show what I have and share if anybody is interested.   

We're also working on this, in fact pretty much all our effort now is devoted to getting Ethernet remote control and video download working. It's a very nontrivial task to just get the video into a RAM buffer, which is one of the reasons why it's taking so long.

The video system is built on a framework called OpenMax (OMX). Most of OMX is run internally by a separate M3 core in the CPU. This runs a binary blob provided by TI, the source is available from TI under an NDA, ask for the "DM8148 EZSDK Overlay Package". This handles pretty much everything related to video input, processing, and output to the display. There's another M3 running a different binary blob which operates the H264 encoder. We've modified the former M3 code somewhat to add features like the video save throttling.

In the camApp, OMX is used directly for live display, and saving is done using gstreamer. Internally, gstreamer uses OMX as OMX is the only way to do anything with the hardware accelerated video pipeline. There is currently a problem with the gstreamer component that allows you to get frames into a RAM buffer, foobar or Loial could comment further, but we believe that the component that provides RAM buffers doesn't properly handle shutting down the pipeline, which crashes the M3. This issue needs to be solved before we can get RAW saving over Etherent working.

gstreamer currently supports streaming compressed video via RTSP, if you just want live display that should be significantly easier than getting RAW.

Take a look at videoRecord.c to see how the gstreamer pipeline is set up. There's also a way to run gstreamer pipelines from the command line, Loial has some examples of doing this.

tretee

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Chronos Cam App open source build discussion
« Reply #25 on: December 28, 2017, 04:14:44 AM »
Thanks for the heads up. Sounds like it's smarter for me to wait and focus on the other parts of the code I need.
I work for one of TI's biggest competitors, so getting code under NDA might be difficult :-)