Has anyone successfully used v4l2loopback on R28.2.1 ?

I ask this because I am running a weird config, but I think this was working fine with R28.1 and R28.2-Pre-Release, however when trying to use it with R28.2.1, although it seems it works (I can successfully read the virtual video device), each time kernel errors are shown.

I have just R28.2.1 rootfs (patched by apply_binaries.sh and apt updated) on a SATA SSD partition, and boot it from eMMC through an extlinux.conf entry (R28.2.1 kernel image is copied into eMMC0 /boot). I have no post-install step (no CUDA, …).

I have built and installed v4l2loopback module as I previously did following this and installed my virtual video device as /dev/video2:

sudo modprobe v4l2loopback devices=1 video_nr=2

Each time I try to use v4l2sink

gst-launch-1.0 -e videotestsrc is-live=true ! 'video/x-raw, format=BGR, width=640, height=480, framerate=30/1' ! tee ! v4l2sink device=/dev/video2

I see these errors :

dmesg --follow
...
[ 9122.756817] Unknown pixelformat 0x30395056
[ 9122.760968] ------------[ cut here ]------------
[ 9122.765577] WARNING: at ffffffc0007a7240 [verbose debug info unavailable]
[ 9122.772351] Modules linked in: v4l2loopback(O) fuse ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 xt_addrtype iptable_filter ip_tables xt_conntrack nf_nat br_netfilter overlay bcmdhd bluedroid_pm pci_tegra [last unloaded: v4l2loopback]

[ 9122.796235] CPU: 0 PID: 5354 Comm: videotestsrc0:s Tainted: G        W  O    4.4.38-tegra #1
[ 9122.804655] Hardware name: quill (DT)
[ 9122.808309] task: ffffffc059a2d780 ti: ffffffc056eb8000 task.ti: ffffffc056eb8000
[ 9122.815781] PC is at v4l_enum_fmt+0x1270/0x1608
[ 9122.820302] LR is at v4l_enum_fmt+0x1270/0x1608
[ 9122.824821] pc : [<ffffffc0007a7240>] lr : [<ffffffc0007a7240>] pstate: 80000045
[ 9122.832202] sp : ffffffc056ebbbf0
[ 9122.835508] x29: ffffffc056ebbbf0 x28: ffffffc001348730 
[ 9122.840826] x27: 0000000000000000 x26: ffffffc056ebbd20 
[ 9122.846145] x25: 0000007f88005730 x24: ffffffbffc02aaa8 
[ 9122.851462] x23: ffffffc124db5d80 x22: ffffffc19c95fe00 
[ 9122.856782] x21: ffffffbffc02aaa8 x20: 0000000000000000 
[ 9122.862100] x19: ffffffc056ebbd20 x18: 0000000000000000 
[ 9122.867418] x17: 0000007f8de98b20 x16: ffffffc0001e6610 
[ 9122.872736] x15: 0000007f8e212000 x14: 0fffffffffffffff 
[ 9122.878055] x13: 0000000000000018 x12: ffffffc001299000 
[ 9122.883374] x11: 0000000000000002 x10: 00000000000008b0 
[ 9122.888693] x9 : ffffffc056ebb9b0 x8 : ffffffc059a2e090 
[ 9122.894010] x7 : 0000000000000400 x6 : 000000000019d7e3 
[ 9122.899329] x5 : 0000000000000000 x4 : ffffffc059a2e098 
[ 9122.904647] x3 : ffffffc19cb4d3cc x2 : ffffffc1eafd3228 
[ 9122.909965] x1 : 0000000000000000 x0 : 000000000000001e 

[ 9122.917090] ---[ end trace fdd57256678830e6 ]---
[ 9122.921698] Call trace:
[ 9122.924141] [<ffffffc0007a7240>] v4l_enum_fmt+0x1270/0x1608
[ 9122.929704] [<ffffffc0007a7dcc>] __video_do_ioctl+0x22c/0x2a0
[ 9122.935439] [<ffffffc0007a782c>] video_usercopy+0x254/0x5ac
[ 9122.941000] [<ffffffc0007a7b98>] video_ioctl2+0x14/0x1c
[ 9122.946214] [<ffffffc0007a2b8c>] v4l2_ioctl+0xbc/0xcc
[ 9122.951257] [<ffffffc0001e6350>] do_vfs_ioctl+0x324/0x5e4
[ 9122.956643] [<ffffffc0001e6694>] SyS_ioctl+0x84/0x98
[ 9122.961600] [<ffffffc000084ff0>] el0_svc_naked+0x24/0x28
[ 9122.967138] Unknown pixelformat 0x43564548
[ 9122.971325] ------------[ cut here ]------------
[ 9122.975956] WARNING: at ffffffc0007a7240 [verbose debug info unavailable]
[ 9122.982738] Modules linked in: v4l2loopback(O) fuse ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 xt_addrtype iptable_filter ip_tables xt_conntrack nf_nat br_netfilter overlay bcmdhd bluedroid_pm pci_tegra [last unloaded: v4l2loopback]

[ 9123.006668] CPU: 1 PID: 5354 Comm: videotestsrc0:s Tainted: G        W  O    4.4.38-tegra #1
[ 9123.015093] Hardware name: quill (DT)
[ 9123.018787] task: ffffffc059a2d780 ti: ffffffc056eb8000 task.ti: ffffffc056eb8000
[ 9123.026286] PC is at v4l_enum_fmt+0x1270/0x1608
[ 9123.030810] LR is at v4l_enum_fmt+0x1270/0x1608
[ 9123.035333] pc : [<ffffffc0007a7240>] lr : [<ffffffc0007a7240>] pstate: 80000045
[ 9123.042715] sp : ffffffc056ebbbf0
[ 9123.046024] x29: ffffffc056ebbbf0 x28: ffffffc001348730 
[ 9123.051348] x27: 0000000000000000 x26: ffffffc056ebbd20 
[ 9123.056670] x25: 0000007f88005780 x24: ffffffbffc02aaa8 
[ 9123.061991] x23: ffffffc124db5d80 x22: ffffffc19c95fe00 
[ 9123.067315] x21: ffffffbffc02aaa8 x20: 0000000000000000 
[ 9123.072636] x19: ffffffc056ebbd20 x18: 0000000000000000 
[ 9123.077959] x17: 0000007f8de98b20 x16: ffffffc0001e6610 
[ 9123.083281] x15: 0000007f8e212000 x14: 0ffffffffffffffe 
[ 9123.088603] x13: 0000000000000020 x12: ffffffc001299000 
[ 9123.093925] x11: 0000000000000002 x10: 00000000000008b0 
[ 9123.099249] x9 : ffffffc056ebb9b0 x8 : ffffffc059a2e090 
[ 9123.104571] x7 : 0000000000000400 x6 : 00000000003835e5 
[ 9123.109894] x5 : 0000000000000000 x4 : ffffffc059a2e098 
[ 9123.115218] x3 : ffffffc19cb4d3cc x2 : ffffffc07033f0a8 
[ 9123.120543] x1 : 0000000000000000 x0 : 000000000000001e 

[ 9123.127796] ---[ end trace fdd57256678830e7 ]---
[ 9123.132408] Call trace:
[ 9123.134853] [<ffffffc0007a7240>] v4l_enum_fmt+0x1270/0x1608
[ 9123.140419] [<ffffffc0007a7dcc>] __video_do_ioctl+0x22c/0x2a0
[ 9123.146157] [<ffffffc0007a782c>] video_usercopy+0x254/0x5ac
[ 9123.151721] [<ffffffc0007a7b98>] video_ioctl2+0x14/0x1c
[ 9123.156940] [<ffffffc0007a2b8c>] v4l2_ioctl+0xbc/0xcc
[ 9123.161986] [<ffffffc0001e6350>] do_vfs_ioctl+0x324/0x5e4
[ 9123.167376] [<ffffffc0001e6694>] SyS_ioctl+0x84/0x98
[ 9123.172335] [<ffffffc000084ff0>] el0_svc_naked+0x24/0x28

The Unknown pixelformat 0x30395056 and 0x43564548 are always there, whatever format I specify before v4l2sink (NV12, I420, YUY2, GRAY8…).
Same with other video sources (nvcamerasrc, nvarguscamerasrc).

Is it just my case or is it reproducible ?

[EDIT: This may be related to v4l2loopback version. It works with 0.9.1 on R28.2-Pre but fails with 0.12.0 on R28.2.1]

Hi Honey_Patouceul,

Following below topic steps to install on r28.2.1/TX2, it’s working.
https://devtalk.nvidia.com/default/topic/1023416/jetson-tx1/error-building-v4l2loopback/post/5228430/#5228430

We have verified with:
[Stream to v4l2sink]

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvvidconv flip-method=2 ! 'video/x-raw, format=(string)I420, framerate=(fraction)30/1' ! tee ! v4l2sink device=/dev/video1

[Get preview via guvcview]

export DISPLAY=:0
guvcview -d /dev/video1

Hi Carolyuu,

The link you’ve provided is the one I’ve followed.
As previously said, in my case it also works but there are kernel errors.

Could you please confirm that you don’t see kernel errors with dmesg ?
If errors are only seen on my side, do you have any suggestion about how I could debug it ?

Thanks

Hi Honey_Patouceul,

We try below commands, got kernel errors too:

gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)I420, framerate=(fraction)30/1' ! v4l2sink device=/dev/video1

It should be third party issue, not our NV issue.
Thanks!

Thanks for checking.
Not sure what you call third party.
If it is about videotestsrc, in my case, it also faults with nvcamerasrc or nvarguscamerasrc.
If it is about v4l2loopback, it was working without errors with previous L4T versions.

Hi Honey,
It is more like an issue in https://github.com/umlaeute/v4l2loopback

In running below pipeline on r28.1, r28.2-prelease, r28.2.1:

gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)I420, framerate=(fraction)30/1' ! v4l2sink device=/dev/video1

videotestsrc and v4l2sink are fixed at gstreamer 1.8.3, but v4l2loopback keeps updating

Maybe it is this one https://github.com/umlaeute/v4l2loopback/issues/187
It shows error [Unknown pixelformat]

I think I’ve figured it out. The bug came with v4l2loopback version 0.11 and is also present in version 0.12. Previous versions 0.9.1 and 0.10.0 don’t have this problem. Further reported here.

So, for anyone wanting to use it, the simplest way is installing dmks version 0.9.1 that seems to work fine:

sudo apt-get install v4l2loopback-dkms v4l2loopback-utils

If you want to try v0.10.0 you would build it this way:

sudo su
apt-get install v4l2loopback-utils
cd /usr/src/linux-headers-4.4.38-tegra
make modules_prepare
mkdir v4l2loopback
cd v4l2loopback
git clone <b>-b v0.10.0</b> https://github.com/umlaeute/v4l2loopback.git
cd v4l2loopback
make
make install
<b>insmod /lib/modules/4.4.38-tegra/extra/v4l2loopback.ko devices=1 video_nr=2</b>

If you have the dkms version installed, modprobe will use this one. So if you want to test your own build, you have to specify the built module in extra directory with insmod.

Note however that with v0.10.0 there is this message when gstreamer starts:

libv4l2: error getting pixformat: Invalid argument

while this is not seen with v0.9.1.

Update: Seems 4.4.38-tegra kernel doesn’t support the VP9 pixel format, although its headers properly define it.

This has been fixed by commenting VP9 and HEVC sections at the end of file v4l2loopback_formats.h (in the folder where you have cloned the project, where you type make).