ICS Embedded Architecture: Final Project Spring 2011 Harold
Bautista Hans Yeager Shannon Kesner Vaidehee Padgaonkar Video
Conferencing Across
Slide 2
Project Overview Goal: Demonstrate video conferencing across
BeagleBoards Presentation Topics o Hardware o Operating System o SW
Development o User App o Performance o Demo Timeline:
[February]Obtained Hardware and Booted OS [March] Basic Peripheral
Check-Out and Select OS [April/May] Compare User Applications Work
on Cross-Compile Resolve Audio on BeagleBoard
Slide 3
Hardware Peripherals Used a BeagleBoard-xM ($150) w/ 1GHz ARM
Cortex-A8 Also used a USB mouse ($10), USB keyboard ($10), monitor
Some webcams were plug-and-play o Logitech Quickcam o Microsoft
Lifecam Cinema Complete list of hardware components in back-up
Slide 4
Host Platform Host platform used for o Formatting and burning
images onto SD card o Validating setups (distinguish if BeagleBoard
was culprit) o Compiling code for user app and kernel Key Learnings
o Its very easy to format the wrong drive (i.e. your HDD ) o Backup
your system before any development work begins! Various options to
run Ubuntu on host platform o Dedicated machine o USB Pendrive
(16GB) o Parallels 4 (more information in back-up)
Slide 5
Cross-Compile Goal: compile C code on x86 host platform for ARM
based BeagleBoard Building a cross-toolchain for use in embedded
systems is a scary prospect, requiring iron will, days if not weeks
of effort, lots of Unix & GNU lore, and sometimes a willingness
to take dodge shortcuts. ~ Dan Kegel Author of Crosstool Building
Embedded Linux Systems, 2 nd edition, O`Reilly, 2008, pg 103
Libraries and kernel on target must match those used to build
cross-tool Cross-compile with school machine worked (only tested
for static libs) ~ Thanks for the tip, Mark! Crosstool-ng works for
dynamic & static libs on x86 host
Slide 6
Operating System Selected Ubuntu 10.10 netbook version
(relatively light-weight) Operating SystemObservations Angstrom+
Stable linux build that comes with BeagleBoard, - No GUI by default
+ Ethernet working ? Audio and video not tested Android - Unstable
on BeagleBoard + GUI available by default - Ethernet not working -
Audio continued after video for app was stopped Ubuntu+ Stable on
BeagleBoard + GUI available by default + Ethernet working +/- Video
working, but initial audio issues
Slide 7
Audio Challenges - Overview Audio in and Audio out did not seem
to work by default in Ubuntu Audio out o Bug filed on Ubuntu site:
Audio disabled by default o Mixer settings need to be modified Used
alsamixer to modify capture and playback settings Audio In is line
in and requires amplification Proved usb webcam could be used to
record voice Details in back-up
Slide 8
User Application Open-source gave flexibility that application
could be compiled for arm/Linux Java (platform-independent) so
would not have needed cross-compile Java potentially slower apps
because the byte codes get interpreted real-time We ultimately
selected Empathy for the user application Empathy supports text,
voice, video Two Google talk accounts were used for Empathy login
ApplicationComments SkypeNot open source and does not run on
arm-linux. Big Blue ButtonJava and open source. Required web
server. EkigaC and open source. Could not establish connection.
LinphoneC and open source. Audio-only for arm-linux. EmpathyC and
open source. Pre-installed with Ubuntu netbook 10.10.
Slide 9
Empathy Performance on BeagleBoard BeagleBoard is dog slow!
Video lags because of the frame generation from the ARM Less lag
with video received from host Audio works stand-alone, but not
during Empathy call
Slide 10
Memory Utilization and Work Load Not memory limited Not OS
back-ground task limited CPU limited w.r.t. Empathy itself Empathy
Not Running: 0.2-0.5 load, 270MB memory, 0 swap Empathy Running:
1.8-4.4 load, 340MB memory, 0 swap
Slide 11
Demo Due to the lack of a network port in the classroom
Initiating the call In the middle of the video chat
Slide 12
What Went Well Starting Early o Early feasibility before
setting project goals o Deciding on and ordering hardware in
February o Booting a few OS by end of February to kick-start OS
selection Selecting a Stable OS (Ubuntu Netbook 10.10) o
Peripherals worked out-of-the-box (including webcams) o Lot of
support sites and precedence Collaboration o Each had our own
setups to work on independent items o Frequent group sessions with
four platforms
Slide 13
What We Would Have Done Different It is a large effort to bring
up the development environment o Majority of the time was spent
setting up the infrastructure o The rest of the time was spent on
evaluation options for user apps o Little time left for core
development work on the project More up-front research, to
determine earlier o That Skype couldnt compile for any target since
it is not open-source o That cross-compile for arm can be done via
school machines o Evaluated user apps performance earlier and
enable audio conferencing only Host Platform Learnings o You need
one to code/compile on BeagleBoard is too slow o Back up your host
platform!!! o Teammates reformatted wrong device (HDD,
Pendrive)
Slide 14
Back Up
Slide 15
Hardware Components Used BeagleBoard-xM 5V Power Supply 4GB SD
Card USB Wired Keyboard USB Wired Mouse Speakers Headsets w/ Mics
Logitech Quick Cam and Microsoft Monitor w/ HDMI input HDMI-to-HDMI
or HDMI-to-DVI-D cable Ethernet Cable
Slide 16
Audio Challenges Audio In Audio in on the BeagleBoard was
actually a Line in and requires amplification o Microphones produce
weak electrical signals that must be amplified to line level o This
meant that a direct mic-in connection from a headset would not work
o With a direct input connection from a headset, audio in was never
heard (recorded and played back) The power amplifier amplifies the
signal to levels that can drive headphones or in this case the
TPS65950 Audio Codec on the Beagleboard o A hardware amplifier
needed to be built in order to use the Audio in directly o The next
step if time remained was to design an amplifier for the mic input
Line in proven functional on Beagleboard by connecting headphone
output of an iPhone to the Audio in jack of the BeagleBoard with a
cable. o This provided an amplified signal to the Audio in jack o
In Ubuntu the input could be recorded and then played back and
heard on the audio out jack. Also, as an alternative proved usb
webcam could be used to record voice
Slide 17
Audio Challenges Audio Out Audio out was disabled on Ubuntu o
Meerkat Maverick 10.10 release of Ubuntu chosen for project has
Audio out disabled by default on BeagleBoard-xM platforms o Ubuntu
Bug #651302 Due to bug, Audio out needs to be enabled and
configured using Alsamixer o Alsamixer settings need to be modified
to unmute HeadsetL Mixer AudioL2 and HeadsetR Mixer AudioR2 mixer
settings o Alsamixer settings need to be modified to adjust volume
using DAC2 Analog and Headset volume controls
Slide 18
Parallels 4 Works great with Windows 7 (ultimate) & no boot
loader Allocate # CPUs, memory, etc... to (Ubuntu) virtual machine
Enable/Disable HDD (Windows) file-system from being visible to
(Ubuntu) virtual machine Can mount image files (in Windows' file
system) as discs in (Ubuntu) virtual machine
Slide 19
Java on BeagleBoard Hello World java code compiled on
development platform Code wouldnt compile on board, but
pre-compiled code ran To run java application on BeagleBoard, run:
sudo apt-get install openjdk-6-jre
Crosstool-ng Cheat Sheet p.1 All of the cross compiler
executables end up in ~/x-tools/arm-cortex_a8-linux-gnueabi/bin So
you must add that to your path (instead of $PRJROOT/tools/bin)
inorder to do the final compile of your "hello_world.c" program.
YOU MAY USE THE ATTACHED "x-tool-config-file" TO COMPARE AGAINST
THE ".config" FILE YOU MAKE WITH THE STEPS BELOW. IF YOU GET STUCK,
JUST USE THE ATTACHED FILE AND RENAME IT TO $PRJROOT/tools/.config
PRIOR TO THE ct-ng build COMMAND.
=========================================================== SET UP
YOUR PATHS & ENV VARIABLES; ADDED THESE TO MY ~/.profile export
PROJECT=bb4 export PRJROOT=/home/ /${PROJECT} # export
PRJROOT=/home/hyeager/${PROJECT} export TARGET=arm-unknown-linux
export HOST=i686-cross-linux-gnu export PREFIX=${PRJROOT}/tools
export TARGET_PREFIX=${PREFIX}/${TARGET}
PATH="$PATH:$PRJROOT:$PREFIX/bin:$PRJROOT/build-tools/bin"
Slide 22
Crosstool-ng Cheat Sheet p.2 unix> source ~/.profile CREATE
THE PROPER DIRECTORY STRUCTURE BY mkdir THE SUB-DIRECTORIES OF YOUR
$PRJROOT unix> cd unix> mkdir $PRJROOT unix> cd $PRJROOT
unix> mkdir bootldr build-tools debug doc images kernel project
rootfs sysapps tmp tools unix> echo $PRJROOT /home/hyeager/bb4
unix> ls $PRJROOT bootldr build-tools debug doc images kernel
project rootfs sysapps tmp tools THIS IS NEEDED BECAUSE THE TOOL IS
GOING TO DOWNLOAD A LOT OF TAR FILES INTO THIS HARD CODED LOCATION.
IF YOU DON'T HAVE THIS, IT SHOULD STILL WORK, BUT IT WILL HAVE TO
DOWNLOAD THE FILES EVERY TIME (IF IT TAKES YOU MORE THAN ONE
TRY).
Slide 23
Crosstool-ng Cheat Sheet p.3 u nix> mkdir ~/src unix> cd
$PRJROOT/build-tools unix> sudo apt-get install mercurial
unix> sudo apt-get install libtool unix> sudo apt-get install
texinfo unix> hg clone http://crosstool-ng.org/hg/crosstool-ng
unix> cd crosstool-ng unix>./configure
--prefix=$PRJROOT/build-tools/ unix> make unix> make install
unix> cd $PRJROOT/tools THIS GIVES YOU A HELP MENU FOR THE ct-ng
TOOL... unix> ct-ng help THIS SETS UP THE.config WITH ALL THE
SETTINGS VERY CLOSE TO WHAT IS NEEDED FOR THE BEAGLE BOARD.
unix> ct-ng arm-cortex_a8-linux-gnueabi SAVE THAT CONFIGURATION
SO YOU CAN COMPARE WITH ANY CHANGES YOU MAKE... unix>
mv.config.config_original NOW MAKE A COUPLE OF CHANGES TO
THE.config FILE: unix> ct-ng
menuconfighttp://crosstool-ng.org/hg/crosstool-ng
Slide 24 " SELECTED PRESS ENTER down-arrow until "Number of
parallel jobs" IS SELECTED AND PRESS "> " SELECTED PRESS ENTER
down-arrow until "Number of parallel jobs" IS SELECTED AND PRESS
ENTER right-arrow (TO SELECT "Exit") AND PRESS ENTER (TO GO UP A
MENU LEVEL) TYPE THE NUMBER OF PROCESSORS YOUR UNIX SYSTEM HAS
AVAILABLE FOR COMPILING -- I TYPED "4" & PRESS ENTER.
down-arrow until "Operating System --->" IS SELECTED AND PRESS
ENTER down-arrow until "Linux kernel version (2.6.36.4) --->" IS
SELECTED AND PRESS ENTER down-arrow until "2.6.35.13 (longterm)" IS
SELECTED AND PRESS ENTER right-arrow (TO SELECT "Exit") AND PRESS
ENTER (TO GO UP A MENU LEVEL) right-arrow (TO SELECT "Exit") AND
PRESS ENTER SELECT "Yes" AND PRESS ENTER TO WRITE THE CHANGES TO
THE.config FILE. NOW YOU CAN SEE THE DIFFERENCES IN THE TWO CONFIG
FILES. YOU NEED THE kernel 2.6.35.13 IN ORDER TO WORK WITH THE
MAVERICK 10.10 IMAGE INSTALL (SEE LINK BELOW). IF YOU TRY TO USE
kernel 2.6.36.4 YOU WILL GET A SEGFAULT & A MESSAGE THAT YOUR
KERNEL VERSION IS TOO OLD. unix> diff.config.config_original NOW
BUILD THE CROSS-TOOL (DOWNLOADS ALL THE SPECIFIED TOOLS, COMPILES
& INSTALLS THEM...) THIS TAKES A WHILE (SEE COMMENT BELOW
BELOW)... unix> ct-ng build"> " SELECTED PRESS ENTER
down-arrow until "Number of parallel jobs" IS SELECTED AND PRESS "
title="Crosstool-ng Cheat Sheet p.4 WITH "Paths and misc options
--->" SELECTED PRESS ENTER down-arrow until "Number of parallel
jobs" IS SELECTED AND PRESS ">
Crosstool-ng Cheat Sheet p.4 WITH "Paths and misc options
--->" SELECTED PRESS ENTER down-arrow until "Number of parallel
jobs" IS SELECTED AND PRESS ENTER right-arrow (TO SELECT "Exit")
AND PRESS ENTER (TO GO UP A MENU LEVEL) TYPE THE NUMBER OF
PROCESSORS YOUR UNIX SYSTEM HAS AVAILABLE FOR COMPILING -- I TYPED
"4" & PRESS ENTER. down-arrow until "Operating System --->"
IS SELECTED AND PRESS ENTER down-arrow until "Linux kernel version
(2.6.36.4) --->" IS SELECTED AND PRESS ENTER down-arrow until
"2.6.35.13 (longterm)" IS SELECTED AND PRESS ENTER right-arrow (TO
SELECT "Exit") AND PRESS ENTER (TO GO UP A MENU LEVEL) right-arrow
(TO SELECT "Exit") AND PRESS ENTER SELECT "Yes" AND PRESS ENTER TO
WRITE THE CHANGES TO THE.config FILE. NOW YOU CAN SEE THE
DIFFERENCES IN THE TWO CONFIG FILES. YOU NEED THE kernel 2.6.35.13
IN ORDER TO WORK WITH THE MAVERICK 10.10 IMAGE INSTALL (SEE LINK
BELOW). IF YOU TRY TO USE kernel 2.6.36.4 YOU WILL GET A SEGFAULT
& A MESSAGE THAT YOUR KERNEL VERSION IS TOO OLD. unix>
diff.config.config_original NOW BUILD THE CROSS-TOOL (DOWNLOADS ALL
THE SPECIFIED TOOLS, COMPILES & INSTALLS THEM...) THIS TAKES A
WHILE (SEE COMMENT BELOW BELOW)... unix> ct-ng build
Slide 25 ct-ng build IF YOU GET A HANG DURING NCURSES... THERE
IS SOME PROBLEM WITH "tic" AND "ncurses" I HAD AN OLDER VERSION OF
ncurses INSTALLED ON MY HOST SYSTEM. I TRIED SEVERAL THINGS, BUT
MAKING SURE MY HOST SYSTEM HAD THE NEWER VERSION OF ncurses THAT
WAS CONSISTENT WITH THE ONE ON THE CROSS COMPILER. -C
http://ftp.gnu.org/pub/gnu/ncurses DOWNLOAD "ncurses-5.9.tar.gz" to
~/src http://gcc-uk.internet.bs/infrastructure/
http://ftp.gnu.org/pub/gnu/ncurses">
Crosstool-ng Cheat Sheet p.5 I HAD SOME PROBLEMS WITH -- HERE
IS WHAT I RAN INTO AND HOW I WORKED AROUND THEM. HOWEVER, ONE OTHER
PERSON DIDN'T HAVE ANY OF THESE PROBLEMS. IF YOU GET AN ERROR
"Could not retrieve 'cloog-ppl-0.15.9' THEN GOTO
http://gcc-uk.internet.bs/infrastructure/ AND DOWNLOAD THE FILE
INTO YOUR ~/src DIRECTORY IT SEEMS THE GNU SERVER FOR THIS WAS DOWN
WHEN I TRIED IT -- BUT IT WORKED THE NEXT DAY WITHOUT A PROBLEM.
unix> ct-ng build IF YOU GET A HANG DURING NCURSES... THERE IS
SOME PROBLEM WITH "tic" AND "ncurses" I HAD AN OLDER VERSION OF
ncurses INSTALLED ON MY HOST SYSTEM. I TRIED SEVERAL THINGS, BUT
MAKING SURE MY HOST SYSTEM HAD THE NEWER VERSION OF ncurses THAT
WAS CONSISTENT WITH THE ONE ON THE CROSS COMPILER. -C
http://ftp.gnu.org/pub/gnu/ncurses DOWNLOAD "ncurses-5.9.tar.gz" to
~/src http://gcc-uk.internet.bs/infrastructure/
http://ftp.gnu.org/pub/gnu/ncurses
Slide 26
Crosstool-ng Cheat Sheet p.6 SAVE IT THE CONTENTS OF THE LINK
TO $PRJROOT/build-tools/crosstool-ng/scripts/build/debug.sh CLEAN
UP THE LINE NUMBERS ETC... YOU MAY NEED TO UPGRADE THE ncurses
VERSION YOUR HOST SYSTEM IS USING TO BE THE SAME AS THE VERSIO N
YOU'RE TRYING TO INSTALL INTO THE CROSS COMPILER. unix> ct-ng
build =============================================================
============================================ WAIT A WHILE -- WITH 4
PROCESSORS IT TAKES ABOUT 30min, WITH AN OLDER DUAL CORE PROCESSOR
COULD BE 5-6 TIMES SLOWE R. AT THE END I STILL GET A BUILD DURING
THE CLEAN-UP STAGE, BUT ALL OF THE COMPILERS ARE ACTUALLY
CONSTRUCTED.
=============================================================
============================================
Slide 27 arm-cortex_a8-linux-gnueabi-gcc hello_world.c -o
hello_world_staticlibs.exe -static unix>
arm-cortex_a8-linux-gnueabi-gcc hello_world.c -o
hello_world_dynamiclibs.exe NOTICE THERE IS A LARGE SIZE DIFFERENCE
BETWEEN THE TWO EXECUTABLES. *staticlibs.exe HAS ALL THE REQUIRED
LIBRARIES INCLUDED IN THE EXECUTABLE. NOW MOVE THE TWO *.exe FILES
TO A USB DRIVE AND MOVE THEM TO THE BEAGLE BOARD AND TRY TO EXECUTE
THEM BOTH. THEY'RE BOTH WORKING WITH THE MAVERIC IMAGE FROM THE
FOLLOWING WEB PAGE: https://wiki.ubuntu.com/ARM/OMAPMaverickInstall
THE KERNEL VERSION IN THE MAVERICK IMAGE ON THIS SITE IS 2.6.35.22
THE KERNEL IMAGE USED IN THE CROSS COMPILER ABOVE IS 2.6.35.13 BUT
THIS WAS CLOSE ENOUGH (AT LEAST FOR A SIMPLE "hello world"
PROGRAM). https://wiki.ubuntu.com/ARM/OMAPMaverickInstall"> cd
$PRJROOT/project unix> vim hello_world.c #include int main() {
printf("Hello World.\n"); ">
Crosstool-ng Cheat Sheet p.7 # NOW LETS TEST IT OUT unix> cd
$PRJROOT/project unix> vim hello_world.c #include int main() {
printf("Hello World.\n"); printf("The Cross Compiler FINALLY works
-- YEAH BABY!!!\n"); return 0; } unix>
arm-cortex_a8-linux-gnueabi-gcc hello_world.c -o
hello_world_staticlibs.exe -static unix>
arm-cortex_a8-linux-gnueabi-gcc hello_world.c -o
hello_world_dynamiclibs.exe NOTICE THERE IS A LARGE SIZE DIFFERENCE
BETWEEN THE TWO EXECUTABLES. *staticlibs.exe HAS ALL THE REQUIRED
LIBRARIES INCLUDED IN THE EXECUTABLE. NOW MOVE THE TWO *.exe FILES
TO A USB DRIVE AND MOVE THEM TO THE BEAGLE BOARD AND TRY TO EXECUTE
THEM BOTH. THEY'RE BOTH WORKING WITH THE MAVERIC IMAGE FROM THE
FOLLOWING WEB PAGE: https://wiki.ubuntu.com/ARM/OMAPMaverickInstall
THE KERNEL VERSION IN THE MAVERICK IMAGE ON THIS SITE IS 2.6.35.22
THE KERNEL IMAGE USED IN THE CROSS COMPILER ABOVE IS 2.6.35.13 BUT
THIS WAS CLOSE ENOUGH (AT LEAST FOR A SIMPLE "hello world"
PROGRAM). https://wiki.ubuntu.com/ARM/OMAPMaverickInstall