From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web10.240.1626801842693015650 for ; Tue, 20 Jul 2021 10:24:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=pnus3dFH; spf=pass (domain: apple.com, ip: 17.171.2.72, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.42/8.16.0.42) with SMTP id 16KHNbaG018252; Tue, 20 Jul 2021 10:24:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=Udsv0I17oK9rV9m/wlZEG2kmwZ/YNvqB/plJmmdecNs=; b=pnus3dFHGCWSZEQ7RlVuecNZRIVMnD+k9jjbZBcbi3BWxdqZYjW+IwYpqR0wS18GcKBC YTfFPVMQ02SIYw/qFqRpMndrdJWIVimtvf3shzCS2rVqgQXpUkOywfnepFeYKb/4ghBA eQiW3JB2R4ElrXr3XqkKrEgicA3Yg6VeaUiPjN71i4HIBhNh6Lus4WKCNa95Je5RQTak jBW1NJj/Zr7vrklYIfRnJuir+nE8gBpYSfkJUrFhd9JLbKBz8+WqPcMpImm8P03xVL9t g1z8KN7T1yRFaI/MgysCTEwzpf49KLgHxm9m2Xg6KFdOF5eU7M4/aCbLzTQ6rWOnB2dW UQ== Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 39vf02sh3s-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 20 Jul 2021 10:24:01 -0700 Received: from rn-mailsvcp-mmp-lapp02.rno.apple.com (rn-mailsvcp-mmp-lapp02.rno.apple.com [17.179.253.15]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) with ESMTPS id <0QWK00ZSD0C1CPK0@rn-mailsvcp-mta-lapp02.rno.apple.com>; Tue, 20 Jul 2021 10:24:01 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp02.rno.apple.com by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) id <0QWK00O000BG9Y00@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Tue, 20 Jul 2021 10:24:01 -0700 (PDT) X-Va-A: X-Va-T-CD: 494ba4982f0b5c44357f821690cbd4e9 X-Va-E-CD: b3a572f7fdc06555290bdf8139bad295 X-Va-R-CD: 10f422070ede74c28609670d445b0042 X-Va-CD: 0 X-Va-ID: 70000f9f-7590-4b6f-85b1-5422967cbca4 X-V-A: X-V-T-CD: 494ba4982f0b5c44357f821690cbd4e9 X-V-E-CD: b3a572f7fdc06555290bdf8139bad295 X-V-R-CD: 10f422070ede74c28609670d445b0042 X-V-CD: 0 X-V-ID: 7a1c4d62-07cf-4a2a-8891-0f8d9e20a99c X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-20_12:2021-07-19,2021-07-20 signatures=0 Received: from [17.235.13.119] (unknown [17.235.13.119]) by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.9.20210415 64bit (built Apr 15 2021)) with ESMTPSA id <0QWK00TI10BZP500@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Tue, 20 Jul 2021 10:24:00 -0700 (PDT) From: "Andrew Fish" Message-id: MIME-version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.1\)) Subject: Re: [edk2-devel] USB isochronous transfers Date: Tue, 20 Jul 2021 10:23:59 -0700 In-reply-to: Cc: "Leif Lindholm (Nuvia address)" , Ray Ni To: edk2-devel-groups-io , Ethin Probst References: X-Mailer: Apple Mail (2.3654.20.0.2.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-20_12:2021-07-19,2021-07-20 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_59F4DA9E-E3D2-464D-8369-9F11DF58348E" --Apple-Mail=_59F4DA9E-E3D2-464D-8369-9F11DF58348E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 20, 2021, at 8:32 AM, Ethin Probst wrot= e: >=20 > Hello all, >=20 > A few days ago Leif determined that the USB DXE does not implement > isochronous transfers. This will make USB Audio quite impossible as > the audio data endpoint requires isochronous transfers. >=20 > I was looking at the EHCI driver but I can't determine a couple things: >=20 > - Isochronous transfers have a different structure compared to other > URB types. (Each URB type may have its own structure -- I haven't > checked.) > - I can't seem to figure out how this is handled in, say, EhciDxe. > - If we were to try and implement this -- though I'm not quite sure > how -- would we need to modify the PEIs too? >=20 I don=E2=80=99t think we would need to change PEI.=20 1s you need to figure out which UsbIo service you would need to code the U= SB Audio driver against.=20 MdePkg/Include/Protocol/UsbIo.h:485: EFI_USB_IO_ISOCHRONOUS_TRANSFER = UsbIsochronousTransfer; MdePkg/Include/Protocol/UsbIo.h:486: EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFE= R UsbAsyncIsochronousTransfer; That service would likely be implemented on top of the matching USB Host C= ontroller service.=20 MdePkg/Include/Protocol/Usb2HostController.h:635: EFI_USB2_HC_PROTOCOL_IS= OCHRONOUS_TRANSFER IsochronousTransfer; MdePkg/Include/Protocol/Usb2HostController.h:636: EFI_USB2_HC_PROTOCOL_AS= YNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer; MdePkg/Include/Protocol/UsbHostController.h:480: EFI_USB_HC_PROTOCOL_ISOC= HRONOUS_TRANSFER IsochronousTransfer; MdePkg/Include/Protocol/UsbHostController.h:481: EFI_USB_HC_PROTOCOL_ASYN= C_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer; So for each USB HC (EHCI, XHCI, OHCI, etc) that is needed you would need t= o implement the required isochronous transfer. This likely involves managin= g the DMA queue of the hardware.=20 You would also need a generic change to the USB Bus Driver to implement th= e UsbIo services on top of the Usb Host Controller services. That would wor= k for every USB Host Controller.=20 Sorry I don=E2=80=99t know of any EFI USB Stack that implements Isochronou= s transfers.=20 Thanks, Andrew Fish PS FYI that post I sent about gdb should work for you too if you grab thos= e 2 files.=20 > --=20 > Signed, > Ethin D. Probst >=20 >=20 >=20 >=20 >=20 --Apple-Mail=_59F4DA9E-E3D2-464D-8369-9F11DF58348E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Jul 20, 2= 021, at 8:32 AM, Ethin Probst <harlydavidsen@gmail.com> wrote:

Hello all,

A few days ago Leif determined that the USB DXE does = not implement
isochronous transfers. This will make USB Audio= quite impossible as
the audio data endpoint requires isochro= nous transfers.

I was looking at the EHCI driv= er but I can't determine a couple things:

- Is= ochronous transfers have a different structure compared to other
URB types. (Each URB type may have its own structure -- I haven'tchecked.)
- I can't seem to figure out how this i= s handled in, say, EhciDxe.
- If we were to try and implement= this -- though I'm not quite sure
how -- would we need to mo= dify the PEIs too?


I don=E2=80=99t think we would need to change = PEI. 


1s= you need to figure out which UsbIo service you would need to code the USB = Audio driver against. 
MdePkg/Include/Protocol/UsbIo.h:48= 5:  EFI_USB_IO_ISOCHRONOUS_TRAN= SFER       UsbIsochronousTransfer;
MdePkg/Include/Protocol/UsbIo.h= :486:  EFI_USB_IO_ASYNC_I= SOCHRONOUS_TRANSFER UsbAsyncIsoc= hronousTransfer;

That service would likely be implemented on top of the matc= hing USB Host Controller service. 

= MdeP= kg/Include/Protocol/Usb2HostController.h:635:  EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER   =     IsochronousTransfer;=
MdePkg/Include/Protoco= l/Usb2HostController.h:636:= &nbs= p; EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER  AsyncIsochronousTransfer;
MdePkg/Include/Protocol/UsbHostController.h:480:  EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER  &= nbsp;     Isochronous= Tran= sfer;
MdePkg/Include= /Protocol/UsbHostController.h:481:  EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER  AsyncIsochronousTransfer;

So for each USB HC (EHCI, XHCI, OHCI, etc) that is needed you wo= uld need to implement the required isochronous transfer. This likely involv= es managing the DMA queue of the hardware. 

You would also need a generic change t= o the USB Bus Driver to implement the UsbIo services on top of the Usb Host= Controller services. That would work for every USB Host Controller. <= /div>

Sorry I don= =E2=80=99t know of any EFI USB Stack that implements Isochronous tran= sfers. 
<= br class=3D"">
Thanks,

And= rew Fish

PS = FYI that post I sent about gdb should work for you too if you grab those 2 = files. 

<= /div>
--
Signed,
Ethin D. Probst






--Apple-Mail=_59F4DA9E-E3D2-464D-8369-9F11DF58348E--