From patchwork Wed Oct 11 14:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 13417510 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 657A7CD6E7B for ; Wed, 11 Oct 2023 14:37:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqaK2-00019M-0C; Wed, 11 Oct 2023 10:36:26 -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 1qqaJz-00018C-5h for qemu-devel@nongnu.org; Wed, 11 Oct 2023 10:36:23 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqaJx-0005oP-BJ for qemu-devel@nongnu.org; Wed, 11 Oct 2023 10:36:22 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3247cefa13aso6282148f8f.1 for ; Wed, 11 Oct 2023 07:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697034979; x=1697639779; darn=nongnu.org; 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=ufC+dD4Md7A3Zyn0mFl7NjM0gBjP2OM76JBiL0XIFTA=; b=AuiB7DZU9qlwZMRuEONJvDSA+nML65rVX8DlgpTXWImWvbUV+Ih2glKDslUGPWP8su T/1mmxUAWrpJ5qWcmudObcdSTwvCadotOkZmv+vGg7d/9XnEdQBuJl2C2QVXXj8U1LhS Ypn7LjcD4l1xFrT/gSTGdvt6NOZxMsmwv2matkH0Le6Fag/lIIQ31lXIFyUNcWCOYBqB BshLpzCOlshHgfCFquh0j+BPRWJv2YTULh6TyDPaqcUjYON8e2LiVUxvdHYGSVYosBz2 UGeM7DjjfuFqUqUOZE/VNHOXd3yIdFLrUNjeWxYMa8ijqvjkRRfqoKBL7yzxo7HuZOqd P6ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697034979; x=1697639779; 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=ufC+dD4Md7A3Zyn0mFl7NjM0gBjP2OM76JBiL0XIFTA=; b=YYJYzzOSr8MFekqZwJ1QuiuI1VM0C/m8GK5Mry902WQdLb++9h/F2ht4Sy8XIzdG9T 09RYzJKYcEXDg/cTBm0VnjIVCA410Jm7sMJ3oydavmg5U3jSw9df19eH7FV+reDs3YCc tDPBkvCcGF1JMldL9hc7VYksRbw+B/WqOYATbtlm4Tgj+KwUkaNQ+9ywq60PS9sxwZ4v X+A3wenMVftALEx/EjzoEqPseHM+brvt0vnywFPuCyFjlFvISESP0AdtXUZo8YpOMhVt xIMGooRvzxZX69vBPQDkX2NqK7rrXLKM3BNIrrECV4uNAoZipYi/IEtmnU3nl1kIk0MB 4Gqw== X-Gm-Message-State: AOJu0Yxm7Q1xP7pgtT/AndynQU+vQ6x1Uv44RG3J/tyFDIFGYM4pvNBk Ogf28bjVHUJ98Iib7rbMXCZMGMOn6AEL2odjB6M= X-Google-Smtp-Source: AGHT+IFixuiyrXL/KosL2gSt6U6TvT2/Iew3TGKNaikPZOFH7ravNQb+GoYSXt2Tdv8ToPFal3ZHbA== X-Received: by 2002:a5d:48cb:0:b0:322:707e:a9fd with SMTP id p11-20020a5d48cb000000b00322707ea9fdmr16920177wrs.34.1697034979447; Wed, 11 Oct 2023 07:36:19 -0700 (PDT) Received: from localhost.localdomain (adsl-26.37.6.0.tellas.gr. [37.6.0.26]) by smtp.gmail.com with ESMTPSA id n8-20020a5d4208000000b003253523d767sm15599869wrq.109.2023.10.11.07.36.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 07:36:18 -0700 (PDT) From: Manos Pitsidianakis X-Google-Original-From: Manos 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?= , "Mark Cave-Ayland" , "Stefano Garzarella" Subject: [PATCH v11 11/11] docs/system: add basic virtio-snd documentation Date: Wed, 11 Oct 2023 17:34:56 +0300 Message-Id: <885b01fe272541fdab5583780d4c3a59bfd8e734.1696935992.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::42b; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wr1-x42b.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 From: Emmanouil Pitsidianakis This commit adds basic documentation for using virtio-snd. Signed-off-by: Emmanouil Pitsidianakis Reviewed-by: Alex Bennée --- MAINTAINERS | 1 + docs/system/device-emulation.rst | 1 + docs/system/devices/virtio-snd.rst (new) | 49 ++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 701f12026a..a32e512a61 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2259,6 +2259,7 @@ M: Manos Pitsidianakis S: Supported F: hw/virtio/virtio-snd*.c F: include/hw/virtio/virtio-snd.h +F: docs/system/devices/virtio-snd.rst nvme M: Keith Busch 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 @@ -79,20 +79,21 @@ in a PCI slot to the exclusive use of the guest. Emulated Devices ~~~~~~~~~~~~~~~~ .. toctree:: :maxdepth: 1 devices/can.rst devices/ccid.rst devices/cxl.rst devices/ivshmem.rst devices/keyboard.rst devices/net.rst devices/nvme.rst 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 devices/igb.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