[edk2-devel] VirtIO Sound Driver (GSoC 2021)

Michael Brown mcb30 at ipxe.org
Thu Apr 15 12:07:06 UTC 2021


On 15/04/2021 06:28, Ethin Probst wrote:
> - I hoped to add recording in case we in future want to add
> accessibility aids like speech recognition (that was one of the todo
> tasks on the EDK2 tasks list)

Is there any necessity for audio input and output to be implemented 
within the same protocol?  Unlike a network device (which is 
intrinsically bidirectional), it seems natural to conceptually separate 
audio input from audio output.

> - Muting and volume control could easily be added by just replacing
> the sample buffer with silence and by multiplying all the samples by a
> percentage.

The code controlling volume/mute may not have any access to the sample 
buffer.  The most natural implementation would seem to allow for a 
platform to notice volume up/down keypresses and use those to control 
the overall system volume, without any knowledge of which samples (if 
any) are currently being played by other code in the system.

> - Finally, the reason I used enumerations for specifying parameters
> like sample rate and stuff was that I was looking at this protocol
> from a general UEFI applications point of view. VirtIO supports all of
> the sample configurations listed in my gist, and it seems reasonable
> to allow the application to control those parameters instead of
> forcing a particular parameter configuration onto the developer.

Consider also the point of view of the developer implementing a driver 
for some other piece of audio hardware that happens not to support 
precisely the same sample rates etc as VirtIO.  It would be extremely 
ugly to force all future hardware to pretend to have the same 
capabilities as VirtIO just because the API was initially designed with 
VirtIO in mind.

As a developer on the other side of the API, writing code to play sound 
files on an arbitrary unknown platform, I would prefer to simply consume 
as simple as possible an abstraction of an audio output protocol and not 
have to care about what hardware is actually implementing it.

Both of these argue in favour of defining a very simple API that 
expresses only a common baseline capability that is plausibly 
implementable for every piece of audio hardware ever made.

Coupled with the relatively minimalistic requirements for boot-time 
audio, I'd probably suggest supporting only a single format for audio 
data, with a fixed sample rate (and possibly only mono output).

As always: perfection is achieved, not when there is nothing more to 
add, but when there is nothing left to take away.  :)

Thanks,

Michael


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74125): https://edk2.groups.io/g/devel/message/74125
Mute This Topic: https://groups.io/mt/81710286/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list