xxorde / librekinect

Depth data from a kinect sensor! Small and fast kernel driver. Also for embedded devices like the raspberry pi!
408 stars 66 forks source link

Make Load Fails #4

Open sergeypolishchuk opened 10 years ago

sergeypolishchuk commented 10 years ago

My process steps:

sudo -s
apt-get install build-essential bc ncurses-dev tmux git
tmux
cd /usr/src/

find out which kernel you are using – in my case 3.12.20+ Mine is $ 3.10.38 so i change instructions to reflect that ...

uname -r
wget https://github.com/raspberrypi/linux/archive/rpi-3.10.y.tar.gz
tar xfvz rpi-3.10.y.tar.gz
mv linux-rpi-3.10.y linux
ln -s /usr/src/linux /lib/modules/$(uname -r)/build
ln -s /usr/src/linux /lib/modules/$(uname -r)/source 

This gives error on my Pi, since my pwd is:

cd /src/linux 
pwd
/usr/src 

and there is no linux fodler in my /src folder so i presume i need to be in /usr/src

cd /linux  
make mrproper

*get your config*
gzip -dc /proc/config.gz > .config

*building, that is going to take a while!*
make **takes all night on my Rpi, don't have a dual boot for cross-compile**
make modules_prepare
make modules_install

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

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

reboot 

(out of timux at this point)

git clone https://github.com/xxorde/librekinect.git
cd librekinect

ready to make

make

gives me the following:

make pc
make[1]: Entering directory `/home/pi/librekinect'
make -C /lib/modules/3.10.38/build M=/home/pi/librekinect modules
make[2]: Entering directory `/usr/src/linux'
  CC [M]  /home/pi/librekinect/gspca.o
  CC [M]  /home/pi/librekinect/kinect.o
  Building modules, stage 2.
  MODPOST 2 modules
  CC      /home/pi/librekinect/gspca.mod.o
  LD [M]  /home/pi/librekinect/gspca.ko
  CC      /home/pi/librekinect/kinect.mod.o
  LD [M]  /home/pi/librekinect/kinect.ko
make[2]: Leaving directory `/usr/src/linux'
make[1]: Leaving directory `/home/pi/librekinect'
make load

FAILS and gives me the following:

pi@illacom ~/librekinect $ make load
make unload_drivers
make[1]: Entering directory `/home/pi/librekinect'
sudo sh unload_drivers.sh
Error: Module kinect is not currently loaded
Error: Module gspca is not currently loaded
Error: Module gspca_main is in use by: gspca_kinect
Error: Module gspca is not currently loaded
Error: Module kinect is not currently loaded
make[1]: Leaving directory `/home/pi/librekinect'
sudo modprobe videodev
sudo insmod gspca.ko
Error: could not insert module gspca.ko: Invalid module format
make: *** [load] Error 1

Not really sure why gspca.ko is invalid module format, I checked all folders and everything seems to be where it should be, but i might be missing something obvious, I can post contents of my folders if that helps , please help me solve this.

Thank you

danielespitiacol commented 10 years ago

Hi, I'm testing librekinect in the UDOO board, with the same problem:

ubuntu@udoobuntu: ~/librekinect $ sudo make make pc make[1]: Entering directory /home/ubuntu/librekinect' make -C /lib/modules/3.0.35/build M= modules make[2]: Entering directory/usr/src/Kernel_Unico' make[2]: execvp: /usr/src/Kernel_Unico/scripts/setsecoversion: Permission denied CHK include/linux/version.h CHK include/generated/utsrelease.h make[3]: include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh Building modules, stage 2. MODPOST 346 modules make[2]: Leaving directory/usr/src/Kernel_Unico' make[1]: Leaving directory `/home/ubuntu/librekinect'

ubuntu@udoobuntu: ~/librekinect $ sudo make load make unload_drivers make[1]: Entering directory /home/ubuntu/librekinect' sudo sh unload_drivers.sh ERROR: Module kinect does not exist in /proc/modules ERROR: Module gspca does not exist in /proc/modules ERROR: Module gspca_main does not exist in /proc/modules ERROR: Module gspca_kinect does not exist in /proc/modules ERROR: Module * does not exist in /proc/modules make[1]: Leaving directory/home/ubuntu/librekinect' sudo modprobe videodev sudo insmod gspca.ko insmod: can't read 'gspca.ko': No such file or directory make: *\ [load] Error 1

Any solution?

Thank you

peterkolski commented 10 years ago

Hi, Here is a thread which might help. (one of the last comments)

https://github.com/OpenKinect/libfreenect/issues/338

Any success?

Peter

xxorde commented 10 years ago

Hi,

having an invalid module format mostly occurs when your module is not compiled with the same Headers as your Kernel! Make sure, you are using your compiled Kernel and to compile your module with the same headers!

Have you got it going?

Alexander

danielespitiacol commented 10 years ago

Hi xxorde, I had the same problem in the raspberry pi, but I downloaded the last wheezy image and finally the kinect is working!!

Now I will try again with the UDOO.

Thank you

eliyash commented 10 years ago

hello! I got the same error as sergeypolishchuk got... I used rasbian 20-6-2014 witch has 3.12 and I checked that I have compiled with 3.12 Headers... At one of the steps (i thinf it was the make witch is before the "make modules_prepare"), it ask me several configuration questions, do you get them? and if so what did you configured?

thank you..

TimboInSpace commented 9 years ago

To the OP: I got exactly that error when I ran "make load" as a regular user. When I ran as root, the errors from unload_drivers.sh persist, but make load succeeds. So maybe try running it as root?

tiancovici commented 9 years ago

Has anyone found a resolution for this yet? I'm using the supposedly latest release, 3.18.0-v7, along with kernel set as 3.18.y

when i type make load, this is what I get:

as regular user

make load make unload_drivers make[1]: Entering directory '/home/pi/librekinect' sudo sh unload_drivers.sh Error: Module kinect is not currently loaded Error: Module gspca is not currently loaded 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/librekinect' sudo modprobe videodev sudo insmod gspca.ko sudo insmod kinect.ko sudo chown -f -R pi:pi /dev/video* Makefile:42: recipe for target 'load' failed make: *\ [load] Error 1

as su pi@raspberrypi ~/librekinect $ sudo -s root@raspberrypi:/home/pi/librekinect# make load make unload_drivers make[1]: Entering directory '/home/pi/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/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 root@raspberrypi:/home/pi/librekinect# exit exit

I'm able to run it by using vlc v4l:///dev/video0

I get one image, and it hangs. Is it just a way of testing it's connected? am I missing some resolution that makes it say more data is ready?

silvio-didonna commented 9 years ago

Try camorama

tiancovici commented 9 years ago

^That did it, thanks

dev-waleed commented 9 years ago

@TimboInSpace and @xxorde can you tell me how to solve make issue and make load issue. I m new to Raspbian. Kernel version is 3.18.9 and i got this when trying make sendd

but runnning make as root gives no error but make load fails whether it is root or pi user, plz help me resolving it.

send 2

lildutchie99 commented 9 years ago

I found when using librekinect on odroid-u3 that make load needs to be run twice to get it to work-- I get an "invalid module format" error the first time but all goes fine the second time. Anyone else had this?

TimboInSpace commented 9 years ago

Yeah I had the exact same thing happen. Doesn't seem to cause any problems though.

stefandz commented 8 years ago

Not trying to necromance a dead thread here, but I have the same issue as @lildutchie99 and @TimboInSpace where double-loading the driver is required. Build is on Raspbian Jessie, Rpi2 B+. Other than that works fine - just recording here in case it helps others.

yash7050 commented 3 years ago

└─# make make -C /lib/modules/5.10.0-kali9-amd64/build M=/usr/src/librekinect modules make[1]: Entering directory '/usr/src/linux-headers-5.10.0-kali9-amd64' CC [M] /usr/src/librekinect/gspca.o /usr/src/librekinect/gspca.c: In function ‘gspca_frame_add’: /usr/src/librekinect/gspca.c:444:31: error: implicit declaration of function ‘ktime_to_timeval’; did you mean ‘ktime_get_real’? [-Werror=implicit-function-declaration] 444 | frame->v4l2_buf.timestamp = ktime_to_timeval(ktime_get()); | ^~~~ | ktime_get_real /usr/src/librekinect/gspca.c:444:31: error: incompatible types when assigning to type ‘struct __kernel_v4l2_timeval’ from type ‘int’ /usr/src/librekinect/gspca.c: In function ‘dev_read’: /usr/src/librekinect/gspca.c:1904:17: error: storage size of ‘timestamp’ isn’t known 1904 | struct timeval timestamp; | ^~~~~ /usr/src/librekinect/gspca.c:1904:17: warning: unused variable ‘timestamp’ [-Wunused-variable] /usr/src/librekinect/gspca.c: In function ‘gspca_dev_probe2’: /usr/src/librekinect/gspca.c:2070:10: error: ‘V4L2_FL_USE_FH_PRIO’ undeclared (first use in this function) 2070 | set_bit(V4L2_FL_USE_FH_PRIO, &gspca_dev->vdev.flags); | ^~~~~~~ /usr/src/librekinect/gspca.c:2070:10: note: each undeclared identifier is reported only once for each function it appears in /usr/src/librekinect/gspca.c:2101:2: error: implicit declaration of function ‘v4l2_disable_ioctl_locking’; did you mean ‘v4l2_disable_ioctl’? [-Werror=implicit-function-declaration] 2101 | v4l2_disable_ioctl_locking(&gspca_dev->vdev, VIDIOC_DQBUF); | ^~~~~~ | v4l2_disable_ioctl /usr/src/librekinect/gspca.c:2117:7: error: ‘VFL_TYPE_GRABBER’ undeclared (first use in this function); did you mean ‘VFL_TYPE_SUBDEV’? 2117 | VFL_TYPE_GRABBER, | ^~~~ | VFL_TYPE_SUBDEV cc1: some warnings being treated as errors make[3]: [/usr/src/linux-headers-5.10.0-kali9-common/scripts/Makefile.build:284: /usr/src/librekinect/gspca.o] Error 1 make[2]: [/usr/src/linux-headers-5.10.0-kali9-common/Makefile:1845: /usr/src/librekinect] Error 2 make[1]: [/usr/src/linux-headers-5.10.0-kali9-common/Makefile:185: __sub-make] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-kali9-amd64' make: [Makefile:24: default] Error 2

Any Solution?