Discussion:
[linux-uvc-devel] Issue with playing 30fps with uvc-gadget.c application
Sricharan Chalasani
2014-02-05 18:01:48 UTC
Permalink
Dear List,

Many thanks for your time.

I am trying to stream (YUV Format) 30fps with the uvc-gadget.c application
with the following modified configuration in file uvc-gadget.c. I am trying
to play the default YUV pattern generated by the application.

static const struct uvc_frame_info uvc_frames_yuyv[] = {
{ 1280, 720, { 333333, 10000000, 50000000, 0 }, },
{ 1280, 720, { 333333, 0 }, },
{ 0, 0, { 0, }, },
};

I am using underlying UVC Class driver with Linux Kernel Version 2.6.36.

My development board acts as a USB Webcam and works in USB device mode and
streams video to connected Host Windows PC. I am running VLC player on the
connected Windows PC and trying to record the YUV stream generated from my
development board.


1. I have analyzed the video stream on VLC media player under Tools option.
It aways says frame rate as 2. Does it mean that the VLC media player is
receiving only 2 frames per second in teh video stream ? Does it mean that
my UVC Class driver is streaming only 2 frames per second ?

2. I have measured the elapsed time between two consecutive calls of the
following function in uvc-gadget.c. I have repeated this test 10 times.

static void uvc_video_fill_buffer(struct uvc_device *dev, struct
v4l2_buffer *buf)

The elapsed time between two consecutive calls of the above function is
approximately 800 milli seconds. But I expect that this function should be
called once for every 33 milli seconds (30 fps).


Please suggest me if I am missing anything here. Do I have to configure
anything more to get this working.

Thaks in advance.

regards,
Sricharan,
Laurent Pinchart
2014-02-10 14:10:24 UTC
Permalink
Hi Sricharan,
Post by Sricharan Chalasani
Dear List,
Many thanks for your time.
I am trying to stream (YUV Format) 30fps with the uvc-gadget.c application
with the following modified configuration in file uvc-gadget.c. I am trying
to play the default YUV pattern generated by the application.
static const struct uvc_frame_info uvc_frames_yuyv[] = {
{ 1280, 720, { 333333, 10000000, 50000000, 0 }, },
{ 1280, 720, { 333333, 0 }, },
There should be a single 720p line, and you should modify
drivers/usb/gadget/webcam.c in your kernel to match this. Removing
uvc_frame_yuv_360p and updating uvc_frame_yuv_720p with the frame rates you
want to support should be enough.
Post by Sricharan Chalasani
{ 0, 0, { 0, }, },
};
I am using underlying UVC Class driver with Linux Kernel Version 2.6.36.
That's ancient...
Post by Sricharan Chalasani
My development board acts as a USB Webcam and works in USB device mode and
streams video to connected Host Windows PC. I am running VLC player on the
connected Windows PC and trying to record the YUV stream generated from my
development board.
1. I have analyzed the video stream on VLC media player under Tools option.
It aways says frame rate as 2. Does it mean that the VLC media player is
receiving only 2 frames per second in teh video stream ? Does it mean that
my UVC Class driver is streaming only 2 frames per second ?
I'm not very familiar with VLC. I would advice using a lower-level test tool,
such as yavta (http://git.ideasonboard.org/yavta.git) on a Linux host.
Post by Sricharan Chalasani
2. I have measured the elapsed time between two consecutive calls of the
following function in uvc-gadget.c. I have repeated this test 10 times.
static void uvc_video_fill_buffer(struct uvc_device *dev, struct
v4l2_buffer *buf)
The elapsed time between two consecutive calls of the above function is
approximately 800 milli seconds. But I expect that this function should be
called once for every 33 milli seconds (30 fps).
There could be many causes to this, from the host not submitting URBs fast
enough to the gadget USB function controller being too slow, including a slow
CPU. You could start by tracing the video commit control writes on the gadget
side to see how the host configures the gadget.
Post by Sricharan Chalasani
Please suggest me if I am missing anything here. Do I have to configure
anything more to get this working.
--
Regards,

Laurent Pinchart
Loading...