On Tue, 3 Feb 2026 at 15:32, Gerd Hoffmann <[email protected]> wrote:
> > 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?

Apart from gimmicks, ultimately, accessibility

> 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.

Which should be doable for the real use-case.

We may also want input for voice control, but hopefully that would also
be short samples.

> 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.

Happy to kick that can down the road for someone who cares :)

> 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,

Thanks!

/
    Leif


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121778): https://edk2.groups.io/g/devel/message/121778
Mute This Topic: https://groups.io/mt/117302329/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to