Difference between revisions of "Elphel Software Kit for Ubuntu"

From ElphelWiki
Jump to: navigation, search
(ImageJ and Elphel plugins for imageJ)
 
(182 intermediate revisions by 10 users not shown)
Line 1: Line 1:
The under development Software Kit working as a "LiveDVD" or installed and running off a disc. This DVD is kubuntu based GNU/Linux distribution with some additional software and preconfigured settings.
+
=About=
  
The idea is to bring our customers a GNU/Linux distribution customized for use with our cameras, with the option of either installing it on their computers or using it as LiveDVD. For more advanced users and developers we have provided many tools to cross-compile, simulate FPGA code, reflash the camera, etc.  
+
This page is a simple howto for running Elphel software on (K)Ubuntu GNU/Linux.
  
This page describes the content of the LiveDVD and instructions on use and customization.
+
You can download this GNU/Linux distribution freely from http://www.kubuntu.org/
  
==ChangeLog:==
+
A <font size='3'>'''[http://community.elphel.com/files/live-dvd/ Live ISO image]'''</font> with almost all the packages pre-installed (except [[Elphel_Software_Kit_for_Ubuntu#Installation_of_the_source_code_of_Elphel_camera_software|Elphel camera source]] code and [[Elphel_Software_Kit_for_Ubuntu#Installing_Xilinx_WebPack_.28to_be_moved_to_a_separate_page.2C_just_a_link_here.29|Xilinx ISE WebPack]]) is available for downloading from [http://community.elphel.com/files/live-dvd/ here]:
 +
* [http://community.elphel.com/files/live-dvd/kubuntu-elphel-3.iso kubuntu-elphel-3.iso] is based on Kubuntu 9.10 LTS.
 +
* [http://community.elphel.com/files/live-dvd/kubuntu-elphel-4.iso kubuntu-elphel-4.iso] is based on Kubuntu 12.04 LTS.
  
===25 Nov 2007: first beta release===
 
  
http://community.elphel.com/files/Elphel-Software-Kit.iso
+
=If you are new to GNU / Linux=
 +
Many forums and wikis are available in many languages to help you to install and use Ubuntu. Ex: http://www.google.com/search?q=forum+ubuntu (you can add "&hl=fr" or any language code to the URL)
  
* beta DVD to be tested by developers and some of our wiki users
+
Most instructions below are commands that you need to enter in the in the terminal window. For the lines that do not end with "\" sign you just copy them one-by-one and paste in the terminal window (in KDE it is Konsole in the "System" menu). For pasting you '''can not''' use <cntrl-V> - you need to '''right-click in the terminal window and select "Paste"''' from the drop-down context menu. Alternatively you can use '''the middle mouse button''' to both copy (drag while middle mouse pressed) and paste - click it in the console window.
  
 +
Character "'''\'''" at the end of the line means continuation, so you can copy the whole block of text where each line but the very last ends with "\" and paste them together.
  
==DVD content:==
+
Many of the commands start with "'''sudo'''" - first time system will ask you for your user password that you enter without any starts (provided you have administrative privileges).
  
Our DVD differs from the standard kubuntu distribution in several way:
+
If you get some problems it is very useful to copy the error message that system outputs (avoiding anything specific to your particular installation - like user directories names) and paste them into the search box of you browser.
  
* It includes all software needed for use of our cameras.
+
=User software=
* We have added some video editing & images processing software.
 
* It includes software for software and hardware developers.
 
* Some configuration files are modified to suit our needs.
 
* We have added some OpenSource applications for Windows (R).
 
  
===User software===
+
Some software need to be patched and recompiled even if they exist in Ubuntu software repositories, some softwares are not yet packaged in Ubuntu, so you have to compile them from sources also. We try to push our software patches to the mainstream applications, but it take time and is not always possible. For Ubuntu users some packages can be downloaded and upgraded using our [https://launchpad.net/~elphel/+archive/ppa ppa on launchpad].
  
For users we provide:
+
sudo add-apt-repository "deb http://ppa.launchpad.net/elphel/ppa/ubuntu natty main"
 +
sudo apt-get update
  
* Flashit icon on the desktop to reflash our cameras with the latest firmware.
+
==Mplayer - Ubuntu 9.10 or later==
* Firefox web browser with mplayer and genres plugins to provide live view of our cameras.
+
'''Kubuntu 9.10 includes MPlayer that is working with Elphel camera "out of the box"'''
* LAMP based DVR to provide a simple way to record video and audio from our cameras.
+
So for (K)Ubuntu 9.10 you just need to install
 +
sudo apt-get install mplayer-nogui mplayer gecko-mediaplayer
  
===Video Applications:===
+
===Mplayer - installation for (K)Ubuntu older than 9.10 release ===
* mplayer
 
* genres
 
* VLC
 
* gstreamer
 
* cinerella
 
* cinepaint
 
* ImageMagick
 
* gocr
 
* mjpegtools
 
* avifie-utils
 
* ElphelSrv
 
* DVR software
 
  
===Elphel SDK===
+
With the previous verions MPlayer has to be patched and recompiled, following instructions document how to do it on (K)Ubuntu or Debian based workstation.
  
We provide our clients with a complete SDK to develop software, FPGA code and even to redesign the hardware.
+
Install gecko-mediaplayer before compiling/installing MPlayer, if you do it later it will install non-patched version of MPlayer
  
IDE:
+
sudo apt-get install gecko-mediaplayer
* Eclipse IDE
 
* VDT verilog plugin for Eclipse IDE
 
  
CAD:
 
* Qcad
 
* Varicad (demo)
 
* Kicad
 
  
FPGA:
+
First install some compilation dependencies, mainly libraries...
* iverilog
 
* GNURadio
 
* GTKWave
 
  
Other:
+
<!-- sudo apt-get install build-essential debhelper libncurses5-dev libesd0-dev liblircclient-dev libgtk2.0-dev \
* dash shell is replaced with bash to comply with Axis SDK
+
libvorbis-dev libsdl1.2-dev sharutils libasound2-dev liblzo-dev gawk libjpeg62-dev libaudiofile-dev \
* LAMP preinstalled on the DVD
+
libsmbclient-dev libxv-dev libpng3-dev libgif-dev libcdparanoia0-dev libxvidcore4-dev libdv-dev \
* GNUeda
+
liblivemedia-dev libfreetype6-dev em8300-headers libgl1-mesa-dev libdvdread-dev libdts-dev libtheora-dev \
* Gerbview
+
libglu-dev libartsc0-dev libfontconfig-dev libxxf86dga-dev libxinerama-dev libxxf86vm-dev \
 +
libxvmc-dev libggi2-dev libmpcdec-dev libspeex-dev libfribidi-dev libfaac-dev  libaa1-dev libcaca-dev \
 +
libx264-dev  libpulse-dev libmad0-dev ladspa-sdk libdbus-glib-1-dev libaudio-dev liblzo2-dev libdvdnav-dev \
 +
libopenal-dev libjack-dev libtwolame-dev libsvga1-dev libenca-dev libmp3lame-dev
  
===OpenSource applications for Windows (R)===
+
'''If you are under Ubuntu 8.10 (Intrepid) replace liblame-dev at the end by libmp3lame-dev''' -->
  
If you insert our DVD into a windows computer you will be able to install OpenSource software to use with our camera:
+
sudo apt-get install build-essential debhelper libncurses5-dev libesd0-dev liblircclient-dev libgtk2.0-dev \
 +
libvorbis-dev libsdl1.2-dev sharutils libasound2-dev gawk libjpeg62-dev libaudiofile-dev \
 +
libsmbclient-dev libxv-dev libpng12-dev libgif-dev libcdparanoia-dev libdv4-dev \
 +
liblivemedia-dev libfreetype6-dev libgl1-mesa-dev libdvdread-dev libdts-dev libtheora-dev \
 +
libglu1-mesa-dev libfontconfig-dev libxxf86dga-dev libxinerama-dev libxxf86vm-dev \
 +
libxvmc-dev libggi2-dev libmpcdec-dev libspeex-dev libfribidi-dev libfaac-dev  libaa1-dev libcaca-dev \
 +
libx264-dev  libpulse-dev libmad0-dev ladspa-sdk libdbus-glib-1-dev libaudio-dev liblzo2-dev libdvdnav-dev \
 +
libopenal-dev libjack-dev libtwolame-dev libsvga1-dev libenca-dev libmp3lame-dev
  
* Mozills FireFox
 
* mplayer-win
 
* VLC
 
  
 +
<!--
 +
Get the MPlayer ubuntu source package:
 +
apt-get source mplayer
  
===Special configurations===
+
patch the sources and compile:
 +
cd mplayer-1.0~rc2/
 +
sed s/\#define\ MAX_RTP_FRAME_SIZE\ 50000/\#define\ MAX_RTP_FRAME_SIZE\ 5000000/g \
 +
libmpdemux/demux_rtp.cpp > libmpdemux/demux_rtp.cpp_
 +
mv libmpdemux/demux_rtp.cpp_ libmpdemux/demux_rtp.cpp
 +
sudo dpkg-buildpackage
 +
cd ..
  
* ...
+
install mplayer package:
* ...
+
sudo dpkg  --install mplayer_1.0~rc2-0ubuntu*.deb
 +
-->
 +
Current MPlayer code is capable of working with full resolution video produced by Elphel cameras. That is not yet true for the MPlayer packages in Ubuntu repositories, so you'll have to obtain the source code from MPlayer recommended source - their Subversion (SVN) source. First you need to install Subversion itself:
 +
sudo apt-get install subversion
 +
Now create a download directory and get MPlayer source:
 +
mkdir download; cd download
 +
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
 +
Configure, compile and prepare Debian package from that source (will take some time):
 +
cd mplayer
 +
sudo dpkg-buildpackage
 +
Occasionally dpkg-buildpackage fails to build, try the comon ./configure, make, make install way then.
  
===How to build latest software version for LiveCD(i.e FireFox)===
+
Now uninstall the default Ubuntu's mplayer and mencoder & install the created package:
 +
sudo apt-get remove mplayer mencoder mplayer-nogui
 +
cd ..
 +
sudo dpkg  --install mplayer_1.0svn*.deb
  
To compile Firefox for a specific version of Knoppix requires a system with fixed versions
+
===MPlayer - testing with Elphel camera ===
the system libraries, utilities, etc. then identical versions used in LiveCD / DVD Knoppix.
+
You should be able now to play videos with up to 5MB frames (highest quality 5MPix images are around 1 MB) as a multicast or unicast video stream. (the streamer in the camera should be ENABLED)
Another option is to boot from a LiveCD and compile the required packages. Booting from LiveCD,
+
mplayer rtsp://192.168.0.9:554 -vo x11 -fs -zoom
you can directly on the free hardware, or using Virtual Machine. The first option is unacceptable
 
if it will be used to compile computer, restart which is not desirable and disconnection. In this case, you may use the virtual machine. Alternatively, perhaps using VMware Workstation for virtual machines (see http://vmware.com). In addition to the LiveCD version of the steps in setting up the same environment. Basic requirements and documentation for the compilation FireFox http://www.mozilla.org/build/ located on the site. When downloading from LiveCD need to create the swapfile, tons by the compiler uses intensively pyamyat and exhaustion free memory lead to the computer freezes. Let's start
 
  
1. Boot from LiveCD
+
''Update 10/09/2009: In (K)Ubuntu 9.10 (Karmic Koala) repository the '''50,000 bytes limit on the frame size''' is fixed, but unfortunately the [https://bugs.launchpad.net/ubuntu/+source/mplayer/+bug/296488 other one -'''frame width limit of 2048 pixels'''] (submitted to MPlayer SVN on May, 5, 2009) - is not''--[[User:Andrey.filippov|Andrey.filippov]] 19:03, 9 October 2009 (CDT)
  
2. Mount physical partition on the hard drive (virtual or real). Here, and as an example to be used hda1:
+
The first (50,000) makes you picture break after the first 50,000 bytes (only top is shown), the second (current for the 9.10) makes MPlayer to report fatal error. So you still have to use MPlayer SVN to have the full resolution from Elphel cameras.
  
  knoppix$ su
+
Additionally, to make MPlayer work inside the web page you need to specify video output as "x11" in the [http://howto.wikia.com/wiki/Howto_configure_MPlayer MPlayer config file] - add a line
  knoppix# mount /dev/hda1 /mnt/hda1
+
vo="x11"
 +
To ~/.mplayer/config file
  
3. Create swapfile and configure it with the following commands:
+
=For developers=
 +
''Following was written for (K)Ubuntu 9.10 and earlier, it also works with 10.04, please see revision-specific notes.''
  
  knoppix# cd /mnt/hda1
+
==Adding universe and multiverse sources==
  knoppix# dd if=/dev/zero of=swapfile bs=1024 count=1024M
+
Please follow this howto for adding universe and multiverse sources.
  knoppix# mkswap swapfile
 
  knoppix# swapon swapfile
 
  
Swapfile size is determined by the availability of free physical memory. For example, when downloading the LiveCD Knoppix in a virtual machine - physical limited to 160 MB of memory and built swapfile size 1 GB
+
https://help.ubuntu.com/community/Repositories/Ubuntu
  
4.Load distribution (source code) Firefox, untar it on mounted a physical partition:
+
or
  
  knoppix$ cd /mnt/hda1
+
https://help.ubuntu.com/community/Repositories/Kubuntu
  knoppix$ mkdir work
 
  knoppix$ cd work
 
  knoppix$ wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.9/source/firefox-2.0.0.9-source.tar.bz2
 
  knoppix$ tar -xjf firefox-2.0.0.9-source.tar.bz2
 
  
5. Now configure and compile a package. Default packages are compiled on the ''/usr/local''. If you want a different location after compiling the binaries - use option ''--prefix''. For example, the generation Firefox Makefile to build the facilities and binary files in a tree ''/opt'' performed as follows:
+
==Install needed packages==
 +
Minimal packages:
 +
sudo apt-get install cvs build-essential autoconf flex byacc bison libglib2.0-dev tcl gettext libncurses5-dev patch zlib1g-dev nfs-kernel-server bash xutils-dev
 +
Suggested packages:
 +
sudo apt-get install kinfocenter minicom firefox graphviz doxygen ctags cervisia php5 php5-cli xchat ssh kompare git-core
  
  knoppix$ cd mozilla
+
==Configure your NFS server==
  knoppix$ ./configure --prefix=/opt --enable-application=browser
 
  knoppix$ make
 
  knoppix$ sudo make install
 
  
6. After compiling and installing the compiled package (in our example, it installed in ''/opt'') remain the only archive directory tree compiled package (''/opt/firefox2.0.0.9'') and received an archive of binary files used to build our LiveCD:
+
Let's say you want to configure an NFS server on your machine and your IP address is '''192.168.0.15'''.
  
  knoppix$ tar -czf firefox.tgz /opt/firefox2.0.0.9
+
<!--Edit /etc/exports file with your favorite editor. Here I use nano.
 +
sudo nano -w /etc/exports
 +
alternatively you may edit the same file with kate
 +
Those who know how to use nano will figure that out themselves --[[User:Andrey.filippov|Andrey.filippov]] 18:09, 23 May 2009 (CDT)
 +
-->
 +
Modify the configuration file:
 +
kdesudo kate /etc/exports
 +
Add at the end of the file:
 +
/nfs            192.168.0.0/255.255.0.0(rw,sync,no_root_squash,no_subtree_check)
 +
save the file.
  
The resulting archive (if we used a virtual machine) on the ftp put to host or , if booted directly with LiveCD, rebooting in the working operating system and hunted with his ''/dev/hda1/work''.
+
If it does not yet exist make /nfs directory and make it world writable to make it possible to write logs from the camera.
 +
sudo mkdir /nfs
 +
sudo chmod 777 -R /nfs
  
===Sources & packages===
+
And finally export the filesystem.
 +
sudo exportfs -a
  
Here is the list of additional debian/ubuntu packages and sources used on our DVD:
+
(Had to reboot after in ubuntu 14.04)
  
AXIS SDK
+
== Installation of GCC Compiler kit for Axis ETRAX processor ==
http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist_1.64-1_i386.deb
+
=== Automatic Installation ((K)Ubuntu 11.04 Natty Narwhal)===
http://www.axis.com/ftp/pub/axis/dev/soft_dist/R2_10/devboard-R2_10.tar.gz
+
1.
 +
sudo add-apt-repository "deb http://ppa.launchpad.net/elphel/ppa/ubuntu natty main"
 +
 +
(The line above is equivalent to adding the following lines to your sources.list ('''sudo kate /etc/apt/sources.list''')):
 +
deb http://ppa.launchpad.net/elphel/ppa/ubuntu natty main
 +
deb-src http://ppa.launchpad.net/elphel/ppa/ubuntu natty main
 +
 
 +
2. (in case of) ...public key is not available...
 +
 
 +
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6050780EC7A72F76
 +
 
 +
3.
 +
sudo apt-get update
 +
sudo apt-get install cris-dist
 +
 
 +
=== Manual Installation ===
 +
====Downloading and unpacking  gcc-cris====
 +
Download and install Cris-GCC compiler. It is needed to compile C and C++ programs for the CPU used in Elphel cameras - [http://en.wikipedia.org/wiki/ETRAX_CRIS Axis ETRAX FS] :
 +
mkdir -p ~/Downloads/axis ; cd ~/Downloads/axis
 +
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-linux-headers-1.64.tar.gz 
 +
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-linux-headersv32-1.64.tar.gz 
 +
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-glibc-1.64.tar.gz
 +
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-1.64.tar.gz
 +
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-1.64-1--1.64-2.patch
 +
tar zxvf cris-dist-1.64.tar.gz
 +
cd cris-dist-1.64/
 +
tar zxvf ../cris-dist-linux-headers-1.64.tar.gz                               
 +
tar zxvf ../cris-dist-linux-headersv32-1.64.tar.gz                           
 +
tar zxvf ../cris-dist-glibc-1.64.tar.gz
 +
patch -p0 < ../cris-dist-1.64-1--1.64-2.patch
 +
 
 +
==== Compiling gcc-cris ====
 +
Now you may proceed with compiling gcc-cris (takes some time):
 +
                                       
 +
sudo ./install-cris-tools
 +
answer by default (enter, enter, ...)
 +
 
 +
<!--
 +
Don't forget to export the path to the cris-compiler - the defaul location is /usr/local/cris, as example
 +
 
 +
tobias@MoonbaseAlphaOne:~$ export PATH=$PATH:/usr/local/cris/bin
 +
 
 +
If everything worked out well, you can check the compiler version with
 +
 
 +
gcc-cris --version
 +
 
 +
Which should result in an output like this one (example, might vary with version)
 +
 
 +
cris-axis-elf-gcc (GCC) 3.2.1 Axis release R64/1.64
 +
Copyright (C) 2002 Free Software Foundation, Inc.
 +
This is free software; see the source for copying conditions.  There is NO
 +
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 +
-->
 +
 
 +
== Build Elphel Software==
 +
Get the [http://sourceforge.net/projects/elphel/files/elphel353-8/install-8.0-fromcvs/elphel353_80_install_from_cvs.sh.tar.gz/download script]. Unpack & Launch.
 +
 
 +
 
 +
== Installation of Kdevelop 3.5 ==
 +
''note: Newer KDevelop 4 does not work with Elphel software''
 +
==== pre (K)Ubuntu 9.10 ====
 +
sudo apt-get install kdevelop
 +
 
 +
==== (K)Ubuntu 9.10 (Karmic), 10.4 (Lucid) ====
 +
see [[KDevelop#Installation_of_KDevelop_3.5_on_.28K.29Ubuntu_9.10|Installation of KDevelop 3.5 on (K)Ubuntu 9.10]]
 +
 
 +
== Install Icarus Verilog and GTKWave ==
 +
(If you plan to develop FPGA code or at least look how it works)
 +
 
 +
GTKWave is OK from repository:
 +
sudo apt-get install gtkwave
 +
 
 +
But unfortunately Icarus Verilog (package verilog) is compiled without needed support for compressed output format, so you'll have to compile it
 +
cd ~/Downloads
 +
wget "ftp://ftp.icarus.com/pub/eda/verilog/v0.9/verilog-0.9.3.tar.gz"
 +
tar zxvf verilog-0.9.3.tar.gz
 +
cd verilog-0.9.3/
 +
./configure
 +
make
 +
sudo make install
 +
 
 +
== Installing Xilinx WebPack (to be moved to a separate page, just a link here)==
 +
If you plan to compile the FPGA code from the source code you will need to install appropriate software from the FPGA manufacturer web site. This is proprietary (and non-free) software provided by [http://www.xilinx.com Xilinx] free of charge. This software is called the [http://www.xilinx.com/tools/webpack.htm ISE WebPACK] and you may download it (currently some 2.2GB) after registering at Xilinx web site. Currently tested version is 10.1.03, we'll try to update our code when Xilinx will release the new version of their software.
 +
 
 +
You will also need that software if you would like to simulate the FPGA functionality. Elphel camera FPGA code (written in Verilog HDL) is  licensed under GNU GPLv3, simulator and waveform viewer (see below) are also Free Software, but there are a few Verilog models of some primitives of Xilinx FPGA that are not and can be only obtained from Xilinx as a part of their unisims library. For simulation we use small subset of the unisims library components and only for functional simulation so it will probably make sense to re-write those primitives models so the 2.2 GB distribution will not be needed to extract just few kilobytes of required source code.
 +
 
 +
Such independent re-implementation will help us to solve another problem - we have to patch the Xilinx library components to make them work correctly with our code and the simulator we use and currently each Xilinx library update breaks our patches.
  
Elphel's VDT plugin for Eclipse
+
When you will build Elphel software (as described later) the installation script will try to locate Xilinx software on your computer and patch a copy of unisims library. If you'll install Xilinx WebPack after building the camera software - you'll need to navigate to ''fpga'' subdirectory of the source tree and execute
http://sourceforge.net/project/showfiles.php?group_id=105686&package_id=184538
+
make clean ; make
 +
It is described in file ''README.simulation'' in that subdirectory.
  
Another Verilog & VHDL editor for Eclipse
 
http://sourceforge.net/project/showfiles.php?group_id=103963
 
  
Icarus Verilog
+
There are additional steps required for the Xilinx WebPACK installation if you have a 64-bit GNU/Linux operation system. The next command line detects if you are running on 64 bit version of GNU/Linux and conditionally installs '''ia64-libs'''. That library is needed if you'll install Xilinx WebPack software (Xilinx does not allow to use 64-bit programs in their free for download software and the provided installation script does not install 32-bit version on its own). There is [http://ubuntuforums.org/showthread.php?t=203459 another trick] you'll need to be aware of if you are using 32-bit Xilinx WebPack on a 64-bit GNU/Linux system.
ftp://ftp.icarus.com/pub/eda/verilog/snapshots/verilog-20070608.tar.gz
+
if [ `uname -m` = "x86_64" ] ; then sudo apt-get install ia32-libs ; fi
  
GTKWave
+
==Installation of the source code of Elphel camera software==
http://home.nc.rr.com/gtkwave/gtkwave-3.0.29.tar.gz
 
  
MPlayer (patched)
+
You may install Elphel source code by either of the two methods. Either from the CVS (the most current code) and form the tarball files.
http://dfn.dl.sourceforge.net/sourceforge/elphel/mplayer_1.0pre7-elphel-2_i386.deb
+
===Installation from the CVS===
  
LIVES
+
Get [http://downloads.sourceforge.net/elphel/elphel353_80_install_from_cvs.sh.tar.gz elphel353_80_install_from_cvs.sh] open archive that contains the shell script and execute it. It is recommended that you create subdirectory in your home directory, i.e. "elphel_projects", move and execute elphel353_80_install_from_cvs.sh script there. Directory "distfiles" will be created there and used as a cache for software archives that will be downloaded during installation.
ftp://ftp-mirror.internap.com/pub/www.getdeb.net/li/lives_0.9.8.5-1~getdeb1_i386.deb
 
  
Kicad
+
mkdir -p ~/elphel_projects; cd ~/elphel_projects
http://iut-tice.ujf-grenoble.fr/cao/kicad-2007-05-25.tgz
+
wget "http://downloads.sourceforge.net/elphel/elphel353_80_install_from_cvs.sh.tar.gz"
 +
tar zxvf elphel353_80_install_from_cvs.sh.tar.gz
 +
./elphel353_80_install_from_cvs.sh
  
==Remastering the DVD:==
+
===Installation from the tarball (release file)===
 +
http://sourceforge.net/projects/elphel
  
Our distribution is based on Kubuntu GNU/Linux. You can remaster it from Live session with an external hard-drive or after installing our base distribution on your computer. From here I am assuming it's installed and you have sufficient space (~6 GO).
+
* get one of the elphel353-8.0.* releases
 +
* decompress the archive
 +
* execute the ./install_elphel script
 +
./install_elphel
  
So here is the modification process:
+
There will be created a file build.log in the top installation directory. If you get any installation problems you can compress that file and email it to Elphel support.
  
 +
At the end of installation the script will generate a list of all the files in the target (camera) file system that are to be installed and compares it against the contents of the file ''target.list'' that is included in the distribution. If there are any differences -- they will be reported (there should be none). If there are some missing files it is likely that something failed to install correctly.
  
===prepare the environment:===
+
After the installation will be completed successfully you may want to execute the following command in the top installation directory (the one that has apps, configure-files, ... subdirectories)
sudo su
+
  ./prep_kdevelop.php
cd
 
mount /media/cdrom
 
mkdir remaster-root remaster-iso  remaster-new-files tmp
 
cp -R /media/cdrom/* remaster-iso
 
mount -t squashfs -o loop,ro remaster-iso/casper/filesystem.squashfs tmp
 
  cp -R tmp/* remaster-root
 
umount tmp
 
rmdir tmp
 
  
===modify the distribution:===
+
That will create ''elphel353.kdevelop'' - a project file for KDevelop IDE (version 3.5.x), you can use it as described here - [[KDevelop]]
mount --bind /proc remaster-root/proc
 
mount --bind /sys remaster-root/sys
 
  mount --bind /dev remaster-root/dev
 
chroot remaster-root
 
#install your software, remove unneeded software modify configuration files, ...
 
apt-get remove nano
 
apt-get install vim
 
apt-get clean
 
exit
 
umount remaster-root/dev
 
umount remaster-root/sys
 
umount remaster-root/proc
 
  
===rebuild the DVD:===
 
chroot . dpkg-query -W --showformat='${Package} ${Version}\n' > ../remaster-iso/casper/filesystem.manifest
 
chroot . dpkg-query -W --showformat='${Package} ${Version}\n' > ../remaster-iso/casper/filesystem.manifest-desktop
 
mksquashfs .  ../remaster-iso/casper/filesystem.squashfs
 
cd ../remaster-iso
 
find . -type f -print0 |xargs -0 md5sum |sudo tee md5sum.txt
 
mkisofs -o ../remaster-new-files/Elphel-Software-Kit.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -r -V "Elphel Software Kit" -cache-inodes -J -l .
 
  
 +
----
  
That's all :) you have a new DVD image in /root/remaster-new-files/Elphel-Software-Kit.iso
+
== ImageJ and Elphel plugins for imageJ ==
 +
ImageJ is a powerful open source image processing package, written in Java. There are plugins to work with Elphel cameras, the most universal one allows opening JP46 files (stored on a file system or downloaded directly from the camera). This plugin reads meta data from the image and un-applies in-camera non-linear conversion resulting in the linearized image, where each pixel is represented by a floating point value proportional to the number of photons that were detected in that pixel.
  
==TODO:==
+
It is a very useful tool to do quantitative analysis of the camera images.
  
* Do a better network detection/setup what I did (look to /etc/rc.local)
+
* Download plugins:
* Check and make completely work the DVR
+
git clone https://git.elphel.com/Elphel/imagej-elphel.git
* Repair the grub message on boot of the LiveDVD
+
git clone --branch v1.1 https://git.elphel.com/Elphel/imagej-elphel.git (for Eyesis4Pi393)
* Check all functionalities that should be user-friendly.
+
* Download [http://www.eclipse.org/downloads/ Eclipse IDE for Java EE Developers] or any other with Maven integration
 +
* Edit ''eclipse.ini'':
 +
-clean -startup
 +
...
 +
-XX:MaxPermSize=24576m
 +
-Xms2048m
 +
-Xmx24576m
 +
* Kubuntu 18.04 might need:
 +
https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty
 +
* From Eclipse:
 +
1. File -> Import -> Existing Maven Projects -> set imagej-elphel as Root Directory - a project will appear in the project list -> Finish
 +
    Importing will take some time
 
   
 
   
==Ideas:==
+
2. Create Run Configuration:
 +
    a. Run Configurations -> select Java Application -> New Launch Configuration -> find the needed plugin class -> Run
 +
        Classes:
 +
        * '''Aberration_Calibration''' - work with calibration data, regenerate kernels, etc.
 +
        * '''Eyesis_correction''' - postprocess images.
 +
    b. It will launch ''ImageJ & Aberration_Calibration plugin''
 +
    c. Other plugins are launched from ImageJ window from Plugins
  
This DVD is based on KUbuntu 7.04. I will work on upgrading our distribution.  
+
<!--
 +
=== ImageJ installation ===
 +
You may download ImageJ bundled with Java from the [http://rsbweb.nih.gov/ij/download.html download page]:
  
I think it should be useful to debianize all our software (ElphelOgm, GenRes, MPlayer, ...) Like what we will be able to use Launchpad PPA https://edge.launchpad.net/~elphel-live to build our Ubuntu packages as i tried on : https://edge.launchpad.net/~polto/+archive I have here a working MPlayer what can be installed by Sinaptic (the user-friendly way) just after adding my personal package repository to your sources.
+
==== With 32-bit Java ====
 +
cd ~/Downloads; wget "http://rsbweb.nih.gov/ij/download/linux/ij147-linux32.zip" ; unzip ij147-linux32.zip
  
So any Ubuntu user will be able to upgrade to our MPlayer, install ElphelSrv, ...
+
cd ~/Downloads; wget "http://rsbweb.nih.gov/ij/download/linux/ij149-linux64.zip" ; unzip ij149-linux64.zip
  
After what we can make some theme packages with backgrounds etc and generate a DVD with everything installed.
+
'''If any of the two direct download links above are broken, please use the [http://rsbweb.nih.gov/ij/download.html] to get the new ImageJ version'''
  
==links:==
+
===Running ImageJ ===
 +
There is "run" command the newly crated directory. You may start ImageJ with the following command:
 +
/Downloads/ImageJ/run
 +
That command allows Java to use 512M of system memory. If you need more you can change "512" to say "1024" in a single-line "run" script. If the run command is started from the command prompt, you'll be able to see some debug output - either from existent plugins or from your own ones. It is also very useful to see any error diagnostic output.
  
- [http://www.ubuntu.com/ ubuntu]
+
=== Installation of Elphel plugins for ImageJ ===
 +
Elphel plugins are available in Elphel project page Git repository. To use it you first need to install git (if it was not already done):
 +
sudo apt-get install git-core
  
- [http://www.opencores.com/ opencores]
+
Then clone the repository - directly to the ImageJ plugins directory. Provided you used the same directory for ImageJ as written above:
 +
cd  ~/Downloads/ImageJ/plugins
 +
old url:  git clone git://elphel.git.sourceforge.net/gitroot/elphel/ImageJ-Elphel
 +
git clone git://git.code.sf.net/p/elphel/ImageJ-Elphel
  
- [http://www.openhardware.de/ openhardware.de]
+
=== Updating Elphel plugins for ImageJ ===
 +
Later, when you'll need to update your files from the repository you will need another command:
 +
cd  ~/Downloads/ImageJ/plugins/ImageJ-Elphel
 +
git pull
 +
=== Running Elphel plugin for ImageJ ===
 +
When you just install Elphel plugins you need to select
 +
~/Downloads/ImageJ/plugins/ImageJ-Elphel/JP46_Reader_camera.java
 +
That command will do exactly as it is named - first compile that source file to the Java bytecode, then execute it. Next time after you close and re-start ImageJ there will be a submenu in Plugins: Plugins->ImageJ-Elphel and JP46_Reader_camera command there,
  
- [http://www.olimex.com/dev/index.html Olimex hardware can be added to Elphel 353]
+
When you'll update the source files, you 'll need to re-run "Compile and run...". meanwhile just use the item in Plugins->ImageJ-Elphel menu.
 +
-->
  
- [http://kubuntu.free.fr/blog/index.php/2007/06/11/222-logiciels-d-electronique-sous-linux-ubuntu-feisty Electronics under Ubuntu]
+
[[Category:353]]

Latest revision as of 13:31, 4 June 2018

About

This page is a simple howto for running Elphel software on (K)Ubuntu GNU/Linux.

You can download this GNU/Linux distribution freely from http://www.kubuntu.org/

A Live ISO image with almost all the packages pre-installed (except Elphel camera source code and Xilinx ISE WebPack) is available for downloading from here:


If you are new to GNU / Linux

Many forums and wikis are available in many languages to help you to install and use Ubuntu. Ex: http://www.google.com/search?q=forum+ubuntu (you can add "&hl=fr" or any language code to the URL)

Most instructions below are commands that you need to enter in the in the terminal window. For the lines that do not end with "\" sign you just copy them one-by-one and paste in the terminal window (in KDE it is Konsole in the "System" menu). For pasting you can not use <cntrl-V> - you need to right-click in the terminal window and select "Paste" from the drop-down context menu. Alternatively you can use the middle mouse button to both copy (drag while middle mouse pressed) and paste - click it in the console window.

Character "\" at the end of the line means continuation, so you can copy the whole block of text where each line but the very last ends with "\" and paste them together.

Many of the commands start with "sudo" - first time system will ask you for your user password that you enter without any starts (provided you have administrative privileges).

If you get some problems it is very useful to copy the error message that system outputs (avoiding anything specific to your particular installation - like user directories names) and paste them into the search box of you browser.

User software

Some software need to be patched and recompiled even if they exist in Ubuntu software repositories, some softwares are not yet packaged in Ubuntu, so you have to compile them from sources also. We try to push our software patches to the mainstream applications, but it take time and is not always possible. For Ubuntu users some packages can be downloaded and upgraded using our ppa on launchpad.

sudo add-apt-repository "deb http://ppa.launchpad.net/elphel/ppa/ubuntu natty main"
sudo apt-get update

Mplayer - Ubuntu 9.10 or later

Kubuntu 9.10 includes MPlayer that is working with Elphel camera "out of the box" So for (K)Ubuntu 9.10 you just need to install

sudo apt-get install mplayer-nogui mplayer gecko-mediaplayer

Mplayer - installation for (K)Ubuntu older than 9.10 release

With the previous verions MPlayer has to be patched and recompiled, following instructions document how to do it on (K)Ubuntu or Debian based workstation.

Install gecko-mediaplayer before compiling/installing MPlayer, if you do it later it will install non-patched version of MPlayer

sudo apt-get install gecko-mediaplayer


First install some compilation dependencies, mainly libraries...


sudo apt-get install build-essential debhelper libncurses5-dev libesd0-dev liblircclient-dev libgtk2.0-dev \
libvorbis-dev libsdl1.2-dev sharutils libasound2-dev gawk libjpeg62-dev libaudiofile-dev \
libsmbclient-dev libxv-dev libpng12-dev libgif-dev libcdparanoia-dev libdv4-dev \
liblivemedia-dev libfreetype6-dev libgl1-mesa-dev libdvdread-dev libdts-dev libtheora-dev \
libglu1-mesa-dev libfontconfig-dev libxxf86dga-dev libxinerama-dev libxxf86vm-dev \
libxvmc-dev libggi2-dev libmpcdec-dev libspeex-dev libfribidi-dev libfaac-dev  libaa1-dev libcaca-dev \
libx264-dev  libpulse-dev libmad0-dev ladspa-sdk libdbus-glib-1-dev libaudio-dev liblzo2-dev libdvdnav-dev \
libopenal-dev libjack-dev libtwolame-dev libsvga1-dev libenca-dev libmp3lame-dev


Current MPlayer code is capable of working with full resolution video produced by Elphel cameras. That is not yet true for the MPlayer packages in Ubuntu repositories, so you'll have to obtain the source code from MPlayer recommended source - their Subversion (SVN) source. First you need to install Subversion itself:

sudo apt-get install subversion

Now create a download directory and get MPlayer source:

mkdir download; cd download
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

Configure, compile and prepare Debian package from that source (will take some time):

cd mplayer
sudo dpkg-buildpackage 

Occasionally dpkg-buildpackage fails to build, try the comon ./configure, make, make install way then.

Now uninstall the default Ubuntu's mplayer and mencoder & install the created package:

sudo apt-get remove mplayer mencoder mplayer-nogui
cd ..
sudo dpkg  --install mplayer_1.0svn*.deb

MPlayer - testing with Elphel camera

You should be able now to play videos with up to 5MB frames (highest quality 5MPix images are around 1 MB) as a multicast or unicast video stream. (the streamer in the camera should be ENABLED)

mplayer rtsp://192.168.0.9:554 -vo x11 -fs -zoom

Update 10/09/2009: In (K)Ubuntu 9.10 (Karmic Koala) repository the 50,000 bytes limit on the frame size is fixed, but unfortunately the other one -frame width limit of 2048 pixels (submitted to MPlayer SVN on May, 5, 2009) - is not--Andrey.filippov 19:03, 9 October 2009 (CDT)

The first (50,000) makes you picture break after the first 50,000 bytes (only top is shown), the second (current for the 9.10) makes MPlayer to report fatal error. So you still have to use MPlayer SVN to have the full resolution from Elphel cameras.

Additionally, to make MPlayer work inside the web page you need to specify video output as "x11" in the MPlayer config file - add a line

vo="x11"

To ~/.mplayer/config file

For developers

Following was written for (K)Ubuntu 9.10 and earlier, it also works with 10.04, please see revision-specific notes.

Adding universe and multiverse sources

Please follow this howto for adding universe and multiverse sources.

https://help.ubuntu.com/community/Repositories/Ubuntu

or

https://help.ubuntu.com/community/Repositories/Kubuntu

Install needed packages

Minimal packages:

sudo apt-get install cvs build-essential autoconf flex byacc bison libglib2.0-dev tcl gettext libncurses5-dev patch zlib1g-dev nfs-kernel-server bash xutils-dev

Suggested packages:

sudo apt-get install kinfocenter minicom firefox graphviz doxygen ctags cervisia php5 php5-cli xchat ssh kompare git-core

Configure your NFS server

Let's say you want to configure an NFS server on your machine and your IP address is 192.168.0.15.

Modify the configuration file:

kdesudo kate /etc/exports

Add at the end of the file:

/nfs            192.168.0.0/255.255.0.0(rw,sync,no_root_squash,no_subtree_check)

save the file.

If it does not yet exist make /nfs directory and make it world writable to make it possible to write logs from the camera.

sudo mkdir /nfs
sudo chmod 777 -R /nfs

And finally export the filesystem.

sudo exportfs -a

(Had to reboot after in ubuntu 14.04)

Installation of GCC Compiler kit for Axis ETRAX processor

Automatic Installation ((K)Ubuntu 11.04 Natty Narwhal)

1.

sudo add-apt-repository "deb http://ppa.launchpad.net/elphel/ppa/ubuntu natty main"

(The line above is equivalent to adding the following lines to your sources.list (sudo kate /etc/apt/sources.list)):
deb http://ppa.launchpad.net/elphel/ppa/ubuntu natty main 
deb-src http://ppa.launchpad.net/elphel/ppa/ubuntu natty main 

2. (in case of) ...public key is not available...

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6050780EC7A72F76

3.

sudo apt-get update
sudo apt-get install cris-dist

Manual Installation

Downloading and unpacking gcc-cris

Download and install Cris-GCC compiler. It is needed to compile C and C++ programs for the CPU used in Elphel cameras - Axis ETRAX FS :

mkdir -p ~/Downloads/axis ; cd ~/Downloads/axis
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-linux-headers-1.64.tar.gz   
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-linux-headersv32-1.64.tar.gz  
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-glibc-1.64.tar.gz 
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-1.64.tar.gz
wget http://www.axis.com/ftp/pub/axis/tools/cris/compiler-kit/cris-dist-1.64-1--1.64-2.patch
tar zxvf cris-dist-1.64.tar.gz
cd cris-dist-1.64/
tar zxvf ../cris-dist-linux-headers-1.64.tar.gz                                 
tar zxvf ../cris-dist-linux-headersv32-1.64.tar.gz                             
tar zxvf ../cris-dist-glibc-1.64.tar.gz
patch -p0 < ../cris-dist-1.64-1--1.64-2.patch

Compiling gcc-cris

Now you may proceed with compiling gcc-cris (takes some time):

sudo ./install-cris-tools

answer by default (enter, enter, ...)


Build Elphel Software

Get the script. Unpack & Launch.


Installation of Kdevelop 3.5

note: Newer KDevelop 4 does not work with Elphel software

pre (K)Ubuntu 9.10

sudo apt-get install kdevelop

(K)Ubuntu 9.10 (Karmic), 10.4 (Lucid)

see Installation of KDevelop 3.5 on (K)Ubuntu 9.10

Install Icarus Verilog and GTKWave

(If you plan to develop FPGA code or at least look how it works)

GTKWave is OK from repository:

sudo apt-get install gtkwave

But unfortunately Icarus Verilog (package verilog) is compiled without needed support for compressed output format, so you'll have to compile it

cd ~/Downloads
wget "ftp://ftp.icarus.com/pub/eda/verilog/v0.9/verilog-0.9.3.tar.gz"
tar zxvf verilog-0.9.3.tar.gz
cd verilog-0.9.3/
./configure
make
sudo make install

Installing Xilinx WebPack (to be moved to a separate page, just a link here)

If you plan to compile the FPGA code from the source code you will need to install appropriate software from the FPGA manufacturer web site. This is proprietary (and non-free) software provided by Xilinx free of charge. This software is called the ISE WebPACK and you may download it (currently some 2.2GB) after registering at Xilinx web site. Currently tested version is 10.1.03, we'll try to update our code when Xilinx will release the new version of their software.

You will also need that software if you would like to simulate the FPGA functionality. Elphel camera FPGA code (written in Verilog HDL) is licensed under GNU GPLv3, simulator and waveform viewer (see below) are also Free Software, but there are a few Verilog models of some primitives of Xilinx FPGA that are not and can be only obtained from Xilinx as a part of their unisims library. For simulation we use small subset of the unisims library components and only for functional simulation so it will probably make sense to re-write those primitives models so the 2.2 GB distribution will not be needed to extract just few kilobytes of required source code.

Such independent re-implementation will help us to solve another problem - we have to patch the Xilinx library components to make them work correctly with our code and the simulator we use and currently each Xilinx library update breaks our patches.

When you will build Elphel software (as described later) the installation script will try to locate Xilinx software on your computer and patch a copy of unisims library. If you'll install Xilinx WebPack after building the camera software - you'll need to navigate to fpga subdirectory of the source tree and execute

make clean ; make

It is described in file README.simulation in that subdirectory.


There are additional steps required for the Xilinx WebPACK installation if you have a 64-bit GNU/Linux operation system. The next command line detects if you are running on 64 bit version of GNU/Linux and conditionally installs ia64-libs. That library is needed if you'll install Xilinx WebPack software (Xilinx does not allow to use 64-bit programs in their free for download software and the provided installation script does not install 32-bit version on its own). There is another trick you'll need to be aware of if you are using 32-bit Xilinx WebPack on a 64-bit GNU/Linux system.

if [ `uname -m` = "x86_64" ] ; then sudo apt-get install ia32-libs ; fi

Installation of the source code of Elphel camera software

You may install Elphel source code by either of the two methods. Either from the CVS (the most current code) and form the tarball files.

Installation from the CVS

Get elphel353_80_install_from_cvs.sh open archive that contains the shell script and execute it. It is recommended that you create subdirectory in your home directory, i.e. "elphel_projects", move and execute elphel353_80_install_from_cvs.sh script there. Directory "distfiles" will be created there and used as a cache for software archives that will be downloaded during installation.

mkdir -p ~/elphel_projects; cd ~/elphel_projects
wget "http://downloads.sourceforge.net/elphel/elphel353_80_install_from_cvs.sh.tar.gz"
tar zxvf elphel353_80_install_from_cvs.sh.tar.gz
./elphel353_80_install_from_cvs.sh

Installation from the tarball (release file)

http://sourceforge.net/projects/elphel

  • get one of the elphel353-8.0.* releases
  • decompress the archive
  • execute the ./install_elphel script
./install_elphel

There will be created a file build.log in the top installation directory. If you get any installation problems you can compress that file and email it to Elphel support.

At the end of installation the script will generate a list of all the files in the target (camera) file system that are to be installed and compares it against the contents of the file target.list that is included in the distribution. If there are any differences -- they will be reported (there should be none). If there are some missing files it is likely that something failed to install correctly.

After the installation will be completed successfully you may want to execute the following command in the top installation directory (the one that has apps, configure-files, ... subdirectories)

./prep_kdevelop.php

That will create elphel353.kdevelop - a project file for KDevelop IDE (version 3.5.x), you can use it as described here - KDevelop



ImageJ and Elphel plugins for imageJ

ImageJ is a powerful open source image processing package, written in Java. There are plugins to work with Elphel cameras, the most universal one allows opening JP46 files (stored on a file system or downloaded directly from the camera). This plugin reads meta data from the image and un-applies in-camera non-linear conversion resulting in the linearized image, where each pixel is represented by a floating point value proportional to the number of photons that were detected in that pixel.

It is a very useful tool to do quantitative analysis of the camera images.

  • Download plugins:
git clone https://git.elphel.com/Elphel/imagej-elphel.git
git clone --branch v1.1 https://git.elphel.com/Elphel/imagej-elphel.git (for Eyesis4Pi393)
-clean -startup
...
-XX:MaxPermSize=24576m
-Xms2048m
-Xmx24576m
  • Kubuntu 18.04 might need:
https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty
  • From Eclipse:
1. File -> Import -> Existing Maven Projects -> set imagej-elphel as Root Directory - a project will appear in the project list -> Finish
   Importing will take some time

2. Create Run Configuration:
   a. Run Configurations -> select Java Application -> New Launch Configuration -> find the needed plugin class -> Run
       Classes:
       * Aberration_Calibration - work with calibration data, regenerate kernels, etc.
       * Eyesis_correction - postprocess images.
   b. It will launch ImageJ & Aberration_Calibration plugin
   c. Other plugins are launched from ImageJ window from Plugins