From: Michael Grzeschik <mgr@pengutronix.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Daniel Scally <dan.scally@ideasonboard.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Avichal Rakesh <arakesh@google.com>,
Jayant Chowdhary <jchowdhary@google.com>,
etalvala@google.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] usb: gadget: uvc: allocate requests based on frame interval length and buffersize
Date: Mon, 22 Apr 2024 01:25:31 +0200 [thread overview]
Message-ID: <ZiWga5Kqno1ICv97@pengutronix.de> (raw)
In-Reply-To: <20240403-uvc_request_length_by_interval-v1-0-9436c4716233@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 3225 bytes --]
On Tue, Apr 09, 2024 at 11:24:56PM +0200, Michael Grzeschik wrote:
>This patch series is improving the size calculation and allocation
>of the uvc requests. Using the currenlty setup frame duration of the
>stream it is possible to calculate the number of requests based on the
>interval length.
The basic concept here is right. But unfortunatly we found out that
together with Patch [1] and the current zero length request pump
mechanism [2] and [3] this is not working as expected.
The conclusion that we can not queue more than one frame at once into
the hw led to [1]. The current implementation of zero length reqeusts
which will be queued while we are waiting for the frame to finish
transferring will enlarge the frame duration. Since every zero-length
request is still taking up at least one frame interval of 125 us.
This longer frameduration of each enqueued will therefor decrease the
absolut framerate.
Therefor to properly make those patches work, we will have to get rid of
the zero length pump mechanism again and make sure that the whole
business logic of what to be queued and when will only be done in the
pump worker. It is possible to let the dwc3 udc run dry, as we are
actively waiting for the frame to finish, the last request in the
prepared and started list will stop the current dwc3 stream and therfor
no underruns will occur with the next ep_queue.
Also keeping the prepared list and doing the preparation in any case
of the pump worker is still a good point we need to keep.
With all these pending patches the whole uvc saga of underruns and
flickering videostreams should come to an end™.
I already started with this but would be happy to see Avichal and others
to review the patches when they are ready in my eyes.
mgr
[1] https://lore.kernel.org/all/20240324-uvc-gadget-errorcheck-v1-1-5538c57bbeba@pengutronix.de/
[2] https://lore.kernel.org/all/99384044-0d14-4ebe-9109-8a5557e64449@google.com/
[3] https://lore.kernel.org/all/20230508231103.1621375-1-arakesh@google.com/
>Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>---
>Michael Grzeschik (3):
> usb: gadget: function: uvc: set req_size once when the vb2 queue is calculated
> usb: gadget: uvc: add g_parm and s_parm for frame interval
> usb: gadget: uvc: set req_size and n_requests based on the frame interval
>
> drivers/usb/gadget/function/uvc.h | 1 +
> drivers/usb/gadget/function/uvc_queue.c | 30 ++++++++++++++-----
> drivers/usb/gadget/function/uvc_v4l2.c | 52 +++++++++++++++++++++++++++++++++
> drivers/usb/gadget/function/uvc_video.c | 17 ++---------
> 4 files changed, 79 insertions(+), 21 deletions(-)
>---
>base-commit: 3295f1b866bfbcabd625511968e8a5c541f9ab32
>change-id: 20240403-uvc_request_length_by_interval-a7efd587d963
>
>Best regards,
>--
>Michael Grzeschik <m.grzeschik@pengutronix.de>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-04-21 23:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 21:24 [PATCH 0/3] usb: gadget: uvc: allocate requests based on frame interval length and buffersize Michael Grzeschik
2024-04-09 21:24 ` [PATCH 1/3] usb: gadget: function: uvc: set req_size once when the vb2 queue is calculated Michael Grzeschik
2024-04-09 21:24 ` [PATCH 2/3] usb: gadget: uvc: add g_parm and s_parm for frame interval Michael Grzeschik
2024-04-09 21:24 ` [PATCH 3/3] usb: gadget: uvc: set req_size and n_requests based on the " Michael Grzeschik
2024-04-21 23:25 ` Michael Grzeschik [this message]
2024-04-23 0:21 ` [PATCH 0/3] usb: gadget: uvc: allocate requests based on frame interval length and buffersize Avichal Rakesh
2024-04-23 14:25 ` Michael Grzeschik
2024-04-23 23:23 ` Avichal Rakesh
2024-04-24 2:28 ` Thinh Nguyen
2024-05-12 22:10 ` Michael Grzeschik
2024-05-17 1:44 ` Thinh Nguyen
2024-05-22 0:08 ` Michael Grzeschik
2024-05-22 1:41 ` Thinh Nguyen
2024-05-22 14:50 ` Alan Stern
2024-05-22 17:17 ` Thinh Nguyen
2024-05-22 17:37 ` Michael Grzeschik
2024-05-22 18:23 ` Thinh Nguyen
2024-05-22 18:58 ` Alan Stern
2024-05-28 17:30 ` Avichal Rakesh
2024-05-28 20:22 ` Michael Grzeschik
2024-05-28 21:27 ` Avichal Rakesh
2024-05-28 22:43 ` Michael Grzeschik
2024-05-29 0:33 ` Avichal Rakesh
2024-05-29 21:24 ` Michael Grzeschik
2024-06-04 22:32 ` Avichal Rakesh
2024-06-10 21:44 ` Michael Grzeschik
2024-05-22 11:16 ` Michael Grzeschik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZiWga5Kqno1ICv97@pengutronix.de \
--to=mgr@pengutronix.de \
--cc=arakesh@google.com \
--cc=dan.scally@ideasonboard.com \
--cc=etalvala@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jchowdhary@google.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox