Linux Media Controller development
 help / color / mirror / Atom feed
* uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
@ 2016-09-03  9:24 Oliver Collyer
  2016-09-04 19:25 ` Andrey Utkin
  0 siblings, 1 reply; 14+ messages in thread
From: Oliver Collyer @ 2016-09-03  9:24 UTC (permalink / raw)
  To: linux-media

Hi all

I’ve been trying to workaround some issues in FFmpeg relating to the V4L2_BUF_FLAG_ERROR flag being passed from V4L2.

In particular this bug here:

https://trac.ffmpeg.org/ticket/4988

The long and short of it is that this error comes through several times at the start of a capture and FFmpeg struggles to handle it properly, despite previous attempts at fixing (such as this one https://trac.ffmpeg.org/ticket/4030)

I’ve also reproduced this outside of FFmpeg using the capture example that is part of the V4L2 API:

https://www.linuxtv.org/downloads/v4l-dvb-apis/capture-example.html

Further, I have the following two devices in my possession and both produce the error, so it doesn’t seem to be related to the specific hardware, unless they are somehow making the same mistake:

Magewell XI100DUSBHDMI
Inogeni DVI2USB3

Significantly, the error does not occur the first time after the USB device is connected (or the machine rebooted or the uvcvideo kernel module reloaded), however it appears 100% of the time thereafter.

I downloaded and built the latest media_build and re-loaded the newly built uvcvideo module but I still get the same behaviour.

The issue can be worked around by using modprobe to unload and reload uvcvideo before each capture.

Here is some dmesg output:

These lines appear when the uvcvideo modules is removed and then added again:

[43909.871585] usbcore: deregistering interface driver uvcvideo
[43910.117724] media: Linux media interface: v0.10
[43910.120736] Linux video capture interface: v2.00
[43910.120738] WARNING: You are using an experimental version of the media stack.
               	As the driver is backported to an older kernel, it doesn't offer
               	enough quality for its usage in production.
               	Use it with care.
               Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
               	23ea23617ba96f7969aa5c175ebaad9557612171 Merge branch 'docs-next' of /git/mchehab/experimental into docs-next
               	fb6609280db902bd5d34445fba1c926e95e63914 [media] dvb_frontend: Use memdup_user() rather than duplicating its implementation
               	8eb14e8084b0f39dbf23dcd0c263fc2fac862048 [media] vb2: Fix vb2_core_dqbuf() kernel-doc
[43910.122896] uvcvideo: Found UVC 1.00 device XI100DUSB-HDMI (2935:0001)
[43910.123874] uvcvideo 2-4:1.0: Entity type for entity Processing 2 was not initialized!
[43910.123877] uvcvideo 2-4:1.0: Entity type for entity Camera 1 was not initialized!
[43910.123952] input: XI100DUSB-HDMI as /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/input/input27
[43910.124016] usbcore: registered new interface driver uvcvideo
[43910.124018] USB Video Class driver (1.1.1)

I then run a capture using FFmpeg or the capture example in the V4L2 API and it works fine, so there is no more trace.

However if I run the same capture/test subsequently I always get these two lines:

[43950.910465] uvcvideo: Non-zero status (-71) in video completion handler.
[43950.910483] videobuf2-v4l2.c: setting V4L2_BUF_FLAG_ERROR

The second line is trace I added myself to show when it sets the buffer error flag. As you can see, first of all there is an error (-71) in the video completion handler, and then shortly afterwards the buffer error flag gets set.

It would appear that when the first capture ends something isn’t being cleaned-up properly, leading to the error state for subsequent captures and the knock-on effects to FFmpeg or anything using V4L2.

These are two of the most popular USB3 capture devices out there so it would be great to get to the bottom of this. I know apps are expected to workaround V4L2_BUF_FLAG_ERROR but in the case of FFmpeg it’s a little problematic because even if we just discard the buffer it still ends up throwing the timestamps of the input out of whack with the output leading to tons of FFmpeg warnings.

Since this happens 100% of the time from the second capture onwards for these devices, and is clearly resolved by a module reload it seems that the best approach would be to fix the underlying cause if possible.

If I can provide any more info please let me know. I am happy to test/make any suggested fixes or even provide ssh access to the machine if necessary.

Regards

Oliver

oliver@NUC-1:~$ uname -a
Linux NUC-1 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

oliver@NUC-1:~/media_build/linux$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 94
Model name:            Intel(R) Core(TM) i7-6770HQ CPU @ 2.60GHz
Stepping:              3
CPU MHz:               1501.500
CPU max MHz:           3500,0000
CPU min MHz:           800,0000
BogoMIPS:              5183.87
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp

oliver@NUC-1:~/media_build/linux$ lsusb
Bus 002 Device 002: ID 2935:0001  
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp. 
Bus 001 Device 005: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
Bus 001 Device 004: ID 05ac:921c Apple, Inc. A1082 [Cinema HD Display 23"]
Bus 001 Device 006: ID 09da:000a A4Tech Co., Ltd. Optical Mouse Opto 510D / OP-620D
Bus 001 Device 002: ID 05ac:911c Apple, Inc. Hub in A1082 [Cinema HD Display 23"]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-03  9:24 uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR Oliver Collyer
@ 2016-09-04 19:25 ` Andrey Utkin
  2016-09-04 19:55   ` Oliver Collyer
  2016-09-05 19:43   ` Oliver Collyer
  0 siblings, 2 replies; 14+ messages in thread
From: Andrey Utkin @ 2016-09-04 19:25 UTC (permalink / raw)
  To: Oliver Collyer; +Cc: linux-media

Hi!
Seems like weird error in V4L subsystem or in uvcvideo driver, in the
most standard usage scenario.
Please retry with kernel and FFmpeg as new as possible, best if compiled
from latest upstream sources.
For kernel please try release 4.7.2 or even linux-next
(git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git), for
FFmpeg please make a git clone from git://source.ffmpeg.org/ffmpeg.git
and there do "./configure && make" and run obtained "ffmpeg" binary.

Please CC me when you come back with your results.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-04 19:25 ` Andrey Utkin
@ 2016-09-04 19:55   ` Oliver Collyer
  2016-09-05 19:43   ` Oliver Collyer
  1 sibling, 0 replies; 14+ messages in thread
From: Oliver Collyer @ 2016-09-04 19:55 UTC (permalink / raw)
  To: Andrey Utkin; +Cc: linux-media

Hi Andrey

I'm already building my own FFmpeg from git master but in any case it happens with the V4L2 API capture example in exactly the same way.

I have rebuilt uvcvideo/v4l from media_build with same result but I'll try later kernel.

Regards

Oliver

> On 4 Sep 2016, at 22:25, Andrey Utkin <andrey_utkin@fastmail.com> wrote:
> 
> Hi!
> Seems like weird error in V4L subsystem or in uvcvideo driver, in the
> most standard usage scenario.
> Please retry with kernel and FFmpeg as new as possible, best if compiled
> from latest upstream sources.
> For kernel please try release 4.7.2 or even linux-next
> (git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git), for
> FFmpeg please make a git clone from git://source.ffmpeg.org/ffmpeg.git
> and there do "./configure && make" and run obtained "ffmpeg" binary.
> 
> Please CC me when you come back with your results.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-04 19:25 ` Andrey Utkin
  2016-09-04 19:55   ` Oliver Collyer
@ 2016-09-05 19:43   ` Oliver Collyer
  2016-09-05 20:19     ` Andrey Utkin
  1 sibling, 1 reply; 14+ messages in thread
From: Oliver Collyer @ 2016-09-05 19:43 UTC (permalink / raw)
  To: linux-media; +Cc: Andrey Utkin

[-- Attachment #1: Type: text/plain, Size: 2527 bytes --]

Hi

So I built 4.8-rc5 from source, added in a line to videobuf2-v4l2.c to output to the kernel debug when it sets the error flag and repeated my tests.

I get exactly the same result.

I also enabled the uvc_trace output in case it helps.

Attached are the following files:

dmesg_reload_uvcvideo_trace - this shows the dmesg output after running modprobe to remove and then re-add the uvcvideo module. This was done at the start of my test to clean things up.
dmesg_first_ffmpeg_capture - this shows the dmesg output after running a test capture using ffmpeg. All is working smoothly at this point.
ffmpeg_first_ffmpeg_capture - this is the output from ffmpeg which corresponds to the above. FFmpeg doesn’t report any problems.
dmesg_second_ffmpeg_capture - this shows where it goes wrong. First you get error -71 (EPROTO) somewhere in uvcvideo. After this, my additional trace picks up the setting of the V4L2_BUF_FLAG_ERROR flag. This occurs on line 267 of videobuf2-v4l2.c
ffmpeg_second_ffmpeg_capture - this is the output from ffmpeg which corresponds to the above. As you can see it reports a corrupted dequeued buffer. On this occasion it handles it ok, with just one further warning regarding “Past duration too large”.
fmpeg_third_ffmpeg_capture - I ran a third ffmpeg capture and this time you can see FFmpeg struggling to deal with the difference in the timestamps between the input and the output, presumably a knock-on effect of the initial buffer corruption. These warnings continue indefinitely if you leave FFmpeg running. The only workaround I’ve so far come up with is to add an option to FFmpeg to simply discard the timestamps from the capture and calculate new ones, or to raise the threshold FFmpeg uses for this warning but this is rather papering over the cracks I feel.
dmesg_api_capture_example - finally I ran the code that comes with the V4L2 API to confirm that it isn’t an issue being caused by FFmpeg. As you can see, error -71 occurs followed by the usual buffer error flag.

I do not have any knowledge of uvcvideo and the associated classes apart from the studying I’ve done the past day or two, but it seems likely that error -71 and the later setting of V4L2_BUF_FLAG_ERROR are linked. Also, the fact it only happens in captures after the first one suggests something isn’t being cleared down or released properly in uvcvideo/v4l2-core at the end of the first capture.

Let me know what I need to do next to further narrow it down.

Regards

Oliver


[-- Attachment #2: dmesg_api_capture_example.txt --]
[-- Type: text/plain, Size: 2438 bytes --]

[ 1138.087237] uvcvideo: uvc_v4l2_open
[ 1138.180909] uvcvideo: Resuming interface 0
[ 1138.180910] uvcvideo: Resuming interface 1
[ 1138.182123] uvcvideo: uvc_v4l2_mmap
[ 1138.182189] uvcvideo: uvc_v4l2_mmap
[ 1138.182239] uvcvideo: uvc_v4l2_mmap
[ 1138.182286] uvcvideo: uvc_v4l2_mmap
[ 1138.182440] uvcvideo: Allocated 5 URB buffers of 16x1024 bytes each.
[ 1138.182446] uvcvideo: uvc_v4l2_poll
[ 1138.185884] uvcvideo: Non-zero status (-71) in video completion handler.
[ 1138.185924] uvcvideo: uvc_v4l2_poll
[ 1138.185927] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[ 1138.185940] uvcvideo: uvc_v4l2_poll
[ 1138.185941] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[ 1138.185945] uvcvideo: uvc_v4l2_poll
[ 1138.185946] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[ 1138.185948] uvcvideo: uvc_v4l2_poll
[ 1138.185949] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[ 1138.185953] uvcvideo: uvc_v4l2_poll
[ 1138.196427] uvcvideo: Frame complete (EOF found).
[ 1138.196453] uvcvideo: uvc_v4l2_poll
[ 1138.196473] uvcvideo: frame 1 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[ 1138.196475] uvcvideo: uvc_v4l2_poll
[ 1138.206993] uvcvideo: Frame complete (EOF found).
[ 1138.207022] uvcvideo: uvc_v4l2_poll
[ 1138.207046] uvcvideo: uvc_v4l2_poll
[ 1138.233023] uvcvideo: frame 2 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[ 1138.243566] uvcvideo: Frame complete (EOF found).
[ 1138.243582] uvcvideo: uvc_v4l2_poll
[ 1138.243613] uvcvideo: uvc_v4l2_poll
[ 1138.273054] uvcvideo: frame 3 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[ 1138.283533] uvcvideo: Frame complete (EOF found).
[ 1138.283547] uvcvideo: uvc_v4l2_poll
[ 1138.283560] uvcvideo: uvc_v4l2_poll
[ 1138.313057] uvcvideo: frame 4 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[ 1138.323574] uvcvideo: Frame complete (EOF found).
[ 1138.323589] uvcvideo: uvc_v4l2_poll
[ 1138.323621] uvcvideo: uvc_v4l2_poll
[ 1138.353018] uvcvideo: frame 5 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[ 1138.363587] uvcvideo: Frame complete (EOF found).
[ 1138.363645] uvcvideo: uvc_v4l2_poll
[ 1138.372573] uvcvideo: uvc_v4l2_release
[ 1140.376210] uvcvideo: Suspending interface 1
[ 1140.376211] uvcvideo: Suspending interface 0


[-- Attachment #3: dmesg_first_ffmpeg_capture.txt --]
[-- Type: text/plain, Size: 26360 bytes --]

[  773.705527] uvcvideo: uvc_v4l2_open
[  773.800021] uvcvideo: Resuming interface 0
[  773.800023] uvcvideo: Resuming interface 1
[  773.800047] uvcvideo: Trying format 0x32315559 (YU12): 1920x1080.
[  773.800048] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  773.800422] uvcvideo: Trying format 0x32315559 (YU12): 1920x1080.
[  773.800423] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  773.800787] uvcvideo: Trying format 0x32315659 (YV12): 1920x1080.
[  773.800788] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  773.801158] uvcvideo: Trying format 0x50323234 (422P): 1920x1080.
[  773.801159] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  773.801532] uvcvideo: Trying format 0x56595559 (YUYV): 1920x1080.
[  773.801532] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  773.801925] uvcvideo: Setting frame interval to 1/25 (400000).
[  773.813144] uvcvideo: uvc_v4l2_mmap
[  773.813237] uvcvideo: uvc_v4l2_mmap
[  773.813300] uvcvideo: uvc_v4l2_mmap
[  773.813366] uvcvideo: uvc_v4l2_mmap
[  773.813428] uvcvideo: uvc_v4l2_mmap
[  773.813491] uvcvideo: uvc_v4l2_mmap
[  773.813552] uvcvideo: uvc_v4l2_mmap
[  773.813614] uvcvideo: uvc_v4l2_mmap
[  773.813677] uvcvideo: uvc_v4l2_mmap
[  773.813739] uvcvideo: uvc_v4l2_mmap
[  773.813800] uvcvideo: uvc_v4l2_mmap
[  773.813862] uvcvideo: uvc_v4l2_mmap
[  773.813923] uvcvideo: uvc_v4l2_mmap
[  773.813985] uvcvideo: uvc_v4l2_mmap
[  773.814046] uvcvideo: uvc_v4l2_mmap
[  773.814107] uvcvideo: uvc_v4l2_mmap
[  773.814175] uvcvideo: uvc_v4l2_mmap
[  773.814236] uvcvideo: uvc_v4l2_mmap
[  773.814297] uvcvideo: uvc_v4l2_mmap
[  773.814358] uvcvideo: uvc_v4l2_mmap
[  773.814420] uvcvideo: uvc_v4l2_mmap
[  773.814480] uvcvideo: uvc_v4l2_mmap
[  773.814542] uvcvideo: uvc_v4l2_mmap
[  773.814603] uvcvideo: uvc_v4l2_mmap
[  773.814664] uvcvideo: uvc_v4l2_mmap
[  773.814725] uvcvideo: uvc_v4l2_mmap
[  773.814787] uvcvideo: uvc_v4l2_mmap
[  773.814848] uvcvideo: uvc_v4l2_mmap
[  773.814909] uvcvideo: uvc_v4l2_mmap
[  773.814971] uvcvideo: uvc_v4l2_mmap
[  773.815032] uvcvideo: uvc_v4l2_mmap
[  773.815092] uvcvideo: uvc_v4l2_mmap
[  773.815254] uvcvideo: Allocated 5 URB buffers of 16x1024 bytes each.
[  773.880959] uvcvideo: Frame complete (EOF found).
[  773.910414] uvcvideo: frame 1 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  773.920953] uvcvideo: Frame complete (EOF found).
[  773.950412] uvcvideo: frame 2 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  773.960953] uvcvideo: Frame complete (EOF found).
[  773.990411] uvcvideo: frame 3 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.000952] uvcvideo: Frame complete (EOF found).
[  774.030413] uvcvideo: frame 4 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.040964] uvcvideo: Frame complete (EOF found).
[  774.070411] uvcvideo: frame 5 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.080952] uvcvideo: Frame complete (EOF found).
[  774.110410] uvcvideo: frame 6 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.120951] uvcvideo: Frame complete (EOF found).
[  774.150411] uvcvideo: frame 7 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.160951] uvcvideo: Frame complete (EOF found).
[  774.190410] uvcvideo: frame 8 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.200950] uvcvideo: Frame complete (EOF found).
[  774.230410] uvcvideo: frame 9 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.240951] uvcvideo: Frame complete (EOF found).
[  774.270410] uvcvideo: frame 10 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.280946] uvcvideo: Frame complete (EOF found).
[  774.310410] uvcvideo: frame 11 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.320950] uvcvideo: Frame complete (EOF found).
[  774.350411] uvcvideo: frame 12 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.360950] uvcvideo: Frame complete (EOF found).
[  774.390409] uvcvideo: frame 13 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.400949] uvcvideo: Frame complete (EOF found).
[  774.430425] uvcvideo: frame 14 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.440949] uvcvideo: Frame complete (EOF found).
[  774.470410] uvcvideo: frame 15 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.480949] uvcvideo: Frame complete (EOF found).
[  774.510409] uvcvideo: frame 16 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.520948] uvcvideo: Frame complete (EOF found).
[  774.550409] uvcvideo: frame 17 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.560949] uvcvideo: Frame complete (EOF found).
[  774.590411] uvcvideo: frame 18 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.600948] uvcvideo: Frame complete (EOF found).
[  774.630412] uvcvideo: frame 19 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.640944] uvcvideo: Frame complete (EOF found).
[  774.670410] uvcvideo: frame 20 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.680947] uvcvideo: Frame complete (EOF found).
[  774.710409] uvcvideo: frame 21 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.720947] uvcvideo: Frame complete (EOF found).
[  774.750409] uvcvideo: frame 22 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.760942] uvcvideo: Frame complete (EOF found).
[  774.790408] uvcvideo: frame 23 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.800946] uvcvideo: Frame complete (EOF found).
[  774.830407] uvcvideo: frame 24 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.840946] uvcvideo: Frame complete (EOF found).
[  774.870408] uvcvideo: frame 25 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.880947] uvcvideo: Frame complete (EOF found).
[  774.910406] uvcvideo: frame 26 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.920945] uvcvideo: Frame complete (EOF found).
[  774.950404] uvcvideo: frame 27 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  774.960941] uvcvideo: Frame complete (EOF found).
[  774.990408] uvcvideo: frame 28 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.000945] uvcvideo: Frame complete (EOF found).
[  775.030408] uvcvideo: frame 29 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.040944] uvcvideo: Frame complete (EOF found).
[  775.070408] uvcvideo: frame 30 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.080945] uvcvideo: Frame complete (EOF found).
[  775.110409] uvcvideo: frame 31 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.120944] uvcvideo: Frame complete (EOF found).
[  775.150407] uvcvideo: frame 32 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.160939] uvcvideo: Frame complete (EOF found).
[  775.190405] uvcvideo: frame 33 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.200945] uvcvideo: Frame complete (EOF found).
[  775.230404] uvcvideo: frame 34 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.240943] uvcvideo: Frame complete (EOF found).
[  775.270403] uvcvideo: frame 35 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.280943] uvcvideo: Frame complete (EOF found).
[  775.310404] uvcvideo: frame 36 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.320942] uvcvideo: Frame complete (EOF found).
[  775.350403] uvcvideo: frame 37 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.360942] uvcvideo: Frame complete (EOF found).
[  775.390402] uvcvideo: frame 38 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.400943] uvcvideo: Frame complete (EOF found).
[  775.430404] uvcvideo: frame 39 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.440942] uvcvideo: Frame complete (EOF found).
[  775.470413] uvcvideo: frame 40 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.480941] uvcvideo: Frame complete (EOF found).
[  775.510401] uvcvideo: frame 41 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.520941] uvcvideo: Frame complete (EOF found).
[  775.550401] uvcvideo: frame 42 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.560940] uvcvideo: Frame complete (EOF found).
[  775.590400] uvcvideo: frame 43 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.600936] uvcvideo: Frame complete (EOF found).
[  775.630399] uvcvideo: frame 44 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.640940] uvcvideo: Frame complete (EOF found).
[  775.670400] uvcvideo: frame 45 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.680935] uvcvideo: Frame complete (EOF found).
[  775.710402] uvcvideo: frame 46 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.720940] uvcvideo: Frame complete (EOF found).
[  775.750401] uvcvideo: frame 47 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.760939] uvcvideo: Frame complete (EOF found).
[  775.790399] uvcvideo: frame 48 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.800939] uvcvideo: Frame complete (EOF found).
[  775.830400] uvcvideo: frame 49 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.840938] uvcvideo: Frame complete (EOF found).
[  775.870397] uvcvideo: frame 50 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.880937] uvcvideo: Frame complete (EOF found).
[  775.910400] uvcvideo: frame 51 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.920937] uvcvideo: Frame complete (EOF found).
[  775.950416] uvcvideo: frame 52 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  775.960938] uvcvideo: Frame complete (EOF found).
[  775.990398] uvcvideo: frame 53 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.000932] uvcvideo: Frame complete (EOF found).
[  776.030402] uvcvideo: frame 54 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.040938] uvcvideo: Frame complete (EOF found).
[  776.070397] uvcvideo: frame 55 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.080936] uvcvideo: Frame complete (EOF found).
[  776.110398] uvcvideo: frame 56 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.120938] uvcvideo: Frame complete (EOF found).
[  776.150396] uvcvideo: frame 57 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.160936] uvcvideo: Frame complete (EOF found).
[  776.190395] uvcvideo: frame 58 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.200935] uvcvideo: Frame complete (EOF found).
[  776.230396] uvcvideo: frame 59 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.240936] uvcvideo: Frame complete (EOF found).
[  776.270394] uvcvideo: frame 60 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.280935] uvcvideo: Frame complete (EOF found).
[  776.310395] uvcvideo: frame 61 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.320935] uvcvideo: Frame complete (EOF found).
[  776.350394] uvcvideo: frame 62 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.360934] uvcvideo: Frame complete (EOF found).
[  776.390394] uvcvideo: frame 63 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.400934] uvcvideo: Frame complete (EOF found).
[  776.430393] uvcvideo: frame 64 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.440924] uvcvideo: Frame complete (EOF found).
[  776.470391] uvcvideo: frame 65 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.480924] uvcvideo: Frame complete (EOF found).
[  776.510393] uvcvideo: frame 66 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.520932] uvcvideo: Frame complete (EOF found).
[  776.550393] uvcvideo: frame 67 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.560932] uvcvideo: Frame complete (EOF found).
[  776.590394] uvcvideo: frame 68 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.600932] uvcvideo: Frame complete (EOF found).
[  776.630392] uvcvideo: frame 69 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.640954] uvcvideo: Frame complete (EOF found).
[  776.670392] uvcvideo: frame 70 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.680931] uvcvideo: Frame complete (EOF found).
[  776.710392] uvcvideo: frame 71 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.720932] uvcvideo: Frame complete (EOF found).
[  776.750391] uvcvideo: frame 72 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.760931] uvcvideo: Frame complete (EOF found).
[  776.790390] uvcvideo: frame 73 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.800931] uvcvideo: Frame complete (EOF found).
[  776.830391] uvcvideo: frame 74 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.840931] uvcvideo: Frame complete (EOF found).
[  776.870390] uvcvideo: frame 75 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.880930] uvcvideo: Frame complete (EOF found).
[  776.910389] uvcvideo: frame 76 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.920929] uvcvideo: Frame complete (EOF found).
[  776.950390] uvcvideo: frame 77 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  776.960929] uvcvideo: Frame complete (EOF found).
[  776.990389] uvcvideo: frame 78 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.000929] uvcvideo: Frame complete (EOF found).
[  777.030388] uvcvideo: frame 79 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.040928] uvcvideo: Frame complete (EOF found).
[  777.070389] uvcvideo: frame 80 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.080929] uvcvideo: Frame complete (EOF found).
[  777.110388] uvcvideo: frame 81 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.120928] uvcvideo: Frame complete (EOF found).
[  777.150393] uvcvideo: frame 82 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.160928] uvcvideo: Frame complete (EOF found).
[  777.190388] uvcvideo: frame 83 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.200928] uvcvideo: Frame complete (EOF found).
[  777.230387] uvcvideo: frame 84 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.240929] uvcvideo: Frame complete (EOF found).
[  777.270389] uvcvideo: frame 85 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.280927] uvcvideo: Frame complete (EOF found).
[  777.310387] uvcvideo: frame 86 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.320927] uvcvideo: Frame complete (EOF found).
[  777.350387] uvcvideo: frame 87 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.360926] uvcvideo: Frame complete (EOF found).
[  777.390386] uvcvideo: frame 88 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.400926] uvcvideo: Frame complete (EOF found).
[  777.430386] uvcvideo: frame 89 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.440927] uvcvideo: Frame complete (EOF found).
[  777.470385] uvcvideo: frame 90 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.480926] uvcvideo: Frame complete (EOF found).
[  777.510386] uvcvideo: frame 91 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.520926] uvcvideo: Frame complete (EOF found).
[  777.550384] uvcvideo: frame 92 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.560925] uvcvideo: Frame complete (EOF found).
[  777.590384] uvcvideo: frame 93 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.600915] uvcvideo: Frame complete (EOF found).
[  777.630384] uvcvideo: frame 94 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.640924] uvcvideo: Frame complete (EOF found).
[  777.670385] uvcvideo: frame 95 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.680921] uvcvideo: Frame complete (EOF found).
[  777.710384] uvcvideo: frame 96 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.720921] uvcvideo: Frame complete (EOF found).
[  777.750384] uvcvideo: frame 97 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.760923] uvcvideo: Frame complete (EOF found).
[  777.790382] uvcvideo: frame 98 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.800930] uvcvideo: Frame complete (EOF found).
[  777.830382] uvcvideo: frame 99 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.840920] uvcvideo: Frame complete (EOF found).
[  777.870384] uvcvideo: frame 100 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.880919] uvcvideo: Frame complete (EOF found).
[  777.910383] uvcvideo: frame 101 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.920917] uvcvideo: Frame complete (EOF found).
[  777.950383] uvcvideo: frame 102 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  777.960920] uvcvideo: Frame complete (EOF found).
[  777.990382] uvcvideo: frame 103 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.000919] uvcvideo: Frame complete (EOF found).
[  778.030382] uvcvideo: frame 104 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.040921] uvcvideo: Frame complete (EOF found).
[  778.070382] uvcvideo: frame 105 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.080918] uvcvideo: Frame complete (EOF found).
[  778.110380] uvcvideo: frame 106 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.120920] uvcvideo: Frame complete (EOF found).
[  778.150382] uvcvideo: frame 107 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.160917] uvcvideo: Frame complete (EOF found).
[  778.190380] uvcvideo: frame 108 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.200917] uvcvideo: Frame complete (EOF found).
[  778.230380] uvcvideo: frame 109 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.240917] uvcvideo: Frame complete (EOF found).
[  778.270379] uvcvideo: frame 110 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.280917] uvcvideo: Frame complete (EOF found).
[  778.310379] uvcvideo: frame 111 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.320917] uvcvideo: Frame complete (EOF found).
[  778.350378] uvcvideo: frame 112 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.360919] uvcvideo: Frame complete (EOF found).
[  778.390379] uvcvideo: frame 113 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.400919] uvcvideo: Frame complete (EOF found).
[  778.430377] uvcvideo: frame 114 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.440918] uvcvideo: Frame complete (EOF found).
[  778.470382] uvcvideo: frame 115 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.480918] uvcvideo: Frame complete (EOF found).
[  778.510378] uvcvideo: frame 116 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.520917] uvcvideo: Frame complete (EOF found).
[  778.550376] uvcvideo: frame 117 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.560917] uvcvideo: Frame complete (EOF found).
[  778.590376] uvcvideo: frame 118 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.600917] uvcvideo: Frame complete (EOF found).
[  778.630377] uvcvideo: frame 119 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.640917] uvcvideo: Frame complete (EOF found).
[  778.670376] uvcvideo: frame 120 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.680915] uvcvideo: Frame complete (EOF found).
[  778.710376] uvcvideo: frame 121 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.720916] uvcvideo: Frame complete (EOF found).
[  778.750377] uvcvideo: frame 122 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.760916] uvcvideo: Frame complete (EOF found).
[  778.790376] uvcvideo: frame 123 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.800915] uvcvideo: Frame complete (EOF found).
[  778.830376] uvcvideo: frame 124 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.840915] uvcvideo: Frame complete (EOF found).
[  778.870373] uvcvideo: frame 125 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.880904] uvcvideo: Frame complete (EOF found).
[  778.910374] uvcvideo: frame 126 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.920914] uvcvideo: Frame complete (EOF found).
[  778.950374] uvcvideo: frame 127 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  778.960914] uvcvideo: Frame complete (EOF found).
[  778.990374] uvcvideo: frame 128 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.000914] uvcvideo: Frame complete (EOF found).
[  779.030373] uvcvideo: frame 129 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.040914] uvcvideo: Frame complete (EOF found).
[  779.070373] uvcvideo: frame 130 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.080913] uvcvideo: Frame complete (EOF found).
[  779.110393] uvcvideo: frame 131 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.120913] uvcvideo: Frame complete (EOF found).
[  779.150372] uvcvideo: frame 132 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.160912] uvcvideo: Frame complete (EOF found).
[  779.190371] uvcvideo: frame 133 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.200912] uvcvideo: Frame complete (EOF found).
[  779.230371] uvcvideo: frame 134 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.240909] uvcvideo: Frame complete (EOF found).
[  779.270371] uvcvideo: frame 135 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.280912] uvcvideo: Frame complete (EOF found).
[  779.310372] uvcvideo: frame 136 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.320911] uvcvideo: Frame complete (EOF found).
[  779.350371] uvcvideo: frame 137 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  779.360909] uvcvideo: Frame complete (EOF found).
[  779.381600] uvcvideo: uvc_v4l2_release
[  782.175302] uvcvideo: Suspending interface 1
[  782.175303] uvcvideo: Suspending interface 0



[-- Attachment #4: dmesg_reload_uvcvideo_trace.txt --]
[-- Type: text/plain, Size: 737 bytes --]

[  714.682235] usbcore: deregistering interface driver uvcvideo
[  714.776488] uvcvideo: Resuming interface 0
[  714.776489] uvcvideo: Resuming interface 1
[  715.013267] media: Linux media interface: v0.10
[  715.027964] Linux video capture interface: v2.00
[  715.046526] uvcvideo: Found UVC 1.00 device XI100DUSB-HDMI (2935:0001)
[  715.063148] uvcvideo 2-4:1.0: Entity type for entity Processing 2 was not initialized!
[  715.063151] uvcvideo 2-4:1.0: Entity type for entity Camera 1 was not initialized!
[  715.063255] input: XI100DUSB-HDMI as /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/input/input15
[  715.063330] usbcore: registered new interface driver uvcvideo
[  715.063331] USB Video Class driver (1.1.1)


[-- Attachment #5: dmesg_second_ffmpeg_capture.txt --]
[-- Type: text/plain, Size: 28276 bytes --]

[  842.073192] uvcvideo: uvc_v4l2_open
[  842.166927] uvcvideo: Resuming interface 0
[  842.166929] uvcvideo: Resuming interface 1
[  842.166951] uvcvideo: Trying format 0x32315559 (YU12): 1920x1080.
[  842.166953] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  842.167330] uvcvideo: Trying format 0x32315559 (YU12): 1920x1080.
[  842.167330] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  842.167675] uvcvideo: Trying format 0x32315659 (YV12): 1920x1080.
[  842.167675] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  842.168049] uvcvideo: Trying format 0x50323234 (422P): 1920x1080.
[  842.168049] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  842.168407] uvcvideo: Trying format 0x56595559 (YUYV): 1920x1080.
[  842.168408] uvcvideo: Using default frame interval 16666.7 us (59.9 fps).
[  842.168806] uvcvideo: Setting frame interval to 1/25 (400000).
[  842.180274] uvcvideo: uvc_v4l2_mmap
[  842.180358] uvcvideo: uvc_v4l2_mmap
[  842.180419] uvcvideo: uvc_v4l2_mmap
[  842.180480] uvcvideo: uvc_v4l2_mmap
[  842.180539] uvcvideo: uvc_v4l2_mmap
[  842.180599] uvcvideo: uvc_v4l2_mmap
[  842.180658] uvcvideo: uvc_v4l2_mmap
[  842.180720] uvcvideo: uvc_v4l2_mmap
[  842.180780] uvcvideo: uvc_v4l2_mmap
[  842.180840] uvcvideo: uvc_v4l2_mmap
[  842.180899] uvcvideo: uvc_v4l2_mmap
[  842.180958] uvcvideo: uvc_v4l2_mmap
[  842.181018] uvcvideo: uvc_v4l2_mmap
[  842.181077] uvcvideo: uvc_v4l2_mmap
[  842.181137] uvcvideo: uvc_v4l2_mmap
[  842.181197] uvcvideo: uvc_v4l2_mmap
[  842.181257] uvcvideo: uvc_v4l2_mmap
[  842.181316] uvcvideo: uvc_v4l2_mmap
[  842.181376] uvcvideo: uvc_v4l2_mmap
[  842.181437] uvcvideo: uvc_v4l2_mmap
[  842.181497] uvcvideo: uvc_v4l2_mmap
[  842.181556] uvcvideo: uvc_v4l2_mmap
[  842.181616] uvcvideo: uvc_v4l2_mmap
[  842.181676] uvcvideo: uvc_v4l2_mmap
[  842.181736] uvcvideo: uvc_v4l2_mmap
[  842.181796] uvcvideo: uvc_v4l2_mmap
[  842.181855] uvcvideo: uvc_v4l2_mmap
[  842.181914] uvcvideo: uvc_v4l2_mmap
[  842.181974] uvcvideo: uvc_v4l2_mmap
[  842.182034] uvcvideo: uvc_v4l2_mmap
[  842.182094] uvcvideo: uvc_v4l2_mmap
[  842.182153] uvcvideo: uvc_v4l2_mmap
[  842.182310] uvcvideo: Allocated 5 URB buffers of 16x1024 bytes each.
[  842.185644] uvcvideo: Non-zero status (-71) in video completion handler.
[  842.185645] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185668] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185671] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185674] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185697] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185699] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185702] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185708] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185712] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185715] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185718] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185741] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185745] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185762] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185766] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185770] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185774] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185778] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185782] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185786] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185791] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185811] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185814] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185818] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185823] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185827] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185831] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185835] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185840] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185843] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185847] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.185850] videobuf2-v4l2.c - setting V4L2_BUF_FLAG_ERROR
[  842.196149] uvcvideo: Frame complete (EOF found).
[  842.196191] uvcvideo: frame 1 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.206690] uvcvideo: Frame complete (EOF found).
[  842.219595] uvcvideo: frame 2 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.230135] uvcvideo: Frame complete (EOF found).
[  842.259592] uvcvideo: frame 3 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.270148] uvcvideo: Frame complete (EOF found).
[  842.299594] uvcvideo: frame 4 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.310134] uvcvideo: Frame complete (EOF found).
[  842.339594] uvcvideo: frame 5 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.350134] uvcvideo: Frame complete (EOF found).
[  842.379592] uvcvideo: frame 6 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.390134] uvcvideo: Frame complete (EOF found).
[  842.419592] uvcvideo: frame 7 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.430133] uvcvideo: Frame complete (EOF found).
[  842.459592] uvcvideo: frame 8 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.470134] uvcvideo: Frame complete (EOF found).
[  842.499592] uvcvideo: frame 9 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.510121] uvcvideo: Frame complete (EOF found).
[  842.539593] uvcvideo: frame 10 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.550133] uvcvideo: Frame complete (EOF found).
[  842.579592] uvcvideo: frame 11 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.590121] uvcvideo: Frame complete (EOF found).
[  842.619594] uvcvideo: frame 12 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.630131] uvcvideo: Frame complete (EOF found).
[  842.659592] uvcvideo: frame 13 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.670105] uvcvideo: Frame complete (EOF found).
[  842.699592] uvcvideo: frame 14 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.710111] uvcvideo: Frame complete (EOF found).
[  842.739593] uvcvideo: frame 15 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.750128] uvcvideo: Frame complete (EOF found).
[  842.779592] uvcvideo: frame 16 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.790120] uvcvideo: Frame complete (EOF found).
[  842.819591] uvcvideo: frame 17 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.830120] uvcvideo: Frame complete (EOF found).
[  842.859590] uvcvideo: frame 18 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.870131] uvcvideo: Frame complete (EOF found).
[  842.899591] uvcvideo: frame 19 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.910129] uvcvideo: Frame complete (EOF found).
[  842.939590] uvcvideo: frame 20 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.950129] uvcvideo: Frame complete (EOF found).
[  842.979588] uvcvideo: frame 21 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  842.990132] uvcvideo: Frame complete (EOF found).
[  843.019589] uvcvideo: frame 22 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.030128] uvcvideo: Frame complete (EOF found).
[  843.059589] uvcvideo: frame 23 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.070117] uvcvideo: Frame complete (EOF found).
[  843.099588] uvcvideo: frame 24 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.110128] uvcvideo: Frame complete (EOF found).
[  843.139588] uvcvideo: frame 25 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.150128] uvcvideo: Frame complete (EOF found).
[  843.179587] uvcvideo: frame 26 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.190127] uvcvideo: Frame complete (EOF found).
[  843.219587] uvcvideo: frame 27 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.230127] uvcvideo: Frame complete (EOF found).
[  843.259587] uvcvideo: frame 28 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.270126] uvcvideo: Frame complete (EOF found).
[  843.299586] uvcvideo: frame 29 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.310127] uvcvideo: Frame complete (EOF found).
[  843.339586] uvcvideo: frame 30 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.350126] uvcvideo: Frame complete (EOF found).
[  843.379587] uvcvideo: frame 31 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.390125] uvcvideo: Frame complete (EOF found).
[  843.419586] uvcvideo: frame 32 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.430114] uvcvideo: Frame complete (EOF found).
[  843.459586] uvcvideo: frame 33 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.470126] uvcvideo: Frame complete (EOF found).
[  843.499586] uvcvideo: frame 34 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.510125] uvcvideo: Frame complete (EOF found).
[  843.539585] uvcvideo: frame 35 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.550124] uvcvideo: Frame complete (EOF found).
[  843.579587] uvcvideo: frame 36 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.590114] uvcvideo: Frame complete (EOF found).
[  843.619585] uvcvideo: frame 37 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.630123] uvcvideo: Frame complete (EOF found).
[  843.659585] uvcvideo: frame 38 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.670124] uvcvideo: Frame complete (EOF found).
[  843.699584] uvcvideo: frame 39 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.710123] uvcvideo: Frame complete (EOF found).
[  843.739584] uvcvideo: frame 40 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.750123] uvcvideo: Frame complete (EOF found).
[  843.779582] uvcvideo: frame 41 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.790111] uvcvideo: Frame complete (EOF found).
[  843.819582] uvcvideo: frame 42 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.830122] uvcvideo: Frame complete (EOF found).
[  843.859582] uvcvideo: frame 43 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.870111] uvcvideo: Frame complete (EOF found).
[  843.899584] uvcvideo: frame 44 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.910121] uvcvideo: Frame complete (EOF found).
[  843.939582] uvcvideo: frame 45 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.950110] uvcvideo: Frame complete (EOF found).
[  843.979582] uvcvideo: frame 46 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  843.990121] uvcvideo: Frame complete (EOF found).
[  844.019582] uvcvideo: frame 47 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.030120] uvcvideo: Frame complete (EOF found).
[  844.059582] uvcvideo: frame 48 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.070110] uvcvideo: Frame complete (EOF found).
[  844.099581] uvcvideo: frame 49 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.110121] uvcvideo: Frame complete (EOF found).
[  844.139580] uvcvideo: frame 50 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.150119] uvcvideo: Frame complete (EOF found).
[  844.179580] uvcvideo: frame 51 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.190119] uvcvideo: Frame complete (EOF found).
[  844.219581] uvcvideo: frame 52 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.230119] uvcvideo: Frame complete (EOF found).
[  844.259579] uvcvideo: frame 53 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.270098] uvcvideo: Frame complete (EOF found).
[  844.299578] uvcvideo: frame 54 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.310118] uvcvideo: Frame complete (EOF found).
[  844.339579] uvcvideo: frame 55 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.350119] uvcvideo: Frame complete (EOF found).
[  844.379576] uvcvideo: frame 56 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.390117] uvcvideo: Frame complete (EOF found).
[  844.419577] uvcvideo: frame 57 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.430117] uvcvideo: Frame complete (EOF found).
[  844.459577] uvcvideo: frame 58 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.470118] uvcvideo: Frame complete (EOF found).
[  844.499576] uvcvideo: frame 59 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.510096] uvcvideo: Frame complete (EOF found).
[  844.539576] uvcvideo: frame 60 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.550116] uvcvideo: Frame complete (EOF found).
[  844.579578] uvcvideo: frame 61 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.590116] uvcvideo: Frame complete (EOF found).
[  844.619578] uvcvideo: frame 62 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.630116] uvcvideo: Frame complete (EOF found).
[  844.659576] uvcvideo: frame 63 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.670116] uvcvideo: Frame complete (EOF found).
[  844.699575] uvcvideo: frame 64 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.710116] uvcvideo: Frame complete (EOF found).
[  844.739577] uvcvideo: frame 65 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.750115] uvcvideo: Frame complete (EOF found).
[  844.779575] uvcvideo: frame 66 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.790115] uvcvideo: Frame complete (EOF found).
[  844.819576] uvcvideo: frame 67 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.830114] uvcvideo: Frame complete (EOF found).
[  844.859574] uvcvideo: frame 68 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.870115] uvcvideo: Frame complete (EOF found).
[  844.899576] uvcvideo: frame 69 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.910114] uvcvideo: Frame complete (EOF found).
[  844.939574] uvcvideo: frame 70 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.950113] uvcvideo: Frame complete (EOF found).
[  844.979574] uvcvideo: frame 71 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  844.990113] uvcvideo: Frame complete (EOF found).
[  845.019573] uvcvideo: frame 72 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.030113] uvcvideo: Frame complete (EOF found).
[  845.059573] uvcvideo: frame 73 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.070112] uvcvideo: Frame complete (EOF found).
[  845.099574] uvcvideo: frame 74 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.110111] uvcvideo: Frame complete (EOF found).
[  845.139572] uvcvideo: frame 75 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.150112] uvcvideo: Frame complete (EOF found).
[  845.179571] uvcvideo: frame 76 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.190111] uvcvideo: Frame complete (EOF found).
[  845.219572] uvcvideo: frame 77 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.230111] uvcvideo: Frame complete (EOF found).
[  845.259571] uvcvideo: frame 78 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.270111] uvcvideo: Frame complete (EOF found).
[  845.299571] uvcvideo: frame 79 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.310104] uvcvideo: Frame complete (EOF found).
[  845.339571] uvcvideo: frame 80 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.350111] uvcvideo: Frame complete (EOF found).
[  845.379571] uvcvideo: frame 81 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.390109] uvcvideo: Frame complete (EOF found).
[  845.419568] uvcvideo: frame 82 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.430100] uvcvideo: Frame complete (EOF found).
[  845.459568] uvcvideo: frame 83 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.470099] uvcvideo: Frame complete (EOF found).
[  845.499569] uvcvideo: frame 84 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.510109] uvcvideo: Frame complete (EOF found).
[  845.539568] uvcvideo: frame 85 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.550097] uvcvideo: Frame complete (EOF found).
[  845.579570] uvcvideo: frame 86 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.590108] uvcvideo: Frame complete (EOF found).
[  845.619569] uvcvideo: frame 87 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.630108] uvcvideo: Frame complete (EOF found).
[  845.659568] uvcvideo: frame 88 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.670108] uvcvideo: Frame complete (EOF found).
[  845.699567] uvcvideo: frame 89 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.710107] uvcvideo: Frame complete (EOF found).
[  845.739566] uvcvideo: frame 90 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.750107] uvcvideo: Frame complete (EOF found).
[  845.779566] uvcvideo: frame 91 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.790107] uvcvideo: Frame complete (EOF found).
[  845.819566] uvcvideo: frame 92 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.830106] uvcvideo: Frame complete (EOF found).
[  845.859567] uvcvideo: frame 93 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.870107] uvcvideo: Frame complete (EOF found).
[  845.899565] uvcvideo: frame 94 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.910106] uvcvideo: Frame complete (EOF found).
[  845.939568] uvcvideo: frame 95 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.950105] uvcvideo: Frame complete (EOF found).
[  845.979564] uvcvideo: frame 96 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  845.990105] uvcvideo: Frame complete (EOF found).
[  846.019563] uvcvideo: frame 97 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.030104] uvcvideo: Frame complete (EOF found).
[  846.059564] uvcvideo: frame 98 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.070105] uvcvideo: Frame complete (EOF found).
[  846.099566] uvcvideo: frame 99 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.110105] uvcvideo: Frame complete (EOF found).
[  846.139565] uvcvideo: frame 100 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.150104] uvcvideo: Frame complete (EOF found).
[  846.179563] uvcvideo: frame 101 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.190103] uvcvideo: Frame complete (EOF found).
[  846.219563] uvcvideo: frame 102 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.230104] uvcvideo: Frame complete (EOF found).
[  846.259563] uvcvideo: frame 103 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.270104] uvcvideo: Frame complete (EOF found).
[  846.299561] uvcvideo: frame 104 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.310102] uvcvideo: Frame complete (EOF found).
[  846.339563] uvcvideo: frame 105 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.350067] uvcvideo: Frame complete (EOF found).
[  846.379560] uvcvideo: frame 106 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.390102] uvcvideo: Frame complete (EOF found).
[  846.419560] uvcvideo: frame 107 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.430101] uvcvideo: Frame complete (EOF found).
[  846.459560] uvcvideo: frame 108 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.470102] uvcvideo: Frame complete (EOF found).
[  846.499560] uvcvideo: frame 109 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.510102] uvcvideo: Frame complete (EOF found).
[  846.539559] uvcvideo: frame 110 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.550101] uvcvideo: Frame complete (EOF found).
[  846.579560] uvcvideo: frame 111 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.590101] uvcvideo: Frame complete (EOF found).
[  846.619559] uvcvideo: frame 112 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.630101] uvcvideo: Frame complete (EOF found).
[  846.659559] uvcvideo: frame 113 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.670100] uvcvideo: Frame complete (EOF found).
[  846.699565] uvcvideo: frame 114 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.710099] uvcvideo: Frame complete (EOF found).
[  846.739558] uvcvideo: frame 115 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.750098] uvcvideo: Frame complete (EOF found).
[  846.779557] uvcvideo: frame 116 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.790099] uvcvideo: Frame complete (EOF found).
[  846.819557] uvcvideo: frame 117 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.830098] uvcvideo: Frame complete (EOF found).
[  846.859557] uvcvideo: frame 118 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.870089] uvcvideo: Frame complete (EOF found).
[  846.899558] uvcvideo: frame 119 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.910098] uvcvideo: Frame complete (EOF found).
[  846.939558] uvcvideo: frame 120 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.950098] uvcvideo: Frame complete (EOF found).
[  846.979557] uvcvideo: frame 121 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  846.990098] uvcvideo: Frame complete (EOF found).
[  847.019556] uvcvideo: frame 122 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.030097] uvcvideo: Frame complete (EOF found).
[  847.059556] uvcvideo: frame 123 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.070096] uvcvideo: Frame complete (EOF found).
[  847.099554] uvcvideo: frame 124 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.110086] uvcvideo: Frame complete (EOF found).
[  847.139556] uvcvideo: frame 125 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.150096] uvcvideo: Frame complete (EOF found).
[  847.179556] uvcvideo: frame 126 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.190095] uvcvideo: Frame complete (EOF found).
[  847.219558] uvcvideo: frame 127 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.230096] uvcvideo: Frame complete (EOF found).
[  847.259567] uvcvideo: frame 128 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.270104] uvcvideo: Frame complete (EOF found).
[  847.299557] uvcvideo: frame 129 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.310095] uvcvideo: Frame complete (EOF found).
[  847.339556] uvcvideo: frame 130 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.350098] uvcvideo: Frame complete (EOF found).
[  847.379556] uvcvideo: frame 131 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.390095] uvcvideo: Frame complete (EOF found).
[  847.419557] uvcvideo: frame 132 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.430094] uvcvideo: Frame complete (EOF found).
[  847.459557] uvcvideo: frame 133 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.470093] uvcvideo: Frame complete (EOF found).
[  847.499556] uvcvideo: frame 134 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.510092] uvcvideo: Frame complete (EOF found).
[  847.539557] uvcvideo: frame 135 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.550093] uvcvideo: Frame complete (EOF found).
[  847.579556] uvcvideo: frame 136 stats: 0/0/254 packets, 0/0/0 pts (!early !initial), 0/0 scr, last pts/stc/sof 0/0/0
[  847.590092] uvcvideo: Frame complete (EOF found).
[  847.613140] uvcvideo: uvc_v4l2_release
[  850.270210] uvcvideo: Suspending interface 1
[  850.270211] uvcvideo: Suspending interface 0


[-- Attachment #6: ffmpeg_first_ffmpeg_capture.txt --]
[-- Type: text/plain, Size: 4640 bytes --]

oliver@NUC-1:~$ ./ffmpeg -f v4l2 -thread_queue_size 1024 -video_size 1920x1080 -framerate 25 -i /dev/video0 -f alsa -thread_queue_size 1024 -i "hw:CARD=XI100DUSBHDMI,DEV=0" -vcodec libx265 -preset ultrafast -vb 3200k -maxrate 3200k -bufsize 3200k -vf yadif=1 -acodec aac -ab 192k -t 60 -f mpegts ~/Desktop/capture.ts -y
ffmpeg version N-81511-gaabe12e Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --enable-gpl --enable-version3 --enable-static --enable-libx264 --enable-libx265 --enable-nvenc --enable-libpulse --disable-debug
  libavutil      55. 29.100 / 55. 29.100
  libavcodec     57. 54.101 / 57. 54.101
  libavformat    57. 48.101 / 57. 48.101
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 58.100 /  6. 58.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 773.483020, bitrate: 829440 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 829440 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:CARD=XI100DUSBHDMI,DEV=0':
  Duration: N/A, start: 1473103066.167109, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
x265 [info]: HEVC encoder version 2.0+1-6a9b6a828f79
x265 [info]: build info [Linux][GCC 5.4.0][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x265 [info]: Main 4:2:2 10 profile, Level-4.1 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: frame threads / pool features       : 3 / wpp(34 rows)
x265 [info]: Coding QT: max CU size, min CU size : 32 / 16
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : dia / 57 / 0 / 2
x265 [info]: Keyframe min / max / scenecut       : 25 / 250 / 0
x265 [info]: Lookahead / bframes / badapt        : 5 / 3 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 0 / 0
x265 [info]: References / ref-limit  cu / depth  : 1 / off / off
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 0.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : ABR-3200 kbps / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock
[mpegts @ 0x2bf5440] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mpegts, to '/home/oliver/Desktop/capture.ts':
  Metadata:
    encoder         : Lavf57.48.101
    Stream #0:0: Video: hevc (libx265), yuv422p, 1920x1080, q=2-31, 3200 kb/s, 50 fps, 90k tbn, 50 tbc
    Metadata:
      encoder         : Lavc57.54.101 libx265
    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, delay 1024, padding 0, 192 kb/s
    Metadata:
      encoder         : Lavc57.54.101 aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
frame=   21 fps=0.0 q=-0.0 size=      20kB time=00:00:00.10 bitrate=1557.5kbits/frame=   50 fps= 49 q=-0.0 size=     101kB time=00:00:00.68 bitrate=1215.4kbits/frame=   75 fps= 49 q=-0.0 size=     150kB time=00:00:01.19 bitrate=1025.6kbits/frame=  100 fps= 49 q=-0.0 size=     295kB time=00:00:01.70 bitrate=1415.8kbits/frame=  126 fps= 50 q=-0.0 size=     367kB time=00:00:02.21 bitrate=1354.8kbits/frame=  151 fps= 50 q=-0.0 size=     490kB time=00:00:02.70 bitrate=1480.8kbits/frame=  176 fps= 50 q=-0.0 size=     575kB time=00:00:03.22 bitrate=1461.6kbits/frame=  202 fps= 50 q=-0.0 size=     637kB time=00:00:03.73 bitrate=1398.1kbits/frame=  226 fps= 50 q=-0.0 size=     736kB time=00:00:04.22 bitrate=1426.6kbits/frame=  252 fps= 50 q=-0.0 size=     830kB time=00:00:04.75 bitrate=1429.7kbits/frame=  267 fps= 49 q=-0.0 Lsize=     877kB time=00:00:05.28 bitrate=1361.0kbits/s speed=0.965x    
video:784kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 11.752733%
x265 [info]: frame I:      2, Avg QP:34.86  kb/s: 6412.80 
x265 [info]: frame P:     67, Avg QP:17.32  kb/s: 4282.73 
x265 [info]: frame B:    198, Avg QP:20.02  kb/s: 100.78  
x265 [info]: consecutive B-frames: 4.3% 0.0% 0.0% 95.7% 

encoded 267 frames in 5.48s (48.76 fps), 1197.46 kb/s, Avg QP:19.45
[aac @ 0x2bf0f60] Qavg: 65536.000


[-- Attachment #7: ffmpeg_second_ffmpeg_capture.txt --]
[-- Type: text/plain, Size: 4812 bytes --]

oliver@NUC-1:~$ ./ffmpeg -f v4l2 -thread_queue_size 1024 -video_size 1920x1080 -framerate 25 -i /dev/video0 -f alsa -thread_queue_size 1024 -i "hw:CARD=XI100DUSBHDMI,DEV=0" -vcodec libx265 -preset ultrafast -vb 3200k -maxrate 3200k -bufsize 3200k -vf yadif=1 -acodec aac -ab 192k -t 60 -f mpegts ~/Desktop/capture.ts -y
ffmpeg version N-81511-gaabe12e Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --enable-gpl --enable-version3 --enable-static --enable-libx264 --enable-libx265 --enable-nvenc --enable-libpulse --disable-debug
  libavutil      55. 29.100 / 55. 29.100
  libavcodec     57. 54.101 / 57. 54.101
  libavformat    57. 48.101 / 57. 48.101
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 58.100 /  6. 58.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[video4linux2,v4l2 @ 0x2d0e560] Dequeued v4l2 buffer contains corrupted data (0 bytes).
    Last message repeated 31 times
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 841.799371, bitrate: 829440 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 829440 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:CARD=XI100DUSBHDMI,DEV=0':
  Duration: N/A, start: 1473103134.484202, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
x265 [info]: HEVC encoder version 2.0+1-6a9b6a828f79
x265 [info]: build info [Linux][GCC 5.4.0][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x265 [info]: Main 4:2:2 10 profile, Level-4.1 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: frame threads / pool features       : 3 / wpp(34 rows)
x265 [info]: Coding QT: max CU size, min CU size : 32 / 16
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : dia / 57 / 0 / 2
x265 [info]: Keyframe min / max / scenecut       : 25 / 250 / 0
x265 [info]: Lookahead / bframes / badapt        : 5 / 3 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 0 / 0
x265 [info]: References / ref-limit  cu / depth  : 1 / off / off
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 0.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : ABR-3200 kbps / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock
[mpegts @ 0x2d29440] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mpegts, to '/home/oliver/Desktop/capture.ts':
  Metadata:
    encoder         : Lavf57.48.101
    Stream #0:0: Video: hevc (libx265), yuv422p, 1920x1080, q=2-31, 3200 kb/s, 50 fps, 90k tbn, 50 tbc
    Metadata:
      encoder         : Lavc57.54.101 libx265
    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, delay 1024, padding 0, 192 kb/s
    Metadata:
      encoder         : Lavc57.54.101 aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Past duration 0.737694 too large
frame=   25 fps=0.0 q=-0.0 size=      36kB time=00:00:00.21 bitrate=1364.5kbits/frame=   51 fps= 50 q=-0.0 size=     102kB time=00:00:00.72 bitrate=1151.9kbits/frame=   76 fps= 50 q=-0.0 size=     145kB time=00:00:01.21 bitrate= 976.7kbits/frame=  101 fps= 50 q=-0.0 size=     293kB time=00:00:01.72 bitrate=1388.8kbits/frame=  127 fps= 50 q=-0.0 size=     367kB time=00:00:02.24 bitrate=1342.6kbits/frame=  151 fps= 50 q=-0.0 size=     486kB time=00:00:02.73 bitrate=1457.1kbits/frame=  177 fps= 50 q=-0.0 size=     580kB time=00:00:03.24 bitrate=1465.0kbits/frame=  202 fps= 50 q=-0.0 size=     634kB time=00:00:03.73 bitrate=1392.0kbits/frame=  227 fps= 50 q=-0.0 size=     739kB time=00:00:04.24 bitrate=1425.4kbits/frame=  253 fps= 50 q=-0.0 size=     831kB time=00:00:04.75 bitrate=1430.7kbits/frame=  263 fps= 49 q=-0.0 Lsize=     876kB time=00:00:05.20 bitrate=1379.6kbits/s dup=0 drop=1 speed=0.967x    
video:783kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 11.578809%
x265 [info]: frame I:      2, Avg QP:34.86  kb/s: 6431.20 
x265 [info]: frame P:     66, Avg QP:17.10  kb/s: 4360.92 
x265 [info]: frame B:    195, Avg QP:19.80  kb/s: 97.53   
x265 [info]: consecutive B-frames: 4.4% 0.0% 0.0% 95.6% 

encoded 263 frames in 5.38s (48.87 fps), 1215.59 kb/s, Avg QP:19.24
[aac @ 0x2d253e0] Qavg: 65536.000


[-- Attachment #8: ffmpeg_third_ffmpeg_capture.txt --]
[-- Type: text/plain, Size: 6082 bytes --]

oliver@NUC-1:~$ ./ffmpeg -f v4l2 -thread_queue_size 1024 -video_size 1920x1080 -framerate 25 -i /dev/video0 -f alsa -thread_queue_size 1024 -i "hw:CARD=XI100DUSBHDMI,DEV=0" -vcodec libx265 -preset ultrafast -vb 3200k -maxrate 3200k -bufsize 3200k -vf yadif=1 -acodec aac -ab 192k -t 60 -f mpegts ~/Desktop/capture.ts -y
ffmpeg version N-81511-gaabe12e Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --enable-gpl --enable-version3 --enable-static --enable-libx264 --enable-libx265 --enable-nvenc --enable-libpulse --disable-debug
  libavutil      55. 29.100 / 55. 29.100
  libavcodec     57. 54.101 / 57. 54.101
  libavformat    57. 48.101 / 57. 48.101
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 58.100 /  6. 58.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[video4linux2,v4l2 @ 0x29e7560] Dequeued v4l2 buffer contains corrupted data (0 bytes).
    Last message repeated 31 times
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1080.263350, bitrate: 829440 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 829440 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:CARD=XI100DUSBHDMI,DEV=0':
  Duration: N/A, start: 1473103372.947138, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
x265 [info]: HEVC encoder version 2.0+1-6a9b6a828f79
x265 [info]: build info [Linux][GCC 5.4.0][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x265 [info]: Main 4:2:2 10 profile, Level-4.1 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: frame threads / pool features       : 3 / wpp(34 rows)
x265 [info]: Coding QT: max CU size, min CU size : 32 / 16
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : dia / 57 / 0 / 2
x265 [info]: Keyframe min / max / scenecut       : 25 / 250 / 0
x265 [info]: Lookahead / bframes / badapt        : 5 / 3 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 0 / 0
x265 [info]: References / ref-limit  cu / depth  : 1 / off / off
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 0.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : ABR-3200 kbps / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock
[mpegts @ 0x2a02440] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mpegts, to '/home/oliver/Desktop/capture.ts':
  Metadata:
    encoder         : Lavf57.48.101
    Stream #0:0: Video: hevc (libx265), yuv422p, 1920x1080, q=2-31, 3200 kb/s, 50 fps, 90k tbn, 50 tbc
    Metadata:
      encoder         : Lavc57.54.101 libx265
    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, delay 1024, padding 0, 192 kb/s
    Metadata:
      encoder         : Lavc57.54.101 aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Past duration 0.737587 too large
Past duration 0.835243 too large
Past duration 0.835213 too large
Past duration 0.835197 too large
Past duration 0.835320 too large
Past duration 0.835442 too large
Past duration 0.835213 too large
Past duration 0.834999 too large
Past duration 0.834969 too large
Past duration 0.834938 too large
Past duration 0.835243 too large
Past duration 0.835548 too large
Past duration 0.835564 too large
Past duration 0.835594 too large
    Last message repeated 2 times
Past duration 0.835670 too large
Past duration 0.835747 too large
    Last message repeated 2 times
frame=   22 fps=0.0 q=-0.0 size=      21kB time=00:00:00.12 bitrate=1322.4kbits/Past duration 0.835594 too large
Past duration 0.835442 too large
Past duration 0.835640 too large
Past duration 0.835838 too large
Past duration 0.835869 too large
Past duration 0.835899 too large
Past duration 0.835915 too large
Past duration 0.835945 too large
    Last message repeated 2 times
Past duration 0.835991 too large
Past duration 0.836037 too large
Past duration 0.836021 too large
Past duration 0.835991 too large
Past duration 0.836037 too large
Past duration 0.836098 too large
Past duration 0.836113 too large
Past duration 0.836143 too large
Past duration 0.836174 too large
Past duration 0.836189 too large
    Last message repeated 2 times
Past duration 0.836235 too large
Past duration 0.836296 too large
Past duration 0.836220 too large
Past duration 0.836143 too large
Past duration 0.836266 too large
Past duration 0.836388 too large
Past duration 0.836372 too large
frame=   51 fps= 50 q=-0.0 size=     102kB time=00:00:00.70 bitrate=1182.9kbits/Past duration 0.836342 too large
Past duration 0.836449 too large
Past duration 0.836540 too large
    Last message repeated 2 times
Past duration 0.836571 too large
Past duration 0.836586 too large
Past duration 0.836647 too large
Past duration 0.836693 too large
    Last message repeated 2 times
Past duration 0.836723 too large
Past duration 0.836739 too large
Past duration 0.836800 too large
frame=   65 fps= 46 q=-0.0 Lsize=     146kB time=00:00:01.24 bitrate= 964.2kbits/s dup=0 drop=1 speed=0.875x    
video:128kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.423185%
x265 [info]: frame I:      1, Avg QP:36.94  kb/s: 264.80  
x265 [info]: frame P:     17, Avg QP:28.68  kb/s: 2860.12 
x265 [info]: frame B:     47, Avg QP:31.85  kb/s: 68.03   
x265 [info]: consecutive B-frames: 11.1% 0.0% 5.6% 83.3% 

encoded 65 frames in 1.42s (45.77 fps), 801.29 kb/s, Avg QP:31.10
[aac @ 0x29fe3e0] Qavg: 65536.000


[-- Attachment #9: Type: text/plain, Size: 834 bytes --]




> On 4 Sep 2016, at 22:25, Andrey Utkin <andrey_utkin@fastmail.com> wrote:
> 
> Hi!
> Seems like weird error in V4L subsystem or in uvcvideo driver, in the
> most standard usage scenario.
> Please retry with kernel and FFmpeg as new as possible, best if compiled
> from latest upstream sources.
> For kernel please try release 4.7.2 or even linux-next
> (git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git), for
> FFmpeg please make a git clone from git://source.ffmpeg.org/ffmpeg.git
> and there do "./configure && make" and run obtained "ffmpeg" binary.
> 
> Please CC me when you come back with your results.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-05 19:43   ` Oliver Collyer
@ 2016-09-05 20:19     ` Andrey Utkin
  2016-09-05 20:32       ` Oliver Collyer
  2016-09-06 10:51       ` Oliver Collyer
  0 siblings, 2 replies; 14+ messages in thread
From: Andrey Utkin @ 2016-09-05 20:19 UTC (permalink / raw)
  To: Oliver Collyer; +Cc: linux-media

On Mon, Sep 05, 2016 at 10:43:49PM +0300, Oliver Collyer wrote:
> I do not have any knowledge of uvcvideo and the associated classes apart from the studying I’ve done the past day or two, but it seems likely that error -71 and the later setting of V4L2_BUF_FLAG_ERROR are linked. Also, the fact it only happens in captures after the first one suggests something isn’t being cleared down or released properly in uvcvideo/v4l2-core at the end of the first capture.
> 
> Let me know what I need to do next to further narrow it down.

Have tried to reproduce this (with kernel 4.6.0 and fresh build of
ffmpeg) with uvcvideo-driven laptop webcam, and it doesn't happen to me.
Also -EPROTO in uvcvideo comes from low-level USB stuff, see
drivers/media/usb/uvc/uvc_status.c:127:

	case -EPROTO:		/* Device is disconnected (reported by some
				 * host controller). */

So it seems like hardware misbehaves. To further clairify situation, I
have such question: do the devices work in other operation systems on
the same machine?

Reviewing your original email mentioning that two different devices
reproduce same problem, which is apparently related to disconnection in
the middle of USB communication, I came to me that the connected device
may be underpowered. So,
 - try plugging your devices through reliable _active_ USB hub,
 - use the most reliable cables you can get,
 - plug into USB 3.0 port if available - it should provide more power
   than 1.0 and 2.0.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-05 20:19     ` Andrey Utkin
@ 2016-09-05 20:32       ` Oliver Collyer
  2016-09-06 10:51       ` Oliver Collyer
  1 sibling, 0 replies; 14+ messages in thread
From: Oliver Collyer @ 2016-09-05 20:32 UTC (permalink / raw)
  To: Andrey Utkin; +Cc: linux-media


> On 5 Sep 2016, at 23:19, Andrey Utkin <andrey_utkin@fastmail.com> wrote:
> 
> On Mon, Sep 05, 2016 at 10:43:49PM +0300, Oliver Collyer wrote:
>> I do not have any knowledge of uvcvideo and the associated classes apart from the studying I’ve done the past day or two, but it seems likely that error -71 and the later setting of V4L2_BUF_FLAG_ERROR are linked. Also, the fact it only happens in captures after the first one suggests something isn’t being cleared down or released properly in uvcvideo/v4l2-core at the end of the first capture.
>> 
>> Let me know what I need to do next to further narrow it down.
> 
> Have tried to reproduce this (with kernel 4.6.0 and fresh build of
> ffmpeg) with uvcvideo-driven laptop webcam, and it doesn't happen to me.
> Also -EPROTO in uvcvideo comes from low-level USB stuff, see
> drivers/media/usb/uvc/uvc_status.c:127:
> 
> 	case -EPROTO:		/* Device is disconnected (reported by some
> 				 * host controller). */
> 
> So it seems like hardware misbehaves. To further clairify situation, I
> have such question: do the devices work in other operation systems on
> the same machine?
> 

Yes, they work perfectly with dshow on Windows on on multiple PCs including this one.

> Reviewing your original email mentioning that two different devices
> reproduce same problem, which is apparently related to disconnection in
> the middle of USB communication, I came to me that the connected device
> may be underpowered. So,
> - try plugging your devices through reliable _active_ USB hub,
> - use the most reliable cables you can get,
> - plug into USB 3.0 port if available - it should provide more power
>   than 1.0 and 2.0.

I will experiment with different ports and report back.

Still, I’m not sure how that suggestion fits with the fact that it always works perfectly after "modprobe -r uvcvideo && modprobe uvcvideo” and only fails again once the capture is stopped and restarted?

Perhaps some kind of “quirk” can be added for these devices that does some extra clearing up/re-initializing at the start of the capture - kind of like *some* of what reloading the module does but only for the specific device.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-05 20:19     ` Andrey Utkin
  2016-09-05 20:32       ` Oliver Collyer
@ 2016-09-06 10:51       ` Oliver Collyer
  2016-09-06 12:28         ` Andrey Utkin
  1 sibling, 1 reply; 14+ messages in thread
From: Oliver Collyer @ 2016-09-06 10:51 UTC (permalink / raw)
  To: linux-media; +Cc: Andrey Utkin

So today I installed Ubuntu 16.04 on another PC (this one a high spec machine with a Rampage V Extreme motherboard) and I reproduced exactly the same errors and trace.

Rebooting the same PC back into Windows 10 and using the same USB 3.0 port, I had no problems capturing using FFmpeg via DirectShow. I could start and stop the capture repeatedly without any warnings or errors appearing in FFmpeg (built from the same source).

If the hardware is misbehaving, on both these capture devices, then DS must be handling it better than V4L2. Or there is simply an obscure bug in V4L2 which only manifests itself with certain devices.

Would providing ssh access to the machine be of interest to anyone who wants to debug this?

> On 5 Sep 2016, at 23:19, Andrey Utkin <andrey_utkin@fastmail.com> wrote:
> 
> On Mon, Sep 05, 2016 at 10:43:49PM +0300, Oliver Collyer wrote:
>> I do not have any knowledge of uvcvideo and the associated classes apart from the studying I’ve done the past day or two, but it seems likely that error -71 and the later setting of V4L2_BUF_FLAG_ERROR are linked. Also, the fact it only happens in captures after the first one suggests something isn’t being cleared down or released properly in uvcvideo/v4l2-core at the end of the first capture.
>> 
>> Let me know what I need to do next to further narrow it down.
> 
> Have tried to reproduce this (with kernel 4.6.0 and fresh build of
> ffmpeg) with uvcvideo-driven laptop webcam, and it doesn't happen to me.
> Also -EPROTO in uvcvideo comes from low-level USB stuff, see
> drivers/media/usb/uvc/uvc_status.c:127:
> 
> 	case -EPROTO:		/* Device is disconnected (reported by some
> 				 * host controller). */
> 
> So it seems like hardware misbehaves. To further clairify situation, I
> have such question: do the devices work in other operation systems on
> the same machine?
> 
> Reviewing your original email mentioning that two different devices
> reproduce same problem, which is apparently related to disconnection in
> the middle of USB communication, I came to me that the connected device
> may be underpowered. So,
> - try plugging your devices through reliable _active_ USB hub,
> - use the most reliable cables you can get,
> - plug into USB 3.0 port if available - it should provide more power
>   than 1.0 and 2.0.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-06 10:51       ` Oliver Collyer
@ 2016-09-06 12:28         ` Andrey Utkin
  2016-09-06 17:26           ` Oliver Collyer
  2016-09-10  7:37           ` Oliver Collyer
  0 siblings, 2 replies; 14+ messages in thread
From: Andrey Utkin @ 2016-09-06 12:28 UTC (permalink / raw)
  To: Oliver Collyer; +Cc: linux-media

On Tue, Sep 06, 2016 at 01:51:51PM +0300, Oliver Collyer wrote:
> So today I installed Ubuntu 16.04 on another PC (this one a high spec machine with a Rampage V Extreme motherboard) and I reproduced exactly the same errors and trace.
> 
> Rebooting the same PC back into Windows 10 and using the same USB 3.0 port, I had no problems capturing using FFmpeg via DirectShow. I could start and stop the capture repeatedly without any warnings or errors appearing in FFmpeg (built from the same source).
> 
> If the hardware is misbehaving, on both these capture devices, then DS must be handling it better than V4L2. Or there is simply an obscure bug in V4L2 which only manifests itself with certain devices.
> 
> Would providing ssh access to the machine be of interest to anyone who wants to debug this?

I am curious to tinker with this, just not sure about free time for it.
Please go through the following instruction, and then we'll see if ssh
is going to help to debug this.

Also I think it is worth to CC actual manufacturers. There are addresses
for technical support of both devices in public on maker websites.
Please CC them when replying with new logs, to let them catch up.

So, I am still not certain what confuses the device, i.e. where the
faulty usage pattern comes from: ffmpeg or driver. So I'd like you to
check the difference with various userspace applications which involve
streaming from device.

For each of your two devices, alone (not two at same time), do this:

For each command from this list:
"v4l2-compliance -s -d /dev/video0",
"ffmpeg -f v4l2 -i /dev/video0 -vcodec rawvideo -f null -y /dev/null",
"<what you referred to as 'capture API example'>"
(feel free to add more, maybe mplayer invocation or such)

dmesg -C
plug in the device
modprobe uvcvideo module
run the command twice or more in row
save uncut commands output (with command lines) to separate file
rmmod uvcvideo
unplug the device
save "dmesg" output to separate file


Done.

I guess this test makes sense, or am I missing something you've already
told us?

If you go making a script for this, make sure to notice if rmmod fails
for any reason, etc.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-06 12:28         ` Andrey Utkin
@ 2016-09-06 17:26           ` Oliver Collyer
  2016-09-10  7:37           ` Oliver Collyer
  1 sibling, 0 replies; 14+ messages in thread
From: Oliver Collyer @ 2016-09-06 17:26 UTC (permalink / raw)
  To: Andrey Utkin; +Cc: linux-media, Support INOGENI, james.liu

[-- Attachment #1: Type: text/plain, Size: 4973 bytes --]

[Resent without HTML content]

> On 6 Sep 2016, at 15:28, Andrey Utkin <andrey_utkin@fastmail.com> wrote:
> 
> On Tue, Sep 06, 2016 at 01:51:51PM +0300, Oliver Collyer wrote:
>> So today I installed Ubuntu 16.04 on another PC (this one a high spec machine with a Rampage V Extreme motherboard) and I reproduced exactly the same errors and trace.
>> 
>> Rebooting the same PC back into Windows 10 and using the same USB 3.0 port, I had no problems capturing using FFmpeg via DirectShow. I could start and stop the capture repeatedly without any warnings or errors appearing in FFmpeg (built from the same source).
>> 
>> If the hardware is misbehaving, on both these capture devices, then DS must be handling it better than V4L2. Or there is simply an obscure bug in V4L2 which only manifests itself with certain devices.
>> 
>> Would providing ssh access to the machine be of interest to anyone who wants to debug this?
> 
> I am curious to tinker with this, just not sure about free time for it.
> Please go through the following instruction, and then we'll see if ssh
> is going to help to debug this.
> 
> Also I think it is worth to CC actual manufacturers. There are addresses
> for technical support of both devices in public on maker websites.
> Please CC them when replying with new logs, to let them catch up.
> 
> So, I am still not certain what confuses the device, i.e. where the
> faulty usage pattern comes from: ffmpeg or driver. So I'd like you to
> check the difference with various userspace applications which involve
> streaming from device.
> 
> For each of your two devices, alone (not two at same time), do this:
> 
> For each command from this list:
> "v4l2-compliance -s -d /dev/video0",
> "ffmpeg -f v4l2 -i /dev/video0 -vcodec rawvideo -f null -y /dev/null",
> "<what you referred to as 'capture API example'>"
> (feel free to add more, maybe mplayer invocation or such)
> 
> dmesg -C
> plug in the device
> modprobe uvcvideo module
> run the command twice or more in row
> save uncut commands output (with command lines) to separate file
> rmmod uvcvideo
> unplug the device
> save "dmesg" output to separate file
> 
> 
> Done.
> 
> I guess this test makes sense, or am I missing something you've already
> told us?
> 
> If you go making a script for this, make sure to notice if rmmod fails
> for any reason, etc.

Hi Andrey

Thanks for your response and suggestions for tests.

Attached is an archive containing the log files you requested.

I did modify the test regime slightly as follows:

dmesg -C
plug in the device
modprobe -v uvcvideo
run the command once (1)
modprobe -v -r uvcvideo
modprobe -v uvcvideo
run the command again (2)
run the command again (3)
save uncut commands output (with command lines) to separate file
modprobe -v -r uvcvideo
unplug the device
save “dmesg” output to separate file

The reason for the additional unload/load of the uvcvideo module after running command (1) is because I was finding that this command was producing the error straightaway with the Magewell device and it took another unload/reload sequence to produce the next error free command (2). The next command (3) then brings back the error. However, this did vary with the inogeni device - in this case, the (1) and (2) didn’t produce the error, but (3) did. Except in the case of the ffmpeg test which followed the same pattern as the Magewell device.

The other difference between the Magewell and Inogeni tests was in the case of the Inogeni it seems that even when the error didn’t occur, ffmpeg was still producing other warnings and errors relating to the capture that the Magewell didn’t produce, which appear to relate to timestamps.

The example capture comes from this page on the V4L2 wiki:

https://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html

…with the addition of these lines from line 125:

		if (buf.flags & V4L2_BUF_FLAG_ERROR ) {
                	fprintf(stderr, "corrupt buffer\n");
		}

The capture example doesn’t do anything with the output so even if it was corrupt it wouldn’t make any difference, thus I’ve added some trace to flag the error.

For reference/your own testing I’ve attached it to this mail too.

In summary:

- both devices produce the Error -71 error leading to the V4L2_BUF_FLAG_ERROR error under similar circumstances, but unloading/reloading the uvcvideo module gets rid of it for one time only.
- the error state occurs in both the capture example and FFmpeg.
- the compliance outputs produces some warnings and errors for both devices, but I don’t know their significance.

Regards

Oliver

PS I’ve copied in support from Magewell and Inogeni - please refer to the linux-media archives for the full history of this discussion concerning capture issues in FFmpeg with your devices, when using V4L2.

http://www.spinics.net/lists/linux-media/msg105073.html


[-- Attachment #2: v4l2_capture_logs.zip --]
[-- Type: application/zip, Size: 13154 bytes --]

[-- Attachment #3: capture_example.c --]
[-- Type: application/octet-stream, Size: 19197 bytes --]

/*
 *  V4L2 video capture example
 *
 *  This program can be used and distributed without restrictions.
 *
 *      This program is provided with the V4L2 API
 * see https://linuxtv.org/docs.php for more information
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#include <getopt.h>             /* getopt_long() */

#include <fcntl.h>              /* low-level i/o */
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>

#include <linux/videodev2.h>

#define CLEAR(x) memset(&(x), 0, sizeof(x))

enum io_method {
        IO_METHOD_READ,
        IO_METHOD_MMAP,
        IO_METHOD_USERPTR,
};

struct buffer {
        void   *start;
        size_t  length;
};

static char            *dev_name;
static enum io_method   io = IO_METHOD_MMAP;
static int              fd = -1;
struct buffer          *buffers;
static unsigned int     n_buffers;
static int              out_buf;
static int              force_format;
static int              frame_count = 70;

static void errno_exit(const char *s)
{
        fprintf(stderr, "%s error %d, %s\n", s, errno, strerror(errno));
        exit(EXIT_FAILURE);
}

static int xioctl(int fh, int request, void *arg)
{
        int r;

        do {
                r = ioctl(fh, request, arg);
        } while (-1 == r && EINTR == errno);

        return r;
}

static void process_image(const void *p, int size)
{
        if (out_buf)
                fwrite(p, size, 1, stdout);

        fflush(stderr);
        fprintf(stderr, ".");
        fflush(stdout);
}

static int read_frame(void)
{
        struct v4l2_buffer buf;
        unsigned int i;

        switch (io) {
        case IO_METHOD_READ:
                if (-1 == read(fd, buffers[0].start, buffers[0].length)) {
                        switch (errno) {
                        case EAGAIN:
                                return 0;

                        case EIO:
                                /* Could ignore EIO, see spec. */

                                /* fall through */

                        default:
                                errno_exit("read");
                        }
                }

                process_image(buffers[0].start, buffers[0].length);
                break;

        case IO_METHOD_MMAP:
                CLEAR(buf);

                buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                buf.memory = V4L2_MEMORY_MMAP;

                if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf)) {
                        switch (errno) {
                        case EAGAIN:
                                return 0;

                        case EIO:
                                /* Could ignore EIO, see spec. */

                                /* fall through */

                        default:
                                errno_exit("VIDIOC_DQBUF");
                        }
                }

                assert(buf.index < n_buffers);

		if (buf.flags & V4L2_BUF_FLAG_ERROR ) {
                	fprintf(stderr, "corrupt buffer\n");
		}

                process_image(buffers[buf.index].start, buf.bytesused);

                if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
                        errno_exit("VIDIOC_QBUF");
                break;

        case IO_METHOD_USERPTR:
                CLEAR(buf);

                buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                buf.memory = V4L2_MEMORY_USERPTR;

                if (-1 == xioctl(fd, VIDIOC_DQBUF, &buf)) {
                        switch (errno) {
                        case EAGAIN:
                                return 0;

                        case EIO:
                                /* Could ignore EIO, see spec. */

                                /* fall through */

                        default:
                                errno_exit("VIDIOC_DQBUF");
                        }
                }

                for (i = 0; i < n_buffers; ++i)
                        if (buf.m.userptr == (unsigned long)buffers[i].start
                            && buf.length == buffers[i].length)
                                break;

                assert(i < n_buffers);

                process_image((void *)buf.m.userptr, buf.bytesused);

                if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
                        errno_exit("VIDIOC_QBUF");
                break;
        }

        return 1;
}

static void mainloop(void)
{
        unsigned int count;

        count = frame_count;

        while (count-- > 0) {
                for (;;) {
                        fd_set fds;
                        struct timeval tv;
                        int r;

                        FD_ZERO(&fds);
                        FD_SET(fd, &fds);

                        /* Timeout. */
                        tv.tv_sec = 2;
                        tv.tv_usec = 0;

                        r = select(fd + 1, &fds, NULL, NULL, &tv);

                        if (-1 == r) {
                                if (EINTR == errno)
                                        continue;
                                errno_exit("select");
                        }

                        if (0 == r) {
                                fprintf(stderr, "select timeout\n");
                                exit(EXIT_FAILURE);
                        }

                        if (read_frame())
                                break;
                        /* EAGAIN - continue select loop. */
                }
        }
}

static void stop_capturing(void)
{
        enum v4l2_buf_type type;

        switch (io) {
        case IO_METHOD_READ:
                /* Nothing to do. */
                break;

        case IO_METHOD_MMAP:
        case IO_METHOD_USERPTR:
                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                if (-1 == xioctl(fd, VIDIOC_STREAMOFF, &type))
                        errno_exit("VIDIOC_STREAMOFF");
                break;
        }
}

static void start_capturing(void)
{
        unsigned int i;
        enum v4l2_buf_type type;

        switch (io) {
        case IO_METHOD_READ:
                /* Nothing to do. */
                break;

        case IO_METHOD_MMAP:
                for (i = 0; i < n_buffers; ++i) {
                        struct v4l2_buffer buf;

                        CLEAR(buf);
                        buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                        buf.memory = V4L2_MEMORY_MMAP;
                        buf.index = i;

                        if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
                                errno_exit("VIDIOC_QBUF");
                }
                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                if (-1 == xioctl(fd, VIDIOC_STREAMON, &type))
                        errno_exit("VIDIOC_STREAMON");
                break;

        case IO_METHOD_USERPTR:
                for (i = 0; i < n_buffers; ++i) {
                        struct v4l2_buffer buf;

                        CLEAR(buf);
                        buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                        buf.memory = V4L2_MEMORY_USERPTR;
                        buf.index = i;
                        buf.m.userptr = (unsigned long)buffers[i].start;
                        buf.length = buffers[i].length;

                        if (-1 == xioctl(fd, VIDIOC_QBUF, &buf))
                                errno_exit("VIDIOC_QBUF");
                }
                type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                if (-1 == xioctl(fd, VIDIOC_STREAMON, &type))
                        errno_exit("VIDIOC_STREAMON");
                break;
        }
}

static void uninit_device(void)
{
        unsigned int i;

        switch (io) {
        case IO_METHOD_READ:
                free(buffers[0].start);
                break;

        case IO_METHOD_MMAP:
                for (i = 0; i < n_buffers; ++i)
                        if (-1 == munmap(buffers[i].start, buffers[i].length))
                                errno_exit("munmap");
                break;

        case IO_METHOD_USERPTR:
                for (i = 0; i < n_buffers; ++i)
                        free(buffers[i].start);
                break;
        }

        free(buffers);
}

static void init_read(unsigned int buffer_size)
{
        buffers = calloc(1, sizeof(*buffers));

        if (!buffers) {
                fprintf(stderr, "Out of memory\n");
                exit(EXIT_FAILURE);
        }

        buffers[0].length = buffer_size;
        buffers[0].start = malloc(buffer_size);

        if (!buffers[0].start) {
                fprintf(stderr, "Out of memory\n");
                exit(EXIT_FAILURE);
        }
}

static void init_mmap(void)
{
        struct v4l2_requestbuffers req;

        CLEAR(req);

        req.count = 4;
        req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        req.memory = V4L2_MEMORY_MMAP;

        if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) {
                if (EINVAL == errno) {
                        fprintf(stderr, "%s does not support "
                                 "memory mapping\n", dev_name);
                        exit(EXIT_FAILURE);
                } else {
                        errno_exit("VIDIOC_REQBUFS");
                }
        }

        if (req.count < 2) {
                fprintf(stderr, "Insufficient buffer memory on %s\n",
                         dev_name);
                exit(EXIT_FAILURE);
        }

        buffers = calloc(req.count, sizeof(*buffers));

        if (!buffers) {
                fprintf(stderr, "Out of memory\n");
                exit(EXIT_FAILURE);
        }

        for (n_buffers = 0; n_buffers < req.count; ++n_buffers) {
                struct v4l2_buffer buf;

                CLEAR(buf);

                buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                buf.memory      = V4L2_MEMORY_MMAP;
                buf.index       = n_buffers;

                if (-1 == xioctl(fd, VIDIOC_QUERYBUF, &buf))
                        errno_exit("VIDIOC_QUERYBUF");

                buffers[n_buffers].length = buf.length;
                buffers[n_buffers].start =
                        mmap(NULL /* start anywhere */,
                              buf.length,
                              PROT_READ | PROT_WRITE /* required */,
                              MAP_SHARED /* recommended */,
                              fd, buf.m.offset);

                if (MAP_FAILED == buffers[n_buffers].start)
                        errno_exit("mmap");
        }
}

static void init_userp(unsigned int buffer_size)
{
        struct v4l2_requestbuffers req;

        CLEAR(req);

        req.count  = 4;
        req.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        req.memory = V4L2_MEMORY_USERPTR;

        if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) {
                if (EINVAL == errno) {
                        fprintf(stderr, "%s does not support "
                                 "user pointer i/o\n", dev_name);
                        exit(EXIT_FAILURE);
                } else {
                        errno_exit("VIDIOC_REQBUFS");
                }
        }

        buffers = calloc(4, sizeof(*buffers));

        if (!buffers) {
                fprintf(stderr, "Out of memory\n");
                exit(EXIT_FAILURE);
        }

        for (n_buffers = 0; n_buffers < 4; ++n_buffers) {
                buffers[n_buffers].length = buffer_size;
                buffers[n_buffers].start = malloc(buffer_size);

                if (!buffers[n_buffers].start) {
                        fprintf(stderr, "Out of memory\n");
                        exit(EXIT_FAILURE);
                }
        }
}

static void init_device(void)
{
        struct v4l2_capability cap;
        struct v4l2_cropcap cropcap;
        struct v4l2_crop crop;
        struct v4l2_format fmt;
        unsigned int min;

        if (-1 == xioctl(fd, VIDIOC_QUERYCAP, &cap)) {
                if (EINVAL == errno) {
                        fprintf(stderr, "%s is no V4L2 device\n",
                                 dev_name);
                        exit(EXIT_FAILURE);
                } else {
                        errno_exit("VIDIOC_QUERYCAP");
                }
        }

        if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
                fprintf(stderr, "%s is no video capture device\n",
                         dev_name);
                exit(EXIT_FAILURE);
        }

        switch (io) {
        case IO_METHOD_READ:
                if (!(cap.capabilities & V4L2_CAP_READWRITE)) {
                        fprintf(stderr, "%s does not support read i/o\n",
                                 dev_name);
                        exit(EXIT_FAILURE);
                }
                break;

        case IO_METHOD_MMAP:
        case IO_METHOD_USERPTR:
                if (!(cap.capabilities & V4L2_CAP_STREAMING)) {
                        fprintf(stderr, "%s does not support streaming i/o\n",
                                 dev_name);
                        exit(EXIT_FAILURE);
                }
                break;
        }


        /* Select video input, video standard and tune here. */


        CLEAR(cropcap);

        cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;

        if (0 == xioctl(fd, VIDIOC_CROPCAP, &cropcap)) {
                crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                crop.c = cropcap.defrect; /* reset to default */

                if (-1 == xioctl(fd, VIDIOC_S_CROP, &crop)) {
                        switch (errno) {
                        case EINVAL:
                                /* Cropping not supported. */
                                break;
                        default:
                                /* Errors ignored. */
                                break;
                        }
                }
        } else {
                /* Errors ignored. */
        }


        CLEAR(fmt);

        fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        if (force_format) {
                fmt.fmt.pix.width       = 640;
                fmt.fmt.pix.height      = 480;
                fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
                fmt.fmt.pix.field       = V4L2_FIELD_INTERLACED;

                if (-1 == xioctl(fd, VIDIOC_S_FMT, &fmt))
                        errno_exit("VIDIOC_S_FMT");

                /* Note VIDIOC_S_FMT may change width and height. */
        } else {
                /* Preserve original settings as set by v4l2-ctl for example */
                if (-1 == xioctl(fd, VIDIOC_G_FMT, &fmt))
                        errno_exit("VIDIOC_G_FMT");
        }

        /* Buggy driver paranoia. */
        min = fmt.fmt.pix.width * 2;
        if (fmt.fmt.pix.bytesperline < min)
                fmt.fmt.pix.bytesperline = min;
        min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
        if (fmt.fmt.pix.sizeimage < min)
                fmt.fmt.pix.sizeimage = min;

        switch (io) {
        case IO_METHOD_READ:
                init_read(fmt.fmt.pix.sizeimage);
                break;

        case IO_METHOD_MMAP:
                init_mmap();
                break;

        case IO_METHOD_USERPTR:
                init_userp(fmt.fmt.pix.sizeimage);
                break;
        }
}

static void close_device(void)
{
        if (-1 == close(fd))
                errno_exit("close");

        fd = -1;
}

static void open_device(void)
{
        struct stat st;

        if (-1 == stat(dev_name, &st)) {
                fprintf(stderr, "Cannot identify '%s': %d, %s\n",
                         dev_name, errno, strerror(errno));
                exit(EXIT_FAILURE);
        }

        if (!S_ISCHR(st.st_mode)) {
                fprintf(stderr, "%s is no device\n", dev_name);
                exit(EXIT_FAILURE);
        }

        fd = open(dev_name, O_RDWR /* required */ | O_NONBLOCK, 0);

        if (-1 == fd) {
                fprintf(stderr, "Cannot open '%s': %d, %s\n",
                         dev_name, errno, strerror(errno));
                exit(EXIT_FAILURE);
        }
}

static void usage(FILE *fp, int argc, char **argv)
{
        fprintf(fp,
                 "Usage: %s [options]\n\n"
                 "Version 1.3\n"
                 "Options:\n"
                 "-d | --device name   Video device name [%s]\n"
                 "-h | --help          Print this message\n"
                 "-m | --mmap          Use memory mapped buffers [default]\n"
                 "-r | --read          Use read() calls\n"
                 "-u | --userp         Use application allocated buffers\n"
                 "-o | --output        Outputs stream to stdout\n"
                 "-f | --format        Force format to 640x480 YUYV\n"
                 "-c | --count         Number of frames to grab [%i]\n"
                 "",
                 argv[0], dev_name, frame_count);
}

static const char short_options[] = "d:hmruofc:";

static const struct option
long_options[] = {
        { "device", required_argument, NULL, 'd' },
        { "help",   no_argument,       NULL, 'h' },
        { "mmap",   no_argument,       NULL, 'm' },
        { "read",   no_argument,       NULL, 'r' },
        { "userp",  no_argument,       NULL, 'u' },
        { "output", no_argument,       NULL, 'o' },
        { "format", no_argument,       NULL, 'f' },
        { "count",  required_argument, NULL, 'c' },
        { 0, 0, 0, 0 }
};

int main(int argc, char **argv)
{
        dev_name = "/dev/video0";

        for (;;) {
                int idx;
                int c;

                c = getopt_long(argc, argv,
                                short_options, long_options, &idx);

                if (-1 == c)
                        break;

                switch (c) {
                case 0: /* getopt_long() flag */
                        break;

                case 'd':
                        dev_name = optarg;
                        break;

                case 'h':
                        usage(stdout, argc, argv);
                        exit(EXIT_SUCCESS);

                case 'm':
                        io = IO_METHOD_MMAP;
                        break;

                case 'r':
                        io = IO_METHOD_READ;
                        break;

                case 'u':
                        io = IO_METHOD_USERPTR;
                        break;

                case 'o':
                        out_buf++;
                        break;

                case 'f':
                        force_format++;
                        break;

                case 'c':
                        errno = 0;
                        frame_count = strtol(optarg, NULL, 0);
                        if (errno)
                                errno_exit(optarg);
                        break;

                default:
                        usage(stderr, argc, argv);
                        exit(EXIT_FAILURE);
                }
        }

        open_device();
        init_device();
        start_capturing();
        mainloop();
        stop_capturing();
        uninit_device();
        close_device();
       fprintf(stderr, "\n");
        return 0;
}

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-06 12:28         ` Andrey Utkin
  2016-09-06 17:26           ` Oliver Collyer
@ 2016-09-10  7:37           ` Oliver Collyer
  2016-09-10 10:14             ` Andrey Utkin
  1 sibling, 1 reply; 14+ messages in thread
From: Oliver Collyer @ 2016-09-10  7:37 UTC (permalink / raw)
  To: linux-media; +Cc: Andrey Utkin, Support INOGENI, james.liu

> I am curious to tinker with this, just not sure about free time for it.
> Please go through the following instruction, and then we'll see if ssh
> is going to help to debug this.
> 
> Also I think it is worth to CC actual manufacturers. There are addresses
> for technical support of both devices in public on maker websites.
> Please CC them when replying with new logs, to let them catch up.
> 

Ok, so I’ve provided all these logs requested by Andrey in an earlier message but I’m unsubscribing from this list now.

I have written a patch for FFmpeg that deals with the problem for both devices so it’s not really an issue for me anymore, but I’m not sure if the patch will get accepted in their master git as it’s a little messy.

I’ve already documented another workaround ("modprobe -r uvcvideo && modprobe uvcvideo” before starting any capture) so really it’s up to the people developing these devices and/or the v4l2 driver/sub-system as to whether this gets sorted. Nobody from Magewell even bothered replying and I’m not going to chase that up as I’ve better things to do!

I am however, perfectly happy for anyone to contact me off list/copy me into any further discussion and I’m happy to provide ssh access to a machine that shows the problem for debugging if that would help.

- Oliver


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-10  7:37           ` Oliver Collyer
@ 2016-09-10 10:14             ` Andrey Utkin
  2016-09-10 10:21               ` Oliver Collyer
  0 siblings, 1 reply; 14+ messages in thread
From: Andrey Utkin @ 2016-09-10 10:14 UTC (permalink / raw)
  To: Oliver Collyer; +Cc: linux-media, Support INOGENI, james.liu

On Sat, Sep 10, 2016 at 10:37:08AM +0300, Oliver Collyer wrote:
> Ok, so I’ve provided all these logs requested by Andrey in an earlier
> message but I’m unsubscribing from this list now.

Fine. You'll be able to post here, as well as receive replies for this
thread, without subscription.

> I have written a patch for FFmpeg that deals with the problem for both
> devices so it’s not really an issue for me anymore, but I’m not sure
> if the patch will get accepted in their master git as it’s a little
> messy.

Please post this patch here!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-10 10:14             ` Andrey Utkin
@ 2016-09-10 10:21               ` Oliver Collyer
  2016-09-10 10:58                 ` Andrey Utkin
  0 siblings, 1 reply; 14+ messages in thread
From: Oliver Collyer @ 2016-09-10 10:21 UTC (permalink / raw)
  To: Andrey Utkin; +Cc: linux-media, Support INOGENI, james.liu


>> I have written a patch for FFmpeg that deals with the problem for both
>> devices so it’s not really an issue for me anymore, but I’m not sure
>> if the patch will get accepted in their master git as it’s a little
>> messy.
> 
> Please post this patch here!

Here you go, Andrey. This patch basically makes it throw away corrupted buffers and then also the first 8 buffers after the last corrupted buffer.

It’s not sufficient just to throw away the corrupted buffers as I have noticed that the first few legitimate buffers appear at slightly irregular time intervals leading to FFmpeg spewing out a bunch of warnings for the duration of the capture. In my tests around 3 buffers have to be ignored but I’ve fixed it at 8 to be on the safe side. It’s a bit ugly though, to be honest, I don’t know how the number of buffers that need to be ignored would depend on the framerate, video size etc, but it works for my 1080i test.

With this patch, you get some warnings at the start, for both devices, as it encounters (and recovers from) the corrupted buffers but after that the captures work just fine.


diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
old mode 100644
new mode 100755
index ddf331d..7b4a826
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -79,6 +79,7 @@ struct video_data {
 
     int buffers;
     volatile int buffers_queued;
+    int buffers_ignore;
     void **buf_start;
     unsigned int *buf_len;
     char *standard;
@@ -519,7 +520,9 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
         av_log(ctx, AV_LOG_WARNING,
                "Dequeued v4l2 buffer contains corrupted data (%d bytes).\n",
                buf.bytesused);
-        buf.bytesused = 0;
+        s->buffers_ignore = 8;
+        enqueue_buffer(s, &buf);
+        return FFERROR_REDO;
     } else
 #endif
     {
@@ -529,14 +532,28 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
             s->frame_size = buf.bytesused;
 
         if (s->frame_size > 0 && buf.bytesused != s->frame_size) {
-            av_log(ctx, AV_LOG_ERROR,
+            av_log(ctx, AV_LOG_WARNING,
                    "Dequeued v4l2 buffer contains %d bytes, but %d were expected. Flags: 0x%08X.\n",
                    buf.bytesused, s->frame_size, buf.flags);
+            s->buffers_ignore = 8;
             enqueue_buffer(s, &buf);
-            return AVERROR_INVALIDDATA;
+            return FFERROR_REDO;
         }
     }
 
+    
+    /* if we just encounted some corrupted buffers then we ignore the next few
+     * legitimate buffers because they can arrive at irregular intervals, causing
+     * the timestamps of the input and output streams to be out-of-sync and FFmpeg
+     * to continually emit warnings. */
+    if (s->buffers_ignore) {
+        av_log(ctx, AV_LOG_WARNING,
+               "Ignoring dequeued v4l2 buffer due to earlier corruption.\n");
+        s->buffers_ignore --;
+        enqueue_buffer(s, &buf);
+        return FFERROR_REDO;
+    }
+
     /* Image is at s->buff_start[buf.index] */
     if (avpriv_atomic_int_get(&s->buffers_queued) == FFMAX(s->buffers / 8, 1)) {
         /* when we start getting low on queued buffers, fall back on copying data */
@@ -608,6 +625,7 @@ static int mmap_start(AVFormatContext *ctx)
         }
     }
     s->buffers_queued = s->buffers;
+    s->buffers_ignore = 0;
 
     type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
     if (v4l2_ioctl(s->fd, VIDIOC_STREAMON, &type) < 0) {


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-10 10:21               ` Oliver Collyer
@ 2016-09-10 10:58                 ` Andrey Utkin
  2016-09-10 11:11                   ` Oliver Collyer
  0 siblings, 1 reply; 14+ messages in thread
From: Andrey Utkin @ 2016-09-10 10:58 UTC (permalink / raw)
  To: Oliver Collyer; +Cc: linux-media, Support INOGENI, james.liu

On Sat, Sep 10, 2016 at 01:21:10PM +0300, Oliver Collyer wrote:
> 
> >> I have written a patch for FFmpeg that deals with the problem for both
> >> devices so it’s not really an issue for me anymore, but I’m not sure
> >> if the patch will get accepted in their master git as it’s a little
> >> messy.
> > 
> > Please post this patch here!
> 
> Here you go, Andrey. This patch basically makes it throw away corrupted buffers and then also the first 8 buffers after the last corrupted buffer.

Thanks a lot for sharing.

> It’s not sufficient just to throw away the corrupted buffers as I have noticed that the first few legitimate buffers appear at slightly irregular time intervals leading to FFmpeg spewing out a bunch of warnings for the duration of the capture. In my tests around 3 buffers have to be ignored but I’ve fixed it at 8 to be on the safe side. It’s a bit ugly though, to be honest, I don’t know how the number of buffers that need to be ignored would depend on the framerate, video size etc, but it works for my 1080i test.
> 
> With this patch, you get some warnings at the start, for both devices, as it encounters (and recovers from) the corrupted buffers but after that the captures work just fine.
> 
> 
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> old mode 100644
> new mode 100755
> index ddf331d..7b4a826
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -79,6 +79,7 @@ struct video_data {
>  
>      int buffers;
>      volatile int buffers_queued;
> +    int buffers_ignore;
>      void **buf_start;
>      unsigned int *buf_len;
>      char *standard;
> @@ -519,7 +520,9 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
>          av_log(ctx, AV_LOG_WARNING,
>                 "Dequeued v4l2 buffer contains corrupted data (%d bytes).\n",
>                 buf.bytesused);
> -        buf.bytesused = 0;
> +        s->buffers_ignore = 8;
> +        enqueue_buffer(s, &buf);
> +        return FFERROR_REDO;
>      } else
>  #endif
>      {
> @@ -529,14 +532,28 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
>              s->frame_size = buf.bytesused;
>  
>          if (s->frame_size > 0 && buf.bytesused != s->frame_size) {
> -            av_log(ctx, AV_LOG_ERROR,
> +            av_log(ctx, AV_LOG_WARNING,
>                     "Dequeued v4l2 buffer contains %d bytes, but %d were expected. Flags: 0x%08X.\n",
>                     buf.bytesused, s->frame_size, buf.flags);
> +            s->buffers_ignore = 8;
>              enqueue_buffer(s, &buf);
> -            return AVERROR_INVALIDDATA;
> +            return FFERROR_REDO;
>          }
>      }

These two chunks look like legit resilience measure, and maybe could be
even added to upstream ffmpeg, maybe for non-default mode.

>  
> +    
> +    /* if we just encounted some corrupted buffers then we ignore the next few
> +     * legitimate buffers because they can arrive at irregular intervals, causing
> +     * the timestamps of the input and output streams to be out-of-sync and FFmpeg
> +     * to continually emit warnings. */
> +    if (s->buffers_ignore) {
> +        av_log(ctx, AV_LOG_WARNING,
> +               "Ignoring dequeued v4l2 buffer due to earlier corruption.\n");
> +        s->buffers_ignore --;
> +        enqueue_buffer(s, &buf);
> +        return FFERROR_REDO;
> +    }

Not clear exactly happens here so that such workaround is needed...


Congratulations, you've ended up with a workaround which works for you,
for such a mysterious issue :)

I still don't know what exactly causes this error condition on original
layer (I suppose that's some "panic" in the peripheral device), but I
guess that due to rarity of this condition, V4L2 code developers (in
both kernel and ffmpeg) just haven't had an opportunity to debug such
situations and handled this error condition formally, without experience
of running into it, and knowledge why it happens and how it could be
handled in most resilient way. (Maybe this should NOT be handled in
resilient way in theory, but still works for your case.) So you had to
pave your own way here.

Maybe comments from senior V4L2 developers shed more lights on this.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
  2016-09-10 10:58                 ` Andrey Utkin
@ 2016-09-10 11:11                   ` Oliver Collyer
  0 siblings, 0 replies; 14+ messages in thread
From: Oliver Collyer @ 2016-09-10 11:11 UTC (permalink / raw)
  To: Andrey Utkin; +Cc: linux-media, Support INOGENI, james.liu


> 
> These two chunks look like legit resilience measure, and maybe could be
> even added to upstream ffmpeg, maybe for non-default mode.
> 

Well I’ve posted it to the FFmpeg dev list for feedback, so we will see.

Non-default mode - yes maybe it needs to be optional. And/or only have an effect at the start of the capture; I am concerned that in some situation where a capture momentarily loses signal and delivers a corrupted buffer that my patch would then actually do more than an end user would require by ignoring subsequent buffers and maybe turning it into a bigger issue.

>> 
>> +    
>> +    /* if we just encounted some corrupted buffers then we ignore the next few
>> +     * legitimate buffers because they can arrive at irregular intervals, causing
>> +     * the timestamps of the input and output streams to be out-of-sync and FFmpeg
>> +     * to continually emit warnings. */
>> +    if (s->buffers_ignore) {
>> +        av_log(ctx, AV_LOG_WARNING,
>> +               "Ignoring dequeued v4l2 buffer due to earlier corruption.\n");
>> +        s->buffers_ignore --;
>> +        enqueue_buffer(s, &buf);
>> +        return FFERROR_REDO;
>> +    }
> 
> Not clear exactly happens here so that such workaround is needed…
> 

Yes, this is the ugly bit. I had it outputting the timestamps of all the buffers received and it clearly showed that 2-3 of them are stamped closer together. It’s as if something is taking extra time to recover from whatever was causing the original problem.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-09-10 11:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-03  9:24 uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR Oliver Collyer
2016-09-04 19:25 ` Andrey Utkin
2016-09-04 19:55   ` Oliver Collyer
2016-09-05 19:43   ` Oliver Collyer
2016-09-05 20:19     ` Andrey Utkin
2016-09-05 20:32       ` Oliver Collyer
2016-09-06 10:51       ` Oliver Collyer
2016-09-06 12:28         ` Andrey Utkin
2016-09-06 17:26           ` Oliver Collyer
2016-09-10  7:37           ` Oliver Collyer
2016-09-10 10:14             ` Andrey Utkin
2016-09-10 10:21               ` Oliver Collyer
2016-09-10 10:58                 ` Andrey Utkin
2016-09-10 11:11                   ` Oliver Collyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox