teknotus / depthview

intel RealSense 3D camera viewer for Linux
GNU Lesser General Public License v2.1
98 stars 38 forks source link

Make issue in "make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules" #13

Open Nikvand opened 8 years ago

Nikvand commented 8 years ago

Hi, I get the following error after applying patch and trying to make:

nima@Nimani:~$ cd linux-* nima@Nimani:~/linux-lts-vivid-3.19.0$ git apply ../0001-Add-video-formats-for-Intel-real-sense-F200-camera.patch nima@Nimani:~/linux-lts-vivid-3.19.0$ sudo cp include/uapi/linux/videodev2.h /usr/include/linux/videodev2.h [sudo] password for nima: nima@Nimani:~/linux-lts-vivid-3.19.0$ (cd drivers/media/usb/uvc/ && make -C /usr/src/linux-headers-uname -r M=pwd modules) make: Entering directory /usr/src/linux-headers-3.19.0-30-generic' CC [M] /home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc/uvc_driver.o /home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc/uvc_driver.c:148:11: error: ‘V4L2_PIX_FMT_INVZ’ undeclared here (not in a function) .fcc = V4L2_PIX_FMT_INVZ, ^ /home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc/uvc_driver.c:153:11: error: ‘V4L2_PIX_FMT_INZI’ undeclared here (not in a function) .fcc = V4L2_PIX_FMT_INZI, ^ /home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc/uvc_driver.c:158:11: error: ‘V4L2_PIX_FMT_INVR’ undeclared here (not in a function) .fcc = V4L2_PIX_FMT_INVR, ^ /home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc/uvc_driver.c:163:11: error: ‘V4L2_PIX_FMT_INRI’ undeclared here (not in a function) .fcc = V4L2_PIX_FMT_INRI, ^ /home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc/uvc_driver.c:168:11: error: ‘V4L2_PIX_FMT_INVI’ undeclared here (not in a function) .fcc = V4L2_PIX_FMT_INVI, ^ /home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc/uvc_driver.c:173:11: error: ‘V4L2_PIX_FMT_RELI’ undeclared here (not in a function) .fcc = V4L2_PIX_FMT_RELI, ^ make[1]: *** [/home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc/uvc_driver.o] Error 1 make: *** [_module_/home/nima/linux-lts-vivid-3.19.0/drivers/media/usb/uvc] Error 2 make: Leaving directory/usr/src/linux-headers-3.19.0-30-generic'

It seems like a header (videodev2.h) is missing. Any ideas are much appreciated.

teknotus commented 8 years ago

Could you link to the git tree you are using and paste in the git commit hash? Sometimes I need to tweak the patch for a specific kernel version. Did you compile the whole kernel or download it from a package repo? I may be able to come up with better instructions on how to build. My knowledge of kernel patch development has improved a bit since I wrote that.

Nikvand commented 8 years ago

Hi @teknotus This is where I got the patch from: https://github.com/teknotus/depthview/tree/kernelpatchfmt

Latest commit is on March 3rd, 2015. As for the hash I get the following for this branch:

ecd476ca4c7539c15d4332b99362bf0ae38cd9a6

Appreciate your help as I am currently not getting IR stream from my camera

teknotus commented 8 years ago

I meant where did you get the kernel source. lts-vivid is a different kernel tree than the Linus Torvalds tree I linked to.

Nikvand commented 8 years ago

@teknotus apt-get source linux-image-$(uname -r) gets me lts-vivid. uname-r returns: 3.19.0-30-generic

Nikvand commented 8 years ago

@teknotus, gives me the same error when I patch the kernel source I got from Linus Trovald's tree.

Nikvand commented 8 years ago

Here is an update from patching Linus Trovald's tree:

nima@Nimani:~/linux$ (cd drivers/media/usb/uvc/ && make -C /usr/src/linux-headers-uname -r M=pwd modules) make: Entering directory `/usr/src/linux-headers-3.19.0-30-generic' CC [M] /home/nima/linux/drivers/media/usb/uvc/uvc_driver.o In file included from /home/nima/linux/drivers/media/usb/uvc/uvc_driver.c:28:0: /home/nima/linux/drivers/media/usb/uvc/uvcvideo.h:18:34: fatal error: media/videobuf2-v4l2.h: No such file or directory

include <media/videobuf2-v4l2.h>

                              ^

compilation terminated. make[1]: [/home/nima/linux/drivers/media/usb/uvc/uvc_driver.o] Error 1 make: [module/home/nima/linux/drivers/media/usb/uvc] Error 2 make: Leaving directory`/usr/src/linux-headers-3.19.0-30-generic'

Nikvand commented 8 years ago

This time it is complaining about "media/videobuf2-v4l2.h"

teknotus commented 8 years ago

I'm thinking the patch is probably OK, but I need to fix my instructions.

Nikvand commented 8 years ago

Appreciate any ideas!

teknotus commented 8 years ago

For the out of kernel tree module I'm working on at the moment the makefile looks like this.

KDIR ?= /lib/modules/uname -r/build

default: $(MAKE) -C $(KDIR) M=$$PWD

So rather than the -C going to a headers directory it seems it should be going to a build directory.

teknotus commented 8 years ago

Also librealsense has a patch that supports most of the F200 formats, and a script to patch the kernel. You could try that.

https://github.com/IntelRealSense/librealsense/tree/master/scripts