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

Update patch-arch.sh based on #4271 #6709

Merged
merged 2 commits into from
Jun 30, 2020

Conversation

puzzlepaint
Copy link
Contributor

Installing librealsense on Manjaro Linux, I ran into the exact issues described in #4271 from a year ago. This PR proposes to update patch-arch.sh accordingly. Notice that it does not update the actual patch file. This may still need adaptation depending on the kernel version that is used (which however seemed to be rather trivial in my case for kernel 5.6.16).

@ev-mp
Copy link
Collaborator

ev-mp commented Jun 28, 2020

@puzzlepaint , thank you for the PR!
Several notes on the implementation:

  1. Can you provide a kernel log for inserting the patched module into the kernel ?
  2. Can you post the kernel log during camera's plugin to ensure that the required formats have been picked up correctly.
  3. While updating the supported streaming formats this script does not provide support for the metadata. It was not part of the original script but you can consider adding this to the PR as well.

@puzzlepaint
Copy link
Contributor Author

Thanks for the response, it is good to know that the metadata part was still missing. I assume this can be fixed by applying one of the realsense-metadata-... patches in addition to the realsense-camera-formats patch. I tried realsense-metadata-bionic-5.patch and it applied to my kernel version without requiring any change. So I added this to the script (but ideally there should be some mechanism that selects a suitable patch based on the kernel version that is used).

  1. The dmesg output for doing sudo modprobe uvcvideo seems to be:
[ 6941.989553] videodev: Linux video capture interface: v2.00
[ 6942.232147] usb 1-3: reset high-speed USB device number 2 using xhci_hcd
[ 6942.592063] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
[ 6942.630249] uvcvideo 1-3:1.0: Entity type for entity Extension 4 was not initialized!
[ 6942.630251] uvcvideo 1-3:1.0: Entity type for entity Extension 6 was not initialized!
[ 6942.630251] uvcvideo 1-3:1.0: Entity type for entity Extension 7 was not initialized!
[ 6942.630252] uvcvideo 1-3:1.0: Entity type for entity Processing 2 was not initialized!
[ 6942.630253] uvcvideo 1-3:1.0: Entity type for entity Extension 3 was not initialized!
[ 6942.630253] uvcvideo 1-3:1.0: Entity type for entity Camera 1 was not initialized!
[ 6942.630296] input: UVC Camera (046d:0825) as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/input/input46
[ 6942.630339] usbcore: registered new interface driver uvcvideo
[ 6942.630339] USB Video Class driver (1.1.1)
  1. When I plug in the camera, it prints:
[ 7227.911930] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 7227.929123] usb 2-1: New USB device found, idVendor=8086, idProduct=0b07, bcdDevice=50.c5
[ 7227.929124] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7227.929125] usb 2-1: Product: Intel(R) RealSense(TM) Depth Camera 435 
[ 7227.929125] usb 2-1: Manufacturer: Intel(R) RealSense(TM) Depth Camera 435 
[ 7227.929126] usb 2-1: SerialNumber: 814113021690
[ 7227.931464] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435  (8086:0b07)
[ 7227.933192] uvcvideo 2-1:1.0: Entity type for entity Intel(R) RealSense(TM) Depth Ca was not initialized!
[ 7227.933193] uvcvideo 2-1:1.0: Entity type for entity Processing 2 was not initialized!
[ 7227.933193] uvcvideo 2-1:1.0: Entity type for entity Camera 1 was not initialized!
[ 7227.933263] input: Intel(R) RealSense(TM) Depth Ca as /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/input/input47
[ 7227.933612] uvcvideo: Unknown video format 36315752-1a66-a242-9065-d01814a8ef8a
[ 7227.933614] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435  (8086:0b07)
[ 7227.935029] uvcvideo 2-1:1.3: Entity type for entity Processing 7 was not initialized!
[ 7227.935030] uvcvideo 2-1:1.3: Entity type for entity Extension 8 was not initialized!
[ 7227.935030] uvcvideo 2-1:1.3: Entity type for entity Camera 6 was not initialized!

It indicates one missing format: Unknown video format 36315752-1a66-a242-9065-d01814a8ef8a.

Running realsense-viewer, I can stream RGB, Z16, Y8, and Y16 images successfully from my D435 camera, but I noticed the following message in the log on the bottom:

Pixel format 36315752-1a66-a242-9065-d01814a likely requires patch for fourcc code RW16!

I am not at all familiar with the Linux kernel or the UVC driver, but it seems to me that the GUID from the camera formats patch that corresponds to the RW16 format does not match the value 36315752-1a66-a242-9065-d01814a8ef8a that it complains about. I then checked the patch realsense-camera-formats-bionic-5.patch and it seems to contain an additional RW16-Bayer format that is not included in the patch realsense-camera-formats.patch that is referenced from patch-arch.sh:

+	#define UVC_GUID_FORMAT_BAYER16 \
+	{ 'R',  'W',  '1',  '6', 0x66, 0x1a, 0x42, 0xa2, \
+		0x90, 0x65, 0xd0, 0x18, 0x14, 0xa8, 0xef, 0x8a}

Probably that should be added as well. But that might be related to the patch files then, and not to the patching script.

@ev-mp
Copy link
Collaborator

ev-mp commented Jun 29, 2020

Thanks for the verification inputs,
The RW16 format is one of the calibration formats and is not required to be patched.
In case you selected the metadata patch though - please check the metadata in realsense-viewer by clicking "Info" button above the stream's viewport and share a screenshot with Depth+IR+RGB streams simultaneously (no need for high FPS/resolution)

@puzzlepaint
Copy link
Contributor Author

Here is a screenshot:
realsense_viewer_screenshot
Not sure what the expected outcome is if the metadata patch works / did not work. Does the existence of the time and frame numbers already show that it works?

@ev-mp
Copy link
Collaborator

ev-mp commented Jun 30, 2020

@puzzlepaint , try to click on the "Info" icon above each viewpoint as highlighted to check the metadata presence
image

@puzzlepaint
Copy link
Contributor Author

Ah, I clicked the "i" button before since it had "info" in its mouse-over tooltip. Here is a new screenshot with the left button activated:
realsense_viewer_screenshot

Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ready for merge - the metadata patch is applied correctly.

@ev-mp ev-mp changed the base branch from development to ac June 30, 2020 16:55
@ev-mp ev-mp merged commit 4e69430 into IntelRealSense:ac Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants