After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785164 - v4lsrc: device negociating a color format not exposed by the driver
v4lsrc: device negociating a color format not exposed by the driver
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.12.2
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-20 09:17 UTC by Florent Thiéry
Modified: 2017-08-31 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gst-launch output (57.34 KB, text/plain)
2017-07-20 09:17 UTC, Florent Thiéry
Details

Description Florent Thiéry 2017-07-20 09:17:11 UTC
Created attachment 356019 [details]
gst-launch output

Hello

I am using a v4l device whose driver does not advertise I420; however, requesting I420 does "work" (but the picture is of course corrupted)

GST_DEBUG=v4l2*:5 gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! "video/x-raw, format=(string)I420, width=(int)1920, height=(int)1080, framerate=(fraction)30" ! fakesink -v

Output is attached.
Comment 1 Nicolas Dufresne (ndufresne) 2017-07-20 12:01:46 UTC
I420 is provided by libv4l2 emulation, buy doing a software converting. The picture should not be corrupted though, but it is the wrong place to file bugs against libv4l2.
Comment 2 Florent Thiéry 2017-07-20 13:02:55 UTC
Thanks. Got confused by the fact that YU12 and I420 are the same (i was not seeing "I420 (emulated)" in the caps list.

0:00:00.011595144   485 0x559f8ec91720 INFO                    v4l2 gstv4l2object.c:1152:gst_v4l2_object_fill_format_list:<v4l2src0>   YU12 (emulated)
0:00:00.011600810   485 0x559f8ec91720 INFO                    v4l2 gstv4l2object.c:1152:gst_v4l2_object_fill_format_list:<v4l2src0>   YV12 (emulated)
Comment 3 Nicolas Dufresne (ndufresne) 2017-07-20 13:33:29 UTC
For the history, can you report which libv4l2 version is this ?

In general, I have a hard time figure-out what happen really, the lib will pseudo randomly pick JPEG or some other format, we need to dig the kernel trace to find out. As this is recurring issue, I'm tempted to consider ditching all emulated format (they are already sorted last, but still they get picked) unless there is nothing else we support. Only advertising JPEG though would break many app that assume that all camera produces raw images.
Comment 4 Florent Thiéry 2017-07-20 13:42:18 UTC
1.12.5 (from v4l-utils on Arch)
Comment 5 Nicolas Dufresne (ndufresne) 2017-07-20 14:01:39 UTC
Ok, same version on Fedora 26. As this high end VisionAV-HD capture card does not produce JPEG, it won't use that (I think JPEG is in general preferred by the library). So maybe YUY2 -> I420 or BGR4 -> I420 is broken. It's pretty annoying, since GStreamer can handle this just right.

Thanks for sharing, this card is interesting, I can see Gst is missing few features (input selection, some of the video formats, tv-norm selection). The driver seems to need some love and modernization though. How do you figure-out what resolution your DVI or SDI source have chosen ?
Comment 6 Florent Thiéry 2017-07-20 14:13:14 UTC
The driver offers private controls allowing get the detected input characteristics (v4l2.RGB133_V4L2_CID_HOR_TIME, v4l2.RGB133_V4L2_CID_VER_TIME). Other private controls allow to override analog timings, brightness, contrast, scaling A/R behaviour ...

We currently don't need/use input selection as the driver supports an option to expose all inputs as separate /dev/videoN device nodes.

Btw the card does internal scaling, so i can just request whatever i want and it will up/down scale if necessary.

Also, they support quite a lot of colorspaces that are not even supported by v4l, which triggers massive amounts of such kernel messages :

[15804.161161] WARNING: CPU: 5 PID: 3162 at drivers/media/v4l2-core/v4l2-ioctl.c:1291 v4l_enum_fmt+0x771/0x1220 [videodev]
[15804.161161] Unknown pixelformat 0x20203842
[15804.161162] Modules linked in: snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp nls_iso8859_1 nls_cp437 snd_hda_intel kvm_intel vfat iTCO_wdt fat rgb200(PO) rgb133(PO) kvm i915 irqbypass snd_hda_codec mei_wdt iTCO_vendor_support crct10dif_pclmul drm_kms_helper ppdev crc32_pclmul snd_hda_core crc32c_intel mxm_wmi ghash_clmulni_intel drm aesni_intel snd_hwdep videodev aes_x86_64 snd_pcm lrw intel_gtt evdev e1000e igb gf128mul media mac_hid snd_timer syscopyarea glue_helper sysfillrect sysimgblt ablk_helper snd dca fb_sys_fops cryptd mei_me i2c_algo_bit mei ptp soundcore i2c_i801 intel_cstate psmouse intel_rapl_perf pps_core shpchp i2c_smbus pcspkr hci_uart btbcm btqca btintel bluetooth parport_pc parport battery i2c_hid acpi_als
[15804.161177]  intel_lpss_acpi rfkill intel_lpss wmi kfifo_buf fjes hid tpm_tis tpm_tis_core video industrialio tpm acpi_pad button sch_fq_codel ip_tables x_tables ext4 crc16 jbd2 fscrypto mbcache sd_mod serio_raw atkbd libps2 ahci libahci xhci_pci libata xhci_hcd scsi_mod usbcore usb_common i8042 serio
[15804.161184] CPU: 5 PID: 3162 Comm: v4l2src11:src Tainted: P        W  O    4.9.37-1-lts #1
[15804.161184] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./IMB-391, BIOS P1.00 10/18/2016
[15804.161185]  ffffc9000a0c3bb0 ffffffff812f904d ffffc9000a0c3c00 0000000000000000
[15804.161186]  ffffc9000a0c3bf0 ffffffff8107cc6b 0000050b0a0c3c28 ffffc9000a0c3d88
[15804.161187]  0000000000000000 0000000000000000 ffffffffa0d5acc0 ffffc90009e6d000
[15804.161188] Call Trace:
[15804.161189]  [<ffffffff812f904d>] dump_stack+0x63/0x86
[15804.161190]  [<ffffffff8107cc6b>] __warn+0xcb/0xf0
[15804.161191]  [<ffffffff8107ccef>] warn_slowpath_fmt+0x5f/0x80
[15804.161192]  [<ffffffffa05eb381>] v4l_enum_fmt+0x771/0x1220 [videodev]
[15804.161194]  [<ffffffffa05ec7b4>] __video_do_ioctl+0x364/0x370 [videodev]
[15804.161194]  [<ffffffff810a6d3f>] ? ttwu_do_activate+0x6f/0x80
[15804.161196]  [<ffffffff810a7800>] ? try_to_wake_up+0xd0/0x3b0
[15804.161198]  [<ffffffffa05ec0fb>] video_usercopy+0x2cb/0x600 [videodev]
[15804.161199]  [<ffffffffa05ec450>] ? video_ioctl2+0x20/0x20 [videodev]
[15804.161200]  [<ffffffff811015e5>] ? do_futex+0x695/0xb90
[15804.161201]  [<ffffffff8118cef6>] ? lru_cache_add_active_or_unevictable+0x36/0xb0
[15804.161202]  [<ffffffffa05ec445>] video_ioctl2+0x15/0x20 [videodev]
[15804.161203]  [<ffffffffa05e774c>] v4l2_ioctl+0xbc/0xe0 [videodev]
[15804.161204]  [<ffffffff8121bec5>] do_vfs_ioctl+0xa5/0x600
[15804.161205]  [<ffffffff8121c499>] SyS_ioctl+0x79/0x90
[15804.161205]  [<ffffffff815fc637>] entry_SYSCALL_64_fastpath+0x1a/0xa9
[15804.161206] ---[ end trace c0e66770b4ca49ed ]---