Create semi-custom camera interface Very quickly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create semi-custom camera interface Very quickly

1,867 Views
AaronLinsdau
Contributor I

Hello,

My timeline has been collapsed to perhaps a level.  What was planned for months is now 2 weeks.  I need to create an interface driver to a basic camera on the CS0 port and have that data streamed over to a very large (128GB) SD card on the Quick Start Board.  It's a customer issue but that's beside the point.  Is this even possible?  I've contacted Timesys about doing this and they've burned up nearly a week thinking about it, code for not going to get it done.

All (haha) I need to do is grab 8-bit RGB data off the CS0 port and block-write that data to a huge SD card.  Nothing more fancy than that.  The data is formatted with Vsync and Hsync progressive.  I can parse the data later but I have to capture that data in a horrible hurry.  It's very slow, 256x256 RGB at 30fps.  In microcontroller land this would have been very easy for me but up in Linux world, it's a whole other story.

I'm committed to work crazy hours to get this done but I need lots of guidance!  Is there a camera port configuration guide how-to?  How do I activate the camera expansion slot on the QSB?  If I can get the data buffered, then it's "just" getting the data onto a regular but big SD card on the QSB.  Any help is greatly appreciated!!!

Aaron

Tags (1)
0 Kudos
21 Replies

1,754 Views
RandyKrakora
NXP Employee
NXP Employee

It should all be documented in the User Guide or Linux Guide...look for "dd" commands. Basically you write uboot, the kernel and the root filesystem to the card...

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

Now that you have LTIB working, which doc explains how to flash your newly built kernel to the uSD card?  Thanks!

jose said:

What i did was to use the vmware image of Ubuntu that Freescale posted on there site.

It already has LTIB and dependencies configured and installed. So you just have to issue ./ltib or i think ./ltib -c to configure the toolchain and then you'll have the option to compile u-boot and kernel. LTIB is tricky at times so just be prepared for some build failed results.

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

I've run LTIB but couldn't let it complete.  I just tried using default for everything.  I'll run it again tonite to see if I get everything correct.  Then hopefully the LTIB docs will explain how to get the images to the uSD card.

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

I've got the LTIB installed and it seems to build, it just takes a long time.  Great!!  Now, if I can find one of the camera drivers, how do I load it so I can write the data to the V4L and Gstreamer?  Perhaps that's already been answered, I'll have to look.

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

I changed over to Ubuntu 10.04.  Yes, I do have that and I'm finding all these packages mentioned in the ltib startup manual.  I'll install them and see what happens.  Thank you!

0 Kudos

1,754 Views
RandyKrakora
NXP Employee
NXP Employee

You could try "apt-get update" first, then try to install libncurses5-dev...

Do you have System->Administration->Synaptic Package Manager?

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

Okay, got that.  I've got Ubuntu 9.04 running in a virtual box and I have the Ubuntu 9.04 iso image.  When I refer to the "install all the packages" from here:

http://www.imxdev.org/wiki/index.php?title=ALL_Boards_ltib_config_ubuntu

I receive a message:

E: Couldn't find package libncurses5-dev

to start with.  Any suggestions?  I'm digging down trying to find the bottom here...

0 Kudos

1,754 Views
RandyKrakora
NXP Employee
NXP Employee

Ok, well, on your host system ( where you run ltib ), you need those tools installed so ltib can build the software for imx.

There's some info here: http://www.imxdev.org/wiki/index.php?title=All_Boards_LTIB

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

Randy,

I ran the command ./ltib and receive the following:

aaron@aaron-desktop:~/develop/ltib$ ./ltib
sh: g++: not found
sh: tclsh: not found

ltib cannot be run because one or more of the host packages needed to run it
are either missing or out of date or not in ltib's standard path.  Please
install/upgrade these packages on your host.  If you have your own utilities
in non-standard paths, please add an entry into the .ltibrc file for example:

%path_std
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/my/own/exes

Package                Minimum ver   Installed info
-------                -----------   ---------------
libstdc++              0             not installed
gcc-c++                2.96          not installed
zlib-devel             0             not installed
rpm                    0             not installed
rpm-build              0             not installed
ncurses-devel          0             not installed
m4                     0             not installed
bison                  0             not installed
patch                  0             not installed
tcl                    0             not installed

Died at ./ltib line 1397.
traceback:
 main::host_checks:1397
  main:542

Started: Mon Mar 26 11:44:56 2012
Ended:   Mon Mar 26 11:44:57 2012
Elapsed: 1 seconds

Build Failed
Exiting on error or interrupt
aaron@aaron-desktop:~/develop/ltib$

0 Kudos

1,754 Views
RandyKrakora
NXP Employee
NXP Employee

Go to /home/name/develop/ltib and run "./ltib" it should install packages to /opt/freescale/pkgs.


If you've already done this and still see errors, post a log of the commands you are typing, from where you are typing them and the errors, please.

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

I've got everything downloaded and ran the ./install from the 

L2.6.35_11.09.01_ER_source

directory.  However, when I put this in my directory

/home/name/develop

and then go there to run ./ltib, all I received are a bunch of messages saying many packages are not installed.  There seems to be a desired location, like /opt/freescale/... structure that this should land in instead?  The ltib_build_host_setup.pdf mentions none of this.

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

Okay, I'll download those and go through them, thank you.  Also the MM package sounds pretty handy!

Wouldn't that be just nice if it "just worked"!

0 Kudos

1,754 Views
RandyKrakora
NXP Employee
NXP Employee

If you download the 11.09 BSP ( sources and docs ) from www.freescale.com/imx. You can unpack it and install ltib from there. In the docs package there will be pdf files describing how to do things. You will also want the 11.09 MM ( multimedia package if you end up building everything yourself  - uboot, kernel, rfs.

After you do your first ltib build, look in <wherever you have it installed>/ltib/rpm/BUILD/linux/drivers/mxc/ipu3/... There's many other drivers in those trees too.

Although maybe you could just start up gstreamer and try a capture and it would just work? :)

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

I'm sure my camera will need a custom driver.  That's where I come in.  It's the framework around the thing that's stymied me.

The "loading into the kernel" part is the big deal here.  Where do I get a copy of the ltib to do this?  Is there a doc describing the procedure?  What is the difference between doing a ltib to build my own kernel vs creating a loadable kernel module?

It looks like gstreamer is the ticket for part of this.  Do you have a link to some existing camera drivers?

If I would have known this would have been many months of work....

0 Kudos

1,754 Views
RandyKrakora
NXP Employee
NXP Employee

Your custom HW may need a customer driver, I don't know. But I believe once you have that driver and it is loaded to the kernel ( sounds easier than it is ), you should be able use gstreamer to grab the data. But you may have to use ltib to perform your own kernel build, unless you develop a loadable kernel module for your camera.

As far as gstreamer, it's a very widely used open source package, the only thing specific to imx ( QSB ) parts is the Freescale plugins for gstreamer ( prefixed with "mfw_" ).

Since I don't have much experience with camera capture, I'd want to get a module with an existing driver and get some experience with it first ( loading the camera kernel driver/module, using gstreamer to capture data , etc. ), then move to my custom HW.

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

I have custom video hardware plugged into the expansion header on the QSB.  The cameras are designed to be mounted on an aircraft.  Hopefully there are drivers available that are similar to mine that I can modify rather than trying to go ground-up?

Yes, I have the Ubuntu uSD card that came with the QSB.

I'll check out the gstreamer site.  Is there something specific on there for the QSB?

0 Kudos

1,754 Views
RandyKrakora
NXP Employee
NXP Employee

What HW are you using? That will be important to know what driver to include in the kernel? Are you using the Ubuntu SD that came with the QSB?

You should probably read the gstreamer website and do some google searches, because for what you want to do, if you have your driver connected in the kernel, gstreamer would make it very easy and flexible.


Here's an example gstreamer pipeline that looks to use raw format - of course you would need to modify it and send it to a filesink:

gst-launchv4lsrc ! video/x-raw-yuv, width=320, height=240, framerate=25/1 !ffmpegcolorspace ! tee ! queue ! video/x-raw-rgb ! ximagesink

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

I've got my hardware all connected up.  The camera data is waiting at the door of the quick start board connector.  "All" I need to do is figure out how to activate and configure the CS0 port and grab the clocked data.  Then write it to a high-capacity SD card.

Was guessing on the gstreamer, since it looked like it was oriented toward compressed incoming video.  I've got raw video that I have to store.

0 Kudos

1,754 Views
RandyKrakora
NXP Employee
NXP Employee

You'd have a linux driver for your camera ( to make a device ) and mfw_v4lsink would connect to it.

Here's a short thread about some camera modules:

http://imxcommunity.org/forum/topics/i-mx53-qsb-camera

How come you think you need compressed video for gstreamer to work?

Do you already have your HW built and working?

0 Kudos

1,754 Views
AaronLinsdau
Contributor I

The mfw_v4lsrc looks like a good start!  Now, the one thing I've not found is where to "connect" between software like that and the underlying CPU.

My video isn't compressed at all, so gstreamer probably won't help.  But thank you!

0 Kudos