All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: PALAK SHAH <palak.shah@raritan.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Stephen Gagliardo <stephen.gagliardo@raritan.com>,
	Maynard CABIENTE <maynard.cabiente@raritan.com>
Subject: Re: usb: gadget: dwc2: not getting audio data
Date: Mon, 28 Aug 2023 10:46:03 +0000	[thread overview]
Message-ID: <b14403fe-ffa2-b085-53d5-18f5551b450d@synopsys.com> (raw)
In-Reply-To: <PAXPR06MB8531C287BA35D325DE5DB42E8DE3A@PAXPR06MB8531.eurprd06.prod.outlook.com>

Hi Palak,

On 8/25/23 22:32, PALAK SHAH wrote:
> Hi Minas,
> It's absolutely essential for us to get the USB audio working on our platform. We cannot proceed further ourselves, without the knowledge of IP core.
> 
> How can we procure documents of the IP core? Can you please tell us who to reach out to, or what is the procedure to get more information/documentation of the IP core?
> 
> Thanks,
> Palak
> 

You open the case via solvnet.synopsys.com, our application engineers 
will help you.

Thanks,
Minas


> -----Original Message-----
> From: PALAK SHAH
> Sent: Tuesday, August 15, 2023 12:08 PM
> To: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
> Cc: linux-usb@vger.kernel.org
> Subject: RE: usb: gadget: dwc2: not getting audio data
> 
> Hi Minas,
> I changed the count to 16 and the end point is still shutting down. I also tried 48 out of curiosity few days ago, and the end point still shuts down.
> 
> I have attached the log showing the end point shutting down. On Raspberry Pi, the end point never shuts  down even with the buffer count 2, so why does the end point shut down on our platform? And even if it shutdown, you can see that it never opens again, so it keeps calling the sart_isoc function and queues, but the dequeue never happens again and the token_ep_disabled keeps getting called.
> 
> Since we don’t have access to IP core, do you have any other suggestions?
> 
> Thanks,
> Palak
> 
> -----Original Message-----
> From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
> Sent: Tuesday, August 15, 2023 4:44 AM
> To: PALAK SHAH <palak.shah@raritan.com>
> Cc: linux-usb@vger.kernel.org
> Subject: Re: usb: gadget: dwc2: not getting audio data
> 
> Hi Palak,
> 
> Please try to reduce request count to 16. Looks like when filling 32 isoc descs before start isoc system spent long time and not able to enable EP on time, before arriving next isoc out packet.
> 
> Thanks,
> Minas
> 
> 
> On 8/9/23 00:48, PALAK SHAH wrote:
>> Hi Minas,
>> Hope you are doing well.
>>
>> This is regarding the DWC2 core EP1 OUT getting disabled and not able to turn it on again. We spoke last in May.
>>
>> I am on kernel to 5.10.100. I have done the IP core test and all the tests (esp. t15 and t16 for ISOC) pass on our system.
>>
>> The original issue was that, when I am playing an audio on the HOST, EP1 OUT on our platform starts receiving the data. After a while, we saw a mysterious time gap and the EP got disabled. And we received the DXEPINT_OUTTKNEPDIS interrupt.
>>
>> After your suggestion, I change the #define UAC1_DEF_REQ_NUM  from 2 to 32.
>>
>> Please note that, with this change, if the host is running audio and the DWC2 core is receiving data, EP keeps running. No issue.
>>
>> However, AFTER I START ARECORD, I get some data like 45076 bytes, and then again, the EP is disabled. And the original issue comes back. I receive DXEPINT_OUTTKNEPDIS interrupt.
>>
>> So by changing the buffer count from 2 to 32, the problem still exists, just delayed, UNTIL AFTER I start ARECORD. It runs for a couple of seconds, then the time gap and then the EP is disabled. Since we don’t know how the IP core works, I cant really figure this out.
>>
>> I got a raspberry PI set up with kernel 6.2 and 5.10.110, and the arecord work just fine. I even compared the source code and the logs between our system and R-PI. Once R-PI starts receiving data, it never stops. I get nice audio. But on our system the EP gets disabled.
>>
>> I have attached the log file. You will see the DWC2 core messages first showing the data coming in on EP1(OUT), then you will see ALSA messages when I start arecord, then you will see the mysterious time gap and then the EP disabled. Once its disabled, it never gets the XFERCOMPL int. We keep getting DXEPINT_OUTTKNEPDIS interrupt.
>>
>>    I have spent a lot of time to understand the g_audio and DWC2 core in detail, but at this point there isn’t more I can do, without synopsis help since we don’t have full sources.
>>
>> Any help appreciated.
>>
>> Thanks,
>> Palak
>>
>> -----Original Message-----
>> From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
>> Sent: Wednesday, May 17, 2023 2:05 AM
>> To: PALAK SHAH <palak.shah@raritan.com>; Maynard CABIENTE
>> <maynard.cabiente@raritan.com>
>> Cc: linux-usb@vger.kernel.org
>> Subject: Re: usb: gadget: dwc2: not getting audio data
>>
>> Hi Palak,
>>
>> On 5/17/23 00:43, PALAK SHAH wrote:
>>> Hi Minas,
>>> 1. Depend on which uac(uac1 or uac2) you use, increase 2 to 32
>>>
>>> I change the #define UAC1_DEF_REQ_NUM       32.
>>>
>>> When I do this, what I see is, that when I play audio on the target, I don’t see the ENDPOINT shutdown. HOWEVER, when I try to record the data, I DO NOT RECORD any data.
>>> The arecord file is empty with only 44 bytes. I saw the same behavior 2 months ago with the older version of kernel.
>>>
>>
>> So, to set req num to 32 resolve time gap issue and ISOC OUT transfers
>> (aplay) going OK. Please keep this 32 setting always.
>>
>> Arecord. In latest log I see that function driver, besides EP1OUT (which for aplay and it normally works), queued 32 requests to EP4IN, which I assume endpoint for ISOC IN for arecord. But transfer on EP4IN never start. Please provide me log and usb tarce when you doing aplay with arecord.
>>
>>> The logs show that the data comes on EP1(OUT) and the buffer queues upto #255 and then wraps around to 0. USB sniffer also shows data coming in.
>> Wrapping from #255 to #0 is Ok, driver allocate 256 descriptors
>>
>>
>> Thanks,
>> Minas
>>
>>>
>>> [ 4022.593932] dwc2 ffb40000.usb: dwc2_hsotg_epint: ep1(out)
>>> DxEPINT=0x00000001 [ 4022.593945] dwc2 ffb40000.usb: dwc2_hsotg_epint:
>>> XferCompl: DxEPCTL=0x800480c8, DXEPTSIZ=1411f0c0 [ 4022.593962] dwc2
>>> ffb40000.usb: complete: ep 5a34f664 ep1out, req 071607a0, 0 =>
>>> 209d0061 [ 4022.593981] dwc2 ffb40000.usb: ep1out: req 071607a0:
>>> 200@f268b719, noi=0, zero=0, snok=0 [ 4022.594005] dwc2 ffb40000.usb:
>>> dwc2_gadget_fill_isoc_desc: Filling ep 1, dir out isoc desc # 255 [
>>> 4022.594017] dwc2 ffb40000.usb:
>>> dwc2_gadget_complete_isoc_request_ddma: compl_desc # 223
>>>
>>> [ 4022.594922] dwc2 ffb40000.usb: dwc2_hsotg_epint: ep1(out)
>>> DxEPINT=0x00000001 [ 4022.594935] dwc2 ffb40000.usb: dwc2_hsotg_epint:
>>> XferCompl: DxEPCTL=0x800480c8, DXEPTSIZ=1409f060 [ 4022.594951] dwc2
>>> ffb40000.usb: complete: ep 5a34f664 ep1out, req bba03a8f, 0 =>
>>> 209d0061 [ 4022.594971] dwc2 ffb40000.usb: ep1out: req bba03a8f:
>>> 200@a96a5d42, noi=0, zero=0, snok=0 [ 4022.594994] dwc2 ffb40000.usb:
>>> dwc2_gadget_fill_isoc_desc: Filling ep 1, dir out isoc desc # 0 [
>>> 4022.595006] dwc2 ffb40000.usb:
>>> dwc2_gadget_complete_isoc_request_ddma: compl_desc # 224
>>>
>>> I see this going on indefinitely in logs. But when I do arecord and try to capture, I don’t get anything recorded.
>>>
>>> Is there anything more that needs to be enabled, to get this working? The endpoint is not shutting down but the data isn’t getting recorded.
>>>
>>> May be this is the going in the right direction but needs something more to be done?
>>>
>>> Attached the logs file here, showing no endpoint shutdown, but arecord file showing NO data.
>>>
>>> 2. Change descriptor DMA (DDMA) mode to buffer DMA (BDMA) mode When I
>>> change this, I am seeing a kernel crash. I will investigate this further.
>>>
>>> Thanks,
>>> Palak
>>>
>>>
>>> -----Original Message-----
>>> From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
>>> Sent: Tuesday, May 16, 2023 3:54 AM
>>> To: PALAK SHAH <palak.shah@raritan.com>; Maynard CABIENTE
>>> <maynard.cabiente@raritan.com>
>>> Cc: linux-usb@vger.kernel.org
>>> Subject: Re: usb: gadget: dwc2: not getting audio data
>>>
>>> Hi Palak,
>>>
>>> On 5/11/23 17:16, PALAK SHAH wrote:
>>>> Hi Minas,
>>>>
>>>> Can you please respond to this? We need USB Audio Gadget working and
>>>> we cannot proceed without Synopsis support on this.
>>>>
>>>> Thanks,
>>>>
>>>> Palak
>>>>
>>>> *From:* PALAK SHAH
>>>> *Sent:* Tuesday, May 9, 2023 10:52 AM
>>>> *To:* Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>; Maynard
>>>> CABIENTE <maynard.cabiente@raritan.com>
>>>> *Cc:* linux-usb@vger.kernel.org
>>>> *Subject:* RE: usb: gadget: dwc2: not getting audio data
>>>>
>>>> Hi Minas,
>>>>
>>>> I have updated the kernel to 5.10.100. I have done the IP core test
>>>> and all the tests (esp. t15 and t16 for ISOC) pass on our system.
>>>>
>>>> However, I am still seeing the original problem. USB gadget DWC2
>>>> driver is getting stuck and not getting the transfers completed.
>>>>
>>>> When I am running audio on the host, and trying to capture the data
>>>> on
>>>> EP1(out) end point -
>>>>
>>>> [  270.855174] dwc2 ffb40000.usb: dwc2_hsotg_irq: gintsts: 042c8028,
>>>> gintsts & gintmsk: 000c0000, gintmsk: (d08c3c44) retry 8 [
>>>> 270.855189] dwc2 ffb40000.usb: dwc2_hsotg_irq: daint=00020002 [
>>>> 270.855205] dwc2 ffb40000.usb: dwc2_hsotg_epint: ep1(out)
>>>> DxEPINT=0x00000001
>>>> [  270.855218] dwc2 ffb40000.usb: dwc2_hsotg_epint: XferCompl:
>>>> DxEPCTL=0x800480c8, DXEPTSIZ=11e55680 [  270.855238] dwc2
>>>> ffb40000.usb: complete: ep 822473bd ep1out, req 76bf77e8, 0 =>
>>>> 778da9a8 [  270.855260] dwc2 ffb40000.usb: ep1out: req
>>>> 76bf77e8: 200@1c821d4e, noi=0, zero=0, snok=0 [  270.855279] dwc2
>>>> ffb40000.usb: dwc2_gadget_fill_isoc_desc: Filling ep 1, dir out isoc
>>>> desc # 195 [  270.855292] dwc2 ffb40000.usb:
>>>> dwc2_gadget_complete_isoc_request_ddma: compl_desc # 193
>>>>
>>>> [  270.856242] dwc2 ffb40000.usb: dwc2_hsotg_irq: gintsts: 04288028,
>>>> gintsts & gintmsk: 00080000, gintmsk: (d08c3c44) retry 8 [
>>>> 270.856255] dwc2 ffb40000.usb: dwc2_hsotg_irq: daint=00020000 [
>>>> 270.856268] dwc2 ffb40000.usb: dwc2_hsotg_epint: ep1(out)
>>>> DxEPINT=0x00000001
>>>> [  270.856282] dwc2 ffb40000.usb: dwc2_hsotg_epint: XferCompl:
>>>> DxEPCTL=0x800480c8, DXEPTSIZ=11dd5620 [  270.856311] dwc2
>>>> ffb40000.usb: complete: ep 822473bd ep1out, req 5af4a660, 0 =>
>>>> 778da9a8 [  270.856346] dwc2 ffb40000.usb: ep1out: req
>>>> 5af4a660: 200@f8820950, noi=0, zero=0, snok=0 [  270.856371] dwc2
>>>> ffb40000.usb: dwc2_gadget_fill_isoc_desc: Filling ep 1, dir out isoc
>>>> desc # 196 [  270.856398] dwc2 ffb40000.usb:
>>>> dwc2_gadget_complete_isoc_request_ddma: compl_desc # 194
>>>>
>>>> [  281.700537] dwc2 ffb40000.usb: dwc2_hsotg_irq: daint=00020002 [
>>>> 281.700552] dwc2 ffb40000.usb: dwc2_hsotg_epint: ep1(out)
>>>> DxEPINT=0x00000010
>>>> [  281.700564] dwc2 ffb40000.usb:
>>>> dwc2_gadget_handle_out_token_ep_disabled: target_frame = 0x000013d0
>>>> [ 281.700580] dwc2 ffb40000.usb: dwc2_gadget_fill_isoc_desc: Filling
>>>> ep 1, dir out isoc desc # 0 [  281.700594] dwc2 ffb40000.usb:
>>>> dwc2_gadget_fill_isoc_desc: Filling ep 1, dir out isoc desc # 1
>>>>
>>>> At 270 seconds, the request #194 was completed and request #196 was
>>>> queued. But right after that, there was a 11 second gap and the
>>>> request
>>>> #195 was never completed.
>>>>
>>>> For some unknown reason, the DWC2 core just stops. There is nothing
>>>> in our system that causes it to get stuck. The interrupts are not disabled.
>>>> The USB sniffer data shows that the data is coming in. However, dwc2
>>>> is not running.
>>>> After the time gap, everything stop working.
>>>>
>>>> I have attached the log file here. Can you please help me fix this
>>>> dwc2 core issue?
>>>>
>>>> Thanks,
>>>> Palak
>>>>
>>>>
>>>
>>> As I recommended earlier, please try:
>>>
>>> 1. Depend on which uac(uac1 or uac2) you use, increase 2 to 32
>>>
>>> 2. Change descriptor DMA (DDMA) mode to buffer DMA (BDMA) mode
>>>
>>> Thanks,
>>> Minas
>>>
>>>
>>> ________________________________
>>>
>>> Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir des informations sensibles et/ ou confidentielles ne devant pas être divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous recevez ce message par erreur), nous vous remercions de le notifier immédiatement à son expéditeur, et de détruire ce message. Toute copie, divulgation, modification, utilisation ou diffusion, non autorisée, directe ou indirecte, de tout ou partie de ce message, est strictement interdite.
>>>
>>>
>>> This e-mail, and any document attached hereby, may contain
>>> confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
>>
>> ________________________________
>>
>> Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir des informations sensibles et/ ou confidentielles ne devant pas être divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous recevez ce message par erreur), nous vous remercions de le notifier immédiatement à son expéditeur, et de détruire ce message. Toute copie, divulgation, modification, utilisation ou diffusion, non autorisée, directe ou indirecte, de tout ou partie de ce message, est strictement interdite.
>>
>>
>> This e-mail, and any document attached hereby, may contain
>> confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
> 
> ________________________________
> 
> Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir des informations sensibles et/ ou confidentielles ne devant pas être divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous recevez ce message par erreur), nous vous remercions de le notifier immédiatement à son expéditeur, et de détruire ce message. Toute copie, divulgation, modification, utilisation ou diffusion, non autorisée, directe ou indirecte, de tout ou partie de ce message, est strictement interdite.
> 
> 
> This e-mail, and any document attached hereby, may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.

  reply	other threads:[~2023-08-28 10:47 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <HE1PR0601MB25868E34AF4BA6CEAFE06F5F8DA39@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2023-02-22  6:39 ` usb: gadget: dwc2: not getting audio data Minas Harutyunyan
     [not found]   ` <HE1PR0601MB2586BFAE94813BA86BAB12708DAA9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2023-02-23  6:31     ` Minas Harutyunyan
     [not found]       ` <HE1PR0601MB25868FC836C3CD2D07B342958DAB9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2023-02-24 10:32         ` Minas Harutyunyan
2023-02-27  2:02           ` Palak SHAH
2023-02-27 10:18             ` Minas Harutyunyan
     [not found]               ` <HE1PR0601MB2586DB1CA3D0B4B45E7720A68DAF9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2023-03-01 19:29                 ` Palak SHAH
2023-03-02 21:38                 ` Palak SHAH
2023-03-03  4:35                 ` Minas Harutyunyan
2023-03-06 16:25                   ` Palak SHAH
2023-03-07  4:30                     ` Minas Harutyunyan
2023-03-08 21:42                       ` Palak SHAH
2023-03-09 10:03                         ` Minas Harutyunyan
2023-03-09 16:21                           ` Palak SHAH
2023-03-10  9:03                             ` Minas Harutyunyan
2023-04-06  1:42                               ` PALAK SHAH
2023-04-06  4:56                                 ` Minas Harutyunyan
2023-04-06 18:06                                   ` PALAK SHAH
     [not found]       ` <PAXPR06MB85319DCC50F69D0790D5F4198D719@PAXPR06MB8531.eurprd06.prod.outlook.com>
     [not found]         ` <PAXPR06MB8531E23298F9BA26C1E651AC8D769@PAXPR06MB8531.eurprd06.prod.outlook.com>
     [not found]           ` <PAXPR06MB8531BF29DA170252843DD5598D769@PAXPR06MB8531.eurprd06.prod.outlook.com>
     [not found]             ` <PAXPR06MB8531D31F642598C1D9B8555B8D749@PAXPR06MB8531.eurprd06.prod.outlook.com>
2023-05-16  7:51               ` Minas Harutyunyan
2023-05-16  7:53               ` Minas Harutyunyan
2023-05-16 20:43                 ` PALAK SHAH
2023-05-17  6:04                   ` Minas Harutyunyan
2023-05-17 19:02                     ` PALAK SHAH
2023-05-18 11:22                       ` Minas Harutyunyan
2023-05-18 18:32                         ` PALAK SHAH
2023-05-19 13:22                           ` Minas Harutyunyan
     [not found]                     ` <PAXPR06MB85314C9FAD4BFEA5ED1B6F828D0DA@PAXPR06MB8531.eurprd06.prod.outlook.com>
2023-08-14 14:47                       ` PALAK SHAH
2023-08-15  8:44                       ` Minas Harutyunyan
     [not found]                         ` <PAXPR06MB85318E88964FE24F74139C678D14A@PAXPR06MB8531.eurprd06.prod.outlook.com>
2023-08-25 18:32                           ` PALAK SHAH
2023-08-28 10:46                             ` Minas Harutyunyan [this message]
     [not found] <HE1PR0601MB2586962582F222B5B889416A8D1B9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
     [not found] ` <AS8PR06MB7976A91E44D7DCDAACC723F7971B9@AS8PR06MB7976.eurprd06.prod.outlook.com>
     [not found]   ` <HE1PR0601MB258625B74749B2DB1242E0048D1B9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
     [not found]     ` <HE1PR0601MB2586E4A641ECA0D0D043A3798D1D9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
     [not found]       ` <HE1PR0601MB258685C64D46C08C978C37EB8D1D9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2022-12-09 11:32         ` Minas Harutyunyan
     [not found]           ` <HE1PR0601MB25861FC1248FF0A61DDBC8F58D1C9@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2022-12-12 12:27             ` Minas Harutyunyan
     [not found]               ` <HE1PR0601MB2586D03B6D11FDF5F513E2488DE29@HE1PR0601MB2586.eurprd06.prod.outlook.com>
     [not found]                 ` <HE1PR0601MB2586AFC1102D078A26615CBC8DE29@HE1PR0601MB2586.eurprd06.prod.outlook.com>
2022-12-14  6:11                   ` Minas Harutyunyan
2022-12-15 21:16               ` Palak SHAH
2022-12-16  7:03                 ` Minas Harutyunyan
2023-01-06 21:37                   ` Palak SHAH
2023-01-12 10:52                     ` Minas Harutyunyan
2023-01-12 20:22                       ` Palak SHAH
2023-01-13  8:08                         ` Minas Harutyunyan

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=b14403fe-ffa2-b085-53d5-18f5551b450d@synopsys.com \
    --to=minas.harutyunyan@synopsys.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=maynard.cabiente@raritan.com \
    --cc=palak.shah@raritan.com \
    --cc=stephen.gagliardo@raritan.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.