libfreenect Bus Error when built from source

Hello All

Just wondering if anyone else has had trouble with compiling and
installing libfreenect from source.

I have tried Ubuntu 11.10 r3 and 11.04 r7 both result in as bus error
when I have tried to compile libfreenect from source and install. I
have triple checked the dependencies and freenect installs without
errors.

I have also tried manually installing the .dep packages for 10.10
using dpkg -i *.dep.
Using this method I do not get a Bus Error but an error from
libfreenect stating 'could not claim interface on camera: -6', and one
time it even worked.

I know that libfreenect should not be this difficult to get working as
tirokart has done this previously without problems and I have
libfreenect working in Angstrom, but Angstrom installs libfreenect
from the opkg package manager.

Finally I am going to make a 10.10 sd card during the week and try and
install using apt so hopefully it works but it shouldn't be this much
trouble in 11.10 or 11.04.

Cheers Troy

Hello All

Just wondering if anyone else has had trouble with compiling and
installing libfreenect from source.

I have tried Ubuntu 11.10 r3 and 11.04 r7 both result in as bus error
when I have tried to compile libfreenect from source and install. I
have triple checked the dependencies and freenect installs without
errors.

This "Bus Error" actually sounds like a kernel issue, when plugging in
the device, do you have a copy of your dmesg? (those two release,
although different versions of ubuntu userspace, actually have the
same kernel (some 3.1.x release), so i'd expect the results to be the
same..)

Care to test v3.2.1-x2?

(on beagle)
wget http://rcn-ee.net/deb/oneiric-armel/v3.2.1-x2/install-me.sh
/bin/bash install-me.sh

I have also tried manually installing the .dep packages for 10.10
using dpkg -i *.dep.
Using this method I do not get a Bus Error but an error from
libfreenect stating 'could not claim interface on camera: -6', and one
time it even worked.

Regards,

Hello

I just tried ubuntu-10.10-r7 which is using the 2.6.38.4 kernel and I
have the same problem.

So what I can do is compile a basic demo using the installed libraries
and headers, however when I try to run tiltdemo or a very basic cvdemo
to show the RBG or depth image I still get 'Bus error'.

Also I am following the ubuntu install instructions

Quick copy-paste instructions to get up-and-running instantly:

sudo apt-get install git-core cmake libglut3-dev pkg-config build-
essential libxmu-dev libxi-dev libusb-1.0-0-dev
git clone git://github.com/OpenKinect/libfreenect.git
cd libfreenect
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib/

sudo adduser ubuntu video

sudo nano /etc/udev/rules.d/51-kinect.rules

# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0",
MODE="0666"
# ATTR{product}=="Xbox NUI Audio"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad",
MODE="0666"
# ATTR{product}=="Xbox NUI Camera"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae",
MODE="0666"

sudo tiltdemo = Bus Error
tiltdemo = Bus Error

dmesg output - these are the two lines related to the fault for 10.10
r7

[ 539.130554] Alignment trap: not handling instruction edd37a00 at
[<4005d7de>]
[ 539.138214] Unhandled fault: alignment exception (0x001) at
0xbeef4412

Finally I'll have to remake a 11.10 sdcard to try the most recent
kernel as I wiped it because it would work with the kinect.

However I think there might be some issue other than hardware as the
10.10 sd card has a different but older kernel.

Do you think that having an ULCD7 attached could create any issues, I
couldn't imagine it as it is only connected to the LCD port and GPIO
access.

Cheers Troy

I finally managed to get libfreenect working on 10.10. But I still
can't install from source I ended up just using dpkg.

Below are my instructions:

Install Libfreenect0.0:

sudo apt-get install libc6 libusb-1.0-0 udev libglu1-mesa libgl1-mesa-
glx libsm6 libice6 libx11-6 libxext6 libglut3 libxmu6 libxi6 libstdc+
+6 libgcc1

wget http://ftp.us.debian.org/debian/pool/main/libf/libfreenect/libfreenect0.0_0.0.1+20101211+2-2_armel.deb

sudo dpkg -i libfreenect0.0_0.0.1+20101211+2-2_armel.deb

install libfreenect-dev:

sudo apt-get install libglut3-dev libxi-dev libxmu-dev libc6-dev
libglu1-mesa-dev libgl1-mesa-dev libsm-dev libice-dev libx11-dev
libxext-dev libstdc++6-4.5-dev libusb-1.0-0-dev pkg-config

wget http://ftp.us.debian.org/debian/pool/main/libf/libfreenect/libfreenect-dev_0.0.1+20101211+2-2_armel.deb

sudo dpkg -i libfreenect-dev_0.0.1+20101211+2-2_armel.deb

install libfreenect-demos:

sudo apt-get install freeglut3 libgcc1 libgl1-mesa-glx libgl1 libglu1-
mesa libglu1 libice6 libsm6 libstdc++6 libx11-6 libxext6 libxi6
libxmu6 libglut3

wget http://ftp.us.debian.org/debian/pool/main/libf/libfreenect/libfreenect-demos_0.0.1+20101211+2-2_armel.deb

sudo dpkg -i libfreenect-demos_0.0.1+20101211+2-2_armel.deb

install freenect

wget http://ftp.us.debian.org/debian/pool/main/libf/libfreenect/freenect_0.0.1+20101211+2-2_armel.deb

sudo dpkg -i freenect_0.0.1+20101211+2-2_armel.deb

sudo cp /lib/udev/rules.d/51-kinect.rules /etc/udev/rules.d/51-
kinect.rules

Hello

I just tried ubuntu-10.10-r7 which is using the 2.6.38.4 kernel and I
have the same problem.

So what I can do is compile a basic demo using the installed libraries
and headers, however when I try to run tiltdemo or a very basic cvdemo
to show the RBG or depth image I still get 'Bus error'.

Also I am following the ubuntu install instructions

Quick copy-paste instructions to get up-and-running instantly:

sudo apt-get install git-core cmake libglut3-dev pkg-config build-
essential libxmu-dev libxi-dev libusb-1.0-0-dev
git clone git://github.com/OpenKinect/libfreenect.git
cd libfreenect
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib/

sudo adduser ubuntu video

sudo nano /etc/udev/rules.d/51-kinect.rules

# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0",
MODE="0666"
# ATTR{product}=="Xbox NUI Audio"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad",
MODE="0666"
# ATTR{product}=="Xbox NUI Camera"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae",
MODE="0666"

sudo tiltdemo = Bus Error
tiltdemo = Bus Error

dmesg output - these are the two lines related to the fault for 10.10
r7

[ 539.130554] Alignment trap: not handling instruction edd37a00 at
[<4005d7de>]
[ 539.138214] Unhandled fault: alignment exception (0x001) at
0xbeef4412

These are safe to ignore, my kernel is missing "secret" ubuntu sauce.. :wink:

Finally I'll have to remake a 11.10 sdcard to try the most recent
kernel as I wiped it because it would work with the kinect.

However I think there might be some issue other than hardware as the
10.10 sd card has a different but older kernel.

Even thou i no longer build images for that old user-space (10.10
maverick), you can at-least get the latest kernel. (same one i
mentioned earlier)

http://rcn-ee.net/deb/maverick-armel/v3.2.1-x2/

Do you think that having an ULCD7 attached could create any issues, I
couldn't imagine it as it is only connected to the LCD port and GPIO
access.

Not likely, it probally is just less "tested" then most usb devices..

Regards,

Thanks for your help.

I don't want to mess with my working image, but when I get another put
together I'll let you know if it fixed it.

Cheers
Troy

Hello again

So I have tracked the problem down to libfreenect.

From what I have found by using git log and rolling back through
previous versions is that commit
'dbfd4cea1e79a6b563e226705dbf3c89c8b26cc1' from 23 july 2011 is the
most recent version of libfreenect to work with the beagleboard and
pandaboard.

So it is not a kernel problem but a libfreenect problem that is
causing the 'bus error'.

I am going to try and investigate within libfreenect, but due to my
limited linux experience I do not hold any high hopes of finding the
problem by myself however the libfreenect guys have given insight how
to activate verbose logging and I am starting to get more comfortable
with git.

So I hope that this problem can be overcome as the kinect provides a
fantastic tool to the boards. I do know that libfreenect is available
in the Angstrom repository, however currently it cannot be installed
onto ubuntu or squeeze using the latest libfreenect source code due to
this problem. Therefore I have concerns about how old the version that
resides in the angstrom repository actual is.

Troy

Drew from libfreenect has a patch in the unstable branch which has
seemed to fix the bus error.

For now you can compile the unstable branch from source to install
libfreenect on beagle or panda.

troy