Hi Minas, Yes I do have g_audio module loaded. This dmesg logs are from my device - [ 1151.517385] g_audio gadget: Linux USB Audio Gadget, version: Feb 2, 2012 [ 1151.517401] g_audio gadget: g_audio ready [ 1151.517418] dwc2 ffb00000.usb: bound driver g_audio [ 1151.640143] dwc2 ffb40000.usb: bound driver configfs-gadget [ 1151.808188] dwc2 ffb40000.usb: new device is high-speed [ 1151.922374] dwc2 ffb40000.usb: new device is high-speed [ 1151.982406] dwc2 ffb40000.usb: new address 24 [ 1151.996762] configfs-gadget gadget: high-speed config #1: c # lsmod Module Size Used by usb_f_uac1 20480 3 u_audio 20480 1 usb_f_uac1 snd_pcm 94208 1 u_audio snd_timer 36864 1 snd_pcm g_audio 16384 0 usb_f_hid 20480 9 libcomposite 61440 16 usb_f_uac1,u_audio,g_audio,usb_f_hid This is my host - [palakshah@fedora ~]$ lsusb Bus 002 Device 002: ID 0bda:0328 Realtek Semiconductor Corp. USB3.0-CRW Bus 002 Device 003: ID 0bda:0411 Realtek Semiconductor Corp. Hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 023: ID 14dd:1010 Raritan Computer, Inc. KX4-101 // this is my device that I am connected to. Bus 001 Device 002: ID 14dd:1007 Raritan Computer, Inc. D2CIM-VUSB KVM connector Bus 001 Device 005: ID 8087:0a2b Intel Corp. Bluetooth wireless interface Bus 001 Device 004: ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub [palakshah@fedora ~]$ sudo ./testusb -D /dev/bus/usb/001/023 -t15 [sudo] password for palakshah: ./testusb: /dev/bus/usb/001/023 may see only control tests /dev/bus/usb/001/023 test 15 --> 25 (Inappropriate ioctl for device) [palakshah@fedora ~]$ sudo ./testusb -D /dev/bus/usb/001/023 -t16 ./testusb: /dev/bus/usb/001/023 may see only control tests /dev/bus/usb/001/023 test 16 --> 25 (Inappropriate ioctl for device) But still host cannot talk to the device. Thanks, Palak -----Original Message----- From: Minas Harutyunyan <Minas.Harutyunyan@xxxxxxxxxxxx> Sent: Thursday, March 9, 2023 5:03 AM To: Palak SHAH <palak.shah@xxxxxxxxxxx>; Maynard CABIENTE <maynard.cabiente@xxxxxxxxxxx> Cc: linux-usb@xxxxxxxxxxxxxxx Subject: RE: usb: gadget: dwc2: not getting audio data Hi Palak, >On 3/9/2023 1:42 AM, Palak SHAH wrote: >From: Palak SHAH <palak.shah@xxxxxxxxxxx> >Sent: Thursday, March 9, 2023 1:42 AM >To: Minas Harutyunyan <hminas@xxxxxxxxxxxx>; Maynard CABIENTE ><maynard.cabiente@xxxxxxxxxxx> >Cc: linux-usb@xxxxxxxxxxxxxxx >Subject: RE: usb: gadget: dwc2: not getting audio data > >Hi Minas, >A while ago, I asked you if I can run a usb test, to test IP core, >without doing audio test. > >You had suggested that to test usbtest program (see >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Feur01.safelinks.protection.outlook.com%2F&data=05%7C01%7Cpalak.shah%40raritan.com%7Ce899edf3108b4733963408db2085841d%7C199686b5bef4496087867a6b1888fee3%7C1%7C0%7C638139530054005175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=efRKGkGDjq5OhK347%2B6r2%2FaXjZy4wysBzzl5XezhEZo%3D&reserved=0? >url=http*3A*2F*2Fwww.linux- >usb.org*2Fusbtest*2F&data=05*7C01*7Cpalak.shah*40raritan.com*7Ccdc9cf18 >d5c54 >b2c74fc08daf53d681e*7C199686b5bef4496087867a6b1888fee3*7C1*7C0*7C638091 >94134 >5558693*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ >BTiI6 >Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C&sdata=OIiLXl6dlCHlfACx6ZxpLhQkp0 >7xIwb >qAR3CtnqfsFU*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSUl!!A4F2R9G_pg!f >3GN6S >P6NM--pKekkA-jG4RICPguFvb3DNeRO6jFDEhovrY3IEC2- >aL0ay4g95j7BsdRM6JRGwjL6kPzTS8z13tShKOe$ ) > >So I tried this program. I compiled it on my linux host, and run it on >the host, which is connected to the Linux device acting as USB gadget. > >I am running test t15 and t16 which is for ISOC. Infact I tried running all. >I ran it on the host device. And I get this error - > >[palakshah@fedora ~]$ sudo ./testusb -D /dev/bus/usb/001/019 -t15 >./testusb: /dev/bus/usb/001/019 may see only control tests >/dev/bus/usb/001/019 test 15 --> 25 (Inappropriate ioctl for device) > >Either I get error 25 (Inappropriate ioctl for device) or error 38 >(Function Not Implemented). > >If I do, [palakshah@fedora ~]$ sudo ./testusb -a no test devices >recognized > >I tried to google, why these tests don’t work, but did not find >anything useful. Do you have any idea? > Did you modprobe g_zero module on device side? lsusb command should show that connected device: ... Bus 001 Device 002: ID 0525:a4a0 Netchip Technology, Inc. Linux-USB "Gadget Zero" ... Thanks, Minas >Thanks, >Palak > >-----Original Message----- >From: Minas Harutyunyan <Minas.Harutyunyan@xxxxxxxxxxxx> >Sent: Monday, March 6, 2023 11:31 PM >To: Palak SHAH <palak.shah@xxxxxxxxxxx>; Maynard CABIENTE ><maynard.cabiente@xxxxxxxxxxx> >Cc: linux-usb@xxxxxxxxxxxxxxx >Subject: RE: usb: gadget: dwc2: not getting audio data > >Hi Palak, > >>On 3/6/2023 8:26 AM, Palak SHAH wrote: >>From: Palak SHAH <palak.shah@xxxxxxxxxxx> >>Sent: Monday, March 6, 2023 8:26 PM >>To: Minas Harutyunyan <hminas@xxxxxxxxxxxx>; Maynard CABIENTE >><maynard.cabiente@xxxxxxxxxxx> >>Cc: linux-usb@xxxxxxxxxxxxxxx >>Subject: RE: usb: gadget: dwc2: not getting audio data >> >>Hi Minas, >> >>>I can recommend you: >>>1. disable debug prints to minimize platform loading >> >>[Palak] I am working on this >> >>>2. change Descriptor DMA mode to Buffer DMA >> >>[Palak] Can you please explain this more, what does this mean? > >Core can work in 3 different modes to transferring data between FIFO >and >RAM: Slave, Buffer DMA and Descriptor DMA. > >To switch from DDMA to BDMA in file params.c file in function >dwc2_set_default_params() > ... > if ((hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) || > (hsotg->dr_mode == USB_DR_MODE_OTG)) { > p->g_dma = dma_capable; > p->g_dma_desc = hw->dma_desc_enable; > ... >Update last line to > p->g_dma_desc = 0; > >Thanks, >Minas > >> >>Thanks, >>Palak >> >>-----Original Message----- >>From: Minas Harutyunyan <Minas.Harutyunyan@xxxxxxxxxxxx> >>Sent: Thursday, March 2, 2023 11:35 PM >>To: Palak SHAH <palak.shah@xxxxxxxxxxx>; Maynard CABIENTE >><maynard.cabiente@xxxxxxxxxxx> >>Cc: linux-usb@xxxxxxxxxxxxxxx >>Subject: RE: usb: gadget: dwc2: not getting audio data >> >>Hi Palak, >> >>>On 2/28/2023 12:21 AM, Palak SHAH wrote: >>>From: Palak SHAH <palak.shah@xxxxxxxxxxx> >>>Sent: Tuesday, February 28, 2023 12:21 AM >>>To: Minas Harutyunyan <hminas@xxxxxxxxxxxx>; Maynard CABIENTE >>><maynard.cabiente@xxxxxxxxxxx> >>>Cc: linux-usb@xxxxxxxxxxxxxxx >>>Subject: RE: usb: gadget: dwc2: not getting audio data >>> >>>Hi Minas, >>>I have attached the following USB traces and debug log. >>>1) dmesg and usb sniffer logs during driver loading. >>> >>>2) EP1(OUT) - I play AUDIO on the HOST. And I do arecord on the linux >>>device that acts as USB gadget. So the audio is going OUT from the >>>host. So you will see EP1 OUT. >>>I have attached logs and USB sniffer data, during arecord. >>> >>>I am not testing ISOC EP1(IN) yet. I am still seeing and debugging >>>issues with Ep1(out). >>> >>>3) When I change UAC1_DEF_REQ_NUM 2 changed to 32, the problem STILL >>>exist with EP1(OUT). ONLY log behaivor is different. In the log I see >>>XferCompl, but I don’t get any data in the arecord. >>>I have attached 2 files. Arecord_command.txt shows what I run. >>>Arecord_output shows what I get after I run the command. >>> >>>4) I sent you regdump, hw_params, params and fifo in the previous email. >>> >> >>I'm not find any issue based on the '_arecord.txt', just again 7 >>second time >>gap: >> >>[ 228.173271] dwc2 ffb40000.usb: dwc2_hsotg_epint: At the end of the >>function, dwc2_hsotg_epint() [ 228.173271] [ 235.536299] dwc2 >>ffb40000.usb: dwc2_hsotg_ep_queue, ep1out: req 777cd34b: req >>len(200)@req buf(af65750d), # of int=0, req zero=0, snok(short not >>ok)=0 >> >>I can recommend you: >>1. disable debug prints to minimize platform loading 2. change >>Descriptor DMA mode to Buffer DMA >> >>Thanks, >>Minas >> >> >>>Thanks, >>>Palak >>> >>>-----Original Message----- >>>From: Minas Harutyunyan <Minas.Harutyunyan@xxxxxxxxxxxx> >>>Sent: Monday, February 27, 2023 5:18 AM >>>To: Palak SHAH <palak.shah@xxxxxxxxxxx>; Maynard CABIENTE >>><maynard.cabiente@xxxxxxxxxxx> >>>Cc: linux-usb@xxxxxxxxxxxxxxx >>>Subject: RE: usb: gadget: dwc2: not getting audio data >>> >>>Hi Palak, >>> >>>>On 2/27/2023 6:02 AM, Palak SHAH wrote: >>>>From: Palak SHAH <palak.shah@xxxxxxxxxxx> >>>>Sent: Monday, February 27, 2023 6:02 AM >>>>To: Minas Harutyunyan <hminas@xxxxxxxxxxxx>; Maynard CABIENTE >>>><maynard.cabiente@xxxxxxxxxxx> >>>>Cc: linux-usb@xxxxxxxxxxxxxxx >>>>Subject: RE: usb: gadget: dwc2: not getting audio data >>>> >>>>Hi Minas, >>>>Please find attached the logs - regdump, hw_params, params and fifo, >>>>taken when the driver is loaded. >>>> >>>>I will send the USB traces tomorrow. >>> >>> >>>USB trace for arecord (EP1IN ISOC) and debug log. >>> >>> >>>Could you please confirm that after defining UAC1_DEF_REQ_NUM to 32 >>>playing audio (EP1OUT ISOC) no any issue seen? >>> >>>Thanks, >>>Minas >>> >>>> >>>>Thanks, >>>>Palak >>>> >>>>-----Original Message----- >>>>From: Minas Harutyunyan <Minas.Harutyunyan@xxxxxxxxxxxx> >>>>Sent: Friday, February 24, 2023 5:33 AM >>>>To: Palak SHAH <palak.shah@xxxxxxxxxxx>; Maynard CABIENTE >>>><maynard.cabiente@xxxxxxxxxxx> >>>>Cc: linux-usb@xxxxxxxxxxxxxxx >>>>Subject: RE: usb: gadget: dwc2: not getting audio data >>>> >>>>Hi Polak, >>>> >>>>>On 2/24/2023 3:04 AM, Palak SHAH wrote: >>>>>From: Palak SHAH <palak.shah@xxxxxxxxxxx> >>>>>Sent: Friday, February 24, 2023 3:04 AM >>>>>To: Minas Harutyunyan <hminas@xxxxxxxxxxxx>; Maynard CABIENTE >>>>><maynard.cabiente@xxxxxxxxxxx> >>>>>Cc: linux-usb@xxxxxxxxxxxxxxx >>>>>Subject: RE: usb: gadget: dwc2: not getting audio data >>>>> >>>>>Hi Minas, >>>>>I have attached the log where I connect to the audio gadget (and >>>>>therefore, load the driver). We can do it using command line on a >>>>>serial prompt or using GUI and connecting to Audio gadget. >>>>> >>>>>However, in both cases, I don’t see any EP1(out) data and the >>>>>register >>>>dump. >>>>>Ep1out comes out only when I play a you tube video and I do arecord >>>>>to capture data. >>>> >>>>According your device configuration EP1(out) using when you play >>>>audio, and >>>>EP1(in) using when you record audio by arecord. >>>>So, after driver loading these both ISOC EP's will not seen in log >>>>until aplay/arecord will not run. >>>> >>>>> >>>>>Please let me know if the log doesn’t have the information you need. >>>> >>>>No, it's again dmesg. I asked for core all register dump which >>>>available under debugfs's. dwc2 debugfs's under follow directory: >>>>/sys/kernel/debug/usb/dwc2.2.auto/ >>>>In your case 'dwc2.2.auto' can be little bit different. In this >>>>directory there are files regdump, hw_params, params, fifo, etc. >>>>Just use 'cat regdump' >>>>to get register dump. Please also provide me cat of hw_params, >>>>params and fifo. These last 3 files need to cat just once after driver loading. >>>> >>>>> >>>>>Also, I tried changing UAC1_DEF_REQ_NUM 2 changed to 32. I saw a >>>>>change in the behaivor of logs, I got XferCompl all the time, and >>>>>not >>>ep_disabled. >>>> >>>>So, after defining UAC1_DEF_REQ_NUM to 32 playing audio (ep1out) >>>>work without any issue? And increasing req number to 32 fixed issue >>>>which we debug till now? >>>> >>>>>However, arecord behaivor did not change, meaning I still did not >>>>>get the data. It only changed the logging behaivor. >>>> >>>>If you still see issues with arecord (ep1in) then please provide me >>>>debug log for this case and USB trace by Ellisys. >>>> >>>>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.