From patchwork Tue Aug 22 19:18:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 13361357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 941D8EE49AF for ; Tue, 22 Aug 2023 19:20:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYWux-0006R1-On; Tue, 22 Aug 2023 15:19:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYWuv-0006Jq-Sn for qemu-devel@nongnu.org; Tue, 22 Aug 2023 15:19:53 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYWut-0000wO-Jg for qemu-devel@nongnu.org; Tue, 22 Aug 2023 15:19:53 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-319e93a1594so4438230f8f.1 for ; Tue, 22 Aug 2023 12:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692731989; x=1693336789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ex2wYhsS71++plSwD4vywQfTwawR7Om/B/i5Q+QelHk=; b=CGawmIMPr+KKww1AGg+Hj29zSPM98Ur3VBM2UqMjf0nBvTK18ool/R6S1nWUCynl0Q biC07tsMbuROHw7PzME8F5eH7x1+SXdV7GytS+13COepMxYwnKIEn2s2fNj02V1kppMO 4FZbI4MKB8CsI2gg5tSX1MivhRgasb2c+8M5k0kubaKdqBet15pk6Hmx9eiCiGx4vtTm rMemrDk9gX0fTSYLiyu7w1gC2auQSxdQLyvT9KBCSPB2auwS0SNOK6kaAxRgncsSmtPj wHuml4GYYJw+X0TJAA20fX+YHuOnxo51quUzagKTmVVz1kxic7dWaGjWHe4AhwQacEyy LdDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692731989; x=1693336789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ex2wYhsS71++plSwD4vywQfTwawR7Om/B/i5Q+QelHk=; b=f7TAag8e3tp/X4thGopZQaqpLohzqgsTle1sAPS/TjJq4zZcguEDApA69gBcQhss5c D8Z2a11fN3LXlU0FOp0g0WS7lrszOpA80FmspttOaOYFeEv5hpdsRFEInKlrHHdwWBO+ EoWxprUQJBIl2CsBw0iTFfRYNq67KsBI+d4uIk1jLofkKUn+py16nPsAezKqj4ilxZ9h fpGtF6FtT9GrCF2W4Nm+xZsak7y9272VD5mBkYA7rHL7YDTUlsS9+JmqehhxWwslnVoD TEzf8eepDH9zAKQJ0sKsv/5nyM+Lrpv079wfy45yvT6hJ273XwRbZsDs0rVGPpk8qrfn XFAw== X-Gm-Message-State: AOJu0YxL6M0SkW8gokoSJ+gt7h+zN964E+/5K09NQKqaXl0Wbimngcui cj4KncBY4IFhFeEstRLcpFFTyFW1o1VWcV1SYIA= X-Google-Smtp-Source: AGHT+IFiggDxmZr8/mDl+OamB4cWThFrkoLGTyxkZmYvnmO01W9toE5KxDHc5Xx9v8hv02ha4fEzbg== X-Received: by 2002:a5d:45c6:0:b0:319:854a:9ea1 with SMTP id b6-20020a5d45c6000000b00319854a9ea1mr7395294wrs.15.1692731989602; Tue, 22 Aug 2023 12:19:49 -0700 (PDT) Received: from localhost.localdomain (adsl-200.109.242.225.tellas.gr. [109.242.225.200]) by smtp.gmail.com with ESMTPSA id n4-20020a05600c294400b003fe2a40d287sm126905wmd.1.2023.08.22.12.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 12:19:49 -0700 (PDT) From: Emmanouil Pitsidianakis To: qemu-devel@nongnu.org Cc: Emmanouil Pitsidianakis , "Igor Skalkin" , "Anton Yakovlev" , "Paolo Bonzini" , "Gerd Hoffmann" , "Michael S. Tsirkin" , "Marcel Apfelbaum" , =?utf-8?q?Daniel_P=2E_Berr?= =?utf-8?q?ang=C3=A9?= , "Eduardo Habkost" , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Volker_R=C3=BCmelin?= , =?utf-8?b?S8WRdsOh?= =?utf-8?b?Z8OzLCBab2x0w6Fu?= , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Subject: [PATCH v7 12/12] docs/system: add basic virtio-snd documentation Date: Tue, 22 Aug 2023 22:18:35 +0300 Message-Id: <6bed90224721b36df5c0c125df5ae4e0d7da2fa3.1692731646.git.manos.pitsidianakis@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This commit adds basic documentation for using virtio-snd. Signed-off-by: Emmanouil Pitsidianakis --- docs/system/device-emulation.rst | 1 + docs/system/devices/virtio-snd.rst | 49 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 docs/system/devices/virtio-snd.rst diff --git a/docs/system/device-emulation.rst b/docs/system/device-emulation.rst index 4491c4cbf7..dae19446e5 100644 --- a/docs/system/device-emulation.rst +++ b/docs/system/device-emulation.rst @@ -92,6 +92,7 @@ Emulated Devices devices/usb.rst devices/vhost-user.rst devices/virtio-pmem.rst + devices/virtio-snd.rst devices/vhost-user-rng.rst devices/canokey.rst devices/usb-u2f.rst diff --git a/docs/system/devices/virtio-snd.rst b/docs/system/devices/virtio-snd.rst new file mode 100644 index 0000000000..2a9187fd70 --- /dev/null +++ b/docs/system/devices/virtio-snd.rst @@ -0,0 +1,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