Linux USB
 help / color / mirror / Atom feed
From: Michael Grzeschik <mgr@pengutronix.de>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"stanley_chang@realtek.com" <stanley_chang@realtek.com>
Subject: Re: DWC3-Gadget: Flickering with ISOC Streaming (UVC) while multiplier set on Superspeed
Date: Wed, 6 Sep 2023 08:40:11 +0200	[thread overview]
Message-ID: <ZPgey9fp6Xst/9da@pengutronix.de> (raw)
In-Reply-To: <20230906004353.ksxjazs4iaejnynk@synopsys.com>

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

On Wed, Sep 06, 2023 at 12:44:02AM +0000, Thinh Nguyen wrote:
>On Mon, Sep 04, 2023, Michael Grzeschik wrote:
>> Cc'ing: Stanley Chang <stanley_chang@realtek.com>
>>
>> On Mon, Sep 04, 2023 at 12:41:33AM +0200, Michael Grzeschik wrote:
>> > Hi Thinh
>> >
>> > On Fri, Sep 01, 2023 at 01:35:16AM +0000, Thinh Nguyen wrote:
>> > > On Fri, Sep 01, 2023, Michael Grzeschik wrote:
>> > > > I just stumbled over a similar issue we already solved for the High
>> > > > Speed Case when streaming ISOC packages and using a multiplier higher
>> > > > then one. Last time we saw some bad frame artefacts when using the
>> > > > higher multiplier value. The Frames were distorted due to truncated
>> > > > transfers.
>> > > >
>> > > > Since the last case we have patch
>> > > >
>> > > > 8affe37c525d ("usb: dwc3: gadget: fix high speed multiplier setting")
>> > > >
>> > > > that fixes the calculation of the mult PCM1 parameter when using high
>> > > > speed transfers. After that no truncations were reported again.
>> > > >
>> > > > However I came across a similar issue which is just a little less easy
>> > > > to trigger and only occurs with Superspeed. Now, while the memory
>> > > > bandwidth of the machine runs on higher load, the UVC frames are
>> > > > similarly distorted when we use a multiplier higher then one.
>> > > >
>> > > > I looked over the implications the multiplier has on the Superspeed case
>> > > > in the dwc3 gadget driver, but could only find some TXFIFO adjustments
>> > > > and no other extra bits e.g. in the transfer descriptors. Do you have
>> > > > some pointers how the multiplier parameter of the endpoint is used in
>> > > > hardware?
>> > > >
>> > >
>> > > As you already know, PCM1 is only for highspeed not Superspeed. What
>> > > failure did the dwc3 driver reported? Missed isoc? What's the request
>> > > transfer size?
>> >
>> > Yes, I see missed isoc errors. But this is just a symptom in this case.
>> >
>> > I can increase the maxburst or maxpacket parameters stepwise and on
>> > one point see the flickering appear. But when I increase the TXFIFOSIZE
>> > for the endpoint the flickering is gone again. Until I increase one of
>> > the parameters maxpacket or maxburst to much again.
>> >
>> > So due to the memory bandwidth is under pressure, it seems like the
>> > hardware is not fast enough with sending the expected data per transfer,
>> > due to the txfifo is not long enough and needs to be refilled more
>> > often.
>> >
>> > This sounds like a fifo underrun issue in the hardware.
>>
>> This whole issue sound like a case of stanleys patches:
>>
>> https://lore.kernel.org/all/20230828055212.5600-1-stanley_chang@realtek.com/
>>
>> For now I was unluky while adjusting the paramaters. Are those registers
>> anywhere documented?
>>
>
>How does his change impact isoc endpoint? His change should only affect
>non-periodic endpoint. Also periodic settings is only for host.

Since I did not find proper documentation of the registers I was just hoping.

In the device-tree documentation stanley added he mentioned some device
mode properties. As I look again it seems the RXFIFO parameters are
the only one affecting device mode. So nevermind.

Thanks,
Michael

-- 
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 --]

  reply	other threads:[~2023-09-06  6:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 22:12 DWC3-Gadget: Flickering with ISOC Streaming (UVC) while multiplier set on Superspeed Michael Grzeschik
2023-09-01  1:35 ` Thinh Nguyen
2023-09-03 22:41   ` Michael Grzeschik
2023-09-04  0:42     ` Michael Grzeschik
2023-09-06  0:44       ` Thinh Nguyen
2023-09-06  6:40         ` Michael Grzeschik [this message]
2023-09-06  0:41     ` Thinh Nguyen
2023-09-06  7:18       ` Michael Grzeschik
2023-09-06 23:05         ` Thinh Nguyen
2023-09-06 23:09           ` Thinh Nguyen
2023-09-07 21:00             ` Michael Grzeschik
2023-09-07 23:33               ` Thinh Nguyen
2023-10-30 12:18                 ` Michael Grzeschik
2023-10-31 23:18                   ` Thinh Nguyen
2023-11-09 23:33                     ` [PATCH] usb: gadget: uvc: reduce the request size to increase the throughput Michael Grzeschik
2023-11-10  2:16                       ` Thinh Nguyen
2023-11-10 22:42                         ` Thinh Nguyen
2023-11-13  8:43                         ` Michael Grzeschik
2023-11-17  2:39                           ` Thinh Nguyen

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=ZPgey9fp6Xst/9da@pengutronix.de \
    --to=mgr@pengutronix.de \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-usb@vger.kernel.org \
    --cc=stanley_chang@realtek.com \
    /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