qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: VirtioSound device emulation implementation


From: Gerd Hoffmann
Subject: Re: Fwd: VirtioSound device emulation implementation
Date: Mon, 19 Apr 2021 15:10:50 +0200

> > AUD_write returns the number of bytes actually accepted.
> >
> > In case the audio backend consumed the complete buffer you can go ahead
> > as described.  Otherwise stop here and resume (try AUD_write() the
> > remaining data) when the callback is called again.
> >
> The callback that is supposed to write the buffers to HWVoiceOut has to
> do it such that it only writes the buffers for the streams that it was
> called by. The tx
> virtqueue is going to have buffers for all the streams. How do I handle
> this situation?

Well, maybe splitting the streams is a good job for the tx handler, i.e.
take the queue element out of the queue, check stream, stick into a
stream-specific buffer list.

The have the AUD_write callback check the stream buffer list.
instead of the virt queue.

Make sure you only complete the virtqueue elements after the buffers
have been passed to the qemu audiodev completely.

Yes, it is perfectly fine to process multiple virtqueue elements at the
same time, and out-of-order completion is fine too.

HTH,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]