From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization To: devel@edk2.groups.io From: "Ethin Probst" X-Originating-Location: Minot, North Dakota, US (74.207.162.234) X-Originating-Platform: Linux Firefox 89 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 30 Jun 2021 16:01:08 -0700 Message-ID: Content-Type: multipart/alternative; boundary="StJn0WXW8turNdOPuhsK" --StJn0WXW8turNdOPuhsK Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all, So Leif and I have been working on USB Audio but we've run into a snag. We= 've encountered a problem -- neither of us knows enough about USB to figure= out how to get the class-specific AC interface descriptors, and those cont= ain vital information that I need to be able to control the audio device. T= he audio specification was quite useless. So I have two projects running in= parallel: the USB audio one and the VirtIO audio (We managed to get the vi= rtio-snd patchset in qemu and I've got a built version of it over here and,= though its not a fully working implementation, as long as I get something = -- no matter how bad it sounds -- I'll be happy). Whichever project we get = working first is the one we move forward with. The VirtIO sound device specification contains four virtqueues: the contro= l queue for controlling the device; the event queue for receiving notificat= ions from the device; the tx queue for transmitting audio data to the devic= e; and the rx queue for receiving audio data from the device. Thus far I've= been following the VirtioRngDxe code as a guide on how to get a VirtIO dev= ice initialized using the VirtioLib in OVMF, but I've reached an impasse re= garding the queues and descriptors. The VirtioRngDxe DXE uses a single descriptor and a single queue for opera= tion. However, the RNG device works vastly differently to the audio device = and is far simpler. The virtio-snd specification says that, to initialize t= he device, I must (copied from the spec): * Configure the control, event, tx and rx queues. * Read the jacks field and send a control request to query information abo= ut the available jacks. * Read the streams field and send a control request to query information a= bout the available PCM streams. * Read the chmaps field and send a control request to query information ab= out the available channel maps. * Populate the event queue with empty buffers. Steps 2, 3, 4, and 5 are a bit confusing and raise some questions: 1. Does the device automatically send notifications in the event queue abo= ut the jacks, streams, and channel maps, or do I have to explicitly ask for= them? 2. How many buffers would we need to populate the event queue with, and wh= at VirtioLib function (if any) specifically accomplishes that? --StJn0WXW8turNdOPuhsK Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all,
So Leif and I have been working on USB Audio but we've run int= o a snag. We've encountered a problem -- neither of us knows enough about U= SB to figure out how to get the class-specific AC interface descriptors, an= d those contain vital information that I need to be able to control the aud= io device. The audio specification was quite useless. So I have two project= s running in parallel: the USB audio one and the VirtIO audio (We managed t= o get the virtio-snd patchset in qemu and I've got a built version of it ov= er here and, though its not a fully working implementation, as long as I ge= t something -- no matter how bad it sounds -- I'll be happy). Whichever pro= ject we get working first is the one we move forward with.
The VirtIO = sound device specification contains four virtqueues: the control queue for = controlling the device; the event queue for receiving notifications from th= e device; the tx queue for transmitting audio data to the device; and the r= x queue for receiving audio data from the device. Thus far I've been follow= ing the VirtioRngDxe code as a guide on how to get a VirtIO device initiali= zed using the VirtioLib in OVMF, but I've reached an impasse regarding the = queues and descriptors.

The VirtioRngDxe DXE uses a single descr= iptor and a single queue for operation. However, the RNG device works vastl= y differently to the audio device and is far simpler. The virtio-snd specif= ication says that, to initialize the device, I must (copied from the spec):=

* Configure the control, event, tx and rx queues.
* Read t= he jacks field and send a control request to query information about the av= ailable jacks.
* Read the streams field and send a control request to = query information about the available PCM streams.
* Read the chmaps f= ield and send a control request to query information about the available ch= annel maps.
* Populate the event queue with empty buffers.

= Steps 2, 3, 4, and 5 are a bit confusing and raise some questions:
1. Does the device automatically send notifications in the event queue a= bout the jacks, streams, and channel maps, or do I have to explicitly ask f= or them?
2. How many buffers would we need to populate the event queue= with, and what VirtioLib function (if any) specifically accomplishes that?=
--StJn0WXW8turNdOPuhsK--