Closed Andoku closed 4 years ago
@Andoku , which branch are you building with and which kernel is being built for that MACHINE? If linux-imx then only the master branch of 'meta-intel-realsense' currently has support for this. The required kernel patches won't be applied if using any other branch.
@srware
which branch are you building with and which kernel is being built for that MACHINE?
I am building with zeus branch. Kernel imx-5.4.3-1.0.0
The required kernel patches won't be applied if using any other branch.
Oh, I followed instruction "1. Checkout the branch which corresponds with your version of Yocto" and checked out zeus branch. Am i supposed to build master instead?
@srware
When trying to build master I get following error:
ERROR: Layer intel-realsense is not compatible with the core layer which only supports these series: zeus (layer is compatible with dunfell gatesgarth)
Generally no, you should keep layer branches the same however IMX devices use a kernel called "linux-imx" provided by the 'meta-freescale' layer. This layer until recently only had support for the standard "linux-yocto" and "linux-intel" kernels so any devices which do not use these kernels required the user to manually override and patch accordingly. I recently added support for the "linux-imx" kernel in master but this hasn't and might not get backported to older branches.
You can try taking the linux-imx_5.4%.bbappend and associated patches from master and applying these to the zeus branch. It will likely work fine however given this is a stable branch it will require more testing for me to officially backport.
@srware
I backported linux-imx_5.4%.bbappend and associated files-folder from master. Everything compiled fine, but dmesg still gives me:
[ 2425.890891] hid-generic 0003:8086:0B3A.0002: device has no listeners, quitting
And running realsense examples (rs-helloworld) on imx8 tells me:
no device connected
Maybe I've missed something from master? What else should I look for?
@srware
Is it possible to use master branch and just add zeus
to
LAYERSERIES_COMPAT_intel-realsense = "dunfell gatesgarth"
Or master branch not compatible with zeus?
@Andoku , this should be possible off the top of my head. I can't think of any other conflicts.
Are you using the D435i with a USB 3 port? The HID message you posted would relate to the IMU specifically. Are you able to access any of the camera streams with the "viewer" application for example?
It might be that there is a missing kernel config with the linux-imx kernel which needs forcing but I will need to look into this some more and unfortunately don't have any hardware to test with...
@srware
Are you using the D435i with a USB 3 port?
Yes. We are using USB3.0 port:
root@imx8mqevk:~# lsusb
Bus 002 Device 002: ID 8086:0b3a Intel Corp. Intel(R) RealSense(TM) Depth Camera 435i
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Is it possible that there is not enough power? Should we try it with usb hub with extra power?
Are you able to access any of the camera streams with the "viewer" application for example?
Unfortunately we can't run realsense-viewer:
root@imx8mqevk:~# realsense-viewer
Could not initialize offscreen content!
I think it is because we use xwayland image because nxp yocto image doesn't support X11 anymore, will it work with wayland? Can we check with something else instead?
@srware
Recompiled with master and added option CONFIG_USB_HIDDEV=y
to uvc.cfg, now dmesg looks like:
[ 507.686506] usb 2-1: new SuperSpeed Gen 1 USB device number 6 using xhci-hcd
[ 507.723549] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a)
[ 507.734522] uvcvideo 2-1:1.0: Entity type for entity Intel(R) RealSense(TM) Depth Ca was not initialized!
[ 507.744131] uvcvideo 2-1:1.0: Entity type for entity Processing 2 was not initialized!
[ 507.752086] uvcvideo 2-1:1.0: Entity type for entity Camera 1 was not initialized!
[ 507.760453] input: Intel(R) RealSense(TM) Depth Ca as /devices/platform/soc@0/38200000.usb/xhci-hcd.0.auto/usb2/2-1/2-1:1.0/input/input18
[ 507.773743] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a)
[ 507.783778] uvcvideo 2-1:1.3: Entity type for entity Processing 7 was not initialized!
[ 507.791716] uvcvideo 2-1:1.3: Entity type for entity Extension 8 was not initialized!
[ 507.799562] uvcvideo 2-1:1.3: Entity type for entity Camera 6 was not initialized!
[ 507.811735] hid-generic 0003:8086:0B3A.000F: device has no listeners, quitting
and examples:
root@imx8mqevk:~# rs-enumerate-devices
No device detected. Is it plugged in?
root@imx8mqevk:~# rs-hello-realsense
RealSense error calling rs2_pipeline_start(pipe:0xeffe0f0):
No device connected
@srware Any ideas what else can we try?
@Andoku , it sounds similar to this
Can you check that the udev rules made it into the image and maybe try the udevadm command to ensure they are in effect. Otherwise I would assume that the kernel patches are not being applied correctly and/or something is missing in the kernel config. I am struggling to build an image currently using meta-freescale master branch due to license issues so I need to work that out before I can check what's going on.
@srware
Can you check that the udev rules made it into the image
It seems like they are in the image:
root@imx8mqevk:~# ls /etc/udev/rules.d/
10-imx.rules 99-librealsense2-libusb.rules localextra.rules
40-libgphoto2.rules automount.rules touchscreen.rules
71-weston-drm.rules autonet.rules
and maybe try the udevadm command to ensure they are in effect
Did it - nothing changed :(
root@imx8mqevk:~# sudo udevadm control --reload-rules && udevadm trigger
root@imx8mqevk:~#
Thanks for testing @Andoku
@srware Is it possible to look at resulting kernel source code in yocto so I can check if kernel patches were applied correctly?
It looks like linux-imx doesn't work like linux-yocto and other kernels with regards to modifying the config: https://community.nxp.com/thread/376369
I might need to update the .bbappend recipe to explicitly copy the additional config to the correct file so the kernel config contains all of the right pieces. I will keep working on it.
@Andoku , I have looked into this some more and it does seem that the kernel config is being applied correctly however there is some missing config for the HID side of the D435i in the linux-imx kernel. I have pushed changes to master. Could you see if this makes any difference for your hardware? Thanks.
@srware dmesg message:
[ 964.404784] usb 2-1: new SuperSpeed Gen 1 USB device number 5 using xhci-hcd
[ 964.445988] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a)
[ 964.456903] uvcvideo 2-1:1.0: Entity type for entity Intel(R) RealSense(TM) Depth Ca was not initialized!
[ 964.466530] uvcvideo 2-1:1.0: Entity type for entity Processing 2 was not initialized!
[ 964.474481] uvcvideo 2-1:1.0: Entity type for entity Camera 1 was not initialized!
[ 964.482338] input: Intel(R) RealSense(TM) Depth Ca as /devices/platform/soc@0/38200000.usb/xhci-hcd.0.auto/usb2/2-1/2-1:1.0/input/input8
[ 964.495520] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a)
[ 964.505550] uvcvideo 2-1:1.3: Entity type for entity Processing 7 was not initialized!
[ 964.513477] uvcvideo 2-1:1.3: Entity type for entity Extension 8 was not initialized!
[ 964.521322] uvcvideo 2-1:1.3: Entity type for entity Camera 6 was not initialized!
[ 964.533430] hid-generic 0003:8086:0B3A.0007: device has no listeners, quitting
and sometimes:
[ 640.845478] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[ 640.893140] hid-generic 0003:8086:0B3A.0004: device has no listeners, quitting
[ 640.974975] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a)
[ 640.984863] uvcvideo 2-1:1.0: Entity type for entity Intel(R) RealSense(TM) Depth Ca was not initialized!
[ 640.994474] uvcvideo 2-1:1.0: Entity type for entity Processing 2 was not initialized!
[ 641.002559] uvcvideo 2-1:1.0: Entity type for entity Camera 1 was not initialized!
[ 641.010405] input: Intel(R) RealSense(TM) Depth Ca as /devices/platform/soc@0/38200000.usb/xhci-hcd.0.auto/usb2/2-1/2-1:1.0/input/input5
[ 641.023095] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a)
[ 641.033172] uvcvideo 2-1:1.3: Entity type for entity Processing 7 was not initialized!
[ 641.041109] uvcvideo 2-1:1.3: Entity type for entity Extension 8 was not initialized!
[ 641.048972] uvcvideo 2-1:1.3: Entity type for entity Camera 6 was not initialized!
[ 641.056758] usbcore: registered new interface driver uvcvideo
[ 641.062550] USB Video Class driver (1.1.1)
# rs-enumerate-devices
No device detected. Is it plugged in?
@Andoku , for want of a better idea can you try pulling master again with my latest changes and add the following to your build config:
PACKAGECONFIG_pn-librealsense2 = "rsusb"
I checked the linux-imx
config and source and everything seems to be working correctly but clearly there are issues using the native backend on your platform (i've seen this reported for other arm based platforms also). I don't have a camera or hardware currently in order to do any further debug.
Thanks.
@srware It's working now!
dmesg:
[ 260.964946] usb 2-1: new SuperSpeed Gen 1 USB device number 81 using xhci-hcd
[ 261.007330] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a)
[ 261.017984] uvcvideo 2-1:1.0: Entity type for entity Intel(R) RealSense(TM) Depth Ca was not initialized!
[ 261.027615] uvcvideo 2-1:1.0: Entity type for entity Processing 2 was not initialized!
[ 261.036612] uvcvideo 2-1:1.0: Entity type for entity Camera 1 was not initialized!
[ 261.044496] input: Intel(R) RealSense(TM) Depth Ca as /devices/platform/soc@0/38200000.usb/xhci-hcd.0.auto/usb2/2-1/2-1:1.0/input/input2
[ 261.057626] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a)
[ 261.067685] uvcvideo 2-1:1.3: Entity type for entity Processing 7 was not initialized!
[ 261.075630] uvcvideo 2-1:1.3: Entity type for entity Extension 8 was not initialized!
[ 261.083502] uvcvideo 2-1:1.3: Entity type for entity Camera 6 was not initialized!
[ 261.095699] hid-generic 0003:8086:0B3A.0002: device has no listeners, quitting
@srware But I noticed that sometimes after running examples like rs-depth or rs-distance camera can't be found and there are erros in dmesg. Only re-plugging camera helps. I will add dmesg errors tomorrow.
It works well for me with D455, running PetaLinux v. 2020.2 on Ultra96-V2 board. Thanks a lot!
Hi @reinaldogotz
Where exactly do I need to add the line PACKAGECONFIG_pn-librealsense2 = "rsusb"
to solve this problem in Petalinux?
@nalithlakshan , it will need to go in 'conf/local.conf' or 'conf/auto.conf' unless you are appending an image recipe etc... elsewhere in your build.
machine:
imx8mqevk
camera:
Intel Corp. Intel(R) RealSense(TM) Depth Camera 435i
branch:
zeus
uname -a output:
Linux imx8mqevk 5.4.3-lts-lf-5.4.y+gf8118585ee3c #1 SMP PREEMPT Sun Jun 28 15:33:27 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux
bitbake imx-image-multimedia
dmesg output: