librekinect icon indicating copy to clipboard operation
librekinect copied to clipboard

Makefile/Build errors on Raspberry Pi 2

Open sjobeek opened this issue 10 years ago • 4 comments

Hey there,

When testing this out on my new Raspberry Pi 2, I ran into a couple bumps with the makefile:

  1. Had to modify the makefile to match $UNAME to armv7l
ifeq ($(UNAME),armv6l)
---------->
ifeq ($(UNAME),armv7l)
  1. to build libreconnect I had to change one variable in one line of gspca.c which seemed to be referencing an undefined variable: (same as issue #14)
V4L2_FL_USE_FH_PRIO
---->
V4L2_FL_USES_V4L2_FH

A google search for the undefined variable turned up the solution which worked: http://sourceforge.net/p/adi-buildroot/bugs/263/

After those changes, I was able to make and load the libraries on my Raspberry Pi 2 and got depth output. Great!

It wasn't clear to me how to "install" the modules permanently in the kernel since make install didn't seem to exist.

sjobeek avatar Feb 11 '15 14:02 sjobeek

Thank you, working fine.

silvio-didonna avatar Feb 18 '15 18:02 silvio-didonna

Hey there,

Thanks for finding these solutions. I am able to make now, but my make load is failing. Are these the errors you were talking about? If so, I don't seem to have a /dev/video0 after the make load.

root@raspberrypi:/home/pi/bucket/librekinect# make
make pc
make[1]: Entering directory '/home/pi/bucket/librekinect'
make -C /lib/modules/3.18.16-v7/build M=/home/pi/bucket/librekinect modules
make[2]: Entering directory '/usr/src/linux'
  Building modules, stage 2.
  MODPOST 2 modules
make[2]: Leaving directory '/usr/src/linux'
make[1]: Leaving directory '/home/pi/bucket/librekinect'



root@raspberrypi:/home/pi/bucket/librekinect# make load
make unload_drivers
make[1]: Entering directory '/home/pi/bucket/librekinect'
sudo sh unload_drivers.sh
Error: Module gspca_main is not currently loaded
Error: Module gspca_kinect is not currently loaded
Error: Module gspca is not currently loaded
Error: Module kinect is not currently loaded
make[1]: Leaving directory '/home/pi/bucket/librekinect'
sudo modprobe videodev
sudo insmod gspca.ko
sudo insmod kinect.ko
sudo chown -f -R root:root /dev/video* 
Makefile:42: recipe for target 'load' failed
make: *** [load] Error 1

tophstar avatar Nov 05 '15 04:11 tophstar

Figured it out... the kinect needed to be plugged in for make load to work.

tophstar avatar Nov 05 '15 04:11 tophstar

If you have Linux 3.17 or above, this has already been merged into the mainline kernel (https://github.com/torvalds/linux/commit/c87c0f079cf8c9c346adbedd367ba53ad0afaded); toggle the 'kinect' module's depth_mode flag to toggle between this depth mode and the older video mode.

Oh, look 3.17 is also when V4L2_FL_USE_FH_PRIO was removed. That is: you don't need to build this.

Regarding the low-levels of V4L2_FL_USE_FH_PRIO: In https://github.com/torvalds/linux/commit/95cd5d5ee67c2108765ae87d34761d54fd6671ce it was removed outright. See the commit message for justification.

LukeShu avatar Mar 07 '16 08:03 LukeShu