Fix device_caps error -22 (EINVAL) on Linux 5.4+#8
Conversation
torvalds/linux@3c13505 broke this driver, requiring the video device's device_caps be set in advance. Set the same device caps that are reported from vidioc_querycap(). Fixes yoshimoto#7.
a102f7a to
33cd75b
Compare
|
Thanks for your contribution. Thanks to you, I can successfully load the driver. After inserting the module/plugging in the camera, dmesg reports which sounds very good, but when reading the video devices I'm grateful for any input you can provide on this issue. |
|
@thamma: I geht the same output, but I can still use the Kinect and get RGB video out. |
|
Sadly no. I can neither read from /dev/video0 nor from /dev/video1. Neither mpv (which usually can immediately read from video devices) nor OBS or applications accessing webcams immediately read any data successfully. Mpv reports I will double check if I loaded all required kernel modules, but I am very certain I always do. I am running my Kinect on rather low amperage (1A instead of 2-3A which some people reccommend), however Protonect (the example program from the libfreenect2 project) can read all video channels as it is supposed to. |
|
Using v4l-utils yields some more info on the devices. In particular, For the |
|
I can look into this tomorrow, but maybe copy the info here into a new issue, which mentions |
|
The command I use to show Kinect2 output is: |
This actually shows the footage. Thanks for your effort and your great contribution in the first place! |
|
In order to use the Kinect2 (which uses the MotionJPG/mjpg codec) with other programs that mostly don't support mjpg, say, as a webcam, I convert with ffmpeg in the background. You do need a v4l2loopback device for this! ffmpeg \
-i /dev/video0 \
# don't do vsync, for less delay
-vsync drop \
# drop half the frames, and scale to 720p -- good enough for webcam use
# also mirror horizontally for webcam use -- other cams do this intrinsically but we need to do it ourselves
-filter:v fps=30,scale=1280:-1,hflip \
# good general-purpose pixel format supported by many apps
-pix_fmt yuyv422 \
# convert the colorspace, so the colors look better (not blown out too much)
-color_trc bt709 \
-color_primaries bt709 \
-color_range tv \
# output device format
-f v4l2 \
# output device
/dev/video2(remove the comments) I keep this running in the background, and can then use |
torvalds/linux@3c13505 broke this driver, requiring the video device's
device_caps be set in advance.
Set the same device caps that are reported from
vidioc_querycap().Fixes #7.