Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9
Hi, On Sun, Dec 7, 2014 at 9:23 PM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: Hi Grazvydas, (CC'ing Paulo Assis) On Saturday 06 December 2014 02:25:25 Grazvydas Ignotas wrote: On Fri, Dec 5, 2014 at 1:46 PM, Laurent Pinchart wrote: On Thursday 06 November 2014 00:29:53 Grazvydas Ignotas wrote: On Wed, Nov 5, 2014 at 4:05 PM, Laurent Pinchart wrote: Would you be able to capture images from the C920 using yavta, with the uvcvideo trace parameter set to 4096, and send me both the yavta log and the kernel log ? Let's start with a capture sequence of 50 to 100 images. I've done 2 captures, if that helps: http://notaz.gp2x.de/tmp/c920_yavta/ The second one was done using low exposure setting, which allows camera to achieve higher frame rate. Thank you for the log, they were very helpful. They revealed that the USB SOF (Start Of Frame) counter values on the device and host side are not in sync. The counters get incremented are very different rates. What USB controller are you using ? 00:1d.7 USB controller: Intel Corporation NM10/ICH7 Family USB2 EHCI Controller (rev 01) (prog-if 20 [EHCI]) Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7592 Flags: bus master, medium devsel, latency 0, IRQ 23 Memory at fe9fbc00 (32-bit, non-prefetchable) [size=1K] Capabilities: [50] Power Management version 2 Capabilities: [58] Debug port: BAR=1 offset=00a0 Kernel driver in use: ehci-pci If it helps, I could try on an ARM board, currently don't have any other x86 hardware around. Actually the frequencies I've computed from the log are correct on the host side but quite off on the device side. I'm puzzled. The following patch allows accessing the contents of the clock data buffer through debugfs. Would you be able to apply it and execute the following steps ? 1. Load the uvcvideo module with the clock trace flag (0x1000) set. 2. Start capturing clock data. while true; do cat /sys/kernel/debug/usb/uvcvideo/2-6/clocks ; done ~/samples.log 3. Capture 100 frames. yavta -c100 yavta.log 4. Stop the while true with ctrl-C. 5. Capture the uvcvideo stats. cat /sys/kernel/debug/usb/uvcvideo/2-6/stats stats.log 6. Capture the kernel log. dmesg dmesg.log 7. Send me all the log files. Done: http://notaz.gp2x.de/tmp/c920_yavta/3/ -- Gražvydas -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9
Hi, On Fri, Dec 5, 2014 at 1:46 PM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: Hi Grazvydas, On Thursday 06 November 2014 00:29:53 Grazvydas Ignotas wrote: On Wed, Nov 5, 2014 at 4:05 PM, Laurent Pinchart wrote: Would you be able to capture images from the C920 using yavta, with the uvcvideo trace parameter set to 4096, and send me both the yavta log and the kernel log ? Let's start with a capture sequence of 50 to 100 images. I've done 2 captures, if that helps: http://notaz.gp2x.de/tmp/c920_yavta/ The second one was done using low exposure setting, which allows camera to achieve higher frame rate. Thank you for the log, they were very helpful. They revealed that the USB SOF (Start Of Frame) counter values on the device and host side are not in sync. The counters get incremented are very different rates. What USB controller are you using ? 00:1d.7 USB controller: Intel Corporation NM10/ICH7 Family USB2 EHCI Controller (rev 01) (prog-if 20 [EHCI]) Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7592 Flags: bus master, medium devsel, latency 0, IRQ 23 Memory at fe9fbc00 (32-bit, non-prefetchable) [size=1K] Capabilities: [50] Power Management version 2 Capabilities: [58] Debug port: BAR=1 offset=00a0 Kernel driver in use: ehci-pci If it helps, I could try on an ARM board, currently don't have any other x86 hardware around. -- Gražvydas -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9
On Thu, Nov 6, 2014 at 12:29 AM, Grazvydas Ignotas nota...@gmail.com wrote: On Wed, Nov 5, 2014 at 4:05 PM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: Hi Rémi, On Tuesday 04 November 2014 22:41:44 Rémi Denis-Courmont wrote: Le mardi 04 novembre 2014, 15:42:37 Rémi Denis-Courmont a écrit : Le 2014-11-04 14:58, Sakari Ailus a écrit : Have you tried with a different application to see if the problem persists? Tried mplayer and cheese now, and it seems they are not affected, so it's an issue with vlc. I wonder why it doesn't like newer flags.. Ohwell, sorry for the noise. I guess the newer VLC could indeed pay attention to the monotonic timestamp flag. Remi, any idea? VLC takes the kernel timestamp, if monotonic, since version 2.1. Otherwise, it generates its own inaccurate timestamp. So either that code is wrong, or the kernel timestamps are. From a quick check with C920, the timestamps from the kernel are quite jittery, and but seem to follow a pattern. When requesting a 10 Hz frame rate, I actually get a frame interval of about 8/9 (i.e. 89ms) jumping to 1/3 every approximately 2 seconds. From my user-space point of view, this is a kernel issue. The problem probably just manifests when both VLC and Linux versions support monotonic timestamps. Whether the root cause is in the kernel, the device driver or the firmware, I can´t say. Would you be able to capture images from the C920 using yavta, with the uvcvideo trace parameter set to 4096, and send me both the yavta log and the kernel log ? Let's start with a capture sequence of 50 to 100 images. I've done 2 captures, if that helps: http://notaz.gp2x.de/tmp/c920_yavta/ The second one was done using low exposure setting, which allows camera to achieve higher frame rate. So, has anyone had time to look at these? Gražvydas -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: (bisected) Logitech C920 (uvcvideo) stutters since 3.9
Hi, On Mon, Nov 3, 2014 at 12:57 AM, Sakari Ailus sakari.ai...@iki.fi wrote: Hi Grazvydas, On Sun, Nov 02, 2014 at 04:03:55AM +0200, Grazvydas Ignotas wrote: There is periodic stutter (seen in vlc, for example) since 3.9 where the stream stops for around half a second every 3-5 seconds or so. Bisecting points to 1b18e7a0be859911b22138ce27258687efc528b8 v4l: Tell user space we're using monotonic timestamps. I've verified the problem is there on stock Ubuntu 14.04 kernel, 3.16.7 from kernel.org and when using media_build.git . The commit does not revert on newer kernels as that code changed, but checking out a commit before the one mentioned gives properly working kernel. I'm using Logitech C920 which can do h264 compression and playing the video using vlc: cvlc v4l2:///dev/video0:chroma=h264:width=1280:height=720 I've got Logitech C270 here but I can't reproduce the problem. The frame rate with the above command is really low, around 5. With a smaller resolution it works quite smoothly. The reason might be that the pixel format is still YUYV. The other option appears to be MJPG. I've tried lower resolution and YUYV with MJPG too, this has the same problem: cvlc v4l2:///dev/video0:chroma=h264:width=320:height=240 cvlc v4l2:///dev/video0:chroma=yuyv:width=320:height=240 My vlc is of version 2.0.3 (Debian). Which one do you have, and does it use libv4l2? Mine is 2.1.4, my distro is Ubuntu 14.04. I can see libv4l2.so.0.0.0 in maps, but I have no idea what it's used for.. Have you tried with a different application to see if the problem persists? Tried mplayer and cheese now, and it seems they are not affected, so it's an issue with vlc. I wonder why it doesn't like newer flags.. Ohwell, sorry for the noise. -- Gražvydas -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
(bisected) Logitech C920 (uvcvideo) stutters since 3.9
Hi, There is periodic stutter (seen in vlc, for example) since 3.9 where the stream stops for around half a second every 3-5 seconds or so. Bisecting points to 1b18e7a0be859911b22138ce27258687efc528b8 v4l: Tell user space we're using monotonic timestamps. I've verified the problem is there on stock Ubuntu 14.04 kernel, 3.16.7 from kernel.org and when using media_build.git . The commit does not revert on newer kernels as that code changed, but checking out a commit before the one mentioned gives properly working kernel. I'm using Logitech C920 which can do h264 compression and playing the video using vlc: cvlc v4l2:///dev/video0:chroma=h264:width=1280:height=720 -- Gražvydas -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html