On Tue, Feb 03, 2026 at 06:12:45AM -0800, Archer Pergande via groups.io wrote: > Hey Leif, > > I also agree with the virtio preference. > > I have done more research into the virtio specifications and edk2 > source and determined the most viable solution would be to expand the > OvmfPkg with a VirtioSoundDxe driver. Edk2 supports a generic > EFI_VIRTIO_DEVICE_PROTOCOL and a helper library for virtio devices. > Leveraging these features from edk2 would make communication with the > sound device trivial.
Well, not trivial I'd say, but most likely easier than any other option. > The biggest question I have on my mind is the stability/jitter issues > with sending/receiving audio data. The simplest solution I have is > producing an event with a notify function to be triggered when the > device finishes processing an audio buffer. That way the consumer can > register a routine to place more audio data into the stream queue > asynchronously without jittering audio. edk2 runs all hardware in polling mode, and you'll go register a timer to regularly check your device, which effectively is cooperative multitasking. I expect you'll see latency spikes if something is busy and doesn't give up the CPU. What is the intended use case? I suspect that'll be just playing sine wave beeps or short (a few seconds at most) sound samples to get the attention of the user sitting in front of the screen. For that it'll probably work best to just pass the complete sample buffer down to the (virtual) sound hardware. For contiguous playback you'll need at least two buffers, one used by the hardware for playback and one for the player application to refill. And, yes, some kind of notification that the hardware finished processing the buffer makes sense, so the caller can either refill the buffer or release the memory. Could be as simple as passing both sample buffer and notification function pointer to the sound driver when queuing up a buffer for playback. HTH & take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121777): https://edk2.groups.io/g/devel/message/121777 Mute This Topic: https://groups.io/mt/117302329/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
