From patchwork Thu Oct 19 10:03:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 13428534 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 8FDDECDB482 for ; Thu, 19 Oct 2023 10:06:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtPuj-0005Og-Qq; Thu, 19 Oct 2023 06:06:01 -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 1qtPug-0005La-JC for qemu-devel@nongnu.org; Thu, 19 Oct 2023 06:05:58 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtPue-0003eI-Q7 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 06:05:58 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso6317813f8f.0 for ; Thu, 19 Oct 2023 03:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697709955; x=1698314755; 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=NFvxjXyPQyQdUo774rlrcRiYhBR/VXY2nK/Mz5j4NP8=; b=HV1r1hu2fBJA8qS6LkOTwf3ZXAXahDCWMPGYB6kxmEbWFeAoAEO/JVJCt19N9wsDQw NdCzUCDog/Y0DOcx782dVOYvgG7GDUwa8a8E9OoT9yKVKbeSoguJVB0lWuq1e+lODm74 i0H++dpeFjSglBYB2b+t/j+VEBj2U2TdcDWnXNeccU6AwyRZnFoqX4PeaPSsWeR8Lplk SOolfqaEAwjnpSR917Rh9ndgSPBTIty4nhCNdNZBILynOfTmYeUf8QucBvzqR+CM69Mv 6eAbjCB72FTFnMB0MhCe90HKiEWpcSrupiB0SgtPAmDKlUZykUnpQp6ue0UTw9K/hEH4 i9JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697709955; x=1698314755; 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=NFvxjXyPQyQdUo774rlrcRiYhBR/VXY2nK/Mz5j4NP8=; b=Js1OnfLOugOZEn8XemtXyU7JEBzbldZwc4uS/6Hee2YjZWeb4DicaC2G/XVK9Tjw5f ZH9VQzNAH5pEhB2ghsuljC+ZxRTzWvtPWVI2Pwp1GNem2QIwdnpG/W4g0l6Z6QkxfaH2 AZRwmzj9ddsisod3+f8PV81cqKzHG1W0jJPVE6APndh76u/1fH8xeyLTBHva9xnFSPzD Q6dH5DcYeKx+jWcTSpFF5EHspFHd0Bpz3uClXKOUV62HsYGbTRIz5yuKay62tHOj51H+ Mo/fskJDyCJeLTGU24k2K+m7zQMJRBh8Or9UeEUHwh4etzNIQ3d2kysybQpXtukDZHfG Vaqw== X-Gm-Message-State: AOJu0Yxv/qOrnlPMm5dPqRKM80Huh0+Wg+9ur34GH3FGHMdwU1vErQK/ ac6Q6TZ0+NiBk1wB/nJdxMcJm3drYuw4bcCI7H4= X-Google-Smtp-Source: AGHT+IHmi+pfvMEP6QaB21ASMsyDxA2e0BHfBbozqzIvBOoCuYPl8gB4wKRK3kE733t3h/ISwHtmbQ== X-Received: by 2002:adf:e886:0:b0:323:37af:c7c7 with SMTP id d6-20020adfe886000000b0032337afc7c7mr1242878wrm.69.1697709954169; Thu, 19 Oct 2023 03:05:54 -0700 (PDT) Received: from localhost.localdomain (adsl-141.37.6.162.tellas.gr. [37.6.162.141]) by smtp.gmail.com with ESMTPSA id d13-20020a5d538d000000b003232d122dbfsm4110307wrv.66.2023.10.19.03.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 03:05:53 -0700 (PDT) From: Emmanouil Pitsidianakis To: qemu-devel@nongnu.org, "Gerd Hoffmann" Cc: Emmanouil Pitsidianakis , "Igor Skalkin" , "Anton Yakovlev" , "Paolo Bonzini" , "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 v12 11/11] docs/system: add basic virtio-snd documentation Date: Thu, 19 Oct 2023 13:03:55 +0300 Message-Id: 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::429; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wr1-x429.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 Reviewed-by: Alex Bennée --- MAINTAINERS | 1 + docs/system/device-emulation.rst | 1 + docs/system/devices/virtio-snd.rst | 49 ++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 docs/system/devices/virtio-snd.rst diff --git a/MAINTAINERS b/MAINTAINERS index cd2663ada8..ca273ddb0e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2274,6 +2274,7 @@ S: Supported F: hw/audio/virtio-snd.c F: hw/audio/virtio-snd-pci.c F: include/hw/audio/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 1167f3a9f2..d1f3277cb0 100644 --- a/docs/system/device-emulation.rst +++ b/docs/system/device-emulation.rst @@ -93,6 +93,7 @@ Emulated Devices devices/vhost-user.rst devices/virtio-gpu.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