BeagleBone
N.B. this attempt has failed - starting from the top in the next post.
I've shelved the Raspberry Pi until the USB webcam issues magically go away. I don't think I have the time or resources to look into these issues any further myself, and 320x240 is a very poor solution in 2012.
Meanwhile I've ordered a BeagleBone from Farnell, and it has arrived today. Back to square one - get the camera working.
Installing Ubuntu
I used the "Install Ubuntu core system" instructions fromhttp://elinux.org/BeagleBoardUbuntu#Oneiric_11.10
see also;
http://fleshandmachines.wordpress.com/2012/05/03/beaglebone-on-ubuntu-11-04/
get the software;
sudo apt-get update
sudo apt-get install ffmpeg motion
sudo nano /etc/motion/motion.conf
changes to motion.conf for em28xx capture device;
input 1
ffmpeg_deinterlace on
webcam_localhost off
Testing with kworld usb2800 gives familiar looking green screen....
Testing with cx321xx (hauppage USB live 2) hangs motion on startup.
(this looks very much like the initial Raspberry Pi results... )
mending em28xx
Trying the linux.tv drivers first
http://git.linuxtv.org/media_build.git
need linux headers for BeagleBone first;
wget http://rcn-ee.net/deb/oneiric-armel/v3.2.21-psp16/linux-headers-3.2.21-psp16_1.0oneiric_armel.deb
dpkg -i linux-headers-3.2.21-psp16_1.0oneiric_armel.deb
this looks useful here
https://groups.google.com/forum/?fromgroups#!topic/beagleboard/5xMAyFxQbdE
Getting full source
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.tar.bz2
(WRONG SOURCE? check http://www.kernel.org/pub/linux/kernel/v3.x/)
wget http://rcn-ee.net/deb/oneiric-armel/v3.2.21-psp16/defconfig
wget http://rcn-ee.net/deb/oneiric-armel/v3.2.21-psp16/patch-3.2-psp16.diff.gz
apply patch
zcat /home/test/patch-3.2-psp16.diff.gz | patch -p1
copy config
cp /home/test/defconfig .config
Looks like we are rebuilding the kernel then. The best of luck!
make
6hrs 50min later It's finished, but with some error.
http://git.linuxtv.org/media_build.git
need linux headers for BeagleBone first;
wget http://rcn-ee.net/deb/oneiric-armel/v3.2.21-psp16/linux-headers-3.2.21-psp16_1.0oneiric_armel.deb
dpkg -i linux-headers-3.2.21-psp16_1.0oneiric_armel.deb
didn't quite work
make[2]: Entering directory `/usr/src/linux-headers-3.2.0-psp7'
CC [M] /home/test/media_build/v4l/altera-lpt.o
In file included from include/linux/timex.h:174:0,
from include/linux/jiffies.h:8,
from include/linux/ktime.h:25,
from include/linux/timer.h:5,
from include/linux/workqueue.h:8,
from include/linux/pm.h:25,
from include/linux/device.h:24,
from include/linux/input.h:1136,
from /home/test/media_build/v4l/compat.h:9,
from <command-line>:0:
/usr/src/linux-headers-3.2.0-psp7/arch/arm/include/asm/timex.h:15:24: fatal error: mach/timex.h: No such file or directory
compilation terminated.
this looks useful here
https://groups.google.com/forum/?fromgroups#!topic/beagleboard/5xMAyFxQbdE
Getting full source
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.tar.bz2
(WRONG SOURCE? check http://www.kernel.org/pub/linux/kernel/v3.x/)
wget http://rcn-ee.net/deb/oneiric-armel/v3.2.21-psp16/defconfig
wget http://rcn-ee.net/deb/oneiric-armel/v3.2.21-psp16/patch-3.2-psp16.diff.gz
apply patch
zcat /home/test/patch-3.2-psp16.diff.gz | patch -p1
copy config
cp /home/test/defconfig .config
make
6hrs 50min later It's finished, but with some error.
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
LZMA arch/arm/boot/compressed/piggy.lzma
/bin/sh: lzma: not found
make[2]: *** [arch/arm/boot/compressed/piggy.lzma] Error 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] Error 2
make: *** [zImage] Error 2
I hope lzma isn't important. (did apt-get install lzma but haven't re-maked yet)... moving on regardless.
make modules
make modules_install
*ABOUT HERE I REBUILT THE SD IMAGE USING QUANTAL - GOT THE SOURCE, BUT I DIDN'T MAKE IT. JUST DID make modules TO GET THE SYSVERS FILES.no progress...
ah - symlink!... /lib/modules/linux-xxx/build was still pointing to headers, not to the source. [Stupid twat.]
./build wants make oldconfig and make prepare now, so I did that.
nearly there I think, media_build now fails with omap_vout. This doesn't sound like something I need - i'm going to just try disabling that.
CC [M] /home/test/media_build/v4l/omap_vout.o
/home/test/media_build/v4l/omap_vout.c: In function 'omapvid_setup_overlay':
/home/test/media_build/v4l/omap_vout.c:423:2: error: 'struct omap_overlay' has no member named 'is_enabled'
/home/test/media_build/v4l/omap_vout.c: In function 'omap_vout_release':
/home/test/media_build/v4l/omap_vout.c:952:7: error: 'struct omap_overlay' has no member named 'disable'
/home/test/media_build/v4l/omap_vout.c: In function 'vidioc_streamon':
/home/test/media_build/v4l/omap_vout.c:1695:13: error: 'struct omap_overlay' has no member named 'enable'
/home/test/media_build/v4l/omap_vout.c: In function 'vidioc_streamoff':
/home/test/media_build/v4l/omap_vout.c:1731:7: error: 'struct omap_overlay' has no member named 'disable'
menu menuconfig
-disabled all v4l platform devices
-trying again
make works this time.
make install
reboot
Oh, that hasn't worked.
According to lsmod no em28xx module is loaded... fatal errors when I try and modprobe the em28xx.ko files in media_build/v4l. Looks like an issue with my
source and the kernel?
I'm going to try and rebuild the kernel again, and actually use the image it makes - at least I will have break for a few hours.
This time I have lzma, but it can't allocate any memory.
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
LZMA arch/arm/boot/compressed/piggy.lzma
lzma: Cannot allocate memory
make[2]: *** [arch/arm/boot/compressed/piggy.lzma] Error 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] Error 2
make: *** [zImage] Error 2
I suspect that would be because there physically isn't enough RAM... swapfile?
(Interesting it was a few hours quicker getting to this stage with the quantal armhf image)
from http://elinux.org/BeagleBoardUbuntusudo mkdir -p /var/cache/swap/ sudo dd if=/dev/zero of=/var/cache/swap/swapfile bs=1M count=1024 sudo chmod 0600 /var/cache/swap/swapfile sudo mkswap /var/cache/swap/swapfile sudo swapon /var/cache/swap/swapfile
it says add this line to /etc/fstab - i'm not sure i want a swapfile yet - i'll see how motion performs once it's working.
/var/cache/swap/swapfile none swap sw 0 0
After playing with Angstrom I've come back to this and tried removing motion and ffmpeg, and installing motion from source. Needed
sudo apt-get install libjpeg8 libjpeg8-dev
to work. (found the name of the jpeg packages here http://www.ozbotz.org/opencv-installation/ )Now I'm getting the seg faults on the lifecam at 720x576 (ok at 320x240).. but I am getting a picture out of the easycam em28xx devices.
Picture not useable - horizontal lines through it and colour problems. Suspect known USB DMA issues afoot?
looking at my .config confirms PIO not set https://groups.google.com/forum/?fromgroups#!topic/beagleboard/rBv2ZGSietM
CONFIG_MUSB_PIO_ONLY=y
Rebuilding the kernel again with this change in .config < and then trying again, by doing it via make menuconfig
used this to make kernel image;
cd /home/test/linux/linux-3.2/arch/arm/boot/
mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux" -d zImage uImage
mv /boot/uboot/uImage /boot/uboot/uImage.old
cp uImage /boot/uboot
reboot
modified from ( http://elinux.org/BeagleBoardUbuntu#BeagleBone and http://linux.die.net/man/1/mkimage)
Notes to self
DC input 2.1mm x 5.5mm
Uses two 46 pin dual row .1 x .1 female headers
this looks useful
http://elinux.org/BeagleBoardUbuntu#Motion
don't forget
apt-get install libncurses5-dev lzma make gcc patchutils libproc-processtable-perl
Uses two 46 pin dual row .1 x .1 female headers
this looks useful
http://elinux.org/BeagleBoardUbuntu#Motion
don't forget
apt-get install libncurses5-dev lzma make gcc patchutils libproc-processtable-perl
Thank you. Needed to swap back on after making bigger for LZMA. This page clued me in.
ReplyDelete