librekinect icon indicating copy to clipboard operation
librekinect copied to clipboard

Anyone run successfully on Raspberry Pi 3 ?

Open lucyking opened this issue 7 years ago • 13 comments

I've modify the source according #36 , #15 ,etc. And build the *.ko successfully. However when insmod , I get the err: insmod: ERROR: could not insert module gspca.ko: Invalid module format

if anyone build and run well on RP3 , please do not be shy to let me konw.

my env is : Linux raspberrypi 4.4.13-v7 #1 SMP Sat Jun 18 06:24:07 UTC 2016 armv7l GNU/Linux

here is the part log, the full log: -> gist

  • make load:
root@raspberrypi:~/Desktop/librekinect# make
make -C /lib/modules/4.4.13-v7/build M=/root/Desktop/librekinect modules
make[1]: Entering directory '/usr/src/linux'
  CC [M]  /root/Desktop/librekinect/gspca.o
  CC [M]  /root/Desktop/librekinect/kinect.o
  Building modules, stage 2.
  MODPOST 2 modules
  CC      /root/Desktop/librekinect/gspca.mod.o
  LD [M]  /root/Desktop/librekinect/gspca.ko
  CC      /root/Desktop/librekinect/kinect.mod.o
  LD [M]  /root/Desktop/librekinect/kinect.ko
make[1]: Leaving directory '/usr/src/linux'
root@raspberrypi:~/Desktop/librekinect# make load
make unload_drivers
make[1]: Entering directory '/root/Desktop/librekinect'
sudo sh unload_drivers.sh
tried to unload all related drivers (and possibly more ;)
make[1]: Leaving directory '/root/Desktop/librekinect'
sudo modprobe videodev
sudo insmod gspca.ko
insmod: ERROR: could not insert module gspca.ko: Invalid module format
Makefile:38: recipe for target 'load' failed
make: *** [load] Error 1
root@raspberrypi:~/Desktop/librekinect# uname -a
Linux raspberrypi 4.4.13-v7 #1 SMP Sat Jun 18 06:24:07 UTC 2016 armv7l GNU/Linux
  • insmod:
root@raspberrypi:~/Desktop/librekinect# modprobe gspca_main
root@raspberrypi:~/Desktop/librekinect# modprobe gspca_kinect
root@raspberrypi:~/Desktop/librekinect# insmod gspca.ko
insmod: ERROR: could not insert module gspca.ko: Invalid module format
root@raspberrypi:~/Desktop/librekinect# insmod kinect.ko
insmod: ERROR: could not insert module kinect.ko: Invalid parameters
root@raspberrypi:~/Desktop/librekinect# insmod gspca.ko depth_mode=1
insmod: ERROR: could not insert module gspca.ko: Invalid module format
root@raspberrypi:~/Desktop/librekinect# 
  • dmesg:
[ 988.544875] gspca_main: kinect-2.14.0 probing 045e:02ae
[ 988.546176] usbcore: registered new interface driver kinect
[ 1000.409075] gspca: exports duplicate symbol gspca_debug (owned by gspca_main)
[ 1008.185163] kinect: disagrees about version of symbol gspca_frame_add
[ 1008.185190] kinect: Unknown symbol gspca_frame_add (err -22)
[ 1008.185262] kinect: disagrees about version of symbol gspca_dev_probe
[ 1008.185273] kinect: Unknown symbol gspca_dev_probe (err -22)

lucyking avatar Jul 30 '16 07:07 lucyking

I have tried to get depth data via librekinect and libfreenect. Both failed. So 👍 to this question

schumannd avatar Aug 28 '16 21:08 schumannd

@schumannd I've tried on x86_64 PC and also met this problem.But you can try to walk around it:

  1. Enable the root account login,instead of normal account then run sudo *. Ensure you has full access to everthing. (camorama can run succeffully only root account)
  2. run make unload_drivers before loading, due to the new kernel will load default kinect module automatically when plug the kinect in.

After above procedures , we can load this module successfully. ->my demo I've not verify it on RPi 3 yet. Please let me konw if you make new progress on RP3.

lucyking avatar Aug 29 '16 07:08 lucyking

Hello @lucyking i am currently trying to make the kinect work with the raspberry pi, and I am getting the same error (Makefile:38) as you were facing upthere. (As for my kernel it is 4.4.13+).

Can you please tell me how did you manage to make it work? or do you still can't?

thank you!!

kalibre92 avatar Sep 06 '16 18:09 kalibre92

@kalibre92 you can follow above 2 steps and try to solve this issue.

lucyking avatar Sep 07 '16 13:09 lucyking

@lucyking I had tryed that and it hadnt work... but I actually just manage to make it work. The one thing I did different this time were this 2 line here:

copy the new kernel image cp /usr/src/linux/arch/arm/boot/zImage /boot/linux-4.4.y

choose it echo "kernel=linux-4.4.y" >> /boot/config.txt

that I saw on @xxorde comment in https://github.com/OpenKinect/libfreenect/issues/338 that could make a diference to load the modules. But thanks anyway!!

and Im gonna use here as well to quickly thank @xxorde for all this!

kalibre92 avatar Sep 08 '16 00:09 kalibre92

@kalibre92 The librekinect 's README has the same content:

# copy the new kernel image
cp /usr/src/linux/arch/arm/boot/zImage /boot/linux-3.12.y

# choose it
echo "kernel=linux-3.12.y" >> /boot/config.txt

I had do according it but failed. It's something to do with linux-3.12.y or linux-4.4.y ?

lucyking avatar Sep 08 '16 09:09 lucyking

@lucyking yeah, I forgot to mention that it is now in the readme file.

And answering your question, everywhere in the readme file where xxorde writes his kernel version (in his case 3.12.20+) you have to change it for your kernel version which, in my case, is 4.4.13+. ps.: the last numbers (13+) usually are not necessery, as it becomes 4.4.y

One important this though, if you have done these two lines you mentioned above with 3.12.y, before doing it with your own, you have to delete "kernel=linux-3.12.y" from the config.txt, and for that you might have to use vi ou nano commands.

Also, after that, try doing sudo -s or sudo su, and then:

cp /usr/src/linux/arch/arm/boot/zImage /boot/linux-4.4.y echo "kernel=linux-4.4.y" >> /boot/config.txt

And last but not least, i had to try doing make load 2 times, before it worked.

let me know if you can make it work =p

kalibre92 avatar Sep 08 '16 21:09 kalibre92

@kalibre92 Are you using a Raspberry Pi 3 and did you get depth information from the kinect? I have put the project on ice due to difficulties. But if you did it there might still be hope! I would also be interested in computing benchmarks.

schumannd avatar Sep 09 '16 21:09 schumannd

I am sorry @lucyking and @schumannd, i didnt pay attention on the issues title, and was only looking at the comments... My raspberry pi is 2, not 3. Sorry about that.

about the depth, im gonna start working on that right now! so far, i only have something like this video here: https://www.youtube.com/watch?v=dNQtsUkjGe0

but I will keep u posted with more info

kalibre92 avatar Sep 10 '16 20:09 kalibre92

@lucyking Hi there, yes it is possible run librekinect on Raspberry Pi 3, After many hours trying I could run it following some instructions from here. (The One you referenced before). For a RPI 3 you must follow @sjobeek instructions using the armv8l instead of armv7l :

makefile: ifeq ($(UNAME),armv6l) ----------> ifeq ($(UNAME),armv8l)

and

gspca.c: V4L2_FL_USE_FH_PRIO ----> V4L2_FL_USES_V4L2_FH

And finally the comment from @tophstar is relevant here to "make load to work"

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

2017-01-06-023018_742x790_scrot

--------------------------------UPDATE!-------------------------------------------

  • Look at this issue, it seems pretty unstable (RPI 3) #48

TOTON95 avatar Jan 06 '17 08:01 TOTON95

looks good :+1:

lucyking avatar Jan 06 '17 16:01 lucyking

It's an old issue, but just in case anybody encounters it, in search of solutions - I recently wrote an article about using Kinect 360 and RTAB-MAP ROS with Rasberry Pi 4, with some tweaks it does work now! https://www.hackster.io/dmitrywat/rgb-d-slam-with-kinect-on-raspberry-pi-4-ros-melodic-ace795

AIWintermuteAI avatar May 10 '20 09:05 AIWintermuteAI

@AIWintermuteAI Thank you, I will be working with my old Kinect sensor and a Pi3 in a few weeks, so I will let you know how I get on! Thank you so much!

XeroHero avatar May 10 '20 12:05 XeroHero