aboutsummaryrefslogtreecommitdiff
path: root/docs/system/devices/virtio-snd.rst
blob: 2a9187fd701a3deed670963a4c3a2b4b379cf2df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
virtio sound
============

This document explains the setup and usage of the Virtio sound device.
The Virtio sound device is a paravirtualized sound card device.

Linux kernel support
--------------------

Virtio sound requires a guest Linux kernel built with the
``CONFIG_SND_VIRTIO`` option.

Description
-----------

Virtio sound implements capture and playback from inside a guest using the
configured audio backend of the host machine.

Device properties
-----------------

The Virtio sound device can be configured with the following properties:

 * ``jacks`` number of physical jacks (Unimplemented).
 * ``streams`` number of PCM streams. At the moment, no stream configuration is supported: the first one will always be a playback stream, an optional second will always be a capture stream. Adding more will cycle stream directions from playback to capture.
 * ``chmaps`` number of channel maps (Unimplemented).

All streams are stereo and have the default channel positions ``Front left, right``.

Examples
--------

Add an audio device and an audio backend at once with ``-audio`` and ``model=virtio``:

 * pulseaudio: ``-audio driver=pa,model=virtio``
   or ``-audio driver=pa,model=virtio,server=/run/user/1000/pulse/native``
 * sdl: ``-audio driver=sdl,model=virtio``
 * coreaudio: ``-audio driver=coreaudio,model=virtio``

etc.

To specifically add virtualized sound devices, you have to specify a PCI device
and an audio backend listed with ``-audio driver=help`` that works on your host
machine, e.g.:

::

  -device virtio-sound-pci,audiodev=my_audiodev \
  -audiodev alsa,id=my_audiodev