Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu-mainline Hunk #1 FAILED #119

Closed
chaosink opened this issue Apr 23, 2016 · 9 comments
Closed

ubuntu-mainline Hunk #1 FAILED #119

chaosink opened this issue Apr 23, 2016 · 9 comments

Comments

@chaosink
Copy link

chaosink commented Apr 23, 2016

Required Info
Camera Model F200
Firmware Version
Operating System & Version Linux Mint 17.2
Kernel Version (Linux Only) 3.13.0-24-generic
Build System Makefile
patching file drivers/media/usb/uvc/uvc_driver.c
Hunk #1 FAILED at 108.
1 out of 1 hunk FAILED -- saving rejects to file drivers/media/usb/uvc/uvc_driver.c.rej
patching file drivers/media/usb/uvc/uvcvideo.h
Hunk #2 succeeded at 130 (offset -15 lines).
patching file include/uapi/linux/videodev2.h
Hunk #1 succeeded at 403 (offset -176 lines).

After runnning sudo modprobe uvcvideo, I didn't see anything related in dmesg or /var/log/syslog.

When I tried to run an example program, a kernel error occurred and the system turned to text mode showing some system logs and I can't do nothing but press the power button to force a reboot.

@ddiakopoulos
Copy link
Contributor

Hi @chaosink we've never tested with the 3.13 kernel on Mint and therefore cannot provide much support. Although it's not recommended, the easiest way to get up and running with a RealSense camera is through the libuvc backend.

@jokla
Copy link

jokla commented Apr 25, 2016

I have the same error in Ubuntu 14.04 (kernel 3.13.0-53-generic). If I run the example bin/cpp-capture the computer freezes and I have to restart it.

Is the patch supposed to work on Ubuntu?

Thanks!

@ddiakopoulos
Copy link
Contributor

@jokla the patch is suitably validated to be applied to kernel 3.19 and above only. Again, I recommend the less-stable libuvc backend for platforms we don't support.

@teknotus
Copy link

So what is happening is that Hunk #1 is patching the list of rules matching
the GUID of the video format with the FOURCC name used with V4L2, and a
human friendly name. All it needs to do is add the matching rules needed
for the video formats unique to RealSense cameras. The order of that array
isn't important. Patch is looking to splice in between V4L2_PIX_FMT_Y16
and V4L2_PIX_FMT_SBGGR8. Unfortunately the human friendly name part of
V4L2_PIX_FMT_SBGGR8

.name           = "BGGR Bayer (BY8 )",

changed in 2014 and so patch cannot find the place to splice in kernel
versions released before that change. I think an easy fix to have this
patch work on a wider range of kernel versions would be to splice the
RealSense formats into a place in the list that hasn't changed in a longer
period of time.

From "git blame" I can see that between V4L2_PIX_FMT_MJPEG
and V4L2_PIX_FMT_YVU420 hasn't changed since June 2008. At the RealSense
hackathon about a week ago someone was having the same problem on Ubuntu
14.04 and I manually edited his kernel source to fix it.

@ddiakopoulos
Copy link
Contributor

No movement on this issue for 3 weeks so closing it out.

dorodnic added a commit that referenced this issue Jun 9, 2016
Fix IMU-related constants in motion_module.cpp
@robertxchen66
Copy link

I have the same problem with kernel: Linux-desktop 4.4.0-040400-generic #201601101930 SMP Mon Jan 11 00:32:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Can you look at it again?

@dotchen
Copy link

dotchen commented Jul 27, 2016

I have the same issue with kernel: Linux version 3.13.0-92-generic (buildd@lgw01-52) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ). I can successfully build the cpp files, but whenever I try to run the tutorial executable, the kernel panics. Could you please take a look at it again?

@mfe7
Copy link

mfe7 commented Sep 16, 2016

I also have this issue:
patching file drivers/media/usb/uvc/uvc_driver.c Hunk #1 succeeded at 168 with fuzz 2 (offset 20 lines). patching file drivers/media/usb/uvc/uvcvideo.h Hunk #1 succeeded at 115 with fuzz 2 (offset -4 lines). patching file include/uapi/linux/videodev2.h Hunk #1 FAILED at 621. 1 out of 1 hunk FAILED -- saving rejects to file include/uapi/linux/videodev2.h.rej

on Ubuntu 14.04 kernel 4.4.0-36-generic. However, dmesg outputs:
[ 2773.969548] media: Linux media interface: v0.10 [ 2773.977361] Linux video capture interface: v2.00 [ 2773.988714] usbcore: registered new interface driver uvcvideo [ 2773.988717] USB Video Class driver (1.1.1)

@petern3
Copy link

petern3 commented Nov 23, 2016

I had the same issue as mfe7, on Ubuntu 14.04 kernel 4.4.0-47-generic, and was able to solve it.

First I ran patch-uvcvideo-ubuntu-mainline.sh line-by-line - line 25 failed. So I went into realsense-camera-formats.patch.

Fortunately the patches are human-readable, and so I manually applied the patches. The files it was trying to change weren't quite what they were expecting.

After that I ran the remaining lines from patch-uvcvideo-ubuntu-mainline.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants