Le 06/06/11 19:42, Laurent Pinchart a écrit :
> Hi Yann,
> 
> Thanks for the patch.
> 
> On Friday 03 June 2011 15:48:59 Yann Sionneau wrote:
>> Hi Laurent and the UVC list,
>>
>> Here is a patch (that applies against the linux-2.6.39 vanilla tree)
>> that shows the number of frames whose header (the one described at
>> section 2.4.3.3 of the document "USB Device Class Definition for Video
>> Devices") contains the SCR, PTS and ERR bits.
>> The patch is attached in the e-mail.
>>
>> The patch works as follow :
>>
>> (*) Apply the patch
>> (*) Compile the patched UVC module
>> (*) Unload the previous module and load the new one
>> (*) Start a video capture
>> (*) Upon "stop" of the video capture (ioctl STREAMOFF) it will print
>> statistics about the stream in the dmesg (/var/log/syslog)
>>
>> It will show the number of frames whose header contains the bits SCR,
>> PTS and ERR. It will show the total number of frames of the stream as
>> well (the stream->sequence).
> 
> You should take all UVC packets into account, not just the first one for each 
> frame. 

Yes I don't know why in my head I thought only the first uvc packet
would have a header for the frame with timestamps and such, but it makes
no sense, each packet has its own header and the start of frame is just
signaled by the toggling of the FID :)

> the important information are
> 
> - do all frames have a PTS timestamp in their first packet ?

It seems so yes, at least on the two webcams I tried with the patch.

> - do all non-empty packets for a frame have a PTS timestamp, and is it 
> constant through the whole frame as it should be ?

Let's modify the patch to count the PTS and SCR of all packets instead
of only one per frame in order to sort this out !

> - how many SCR timestamps do we have per frame ? are they constant through 
> the 
> whole frame or do they vary as they should ?
> 

Same here !

>> I have tested this patch with 2 webcams so far, one is the Logitech HD
>> Pro C910, the other is the Freetalk "skype" webcam made by Tatung, model
>> "Talk 7190", board "R00C", firmware "SDK8RC26".
>>
>> The second one is featuring a MG3500 chip from Maxim IC, it does
>> hardware encoding to stream H.264 codec inside a MPEG-2 TS container.
>>
>> During my test I used it without any hardware encoding, it was doing
>> normal raw YUV 4:2:2 streaming.
>>
>> I noticed both webcams are putting PTS and SCR bits on all (or all but
>> one, not sure) frames.
>> Moreover no frame got the ERR bit on (good :)).
>>
>> Here are two examples of what the patch should output :
>>
>> Jun  3 11:58:43 obiwan kernel: [180779.218667] [uvcvideo] stats about
>> previous stream :
>> Jun  3 11:58:43 obiwan kernel: [180779.218672] nb_pts = 140 ; nb_scr =
>> 140 ; nb_err = 0 over 139 frames
>>
>> and
>>
>> Jun  3 11:46:33 obiwan kernel: [180050.637465] [uvcvideo] stats about
>> previous stream :
>> Jun  3 11:46:33 obiwan kernel: [180050.637471] nb_pts = 258 ; nb_scr =
>> 258 ; nb_err = 0 over 257 frames
>>
>> I don't know why I have one extra frame in my pts, scr and err counters
>> than in the stream->sequence.
>>
>> I used "guvcview -d /dev/video0" to start the stream, and closed the GTK
>> window to stop the stream.
>>
>> Feel free to test this patch with your webcams are report back your
>> dmesg output (with framerate and the duration of the test please).
>>
>> This test is the first step of a bigger goal : implementing a correct
>> timestamp support.
>>
>> Regards,
> 

Thanks for your review and comments, will submit a new patch ASAP !

Regards,

-- 
Yann Sionneau
_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to