[PATCH 2/4] conf: allow to map sound device to host device

Gerd Hoffmann kraxel at redhat.com
Wed Jul 22 06:55:02 UTC 2020


> IIUC, QEMU can expose multiple sound devices to the guest too.
> I think this means that we can have a M:N relationship between
> a sound device, and an audio backend, not just 1:1.

It's 1:N.  Sound devices have a single backend, but a backends can
service multiple sound devices.

> Assuming I'm right about the M:N relationship, I assume that
> of multiple cards all do playback concurrently, something
> will have todo mixing of the streams ?

In general it is a good idea to go with 1:1 if possible.  With
pulseaudio this works fine.  You'll have two streams to pulseaudio
then, pulseaudio does the mixing, and you'll see both streams in
mixer apps.

OSS devices tend to not like being opened multiple times, so you
have to go with 1:N if you want multiple sound devices.  qemu mixes
the playback streams then.  Not fully sure what happens with
recording, probably all sound devices see the very same stream.

take care,

More information about the libvir-list mailing list