public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ethin Probst" <harlydavidsen@gmail.com>
To: devel@edk2.groups.io
Subject: EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization
Date: Wed, 30 Jun 2021 16:01:08 -0700	[thread overview]
Message-ID: <FsJK.1625094068710372186.5BeK@groups.io> (raw)

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

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 contain vital information that I need to be able to control the audio device. The 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 virtio-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 control queue for controlling the device; the event queue for receiving notifications from the device; the tx queue for transmitting audio data to the device; 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 device initialized using the VirtioLib in OVMF, but I've reached an impasse regarding the queues and descriptors.

The VirtioRngDxe DXE uses a single descriptor and a single queue for operation. However, the RNG device works vastly differently to the audio device and is far simpler. The virtio-snd specification says that, to initialize the 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 about the available jacks.
* Read the streams field and send a control request to query information about the available PCM streams.
* Read the chmaps field and send a control request to query information about 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 about 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 what VirtioLib function (if any) specifically accomplishes that?

[-- Attachment #2: Type: text/html, Size: 2333 bytes --]

             reply	other threads:[~2021-06-30 23:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30 23:01 Ethin Probst [this message]
2021-07-01 14:15 ` [edk2-devel] EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization Michael Brown
2021-07-01 18:10   ` Ethin Probst
2021-07-02  8:59     ` Laszlo Ersek
2021-07-02  9:41     ` Michael Brown
     [not found]     ` <168DEFFB0E406B59.30759@groups.io>
2021-07-02  9:46       ` Michael Brown
2021-07-02 18:18         ` Ethin Probst
2021-07-02 18:22           ` Ethin Probst
2021-07-06 12:53             ` Michael Brown
2021-07-02  8:54 ` Laszlo Ersek

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-list 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=FsJK.1625094068710372186.5BeK@groups.io \
    --to=devel@edk2.groups.io \
    /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