From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610717705; cv=none; d=zohomail.com; s=zohoarc; b=A4BcnoIEWU5HxOMMh7opH+S1ZSerILrZIBIr28bv7mUtlyefYtDMc/HTrW+C1a14e3zOXGHBsu9aDP5FcYgLCaguyseI5betYVZdEqEpuSHMRuAOP8CB5sZG5HMmxZFlbbuGdIvsOFtLm53pzlRZWNK0++JALFOTpcxoUxgkTFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610717705; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ech2SUjyUk80bT9CYIHII+RZubdosfd6kXATCvqsEz4=; b=lUCPBmQYNDVlVkjsxthW4WuFLkwEICpgMSsRq3JJs4QIcDV+H2CsOELCfeZ7VQAGS3IO+Y7SlRTMvekcNOoeqxSO/MvKFoFIMbLjqqNloZbg4ltqUYsCtDspsYRs//QgePXtiOvhR2FBPPD8HGvEx/dfS4wXUbHX+TlIPXMudS0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610717705863648.1274203147876; Fri, 15 Jan 2021 05:35:05 -0800 (PST) Received: from localhost ([::1]:43366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PFo-0002Fv-Cs for importer@patchew.org; Fri, 15 Jan 2021 08:35:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3C-0006nT-2j for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:24295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P36-0003Ib-1v for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:01 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-46-ilsPyvVwMC6nocGoqhHzqA-1; Fri, 15 Jan 2021 08:21:51 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC2E7806660; Fri, 15 Jan 2021 13:21:50 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99CB96F7EA; Fri, 15 Jan 2021 13:21:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2125B1800607; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ech2SUjyUk80bT9CYIHII+RZubdosfd6kXATCvqsEz4=; b=ZfjOT61OSdvZvPtWYOO0vv2eW+DzR3Mwxv3RZxdBHNefm8Ch2Zw4x9vB2xFOa9R3pGb2jQ iGj6nQ9AIBXDR0mjvEbs7yd/RwEjgH0z3xEywAYaC1eIkFc6r2340uEHP0Xgm8Rphfuc3Y C2Dij1r9qfRNjGG0ie5lt5KaG4EhvmY= X-MC-Unique: ilsPyvVwMC6nocGoqhHzqA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 01/30] sdlaudio: remove leftover SDL1.2 code Date: Fri, 15 Jan 2021 14:21:17 +0100 Message-Id: <20210115132146.1443592-2-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Signed-off-by: Volker R=C3=BCmelin Reviewed-by: Thomas Huth Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/sdlaudio.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 21b7a0484bec..bf3cfb845616 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -240,28 +240,24 @@ static void sdl_callback (void *opaque, Uint8 *buf, i= nt len) } } =20 -#define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args, fail, unlock) \ - static ret_type glue(sdl_, name)args_decl \ - { \ - ret_type ret; \ - \ - SDL_LockAudio(); \ - \ - ret =3D glue(audio_generic_, name)args; \ - \ - SDL_UnlockAudio(); \ - return ret; \ +#define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args) \ + static ret_type glue(sdl_, name)args_decl \ + { \ + ret_type ret; \ + \ + SDL_LockAudio(); \ + ret =3D glue(audio_generic_, name)args; \ + SDL_UnlockAudio(); \ + \ + return ret; \ } =20 SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size), - (hw, size), *size =3D 0, sdl_unlock) + (hw, size)) SDL_WRAPPER_FUNC(put_buffer_out, size_t, - (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size), - /*nothing*/, sdl_unlock_and_post) + (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size)) SDL_WRAPPER_FUNC(write, size_t, - (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size), - /*nothing*/, sdl_unlock_and_post) - + (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size)) #undef SDL_WRAPPER_FUNC =20 static void sdl_fini_out (HWVoiceOut *hw) --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718113; cv=none; d=zohomail.com; s=zohoarc; b=b3jznW8fqioVXymLnlNLzLG7qKerfJzbnT+VRMzOkjYzaJXk626r07hjXdHA0W4AySaLl9x+Z/8Z8J7arvwNQpR9HGkFdjYGlNkdLSSCe8M4kKxTOZLh/A+JMJy82Wm/cXIN0EBdNWJnVnW5XfNIT8Xu9cEadXxAaY5uvuelKZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718113; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=P0tYVpttXfRb0Qnh1uN5/ixevCObt9P8fBy6EFlQWSs=; b=CAI4LxP75so2I+4GZQsl3SI4HKOmh+1HlnW4CDb2UyEo4XaGcSe+1SFBmwySVnsiLJMCMIe/m4WaKtl70Xu1u1xo9SMUQjCpi+kTPnqkilMEJWvwVUsOkBgbv0Uahye5T0D7AnkUYgRoChQyzQORuLleukBp6XTKZSgdnCKPENM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718113400240.35497473153282; Fri, 15 Jan 2021 05:41:53 -0800 (PST) Received: from localhost ([::1]:59438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PMO-0000de-8d for importer@patchew.org; Fri, 15 Jan 2021 08:41:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3D-0006rM-Nd for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003H5-4I for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-OiRq-O17OdaiYPZZIp_aDg-1; Fri, 15 Jan 2021 08:21:51 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACEB0107ACF7; Fri, 15 Jan 2021 13:21:50 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98FAF5D756; Fri, 15 Jan 2021 13:21:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2D1751800610; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P0tYVpttXfRb0Qnh1uN5/ixevCObt9P8fBy6EFlQWSs=; b=cQhgTWu1oJNkEOP3h8GpHsMov8peUQJDu4fTeQRVk+IdKZ3PRKB5qJH7fFIHbgl3KKWJsp UwXuo70cdQX3RqeIuUSNDX3C6jel0nixmNu6MkSVJEA8cini+pLDnIL6QE9IkWfmoISFW+ 0Et70OMnE+C/tedSHueiCwAfsPz4W4c= X-MC-Unique: OiRq-O17OdaiYPZZIp_aDg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 02/30] audio: fix bit-rotted code Date: Fri, 15 Jan 2021 14:21:18 +0100 Message-Id: <20210115132146.1443592-3-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/alsaaudio.c | 2 +- audio/sdlaudio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index a8e62542f97e..6787e91bc198 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -599,7 +599,7 @@ static int alsa_open(bool in, struct alsa_params_req *r= eq, } =20 #ifdef DEBUG - alsa_dump_info(req, obt, obtfmt, pdo); + alsa_dump_info(req, obt, obtfmt, apdo); #endif return 0; =20 diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index bf3cfb845616..00cd12ba66a0 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -215,7 +215,7 @@ static void sdl_callback (void *opaque, Uint8 *buf, int= len) return; } =20 - /* dolog ("in callback samples=3D%zu live=3D%zu\n", samples, sdl->live= ); */ + /* dolog("callback: len=3D%d avail=3D%zu\n", len, hw->pending_emul); */ =20 while (hw->pending_emul && len) { size_t write_len; --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718230; cv=none; d=zohomail.com; s=zohoarc; b=XnhB+7uoH8FzOPKlEbvsS+R1iQJe2NNfY5rIfk+u/Jb1guR6ARu2RGexjRWVUkq6Tlw0NRlDkAp5a0ZPQVc76mRR2C9i7YpAeBXHkCb1bQQTk7dEXA6wXmxzttQwuSnEouIdrIZnUWpuSwYNb1RiKk7AUERHNNEGjRYzqoV/Y0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718230; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aeDg4125dizdq5rxpU5rsLCl6t7va00pdbEznyBm+wc=; b=QgsRsMfRPhKsgBa7c3kFlj6pSdLHeK241yg8VwsGaUjThDYJsdeoBvNhVVjomlFZyagXGr8JPGj0vav8ZM848l/ApA0Lx3FJY+ttXJIl92K14kOB4OKceVcXzoKi6q/a2QMc3pPlT/d0dEeBD+uPx6ayO6JHLZVQwWR0Xl9Z62Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16107182307401010.976615794349; Fri, 15 Jan 2021 05:43:50 -0800 (PST) Received: from localhost ([::1]:40116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0POH-0004GU-Gs for importer@patchew.org; Fri, 15 Jan 2021 08:43:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3K-0006xw-1P for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56967) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003Ht-6u for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-418-9f2-nUg1NFi5TC162wEGjg-1; Fri, 15 Jan 2021 08:21:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E4A48030A2; Fri, 15 Jan 2021 13:21:51 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1C74648A1; Fri, 15 Jan 2021 13:21:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 40B901800612; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aeDg4125dizdq5rxpU5rsLCl6t7va00pdbEznyBm+wc=; b=OATSxc5B6NxluMQemkAg8byLnpZ6okiz5CszvCnQDxfk5gDsfMifrg9+utTtXPS9Ht6/i9 ceam3Sh9sccci6vo19C2S5akm+ENeG5V0Bj6oW9wziFpgl2nDms4ifsOdaH6LgezlolfPT BWLhUAhnZA8d7dGbMqIY6rpGNvtHNQ0= X-MC-Unique: 9f2-nUg1NFi5TC162wEGjg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 03/30] sdlaudio: add -audiodev sdl,out.buffer-count option Date: Fri, 15 Jan 2021 14:21:19 +0100 Message-Id: <20210115132146.1443592-4-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Currently there is a crackling noise with SDL2 audio playback. Commit bcf19777df: "audio/sdlaudio: Allow audio playback with SDL2" already mentioned the crackling noise. Add an out.buffer-count option to give users a chance to select sane settings for glitch free audio playback. The idea was taken from the coreaudio backend. The in.buffer-count option will be used with one of the next patches. Signed-off-by: Volker R=C3=BCmelin Acked-by: Markus Armbruster Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/audio_template.h | 2 +- audio/audio.c | 2 +- audio/audio_legacy.c | 3 ++- audio/sdlaudio.c | 11 +++++++++-- qapi/audio.json | 33 ++++++++++++++++++++++++++++++++- qemu-options.hx | 8 +++++++- 6 files changed, 52 insertions(+), 7 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index 8dd48ce14e9d..434df5d5e750 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -337,7 +337,7 @@ AudiodevPerDirectionOptions *glue(audio_get_pdo_, TYPE)= (Audiodev *dev) case AUDIODEV_DRIVER_PA: return qapi_AudiodevPaPerDirectionOptions_base(dev->u.pa.TYPE); case AUDIODEV_DRIVER_SDL: - return dev->u.sdl.TYPE; + return qapi_AudiodevSdlPerDirectionOptions_base(dev->u.sdl.TYPE); case AUDIODEV_DRIVER_SPICE: return dev->u.spice.TYPE; case AUDIODEV_DRIVER_WAV: diff --git a/audio/audio.c b/audio/audio.c index b48471bb3f64..d048d262835e 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -2003,7 +2003,7 @@ void audio_create_pdos(Audiodev *dev) CASE(JACK, jack, Jack); CASE(OSS, oss, Oss); CASE(PA, pa, Pa); - CASE(SDL, sdl, ); + CASE(SDL, sdl, Sdl); CASE(SPICE, spice, ); CASE(WAV, wav, ); =20 diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c index ffdbd0bcce8c..0fe827b05735 100644 --- a/audio/audio_legacy.c +++ b/audio/audio_legacy.c @@ -286,7 +286,8 @@ static void handle_sdl(Audiodev *dev) { /* SDL is output only */ get_samples_to_usecs("QEMU_SDL_SAMPLES", &dev->u.sdl.out->buffer_lengt= h, - &dev->u.sdl.out->has_buffer_length, dev->u.sdl.ou= t); + &dev->u.sdl.out->has_buffer_length, + qapi_AudiodevSdlPerDirectionOptions_base(dev->u.sdl.out)); } =20 /* wav */ diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 00cd12ba66a0..431bfcfddd97 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -276,12 +276,18 @@ static int sdl_init_out(HWVoiceOut *hw, struct audset= tings *as, int endianness; int err; AudioFormat effective_fmt; + AudiodevSdlPerDirectionOptions *spdo =3D s->dev->u.sdl.out; struct audsettings obt_as; =20 req.freq =3D as->freq; req.format =3D aud_to_sdlfmt (as->fmt); req.channels =3D as->nchannels; - req.samples =3D audio_buffer_samples(s->dev->u.sdl.out, as, 11610); + /* + * This is wrong. SDL samples are QEMU frames. The buffer size will be + * the requested buffer size multiplied by the number of channels. + */ + req.samples =3D audio_buffer_samples( + qapi_AudiodevSdlPerDirectionOptions_base(spdo), as, 11610); req.callback =3D sdl_callback; req.userdata =3D sdl; =20 @@ -301,7 +307,8 @@ static int sdl_init_out(HWVoiceOut *hw, struct audsetti= ngs *as, obt_as.endianness =3D endianness; =20 audio_pcm_init_info (&hw->info, &obt_as); - hw->samples =3D obt.samples; + hw->samples =3D (spdo->has_buffer_count ? spdo->buffer_count : 4) * + obt.samples; =20 s->initialized =3D 1; s->exit =3D 0; diff --git a/qapi/audio.json b/qapi/audio.json index 072ed79def50..9cba0df8a4e9 100644 --- a/qapi/audio.json +++ b/qapi/audio.json @@ -301,6 +301,37 @@ '*out': 'AudiodevPaPerDirectionOptions', '*server': 'str' } } =20 +## +# @AudiodevSdlPerDirectionOptions: +# +# Options of the SDL audio backend that are used for both playback and +# recording. +# +# @buffer-count: number of buffers (default 4) +# +# Since: 6.0 +## +{ 'struct': 'AudiodevSdlPerDirectionOptions', + 'base': 'AudiodevPerDirectionOptions', + 'data': { + '*buffer-count': 'uint32' } } + +## +# @AudiodevSdlOptions: +# +# Options of the SDL audio backend. +# +# @in: options of the recording stream +# +# @out: options of the playback stream +# +# Since: 6.0 +## +{ 'struct': 'AudiodevSdlOptions', + 'data': { + '*in': 'AudiodevSdlPerDirectionOptions', + '*out': 'AudiodevSdlPerDirectionOptions' } } + ## # @AudiodevWavOptions: # @@ -385,6 +416,6 @@ 'jack': 'AudiodevJackOptions', 'oss': 'AudiodevOssOptions', 'pa': 'AudiodevPaOptions', - 'sdl': 'AudiodevGenericOptions', + 'sdl': 'AudiodevSdlOptions', 'spice': 'AudiodevGenericOptions', 'wav': 'AudiodevWavOptions' } } diff --git a/qemu-options.hx b/qemu-options.hx index 1698a0c751ff..4e02e9bd7604 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -588,6 +588,7 @@ DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev, #endif #ifdef CONFIG_AUDIO_SDL "-audiodev sdl,id=3Did[,prop[=3Dvalue][,...]]\n" + " in|out.buffer-count=3D number of buffers\n" #endif #ifdef CONFIG_SPICE "-audiodev spice,id=3Did[,prop[=3Dvalue][,...]]\n" @@ -745,7 +746,12 @@ SRST ``-audiodev sdl,id=3Did[,prop[=3Dvalue][,...]]`` Creates a backend using SDL. This backend is available on most systems, but you should use your platform's native backend if - possible. This backend has no backend specific properties. + possible. + + SDL specific options are: + + ``in|out.buffer-count=3Dcount`` + Sets the count of the buffers. =20 ``-audiodev spice,id=3Did[,prop[=3Dvalue][,...]]`` Creates a backend that sends audio through SPICE. This backend --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718746; cv=none; d=zohomail.com; s=zohoarc; b=T24MBoHdBYiZMxKwXV/l5KJ/UPWXWrpOBs0BcKOUYQTyXc9tS8ver3NmVKQXN5iPXuXek3MJWC/81mtAg/gpJtPr88Pm5oJoGJ5trPCVtLBxg/2C/6ZRUOGMHj+MgCzi8BJaz6k7P6x9azO1SoIwjnAbisH4wiqSW4d0iuRB7fM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718746; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KFWPq1W6WpQvv5fZvi5fxk9b8cb3IFSPQqe4LAA/rvc=; b=eZr0nmtjOSCMu6eCn+fOO8/S1PvK4sZXPSXSneXmybW8wjBgY8lw25EttnnHxpcdWy+DBgYVt++Jl3UF/zkDjVD1UrBjCcCTZhVWeqxQl8skd5XxyJJqjN7b1sVSXIUWgjWpvWAU9om93x1C+hJ3JQhrDqWCuhcwKsRpFiG33xw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718746142683.8762892747296; Fri, 15 Jan 2021 05:52:26 -0800 (PST) Received: from localhost ([::1]:37454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PWa-0006u1-Vn for importer@patchew.org; Fri, 15 Jan 2021 08:52:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3L-00070Q-62 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003HA-78 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-370-qsW7RuZjP7WcVycRBJ9u4Q-1; Fri, 15 Jan 2021 08:21:51 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6637100F340; Fri, 15 Jan 2021 13:21:50 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE97B6F7EB; Fri, 15 Jan 2021 13:21:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4B00C1800633; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KFWPq1W6WpQvv5fZvi5fxk9b8cb3IFSPQqe4LAA/rvc=; b=AWGY5KHDSvZ1Y28YPQswmpCSeywQ7pURv7vKtHzky0QwdjpmzmoLzmnqWNIus4QeC1HZIj Al+LCo29leVHfl+afJMGsQ1ZesqB1UfOrcJwEMBMFKX6wfFu0sa/bjPpNLpUJSW83yJlot tZ7myHVEv2LaQeRS0S+t8XkpxvOOebQ= X-MC-Unique: qsW7RuZjP7WcVycRBJ9u4Q-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 04/30] sdlaudio: don't start playback in init routine Date: Fri, 15 Jan 2021 14:21:20 +0100 Message-Id: <20210115132146.1443592-5-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Every emulated audio device has a way to enable audio playback. Don't start playback until the guest enables the audio device. This patch keeps the SDL2 device pause state in sync with hw->enabled. Signed-off-by: Volker R=C3=BCmelin Reviewed-by: Thomas Huth Tested-by: Thomas Huth Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-4-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/sdlaudio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 431bfcfddd97..68126a99ab32 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -312,7 +312,6 @@ static int sdl_init_out(HWVoiceOut *hw, struct audsetti= ngs *as, =20 s->initialized =3D 1; s->exit =3D 0; - SDL_PauseAudio (0); return 0; } =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718572; cv=none; d=zohomail.com; s=zohoarc; b=PX+r8n6haNFFibfghxRNE+TymhahcD/oTDRZ4nPibFzQTzJvtrJ+ED+SSG74YxFD2NeFmjCCSlFcA3lh3518bi3WpOpdy0CgI7O9A9MiKv4+CdtZlIr9w6BS0/VyqOxYMNtRN9kI+l+YW1vFw3YZEdm2/G90LhDN4AJxdsBhEpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718572; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cGGocoEQ3P6f9bdFcttulrNqEEZTGBL2HjrIcE7dPH4=; b=TQF7mVZsnLRLCtrkiA4ZWqnYSPSbvm7P3kbK7wVm0ab/YjMQw4kKF85HSWZthL7KAo1vOF7hF73P7PazfLzB05Ow1z5IxnhoLsVC2ouoaeBjF741AEWWhvfnbUWO5+pfIfQLFxp9vAWjyA3w0YoI2b6WyQ8Ytd/AyUYJNuK0ns8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16107185727941004.2141570263591; Fri, 15 Jan 2021 05:49:32 -0800 (PST) Received: from localhost ([::1]:57380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PTm-0003FE-Up for importer@patchew.org; Fri, 15 Jan 2021 08:49:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3K-0006yv-DP for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003JR-7S for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-73-ddphLbU3ObeHQDrZMCpaMA-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3BDD107ACF7; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7776371C5E; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 55D90180063A; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cGGocoEQ3P6f9bdFcttulrNqEEZTGBL2HjrIcE7dPH4=; b=O4BTBOIDP6dfQVXDA5iP9MZ0+WpwcOuyUJBvphBRGUIFo63N3w+xeQze3O8RExOimDxzWX KGqSwoJR87mMplPT0zFUSzhUWZhJI6JhRMOkbBhs6im58TSJ2yd+1QnLvZS8jIsnXA/BTj nNo7bh+eYIUILpCTsrDsq5nzLJxg70U= X-MC-Unique: ddphLbU3ObeHQDrZMCpaMA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 05/30] sdlaudio: always clear the sample buffer Date: Fri, 15 Jan 2021 14:21:21 +0100 Message-Id: <20210115132146.1443592-6-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Always fill the remaining audio callback buffer with silence. SDL 2.0 doesn't initialize the audio callback buffer. This was an incompatible change compared to SDL 1.2. For reference read the SDL 1.2 to 2.0 migration guide. Signed-off-by: Volker R=C3=BCmelin Reviewed-by: Thomas Huth Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-5-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/sdlaudio.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 68126a99ab32..79eed23849ea 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -211,27 +211,26 @@ static void sdl_callback (void *opaque, Uint8 *buf, i= nt len) SDLAudioState *s =3D &glob_sdl; HWVoiceOut *hw =3D &sdl->hw; =20 - if (s->exit) { - return; - } + if (!s->exit) { =20 - /* dolog("callback: len=3D%d avail=3D%zu\n", len, hw->pending_emul); */ + /* dolog("callback: len=3D%d avail=3D%zu\n", len, hw->pending_emul= ); */ =20 - while (hw->pending_emul && len) { - size_t write_len; - ssize_t start =3D ((ssize_t) hw->pos_emul) - hw->pending_emul; - if (start < 0) { - start +=3D hw->size_emul; + while (hw->pending_emul && len) { + size_t write_len; + ssize_t start =3D (ssize_t)hw->pos_emul - hw->pending_emul; + if (start < 0) { + start +=3D hw->size_emul; + } + assert(start >=3D 0 && start < hw->size_emul); + + write_len =3D MIN(MIN(hw->pending_emul, len), + hw->size_emul - start); + + memcpy(buf, hw->buf_emul + start, write_len); + hw->pending_emul -=3D write_len; + len -=3D write_len; + buf +=3D write_len; } - assert(start >=3D 0 && start < hw->size_emul); - - write_len =3D MIN(MIN(hw->pending_emul, len), - hw->size_emul - start); - - memcpy(buf, hw->buf_emul + start, write_len); - hw->pending_emul -=3D write_len; - len -=3D write_len; - buf +=3D write_len; } =20 /* clear remaining buffer that we couldn't fill with data */ --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610719449; cv=none; d=zohomail.com; s=zohoarc; b=OqlTJHPJWzrgJA059hsSIQJ/dSaSrLYGn0Mc8ZIMBT/9pyNFs5sw+y3VwzRDlmrkRbFcq4fcQWbc/usqwVDcIKeKABNYonFRVo3M2u3GfBjdSQQsVggcx/KPtgFYf97SjRXLHSbteOd39yfHBvpLnZLjB/hLZK1Us/CyWj7V+U0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610719449; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gBvVXe3vuri1sap6BFOCFVQiOjM8pbUv9nTR1xQirrg=; b=SbTGa4jCvyu2u6WNg1ef7DB9OkCorBnfnxW10mz/zu3ga1013eEjvlvhIK5XHynB6eOSJkvyKGvEGaXl+9R/8MZWxbIXhwbUmjMg4MTNgJ0jot8mYD87SeDH3R914nhmYd5STs0suUXa+kF0dDs5EEZknxgBW+KLx/zkTIBH+Ac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610719449442311.65422474624734; Fri, 15 Jan 2021 06:04:09 -0800 (PST) Received: from localhost ([::1]:43198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Phw-0004L6-4f for importer@patchew.org; Fri, 15 Jan 2021 09:04:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3O-00078g-IO for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51428) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3B-0003KB-9G for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:14 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-158-pCP5OUIfOyeglo09HLfpHQ-1; Fri, 15 Jan 2021 08:21:58 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A3B1E107ACF9; Fri, 15 Jan 2021 13:21:57 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 67F706E50A; Fri, 15 Jan 2021 13:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6016F180063C; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gBvVXe3vuri1sap6BFOCFVQiOjM8pbUv9nTR1xQirrg=; b=E51CznWC2dQQfQyPQ8LKmBX3jDmIZZBkjJz3zJaamb3PUiJ0Gn2xqh2Z2kXHBJ74egTxe4 R8wJqbs/g1KG4SMCJOqp/QkECtVxTOdPM9gtL4UAvtoqiLENJeb2KkBji81rcLTD/Mm/qW AATcOeeELxDJbtBsa/I6NCpO1d/jkNI= X-MC-Unique: pCP5OUIfOyeglo09HLfpHQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 06/30] sdlaudio: fill remaining sample buffer with silence Date: Fri, 15 Jan 2021 14:21:22 +0100 Message-Id: <20210115132146.1443592-7-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Fill the remaining sample buffer with silence. To fill it with zeroes is wrong for unsigned samples because this is silence with a DC bias. Signed-off-by: Volker R=C3=BCmelin Reviewed-by: Thomas Huth Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-6-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/sdlaudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 79eed23849ea..01ae4c600e80 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -235,7 +235,8 @@ static void sdl_callback (void *opaque, Uint8 *buf, int= len) =20 /* clear remaining buffer that we couldn't fill with data */ if (len) { - memset(buf, 0, len); + audio_pcm_info_clear_buf(&hw->info, buf, + len / hw->info.bytes_per_frame); } } =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718284; cv=none; d=zohomail.com; s=zohoarc; b=Z6CeFtYLP6rtlXqcix04kqVKkWwnApLaRpaSkKIKf3rEES7j6IQ7RYIOLw+sgsVlvHhIXH+wxYTHKN90ERSecYjvct4zCIDrlW4eTpZDMODgOPBS51B0rCZcx9WChwVjrNPni0+tTuFSBSkH6AB1ppbhZzru0zhAktjw0hS0g2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718284; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZTJk/IO1CG0AfYOte8jvRBNHTN1JrAxcVRl8PeAOiJc=; b=f8L/KmhU+ZPu+H5gZ2uGRs/QxPiwP8M+PXSgtrwqDg3Bel6jVkgRutsIO7+mdwHgkz+VBixCInHcw7pLULtuFLw4I3AJi/8uQpy1rwBUDsBbe/0TxAtPskk75wn3xm4qFC2pQ/Hao38Z3cz1phDAfQYSom8TAlSd0PElddsBD3E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718284211355.16275998434094; Fri, 15 Jan 2021 05:44:44 -0800 (PST) Received: from localhost ([::1]:41818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PP8-0004yd-UE for importer@patchew.org; Fri, 15 Jan 2021 08:44:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3O-00079c-VG for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3B-0003K9-4g for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:14 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-Ns1dOkC3P824tV3QUfupLg-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE9418030A5; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 833E15D9E3; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6BD2F180063D; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZTJk/IO1CG0AfYOte8jvRBNHTN1JrAxcVRl8PeAOiJc=; b=Rd3jaYYUL/wBizEvS6REaLun296+m6bUEe8MLeZXG6WZwk1cWmcCB/z4abNXq79RrGACxD 5z3B1Ak/xCWBQ2OdkoFBpIDKv2RwZ57xqCXwgozT0i+kquVwBeWTGx6vDTkyFuhy55fLxM OJfTClScJGpsS6qDmjrF1Q7MUUu7rGA= X-MC-Unique: Ns1dOkC3P824tV3QUfupLg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 07/30] sdlaudio: replace legacy functions with modern ones Date: Fri, 15 Jan 2021 14:21:23 +0100 Message-Id: <20210115132146.1443592-8-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin With the modern audio functions it's possible to add new features like audio recording. As a side effect this patch fixes a bug where SDL2 can't be used on Windows. This bug was reported on the qemu-devel mailing list at https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg04043.html Signed-off-by: Volker R=C3=BCmelin Reviewed-by: Thomas Huth Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-7-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/sdlaudio.c | 107 ++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 57 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 01ae4c600e80..47968c502027 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -41,15 +41,11 @@ =20 typedef struct SDLVoiceOut { HWVoiceOut hw; -} SDLVoiceOut; - -static struct SDLAudioState { int exit; int initialized; - bool driver_created; Audiodev *dev; -} glob_sdl; -typedef struct SDLAudioState SDLAudioState; + SDL_AudioDeviceID devid; +} SDLVoiceOut; =20 static void GCC_FMT_ATTR (1, 2) sdl_logerr (const char *fmt, ...) { @@ -155,9 +151,10 @@ static int sdl_to_audfmt(int sdlfmt, AudioFormat *fmt,= int *endianness) return 0; } =20 -static int sdl_open (SDL_AudioSpec *req, SDL_AudioSpec *obt) +static SDL_AudioDeviceID sdl_open(SDL_AudioSpec *req, SDL_AudioSpec *obt, + int rec) { - int status; + SDL_AudioDeviceID devid; #ifndef _WIN32 int err; sigset_t new, old; @@ -166,18 +163,19 @@ static int sdl_open (SDL_AudioSpec *req, SDL_AudioSpe= c *obt) err =3D sigfillset (&new); if (err) { dolog ("sdl_open: sigfillset failed: %s\n", strerror (errno)); - return -1; + return 0; } err =3D pthread_sigmask (SIG_BLOCK, &new, &old); if (err) { dolog ("sdl_open: pthread_sigmask failed: %s\n", strerror (err)); - return -1; + return 0; } #endif =20 - status =3D SDL_OpenAudio (req, obt); - if (status) { - sdl_logerr ("SDL_OpenAudio failed\n"); + devid =3D SDL_OpenAudioDevice(NULL, rec, req, obt, 0); + if (!devid) { + sdl_logerr("SDL_OpenAudioDevice for %s failed\n", + rec ? "recording" : "playback"); } =20 #ifndef _WIN32 @@ -190,30 +188,32 @@ static int sdl_open (SDL_AudioSpec *req, SDL_AudioSpe= c *obt) exit (EXIT_FAILURE); } #endif - return status; + return devid; } =20 -static void sdl_close (SDLAudioState *s) +static void sdl_close_out(SDLVoiceOut *sdl) { - if (s->initialized) { - SDL_LockAudio(); - s->exit =3D 1; - SDL_UnlockAudio(); - SDL_PauseAudio (1); - SDL_CloseAudio (); - s->initialized =3D 0; + if (sdl->initialized) { + SDL_LockAudioDevice(sdl->devid); + sdl->exit =3D 1; + SDL_UnlockAudioDevice(sdl->devid); + SDL_PauseAudioDevice(sdl->devid, 1); + sdl->initialized =3D 0; + } + if (sdl->devid) { + SDL_CloseAudioDevice(sdl->devid); + sdl->devid =3D 0; } } =20 -static void sdl_callback (void *opaque, Uint8 *buf, int len) +static void sdl_callback_out(void *opaque, Uint8 *buf, int len) { SDLVoiceOut *sdl =3D opaque; - SDLAudioState *s =3D &glob_sdl; HWVoiceOut *hw =3D &sdl->hw; =20 - if (!s->exit) { + if (!sdl->exit) { =20 - /* dolog("callback: len=3D%d avail=3D%zu\n", len, hw->pending_emul= ); */ + /* dolog("callback_out: len=3D%d avail=3D%zu\n", len, hw->pending_= emul); */ =20 while (hw->pending_emul && len) { size_t write_len; @@ -240,43 +240,44 @@ static void sdl_callback (void *opaque, Uint8 *buf, i= nt len) } } =20 -#define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args) \ +#define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args, dir) \ static ret_type glue(sdl_, name)args_decl \ { \ ret_type ret; \ + glue(SDLVoice, dir) *sdl =3D (glue(SDLVoice, dir) *)hw; \ \ - SDL_LockAudio(); \ + SDL_LockAudioDevice(sdl->devid); \ ret =3D glue(audio_generic_, name)args; \ - SDL_UnlockAudio(); \ + SDL_UnlockAudioDevice(sdl->devid); \ \ return ret; \ } =20 SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size), - (hw, size)) + (hw, size), Out) SDL_WRAPPER_FUNC(put_buffer_out, size_t, - (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size)) + (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size)= , Out) SDL_WRAPPER_FUNC(write, size_t, - (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size)) + (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size)= , Out) #undef SDL_WRAPPER_FUNC =20 -static void sdl_fini_out (HWVoiceOut *hw) +static void sdl_fini_out(HWVoiceOut *hw) { - (void) hw; + SDLVoiceOut *sdl =3D (SDLVoiceOut *)hw; =20 - sdl_close (&glob_sdl); + sdl_close_out(sdl); } =20 static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as, void *drv_opaque) { - SDLVoiceOut *sdl =3D (SDLVoiceOut *) hw; - SDLAudioState *s =3D &glob_sdl; + SDLVoiceOut *sdl =3D (SDLVoiceOut *)hw; SDL_AudioSpec req, obt; int endianness; int err; AudioFormat effective_fmt; - AudiodevSdlPerDirectionOptions *spdo =3D s->dev->u.sdl.out; + Audiodev *dev =3D drv_opaque; + AudiodevSdlPerDirectionOptions *spdo =3D dev->u.sdl.out; struct audsettings obt_as; =20 req.freq =3D as->freq; @@ -288,16 +289,18 @@ static int sdl_init_out(HWVoiceOut *hw, struct audset= tings *as, */ req.samples =3D audio_buffer_samples( qapi_AudiodevSdlPerDirectionOptions_base(spdo), as, 11610); - req.callback =3D sdl_callback; + req.callback =3D sdl_callback_out; req.userdata =3D sdl; =20 - if (sdl_open (&req, &obt)) { + sdl->dev =3D dev; + sdl->devid =3D sdl_open(&req, &obt, 0); + if (!sdl->devid) { return -1; } =20 err =3D sdl_to_audfmt(obt.format, &effective_fmt, &endianness); if (err) { - sdl_close (s); + sdl_close_out(sdl); return -1; } =20 @@ -310,41 +313,31 @@ static int sdl_init_out(HWVoiceOut *hw, struct audset= tings *as, hw->samples =3D (spdo->has_buffer_count ? spdo->buffer_count : 4) * obt.samples; =20 - s->initialized =3D 1; - s->exit =3D 0; + sdl->initialized =3D 1; + sdl->exit =3D 0; return 0; } =20 static void sdl_enable_out(HWVoiceOut *hw, bool enable) { - SDL_PauseAudio(!enable); + SDLVoiceOut *sdl =3D (SDLVoiceOut *)hw; + + SDL_PauseAudioDevice(sdl->devid, !enable); } =20 static void *sdl_audio_init(Audiodev *dev) { - SDLAudioState *s =3D &glob_sdl; - if (s->driver_created) { - sdl_logerr("Can't create multiple sdl backends\n"); - return NULL; - } - if (SDL_InitSubSystem (SDL_INIT_AUDIO)) { sdl_logerr ("SDL failed to initialize audio subsystem\n"); return NULL; } =20 - s->driver_created =3D true; - s->dev =3D dev; - return s; + return dev; } =20 static void sdl_audio_fini (void *opaque) { - SDLAudioState *s =3D opaque; - sdl_close (s); SDL_QuitSubSystem (SDL_INIT_AUDIO); - s->driver_created =3D false; - s->dev =3D NULL; } =20 static struct audio_pcm_ops sdl_pcm_ops =3D { --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718774; cv=none; d=zohomail.com; s=zohoarc; b=CHb+MpquSD1Z+LRpKARZwC5AowHgRaxy1cxDctCXF6v9zXxUG0kd2GZz8DtxQGCc5+EuCtY+rStq+YTVfb2/h1VMaLsoFT8iO2+m9Ce79BH975vNUdEMgCenfXCmPC4kqRhFFiVBhTra9Sq6AkCHGeH43eqS0+g1eV2s13Vg4V4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718774; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0S5rSsMuMAe5Af//GBkj7gzRXALvTh+gUhOFh/bH7bk=; b=DpgIFS0nhgGTYFP2yxtPZyWqnEY/zpoc/IZ6wQTFxHX+uQD4HqzU9tMJneEJY/akmueh7zusf4wNaKK9cTYr4X4zhyXkXBUOTUDAhDYOlY1eifa6NXwOfS36Cjfj/SkqlLuZC2cJDc/R8Nwg3g9gYWCwJDAX8HK9+MIPZPqY4fU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718774146881.3859703168914; Fri, 15 Jan 2021 05:52:54 -0800 (PST) Received: from localhost ([::1]:38236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PWv-0007Ez-8z for importer@patchew.org; Fri, 15 Jan 2021 08:52:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3I-0006tU-By for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003In-3b for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:08 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-342-sV_VM0boNCG4-lf4n_HDbA-1; Fri, 15 Jan 2021 08:21:53 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 011DA180A0A1; Fri, 15 Jan 2021 13:21:53 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FBD46F991; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 80814180063E; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0S5rSsMuMAe5Af//GBkj7gzRXALvTh+gUhOFh/bH7bk=; b=F8zjzdsZX72SPBgdHaaPs0W1eI27beQMXad+BekL5GaIEKN0CRLsWRgOqODLME8jMigB8L /YLtkwJyBUKX9cL2hkJuauJvS2jcsQcz16LJaYTZCKGdlwwTxGnlgQr+hulAvbsv1Ym1zC HZEtsgw5sT+tjYQWHd0cE3fdtlc6xbo= X-MC-Unique: sV_VM0boNCG4-lf4n_HDbA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 08/30] audio: split pcm_ops function get_buffer_in Date: Fri, 15 Jan 2021 14:21:24 +0100 Message-Id: <20210115132146.1443592-9-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Split off pcm_ops function run_buffer_in from get_buffer_in and call run_buffer_in before get_buffer_in. The next patch only needs the generic buffer management part from audio_generic_get_buffer_in(). Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-8-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/audio_int.h | 2 ++ audio/alsaaudio.c | 1 + audio/audio.c | 18 ++++++++++++++---- audio/jackaudio.c | 1 + audio/noaudio.c | 1 + audio/ossaudio.c | 1 + audio/spiceaudio.c | 1 + 7 files changed, 21 insertions(+), 4 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index 4775857bf245..06f0913835b0 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -172,12 +172,14 @@ struct audio_pcm_ops { int (*init_in) (HWVoiceIn *hw, audsettings *as, void *drv_opaque); void (*fini_in) (HWVoiceIn *hw); size_t (*read) (HWVoiceIn *hw, void *buf, size_t size); + void (*run_buffer_in)(HWVoiceIn *hw); void *(*get_buffer_in)(HWVoiceIn *hw, size_t *size); void (*put_buffer_in)(HWVoiceIn *hw, void *buf, size_t size); void (*enable_in)(HWVoiceIn *hw, bool enable); void (*volume_in)(HWVoiceIn *hw, Volume *vol); }; =20 +void audio_generic_run_buffer_in(HWVoiceIn *hw); void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size); void audio_generic_put_buffer_in(HWVoiceIn *hw, void *buf, size_t size); void audio_generic_run_buffer_out(HWVoiceOut *hw); diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 6787e91bc198..5a871aaf6b48 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -929,6 +929,7 @@ static struct audio_pcm_ops alsa_pcm_ops =3D { .init_in =3D alsa_init_in, .fini_in =3D alsa_fini_in, .read =3D alsa_read, + .run_buffer_in =3D audio_generic_run_buffer_in, .enable_in =3D alsa_enable_in, }; =20 diff --git a/audio/audio.c b/audio/audio.c index d048d262835e..480b3cce1ffb 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1241,6 +1241,10 @@ static size_t audio_pcm_hw_run_in(HWVoiceIn *hw, siz= e_t samples) size_t conv =3D 0; STSampleBuffer *conv_buf =3D hw->conv_buf; =20 + if (hw->pcm_ops->run_buffer_in) { + hw->pcm_ops->run_buffer_in(hw); + } + while (samples) { size_t proc; size_t size =3D samples * hw->info.bytes_per_frame; @@ -1381,10 +1385,8 @@ void audio_run(AudioState *s, const char *msg) #endif } =20 -void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size) +void audio_generic_run_buffer_in(HWVoiceIn *hw) { - ssize_t start; - if (unlikely(!hw->buf_emul)) { size_t calc_size =3D hw->conv_buf->size * hw->info.bytes_per_frame; hw->buf_emul =3D g_malloc(calc_size); @@ -1403,8 +1405,12 @@ void *audio_generic_get_buffer_in(HWVoiceIn *hw, siz= e_t *size) break; } } +} + +void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size) +{ + ssize_t start =3D (ssize_t)hw->pos_emul - hw->pending_emul; =20 - start =3D ((ssize_t) hw->pos_emul) - hw->pending_emul; if (start < 0) { start +=3D hw->size_emul; } @@ -1505,6 +1511,10 @@ size_t audio_generic_read(HWVoiceIn *hw, void *buf, = size_t size) { size_t total =3D 0; =20 + if (hw->pcm_ops->run_buffer_in) { + hw->pcm_ops->run_buffer_in(hw); + } + while (total < size) { size_t src_size =3D size - total; void *src =3D hw->pcm_ops->get_buffer_in(hw, &src_size); diff --git a/audio/jackaudio.c b/audio/jackaudio.c index 3b7c18443dbe..f8afb5cc318c 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -657,6 +657,7 @@ static struct audio_pcm_ops jack_pcm_ops =3D { .init_in =3D qjack_init_in, .fini_in =3D qjack_fini_in, .read =3D qjack_read, + .run_buffer_in =3D audio_generic_run_buffer_in, .enable_in =3D qjack_enable_in }; =20 diff --git a/audio/noaudio.c b/audio/noaudio.c index 05798ea21032..aac87dbc93fb 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -124,6 +124,7 @@ static struct audio_pcm_ops no_pcm_ops =3D { .init_in =3D no_init_in, .fini_in =3D no_fini_in, .read =3D no_read, + .run_buffer_in =3D audio_generic_run_buffer_in, .enable_in =3D no_enable_in }; =20 diff --git a/audio/ossaudio.c b/audio/ossaudio.c index a7dcaa31adeb..c1db89f23300 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -762,6 +762,7 @@ static struct audio_pcm_ops oss_pcm_ops =3D { .init_in =3D oss_init_in, .fini_in =3D oss_fini_in, .read =3D oss_read, + .run_buffer_in =3D audio_generic_run_buffer_in, .enable_in =3D oss_enable_in }; =20 diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 8967cca12925..999bfbde47c5 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -293,6 +293,7 @@ static struct audio_pcm_ops audio_callbacks =3D { .init_in =3D line_in_init, .fini_in =3D line_in_fini, .read =3D line_in_read, + .run_buffer_in =3D audio_generic_run_buffer_in, .enable_in =3D line_in_enable, #if ((SPICE_INTERFACE_RECORD_MAJOR >=3D 2) && (SPICE_INTERFACE_RECORD_MINO= R >=3D 2)) .volume_in =3D line_in_volume, --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610717760; cv=none; d=zohomail.com; s=zohoarc; b=bwi0P3k7NyRUI2edVZtioood5U8bmLYif0B+vYcpKhEgx/qdkFIxfy+TWY2BBTpF1CkVvpHnsZQkATiOaB9oqVWa2r3D2LqNpobLBPvprJ4D05Rp5VeIhU1w6WUb0Ds8TrxrhAdXajtssvwYnHg7CW8sNC6Y/V3xDKnjwTbNMAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610717760; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fsy0pg4y6bLGVzgqVrfaDRt23dgks7Zl0JvVvVOxET8=; b=gWZz3/nrI47XAxZWRSmU1D+ck+QCGoejkVRn14jI4GqKJ9XAXX823JZFtyRte24k7kNi/5lP1trHQWLVYRSg/dRof02glbEyvE40C+dJjvcicGLZBIJt8sSMeyvDkZeBQOLB5VeNWoAjDg/3KoNbSsYTBFK//RyfFa1JA6LML3o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16107177608601011.247025335788; Fri, 15 Jan 2021 05:36:00 -0800 (PST) Received: from localhost ([::1]:44998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PGh-0002vj-LS for importer@patchew.org; Fri, 15 Jan 2021 08:35:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3M-00074z-W5 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003Ir-8V for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-177-Wd-DqByZPWGCVlT7B5s9Dg-1; Fri, 15 Jan 2021 08:21:54 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0910B180A0A2; Fri, 15 Jan 2021 13:21:53 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9128A5D761; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8C1B4180063F; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fsy0pg4y6bLGVzgqVrfaDRt23dgks7Zl0JvVvVOxET8=; b=TLOSRJxnhVfUMJJP9zQY6z1Z4sK/x4c+/GnNJ3T70EhhJPwa2p1ayaXo5P4Cut+Wucl4QJ bWXj8BQLmF6IjjoHTjas+i6cxshMIGBJlAtMAodwDXkHMU7Q+aXQsj9XyAVBb8f0rUuPL/ 8uLpZvta7bK3hiIjrrR/19hH3Afml5g= X-MC-Unique: Wd-DqByZPWGCVlT7B5s9Dg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 09/30] sdlaudio: add recording functions Date: Fri, 15 Jan 2021 14:21:25 +0100 Message-Id: <20210115132146.1443592-10-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Add audio recording functions. SDL 2.0.5 or later is required to use the recording functions. Playback continues to work with earlier SDL 2.0 versions. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-9-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/sdlaudio.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 3 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 47968c502027..445cae8de578 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -47,6 +47,14 @@ typedef struct SDLVoiceOut { SDL_AudioDeviceID devid; } SDLVoiceOut; =20 +typedef struct SDLVoiceIn { + HWVoiceIn hw; + int exit; + int initialized; + Audiodev *dev; + SDL_AudioDeviceID devid; +} SDLVoiceIn; + static void GCC_FMT_ATTR (1, 2) sdl_logerr (const char *fmt, ...) { va_list ap; @@ -240,6 +248,45 @@ static void sdl_callback_out(void *opaque, Uint8 *buf,= int len) } } =20 +static void sdl_close_in(SDLVoiceIn *sdl) +{ + if (sdl->initialized) { + SDL_LockAudioDevice(sdl->devid); + sdl->exit =3D 1; + SDL_UnlockAudioDevice(sdl->devid); + SDL_PauseAudioDevice(sdl->devid, 1); + sdl->initialized =3D 0; + } + if (sdl->devid) { + SDL_CloseAudioDevice(sdl->devid); + sdl->devid =3D 0; + } +} + +static void sdl_callback_in(void *opaque, Uint8 *buf, int len) +{ + SDLVoiceIn *sdl =3D opaque; + HWVoiceIn *hw =3D &sdl->hw; + + if (sdl->exit) { + return; + } + + /* dolog("callback_in: len=3D%d pending=3D%zu\n", len, hw->pending_emu= l); */ + + while (hw->pending_emul < hw->size_emul && len) { + size_t read_len =3D MIN(len, MIN(hw->size_emul - hw->pos_emul, + hw->size_emul - hw->pending_emul)); + + memcpy(hw->buf_emul + hw->pos_emul, buf, read_len); + + hw->pending_emul +=3D read_len; + hw->pos_emul =3D (hw->pos_emul + read_len) % hw->size_emul; + len -=3D read_len; + buf +=3D read_len; + } +} + #define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args, dir) \ static ret_type glue(sdl_, name)args_decl \ { \ @@ -253,13 +300,30 @@ static void sdl_callback_out(void *opaque, Uint8 *buf= , int len) return ret; \ } =20 +#define SDL_WRAPPER_VOID_FUNC(name, args_decl, args, dir) \ + static void glue(sdl_, name)args_decl \ + { \ + glue(SDLVoice, dir) *sdl =3D (glue(SDLVoice, dir) *)hw; \ + \ + SDL_LockAudioDevice(sdl->devid); \ + glue(audio_generic_, name)args; \ + SDL_UnlockAudioDevice(sdl->devid); \ + } + SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size), (hw, size), Out) SDL_WRAPPER_FUNC(put_buffer_out, size_t, (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size)= , Out) SDL_WRAPPER_FUNC(write, size_t, (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size)= , Out) +SDL_WRAPPER_FUNC(read, size_t, (HWVoiceIn *hw, void *buf, size_t size), + (hw, buf, size), In) +SDL_WRAPPER_FUNC(get_buffer_in, void *, (HWVoiceIn *hw, size_t *size), + (hw, size), In) +SDL_WRAPPER_VOID_FUNC(put_buffer_in, (HWVoiceIn *hw, void *buf, size_t siz= e), + (hw, buf, size), In) #undef SDL_WRAPPER_FUNC +#undef SDL_WRAPPER_VOID_FUNC =20 static void sdl_fini_out(HWVoiceOut *hw) { @@ -325,6 +389,69 @@ static void sdl_enable_out(HWVoiceOut *hw, bool enable) SDL_PauseAudioDevice(sdl->devid, !enable); } =20 +static void sdl_fini_in(HWVoiceIn *hw) +{ + SDLVoiceIn *sdl =3D (SDLVoiceIn *)hw; + + sdl_close_in(sdl); +} + +static int sdl_init_in(HWVoiceIn *hw, audsettings *as, void *drv_opaque) +{ + SDLVoiceIn *sdl =3D (SDLVoiceIn *)hw; + SDL_AudioSpec req, obt; + int endianness; + int err; + AudioFormat effective_fmt; + Audiodev *dev =3D drv_opaque; + AudiodevSdlPerDirectionOptions *spdo =3D dev->u.sdl.in; + struct audsettings obt_as; + + req.freq =3D as->freq; + req.format =3D aud_to_sdlfmt(as->fmt); + req.channels =3D as->nchannels; + /* SDL samples are QEMU frames */ + req.samples =3D audio_buffer_frames( + qapi_AudiodevSdlPerDirectionOptions_base(spdo), as, 11610); + req.callback =3D sdl_callback_in; + req.userdata =3D sdl; + + sdl->dev =3D dev; + sdl->devid =3D sdl_open(&req, &obt, 1); + if (!sdl->devid) { + return -1; + } + + err =3D sdl_to_audfmt(obt.format, &effective_fmt, &endianness); + if (err) { + sdl_close_in(sdl); + return -1; + } + + obt_as.freq =3D obt.freq; + obt_as.nchannels =3D obt.channels; + obt_as.fmt =3D effective_fmt; + obt_as.endianness =3D endianness; + + audio_pcm_init_info(&hw->info, &obt_as); + hw->samples =3D (spdo->has_buffer_count ? spdo->buffer_count : 4) * + obt.samples; + hw->size_emul =3D hw->samples * hw->info.bytes_per_frame; + hw->buf_emul =3D g_malloc(hw->size_emul); + hw->pos_emul =3D hw->pending_emul =3D 0; + + sdl->initialized =3D 1; + sdl->exit =3D 0; + return 0; +} + +static void sdl_enable_in(HWVoiceIn *hw, bool enable) +{ + SDLVoiceIn *sdl =3D (SDLVoiceIn *)hw; + + SDL_PauseAudioDevice(sdl->devid, !enable); +} + static void *sdl_audio_init(Audiodev *dev) { if (SDL_InitSubSystem (SDL_INIT_AUDIO)) { @@ -350,6 +477,15 @@ static struct audio_pcm_ops sdl_pcm_ops =3D { /* wrapper for audio_generic_put_buffer_out */ .put_buffer_out =3D sdl_put_buffer_out, .enable_out =3D sdl_enable_out, + .init_in =3D sdl_init_in, + .fini_in =3D sdl_fini_in, + /* wrapper for audio_generic_read */ + .read =3D sdl_read, + /* wrapper for audio_generic_get_buffer_in */ + .get_buffer_in =3D sdl_get_buffer_in, + /* wrapper for audio_generic_put_buffer_in */ + .put_buffer_in =3D sdl_put_buffer_in, + .enable_in =3D sdl_enable_in, }; =20 static struct audio_driver sdl_audio_driver =3D { @@ -360,9 +496,9 @@ static struct audio_driver sdl_audio_driver =3D { .pcm_ops =3D &sdl_pcm_ops, .can_be_default =3D 1, .max_voices_out =3D 1, - .max_voices_in =3D 0, - .voice_size_out =3D sizeof (SDLVoiceOut), - .voice_size_in =3D 0 + .max_voices_in =3D 1, + .voice_size_out =3D sizeof(SDLVoiceOut), + .voice_size_in =3D sizeof(SDLVoiceIn), }; =20 static void register_audio_sdl(void) --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610717374; cv=none; d=zohomail.com; s=zohoarc; b=Gxb2vxDaeymaqZYMsvKd88DSQpipyJHjAI4tcrzDcMS/WJy1NQg7xUj++f4fPuqq1EfUcT9kh/f7fYoiCVb/biADmt4Cocr7iBxKq3syluZHmzG0EH2nxMqUMt2eXAVrIlfcmTHDKd4dtP9IfKzXIlqzIGjzc0r7AVL3f0Ggyks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610717374; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AnAXyOZxzryLO3jXO6hO3fVMwALA3DXq8z0PDBwf4Xs=; b=IOjP62rK1G+5JxWMBuehhXAa5vXjnSlN6JDY2rfiXMVSnPrws5oKr+VOGS1cFld604eqGs80MSjB8BionR0tVjThqZ1UL3VI6c+mG+x88SCYNcusycUk1a+R+EhiBDlc0YVI+lE1I8DGJzuuYSJVwtxwAiRd2dX8Lu8xr2Bizcw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610717374512518.0506453928065; Fri, 15 Jan 2021 05:29:34 -0800 (PST) Received: from localhost ([::1]:57104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PAT-0004ZV-AS for importer@patchew.org; Fri, 15 Jan 2021 08:29:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3I-0006uI-KO for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28385) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003Ij-6n for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:08 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-514-qXXFRQxtNWqQsnAGA5Jt2g-1; Fri, 15 Jan 2021 08:21:53 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC4A1806663; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83F676F7EF; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 967351800D40; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AnAXyOZxzryLO3jXO6hO3fVMwALA3DXq8z0PDBwf4Xs=; b=EFesPQFHTI29UwHoM6AjVKXO7tvqir/9JMPHUhyfuCqLjJsppcjGYzxTZfQj1QirpACIln LRcIImzJX/CB89nXh55/YWQLcuqswF6Bqpr5eTKSbtAzKn2pF6WzPHRCuxTG9S+s7rKsde miGsh1edkJ/hNbUFcvqTT8Qx12isPNk= X-MC-Unique: qXXFRQxtNWqQsnAGA5Jt2g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 10/30] audio: break generic buffer dependency on mixing-engine Date: Fri, 15 Jan 2021 14:21:26 +0100 Message-Id: <20210115132146.1443592-11-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Break the unnecessary dependency of the generic buffer management code on mixing-engine. This is required for the next patch. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-10-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/audio.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 480b3cce1ffb..22d769db0c99 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1388,9 +1388,8 @@ void audio_run(AudioState *s, const char *msg) void audio_generic_run_buffer_in(HWVoiceIn *hw) { if (unlikely(!hw->buf_emul)) { - size_t calc_size =3D hw->conv_buf->size * hw->info.bytes_per_frame; - hw->buf_emul =3D g_malloc(calc_size); - hw->size_emul =3D calc_size; + hw->size_emul =3D hw->samples * hw->info.bytes_per_frame; + hw->buf_emul =3D g_malloc(hw->size_emul); hw->pos_emul =3D hw->pending_emul =3D 0; } =20 @@ -1452,10 +1451,8 @@ void audio_generic_run_buffer_out(HWVoiceOut *hw) void *audio_generic_get_buffer_out(HWVoiceOut *hw, size_t *size) { if (unlikely(!hw->buf_emul)) { - size_t calc_size =3D hw->mix_buf->size * hw->info.bytes_per_frame; - - hw->buf_emul =3D g_malloc(calc_size); - hw->size_emul =3D calc_size; + hw->size_emul =3D hw->samples * hw->info.bytes_per_frame; + hw->buf_emul =3D g_malloc(hw->size_emul); hw->pos_emul =3D hw->pending_emul =3D 0; } =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610719057; cv=none; d=zohomail.com; s=zohoarc; b=aCFc6MCeQyEDBvYWjT9djgHPURKJ7kcm7uUObHw9GIZsXzXX9/2VgR1zAAh6wf6Xh3ERIQVKoelAPfxWkjmQeX83cYKjEbpWZuecn3LAkgDimstY5vDa/82HWfC4pdxb9CqTqInoZmUFKZ0noUeHRSWandjEkjLwkp0vdqcrsTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610719057; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IcYGpixJsOdNXA7cGNh8k3hPWJdlHtoXcTQ2oq2ff/8=; b=Sr2s554OKFrQDOtRf1E5ACxpjnhS3m7c1gu46dI0UYkpXIQYPh/kCY13Hz+uBLwzqIXdQBCFymfvjTOunyC5RDW3lJU70EzovDkoLPniRALLTeJVtuoXt3KTzERTwjXsW5VKigTE48uUAtLhcFjxa2VVLd4G5/eAUymsiqpgFmE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161071905740098.24140386938643; Fri, 15 Jan 2021 05:57:37 -0800 (PST) Received: from localhost ([::1]:55360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Pbc-0005uo-Ay for importer@patchew.org; Fri, 15 Jan 2021 08:57:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3J-0006xN-Nw for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:48910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003Ih-6s for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-330-TypLu9H4OSORI3sXNzL7uQ-1; Fri, 15 Jan 2021 08:21:53 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1CAE180A09B; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 926FE6F7F3; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A0ACB1800D45; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IcYGpixJsOdNXA7cGNh8k3hPWJdlHtoXcTQ2oq2ff/8=; b=hTauWUnkpIBHOkTjIyWeqlDE0w1ddzYO/QYgpn6DzzLdhUKI/uyftlHZGqMFkQ4Sn3Y5je RJImA7PX9BUHBcYAaWMEZaTaQHzeA3+1dQ1Sx+/VP7U1UdCFux0Zd++W9VBTpZqsANodq1 2AEkKbpnWL6KWP2k1M9OPQ7/m8M5Joc= X-MC-Unique: TypLu9H4OSORI3sXNzL7uQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 11/30] sdlaudio: enable (in|out).mixing-engine=off Date: Fri, 15 Jan 2021 14:21:27 +0100 Message-Id: <20210115132146.1443592-12-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Enable the SDL2 backend options -audiodev sdl,out.mixing- engine=3Doff,in.mixing-engine=3Doff. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-11-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/sdlaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index 445cae8de578..c68c62a3e4f1 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -495,8 +495,8 @@ static struct audio_driver sdl_audio_driver =3D { .fini =3D sdl_audio_fini, .pcm_ops =3D &sdl_pcm_ops, .can_be_default =3D 1, - .max_voices_out =3D 1, - .max_voices_in =3D 1, + .max_voices_out =3D INT_MAX, + .max_voices_in =3D INT_MAX, .voice_size_out =3D sizeof(SDLVoiceOut), .voice_size_in =3D sizeof(SDLVoiceIn), }; --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718850; cv=none; d=zohomail.com; s=zohoarc; b=nHMTNTYTyMzHSC0KOiqDwVOx/dDO+donsC3LzAnHjPiYmmh2PYbGORdx3wwXf7F1JBqQVbpW7eq4mBH7LSdkOX2DubIapqzRixXf196Xb6uzOAv+G88O/7XeEa1AxjoQQhZq89NMIJgth1Rd+bN4wiDur2Nqjugwd509EO/bbU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718850; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=In8PUGOOa/IGTluhAQ9CWs/0bnDy0RkHyhU9+DnYd6g=; b=GulIS6obDogvVQntXKvBPFi6d0DVHGhsDA9KvD8+8WHzWrK7thnh0V4sGebgNfRgQmGNGThyor2+mH9x6NRfk3/VuVFs0yukBWS7eSCHOeanV1VSyy/UJma4h3K2R59fAgou4c+JPcYyjRU+UCtVZs9r6b1CFIBuVSSX0AQk+mI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718850660291.7216883515407; Fri, 15 Jan 2021 05:54:10 -0800 (PST) Received: from localhost ([::1]:45840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PYH-0001tE-IH for importer@patchew.org; Fri, 15 Jan 2021 08:54:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3L-00071W-KL for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003JI-8A for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-297-Cm4Tkn3XMcmGx-U26vEqbA-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 929A7100F340; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85E7310027A5; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AB6A21800D47; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=In8PUGOOa/IGTluhAQ9CWs/0bnDy0RkHyhU9+DnYd6g=; b=FoROWvnlU2DzHny8d4QoN9RJCvGFWQwOEB7G4QK39elL4tpd93/dGUMG3efE0ATib3jIF2 ejzz+l1O1AiD6suEjTWh5fhOSj4p4OtL7z1OVE3Zt0xDmr0Eg2mwSl6eaUTkgaG1/opOPm DD6lxr2EWDlg8pbhOsyC8nSe2hl4j2g= X-MC-Unique: Cm4Tkn3XMcmGx-U26vEqbA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 12/30] audio: remove remaining unused plive code Date: Fri, 15 Jan 2021 14:21:28 +0100 Message-Id: <20210115132146.1443592-13-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Commit 73ad33ef7b "audio: remove plive" forgot to remove this code. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-12-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/audio.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 22d769db0c99..34c9cb918279 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1132,7 +1132,7 @@ static void audio_run_out (AudioState *s) =20 while ((hw =3D audio_pcm_hw_find_any_enabled_out(s, hw))) { size_t played, live, prev_rpos, free; - int nb_live, cleanup_required; + int nb_live; =20 live =3D audio_pcm_hw_get_live_out (hw, &nb_live); if (!nb_live) { @@ -1194,7 +1194,6 @@ static void audio_run_out (AudioState *s) audio_capture_mix_and_clear (hw, prev_rpos, played); } =20 - cleanup_required =3D 0; for (sw =3D hw->sw_head.lh_first; sw; sw =3D sw->entries.le_next) { if (!sw->active && sw->empty) { continue; @@ -1210,7 +1209,6 @@ static void audio_run_out (AudioState *s) =20 if (!sw->total_hw_samples_mixed) { sw->empty =3D 1; - cleanup_required |=3D !sw->active && !sw->callback.fn; } =20 if (sw->active) { @@ -1220,19 +1218,6 @@ static void audio_run_out (AudioState *s) } } } - - if (cleanup_required) { - SWVoiceOut *sw1; - - sw =3D hw->sw_head.lh_first; - while (sw) { - sw1 =3D sw->entries.le_next; - if (!sw->active && !sw->callback.fn) { - audio_close_out (sw); - } - sw =3D sw1; - } - } } } =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610719276; cv=none; d=zohomail.com; s=zohoarc; b=be5V6T6AuuNLLvE7NF4XdI+/UvphJIvwiEnhic4YyxgEPDr9uzRFZEOkluZxIdK7K/xWSkoWr+t+awvnrZf1ZUpjcK3/M0cK2AEkHEvVGqjsEa1UJtfkt8Jwk93vElqViuokVNTFjY+lBnRT7paNXEYnMDYBx/KrEASB4ih3rwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610719276; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t79JUn/Rxh8U+UErYcQu+ddL2SReo82Gt9CWPZf2H0k=; b=f5ld55IGlZ+35EtKPjeX/TEDzX7+xRY+aRMRcuN83DCrhgZC/NrrMDy8qSBd5SCrTQTiynqS3lB7eczbweQ659Fa6QlxxCS2BkWxucRtjHfY5VjXc05Tg76+p2+hU1SSXaBQ6NeS2M8b2gj3Np4sUoLKAV6JF9pnGYqTAMVcmWo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610719276716721.1545590478585; Fri, 15 Jan 2021 06:01:16 -0800 (PST) Received: from localhost ([::1]:34760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Pf8-0000gu-FL for importer@patchew.org; Fri, 15 Jan 2021 09:01:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3N-00075U-6t for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003Je-Dk for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-55-dEJtPyorPFOQJckPuzwh8w-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7BAF8030A8; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A136819C71; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B81221800D48; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t79JUn/Rxh8U+UErYcQu+ddL2SReo82Gt9CWPZf2H0k=; b=GQm12liNY2mBD8F+fWYouYK/yyPbdk1AX2Xvp3xSniD1kIglv56G+GGwwvMwhxNUgoDpcQ muW9ClC/jU5HK4S6ZKGNqWUEVAz2an8ZP/0afK4VWlPxs8ZFUCnyG9N7O33WgCiHhE3D9m /hRDYJED6YF1efbmlOCIxWlcSJeW0Kk= X-MC-Unique: dEJtPyorPFOQJckPuzwh8w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 13/30] paaudio: avoid to clip samples multiple times Date: Fri, 15 Jan 2021 14:21:29 +0100 Message-Id: <20210115132146.1443592-14-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin The pulseaudio backend currently converts, clips and copies audio playback samples in the mixing-engine sample buffer multiple times. In qpa_get_buffer_out() the function pa_stream_begin_write() returns a rather large buffer and this allows audio_pcm_hw_run_out() in audio/audio.c to copy all samples in the mixing-engine buffer to the pulse audio buffer. Immediately after copying, qpa_write() notices with a call to pa_stream_writable_size() that pulse audio only needs a smaller part of the copied samples and ignores the rest. This copy and ignore process happens several times for each audio sample. To fix this behaviour, call pa_stream_writable_size() in qpa_get_buffer_out() to limit the number of samples audio_pcm_hw_run_out() will convert. With this change the pulseaudio pcm_ops functions put_buffer_out and write are no longer identical and a separate qpa_put_buffer_out is needed. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-13-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index b05208469831..229bcfcae838 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -207,6 +207,7 @@ static void *qpa_get_buffer_out(HWVoiceOut *hw, size_t = *size) PAVoiceOut *p =3D (PAVoiceOut *) hw; PAConnection *c =3D p->g->conn; void *ret; + size_t l; int r; =20 pa_threaded_mainloop_lock(c->mainloop); @@ -214,12 +215,19 @@ static void *qpa_get_buffer_out(HWVoiceOut *hw, size_= t *size) CHECK_DEAD_GOTO(c, p->stream, unlock_and_fail, "pa_threaded_mainloop_lock failed\n"); =20 + l =3D pa_stream_writable_size(p->stream); + CHECK_SUCCESS_GOTO(c, l !=3D (size_t) -1, unlock_and_fail, + "pa_stream_writable_size failed\n"); + *size =3D -1; r =3D pa_stream_begin_write(p->stream, &ret, size); CHECK_SUCCESS_GOTO(c, r >=3D 0, unlock_and_fail, "pa_stream_begin_write failed\n"); =20 pa_threaded_mainloop_unlock(c->mainloop); + if (*size > l) { + *size =3D l; + } return ret; =20 unlock_and_fail: @@ -228,6 +236,28 @@ unlock_and_fail: return NULL; } =20 +static size_t qpa_put_buffer_out(HWVoiceOut *hw, void *data, size_t length) +{ + PAVoiceOut *p =3D (PAVoiceOut *)hw; + PAConnection *c =3D p->g->conn; + int r; + + pa_threaded_mainloop_lock(c->mainloop); + + CHECK_DEAD_GOTO(c, p->stream, unlock_and_fail, + "pa_threaded_mainloop_lock failed\n"); + + r =3D pa_stream_write(p->stream, data, length, NULL, 0LL, PA_SEEK_RELA= TIVE); + CHECK_SUCCESS_GOTO(c, r >=3D 0, unlock_and_fail, "pa_stream_write fail= ed\n"); + + pa_threaded_mainloop_unlock(c->mainloop); + return length; + +unlock_and_fail: + pa_threaded_mainloop_unlock(c->mainloop); + return 0; +} + static size_t qpa_write(HWVoiceOut *hw, void *data, size_t length) { PAVoiceOut *p =3D (PAVoiceOut *) hw; @@ -861,7 +891,7 @@ static struct audio_pcm_ops qpa_pcm_ops =3D { .fini_out =3D qpa_fini_out, .write =3D qpa_write, .get_buffer_out =3D qpa_get_buffer_out, - .put_buffer_out =3D qpa_write, /* pa handles it */ + .put_buffer_out =3D qpa_put_buffer_out, .volume_out =3D qpa_volume_out, =20 .init_in =3D qpa_init_in, --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610719679; cv=none; d=zohomail.com; s=zohoarc; b=PO3JGD8+a2KONW+/cBhbSoVz/4otsAPNLiVJ0/VwEqo6J1RQLWBwUP1ahKpwJ+mCmlpTskiKNNSwuGTu2Y/wKfMIJhnOTzzX9agoNepbD06s3X+m82puiVzrIZTyAie2YLy6zWku3D3n+nOTPGLVBqRli5KIVMNHYfMwJ8kbqc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610719679; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4qlwhf25t/fMbWfP7mPYJ4QN5+k3A61Ud3sPas/O3NY=; b=VqNXmH55pCOhlAeBBtPeYtXa2aC8XxATxfRl/rRHfUGV6vPaKsRgbj5nVTa7V5nqF/xc25VQOmWX+ASezJ6ce7g1Mdv3ehsYX6NMO0535v3oiS9MHuhG9rxCeDEhgZ2YifVkQ2mtdLQQ6SdiP1mmNalDfYHnOYRs5r+XOhidyHo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610719679805785.6261394237494; Fri, 15 Jan 2021 06:07:59 -0800 (PST) Received: from localhost ([::1]:51846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Ple-0007yh-IQ for importer@patchew.org; Fri, 15 Jan 2021 09:07:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3Y-0007DH-2w for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36942) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003Jq-Uu for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:23 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-564--qHi3oJWNG6SZ0Fnl2DCJw-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F6FF806662; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A41E11002C11; Fri, 15 Jan 2021 13:21:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C27751800D49; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4qlwhf25t/fMbWfP7mPYJ4QN5+k3A61Ud3sPas/O3NY=; b=aWfnqQVJi4A/IV/laCnem9A7CxM4+zlg6rurjMKJDgHoiumR7sgXpglEZGF5PlCu/fYTgJ ka4B93VZauC8vkGdhrrqrLRsn8SDnjgToA2/fb+a4A7hG3N8eLyzWGj1DjVnuthmyVqFix C4hU2EtpK/vFIQhvWtQh6Edod6CPv60= X-MC-Unique: -qHi3oJWNG6SZ0Fnl2DCJw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 14/30] paaudio: wait for PA_STREAM_READY in qpa_write() Date: Fri, 15 Jan 2021 14:21:30 +0100 Message-Id: <20210115132146.1443592-15-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Don't call pa_stream_writable_size() in qpa_write() before the playback stream is ready. This prevents a lot of the following pulseaudio error messages. pulseaudio: pa_stream_writable_size failed pulseaudio: Reason: Bad state To reproduce start qemu with -parallel none -device gus,audiodev=3Daudio0 -audiodev pa,id=3Daudio0,out.mixing-engine=3Doff Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-14-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/audio/paaudio.c b/audio/paaudio.c index 229bcfcae838..1a7252b16d6d 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -269,6 +269,11 @@ static size_t qpa_write(HWVoiceOut *hw, void *data, si= ze_t length) =20 CHECK_DEAD_GOTO(c, p->stream, unlock_and_fail, "pa_threaded_mainloop_lock failed\n"); + if (pa_stream_get_state(p->stream) !=3D PA_STREAM_READY) { + /* wait for stream to become ready */ + l =3D 0; + goto unlock; + } =20 l =3D pa_stream_writable_size(p->stream); =20 @@ -282,6 +287,7 @@ static size_t qpa_write(HWVoiceOut *hw, void *data, siz= e_t length) r =3D pa_stream_write(p->stream, data, l, NULL, 0LL, PA_SEEK_RELATIVE); CHECK_SUCCESS_GOTO(c, r >=3D 0, unlock_and_fail, "pa_stream_write fail= ed\n"); =20 +unlock: pa_threaded_mainloop_unlock(c->mainloop); return l; =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718225; cv=none; d=zohomail.com; s=zohoarc; b=ZsdY05OPltPKZF82NiUP3JgsTevB+kIWT2Zfk3TF+ykmCUYOBCKEG9MtHrr9H/RWUOAacS0sspkVvoSISA7QvvBNjwyUrqLsPUl+qfAFJYDDCnYZKgBC7CmE0hSFRGbYk1nuGbiSOc8Vm5pTvjhnRxlN78THXPOY+dgS07NrYNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718225; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TApp/TW9A8Q/k+BT23bohUT6cwsF5KUnbdWpHkQojt8=; b=JANsK3hNgCMTvafIoz1GXEkAZeIuO3gXKdljKo9WlfABRDINax7ugOheBslk8+Ysc162YX+heQqH+PD7jk9dLRr2sDtrz+GePaJg/9+FfZwrTUWil+GhAO1FpWxAGRmkmU0GGvpVOceTq6M5QTX8WPTS4UnI3D7ffBUaNXsla0g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718225990694.3143428657756; Fri, 15 Jan 2021 05:43:45 -0800 (PST) Received: from localhost ([::1]:39654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0POC-00044s-On for importer@patchew.org; Fri, 15 Jan 2021 08:43:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3L-000722-Rk for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54541) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003J3-8T for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-PlAYcvxCPkOsOnoO6kIHiQ-1; Fri, 15 Jan 2021 08:21:55 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6CE3A107ACF8; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 341006F818; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CCCE11800D4A; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TApp/TW9A8Q/k+BT23bohUT6cwsF5KUnbdWpHkQojt8=; b=E+Bsi7pDqb9x7iAfc8nj3Yx/ue7xSrljRL06IqN7OLpDvglEqv5Oay2oa9BZs0m2/RhD4m v+tbzaa+r7pYeA+0XmFpxlEgxLsIR9KPv6IUj5wmkp1qRS5zb/kiAsEzu/eAxvo8hV6vzR f0ft/mrTqsWpBrBMwPjeP0i0ss2yzW0= X-MC-Unique: PlAYcvxCPkOsOnoO6kIHiQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 15/30] paaudio: wait until the playback stream is ready Date: Fri, 15 Jan 2021 14:21:31 +0100 Message-Id: <20210115132146.1443592-16-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Don't call pa_stream_writable_size() in qpa_get_buffer_out() before the playback stream is ready. This prevents a lot of the following pulseaudio error messages. pulseaudio: pa_stream_writable_size failed pulseaudio: Reason: Bad state To reproduce start qemu with -parallel none -device gus,audiodev=3Daudio0 -audiodev pa,id=3Daudio0 Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-15-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/audio/paaudio.c b/audio/paaudio.c index 1a7252b16d6d..4a1ffda753d5 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -214,6 +214,12 @@ static void *qpa_get_buffer_out(HWVoiceOut *hw, size_t= *size) =20 CHECK_DEAD_GOTO(c, p->stream, unlock_and_fail, "pa_threaded_mainloop_lock failed\n"); + if (pa_stream_get_state(p->stream) !=3D PA_STREAM_READY) { + /* wait for stream to become ready */ + l =3D 0; + ret =3D NULL; + goto unlock; + } =20 l =3D pa_stream_writable_size(p->stream); CHECK_SUCCESS_GOTO(c, l !=3D (size_t) -1, unlock_and_fail, @@ -224,6 +230,7 @@ static void *qpa_get_buffer_out(HWVoiceOut *hw, size_t = *size) CHECK_SUCCESS_GOTO(c, r >=3D 0, unlock_and_fail, "pa_stream_begin_write failed\n"); =20 +unlock: pa_threaded_mainloop_unlock(c->mainloop); if (*size > l) { *size =3D l; --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718396; cv=none; d=zohomail.com; s=zohoarc; b=MLIjLOelatTyo0ZkaurHG8OZFwAz7nYLy+PSjh2WPVWvlm0ouRDH1+GK3Ptz+wb+JfnLqbnUe/n3xNrzSy3qbtXEzQQDxOi8RatKcnuPV95rTDxua879kRGYhH32EBDpRiwFLbVHwvxgZwdOH+hPt0VPFTHIerh07Lvq3VjMgFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718396; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/CsAFhHZipfI4c7va0vtqF+oszypLzX1Hm3+BZ1ugGs=; b=fcfie2dso9gbk+GRZr4TBCZAIZS2kxaz51Cv4AGFP+LxfKYdURmLoClsTE8olqxmm6vEh4BbfyAdTFNe+ijKz89A2K5TGPEqBYkvRnCRuupPYJyf3Mh8jBNczS2YfAHRH9uGjSebD4coJcYGj55MCEDOiaMjbvDwAFlU6xqn4dA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718396440473.08778273362316; Fri, 15 Jan 2021 05:46:36 -0800 (PST) Received: from localhost ([::1]:48306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PQx-0007n6-6Z for importer@patchew.org; Fri, 15 Jan 2021 08:46:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3Y-0007DX-NK for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3B-0003Kg-KX for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-nNx3R6-FNcaeLpAWgVVb8Q-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDED0180A09B; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39FA219726; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D77F01800D4B; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/CsAFhHZipfI4c7va0vtqF+oszypLzX1Hm3+BZ1ugGs=; b=OxQP3Lx1vUGDNHVV8V/WJXR1z+CW+FZeO6Bxj2z8EVsE/yPD08rJQUw7ZGRZyRIdqHIx7/ zq42xg1HYuAxb3qKERuZFqeBgFtootCw4KAN6MuJiqzIajS0lULBh2iLF3NI+MvhAkTdwQ /zFEKot7yGrUD927U/pyRig0t5cWjyg= X-MC-Unique: nNx3R6-FNcaeLpAWgVVb8Q-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 16/30] paaudio: remove unneeded code Date: Fri, 15 Jan 2021 14:21:32 +0100 Message-Id: <20210115132146.1443592-17-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Commit baea032ec7 "audio/paaudio: fix ignored buffer_length setting" added code to handle buffer_length defaults. This was unnecessary because the audio_buffer_* functions in audio/audio.c already handle this. Remove the unneeded code. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-16-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index 4a1ffda753d5..86038f3e1392 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -539,8 +539,7 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsetti= ngs *as, =20 audio_pcm_init_info (&hw->info, &obt_as); hw->samples =3D audio_buffer_samples( - qapi_AudiodevPaPerDirectionOptions_base(ppdo), - &obt_as, ppdo->buffer_length); + qapi_AudiodevPaPerDirectionOptions_base(ppdo), &obt_as, 46440); =20 return 0; =20 @@ -587,8 +586,7 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsetting= s *as, void *drv_opaque) =20 audio_pcm_init_info (&hw->info, &obt_as); hw->samples =3D audio_buffer_samples( - qapi_AudiodevPaPerDirectionOptions_base(ppdo), - &obt_as, ppdo->buffer_length); + qapi_AudiodevPaPerDirectionOptions_base(ppdo), &obt_as, 46440); =20 return 0; =20 @@ -738,10 +736,6 @@ static void qpa_volume_in(HWVoiceIn *hw, Volume *vol) static int qpa_validate_per_direction_opts(Audiodev *dev, AudiodevPaPerDirectionOptions *= pdo) { - if (!pdo->has_buffer_length) { - pdo->has_buffer_length =3D true; - pdo->buffer_length =3D 46440; - } if (!pdo->has_latency) { pdo->has_latency =3D true; pdo->latency =3D 15000; --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610719043; cv=none; d=zohomail.com; s=zohoarc; b=KmUiQndMYkkVXzq/YMN7/OIjh/eAEA2sMNrHkGMpM5wnDnTFE+t91ET2i7lqaIV014HtLZ8JLt1VatgwL4NRtEzCSeJtlCNcy9gOtpZYA+sGAmDgpEcOHAnVKkjPOmR1YeMv+090dPS9hWKg28evypsAP4gcDbcC9BbpDh9W1vM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610719043; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Lijfuh4ogh+RJzDwIEQJkzCTtJubUXLmtHSgaBsd0Hk=; b=WWrg9xZi9jjTjwzLTEaCst6q6MqJ4mUqGNk47AChi306UwZgLgA+2aYx8tp1+hDT0QdeWtASyYJogfilaksr3zWVBZFpIKz9lmWSwLa89mDow+C7vdt/GAIRuYhMulFZxgtZ/Kr2eBw3f2XuIrPqFIDAofzwF4/yPMrhHMvdBk4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610719043567107.71606823111381; Fri, 15 Jan 2021 05:57:23 -0800 (PST) Received: from localhost ([::1]:54432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PbO-0005YC-GV for importer@patchew.org; Fri, 15 Jan 2021 08:57:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3M-00073N-Du for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003J5-8Y for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-KpMkoVyROLeysWSSUmsR9g-1; Fri, 15 Jan 2021 08:21:55 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9C84A8030A3; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51F5F60BF3; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E1C851800D4C; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Lijfuh4ogh+RJzDwIEQJkzCTtJubUXLmtHSgaBsd0Hk=; b=hNL3Vn2DY6RR4R9FjtvUZr0GcC1qwwaR8d2tUwX2Em2cpcGs7UvXU3nw/oZtc3uvcC1aqE LJ0CQ0cT5DkPcxWhUzOr2QWf/zaVOjo+dv4jBwhe6XcUfShyLpErIlbKPQ7iGpgozxnb0y Zs7iY3o+FH+A/C/2BqCxqPQGgiVIkQM= X-MC-Unique: KpMkoVyROLeysWSSUmsR9g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 17/30] paaudio: comment bugs in functions qpa_init_* Date: Fri, 15 Jan 2021 14:21:33 +0100 Message-Id: <20210115132146.1443592-18-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin The audio buffer size in audio/paaudio.c is typically larger than expected. Just comment the bugs in qpa_init_in() and qpa_init_out() for now. Fixing these bugs may break glitch free audio playback with fine tuned user audio settings. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-17-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/audio/paaudio.c b/audio/paaudio.c index 86038f3e1392..ff3dd01c96dd 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -538,6 +538,10 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsett= ings *as, } =20 audio_pcm_init_info (&hw->info, &obt_as); + /* + * This is wrong. hw->samples counts in frames. hw->samples will be + * number of channels times larger than expected. + */ hw->samples =3D audio_buffer_samples( qapi_AudiodevPaPerDirectionOptions_base(ppdo), &obt_as, 46440); =20 @@ -585,6 +589,10 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsettin= gs *as, void *drv_opaque) } =20 audio_pcm_init_info (&hw->info, &obt_as); + /* + * This is wrong. hw->samples counts in frames. hw->samples will be + * number of channels times larger than expected. + */ hw->samples =3D audio_buffer_samples( qapi_AudiodevPaPerDirectionOptions_base(ppdo), &obt_as, 46440); =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610717885; cv=none; d=zohomail.com; s=zohoarc; b=YxV3aBq5gVwfXAfUaXEADULdhkaVet6OFuEs281icozB1LOrZT8jy6MhQ3ajgskAlNLT7TK4r2tobEjWbAqlPA4xkRVqLSF+5iD8Ku5qyf0z6ckbwDf5CStXq4rKje5pSNWeFglqJ8JJQZZEeC84ucTMTQHoFsXUzFy+4hxTkKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610717885; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MbTWa6XA/XTnc8oR+OmYjlUe298v+sSdsQKTwN+5iEo=; b=R3mBp2XWriZz02dakuBMYgMFLtTh2efFYO+UqrfsuWFk2Pz06Ug/pY1k8Yl2ci2X72bJCu7C3fgYwG6BxDpYIg310FeOjDwYZMSZGN33NX1M8rS+qCMXZBR2rZng6HWHGWCOo+qzAmYK8eCXvziuhzmH1kn6cToM9E6Hi8BZFc4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610717885699487.6587409201113; Fri, 15 Jan 2021 05:38:05 -0800 (PST) Received: from localhost ([::1]:50834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PIi-0005PQ-Ko for importer@patchew.org; Fri, 15 Jan 2021 08:38:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3D-0006r1-Jh for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003J1-6k for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-281--i-tHvozOkOLlUMAHEWQGA-1; Fri, 15 Jan 2021 08:21:55 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A5384180A0A0; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 564616F81E; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EC0B01800D4D; Fri, 15 Jan 2021 14:21:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MbTWa6XA/XTnc8oR+OmYjlUe298v+sSdsQKTwN+5iEo=; b=U7yDhn4hoXRZvFguRv20gAZrK+HbUU7W8p5JEGA4OUKwujLeryYMKKFQzPmzcgc5BhAKLU RWyP9NURh8qa/fkm+jGWfxTpFTJ00ADfm+AGXdx1xFS0E8wH5XRN+7p5FDDyuKlTkEmdeZ ESiuCtNHkH870zHfwSumUWviat+GBAQ= X-MC-Unique: -i-tHvozOkOLlUMAHEWQGA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 18/30] paaudio: limit minreq to 75% of audio timer_rate Date: Fri, 15 Jan 2021 14:21:34 +0100 Message-Id: <20210115132146.1443592-19-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Currently with the playback buffer attribute minreq =3D -1 and flag PA_STREAM_EARLY_REQUESTS PulseAudio uses minreq =3D tlength / 4. To improve audio playback with larger PulseAudio server side buffers, limit minreq to a maximum of 75% of audio timer_rate. That way there is a good chance qemu receives a stream buffer size update before it tries to write data to the playback stream. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-18-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index ff3dd01c96dd..318686829428 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -517,7 +517,8 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsetti= ngs *as, ss.rate =3D as->freq; =20 ba.tlength =3D pa_usec_to_bytes(ppdo->latency, &ss); - ba.minreq =3D -1; + ba.minreq =3D pa_usec_to_bytes(MIN(ppdo->latency >> 2, + (g->dev->timer_period >> 2) * 3), &ss= ); ba.maxlength =3D -1; ba.prebuf =3D -1; =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610720369; cv=none; d=zohomail.com; s=zohoarc; b=PNIo7H5wLH65aYcD8tkchZh/UflwuFuFoglsHZDzYlEChSPMbWLm37YI3Zzw/3zTdLBx/5SEYlekZP6w4xTuUBhoFnj7QY/2BfuDgsqw/3squAVEgvVjBE+N7eNBE/BkS8xEwHufFkUPKL0igEI36ojZIOYnbgdAf1OP3yZ1Xr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610720369; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u5KAmuZZ+pHkKVDoOgjVaDNcS/Mh/vkpiooZYHRwnis=; b=B/L1+Cb0s05qYeX0kcYXL2u/KZ53PReddhb82Wuwi1JFrgqXyWES4rfRQEKN7x8wfZu4lQPbqeqK2044KzcN9hqBZSw8tKUYXhbSTPe5fFtRItGKJcfEspZ/2ezaCDKQIohp1AmHfbgp/3NJJ69LT1zqPpoSOHzTg5dVvJTqTCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610720369083961.8351949703149; Fri, 15 Jan 2021 06:19:29 -0800 (PST) Received: from localhost ([::1]:57848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Pwj-00069l-Ve for importer@patchew.org; Fri, 15 Jan 2021 09:19:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3j-0007FQ-HM for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28711) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3C-0003Ku-40 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:34 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-306-StRqNrVjP9q_LSyijI4Khw-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C0E9E100F342; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A05160C6E; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0234A1800D4E; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u5KAmuZZ+pHkKVDoOgjVaDNcS/Mh/vkpiooZYHRwnis=; b=a76C0gqJVUT8G3qwmpK+HsJL/lJ7FVk62m7HtZQWPEGNICd18pVTWB/yQPPqJCZXgte5FB LS7RVImLGOjvITiMbf9VzNA+wPtHnWGj9yZxle/7zCCSr9tukWh0JHKlc5egYiiLVrRco0 j0WMpOwP28ArYh7G7m9AuApp+zDlbrM= X-MC-Unique: StRqNrVjP9q_LSyijI4Khw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 19/30] paaudio: send recorded data in smaller chunks Date: Fri, 15 Jan 2021 14:21:35 +0100 Message-Id: <20210115132146.1443592-20-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Tell PulseAudio to send recorded audio data in smaller chunks than timer_period, so there's a good chance that qemu can read recorded audio data every time it looks for new data. PulseAudio tries to send buffer updates at a fragsize / 2 rate. With fragsize =3D timer_period / 2 * 3 the update rate is 75% of timer_period. The lower limit for the recording buffer size maxlength is fragsize * 2. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-19-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index 318686829428..1e6f4448ce37 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -568,8 +568,9 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsetting= s *as, void *drv_opaque) ss.channels =3D as->nchannels; ss.rate =3D as->freq; =20 - ba.fragsize =3D pa_usec_to_bytes(ppdo->latency, &ss); - ba.maxlength =3D pa_usec_to_bytes(ppdo->latency * 2, &ss); + ba.fragsize =3D pa_usec_to_bytes((g->dev->timer_period >> 1) * 3, &ss); + ba.maxlength =3D pa_usec_to_bytes( + MAX(ppdo->latency, g->dev->timer_period * 3), &ss); ba.minreq =3D -1; ba.prebuf =3D -1; =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718869; cv=none; d=zohomail.com; s=zohoarc; b=O/sK+7UupkYvYV0RcEYWtd5O4NjtCFsHecOAhspcHQlSEFYII/3dVzBNkSXaGd3rvw7mOOA198/3MPTcsSxQHXAULsoitEmNYDV4pHas8fJHobjs1bpBvCr+pkz24diyU/3KwfnYKweVwy31W90ovk2HDnHK/X9kZU69pw1I6Vc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718869; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XzwoiS4AvB1DAMeelsnbRmyDx1AnnwrHSMYkLdfdsh0=; b=POR0Df1BUCqgJyr9GFXvg9hGkl440aZAacl2pyHYxb2jM9Ja/uTbS1fRwDHLMD8ijKSvwjHF4ijGAfokihLztoNSyUSWE5TVVyLzj1/43f5E0dh4pJLfr+rmZ+CK1ogpx4uH3a5iQ17TyK51c1MpCKzSRHiBcg9ILq0GXWfSNak= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718869103448.56600704482275; Fri, 15 Jan 2021 05:54:29 -0800 (PST) Received: from localhost ([::1]:46700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PYY-0002FY-FA for importer@patchew.org; Fri, 15 Jan 2021 08:54:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3I-0006vO-Vp for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003JP-4R for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:08 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-ahIgUiTWMKiraCMc7byzLQ-1; Fri, 15 Jan 2021 08:21:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDF1BCE642; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87D6F71C89; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0E4961800D4F; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XzwoiS4AvB1DAMeelsnbRmyDx1AnnwrHSMYkLdfdsh0=; b=GcRZwz+KWztTjBHElUJJ+cAuAB7Yjjs+jFC1MD0u3pLg1tkzHV0DSO63Iqzt1pJazYVHAH EgdnQ0NsE3CheOoIOB8xCJ1tXTKmpUKoT0fAVPY36afPiDRYHrju/7jWSUVI6XIgB14BC5 gK3MrdZY+MdpDBOWngAu4/0bP/INjQ0= X-MC-Unique: ahIgUiTWMKiraCMc7byzLQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 20/30] dsoundaudio: replace GetForegroundWindow() Date: Fri, 15 Jan 2021 14:21:36 +0100 Message-Id: <20210115132146.1443592-21-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin GetForegroundWindow() doesn't necessarily return the own window handle. It just returns a handle to the currently active window and can even return NULL. At the time dsound_open() gets called the active window is most likely the shell window and not the QEMU window. Replace GetForegroundWindow() with GetDesktopWindow() which always returns a valid window handle, and at the same time replace the DirectSound buffer flag DSBCAPS_STICKYFOCUS with DSBCAPS_GLOBALFOCUS where Windows only expects a valid window handle for DirectSound function SetCooperativeLevel(). The Microsoft online docs for IDirectSound::SetCooperativeLevel recommend this in the remarks. This fixes a bug where you can't hear sound from the guest. To reproduce start qemu with -machine pcspk-audiodev=3Daudio0 -device intel-hda -device hda-duplex,audiodev=3Daudio0 -audiodev dsound,id=3Daudio0,out.mixing-engine=3Doff from a shell and start audio playback with the hda device in the guest. The guest will be silent. To hear guest audio you have to activate the shell window once. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-20-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/dsound_template.h | 2 +- audio/dsoundaudio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/dsound_template.h b/audio/dsound_template.h index 9c5ce625ab91..0678f2de38be 100644 --- a/audio/dsound_template.h +++ b/audio/dsound_template.h @@ -205,7 +205,7 @@ static int dsound_init_out(HWVoiceOut *hw, struct audse= ttings *as, NULL ); #else - bd.dwFlags =3D DSBCAPS_STICKYFOCUS | DSBCAPS_GETCURRENTPOSITION2; + bd.dwFlags =3D DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2; hr =3D IDirectSound_CreateSoundBuffer ( s->dsound, &bd, diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 4cdf19ab6799..0fbdf770ac75 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -347,7 +347,7 @@ static int dsound_open (dsound *s) HRESULT hr; HWND hwnd; =20 - hwnd =3D GetForegroundWindow (); + hwnd =3D GetDesktopWindow(); hr =3D IDirectSound_SetCooperativeLevel ( s->dsound, hwnd, --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610717577; cv=none; d=zohomail.com; s=zohoarc; b=jrrmMul6/onnHhG20sRE3mWpYEfprc5YZcBy86p/zZsDeslXOglDqbUsfaowjbioUxXLEVoDQMj33W2NWAcaL2XwOU4Xm1hKXPXfDNbuAnnR8SA7y2emimbQvRhj+Ef05eUMLamZh7yFacwRp4KfRg46htHKqfOB56Sl9pFyTog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610717577; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0LBA83OsZdc5NiYe4eEtS2i8fh03LsyFVlbEeRAvgyM=; b=mvQtzXwVcWmTDqgGailOPt+A3PLPZrBL4O9B7TyYSRRsIORb/4mqacEUWQdGsgtc38xQCegMxYmjLKmlZTv1jZPVbaP78cSPeMItVEpXuUJQk6EZQ9WjCGy0IuOEGtJhbxtG3tFqOwexpRfWX29eB8ivbb3QXEMc98w7knTN1v0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610717577423221.97473765287782; Fri, 15 Jan 2021 05:32:57 -0800 (PST) Received: from localhost ([::1]:37388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PDi-0008A5-6Q for importer@patchew.org; Fri, 15 Jan 2021 08:32:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3M-00074E-NF for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003JG-76 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-10kBzmYTPtSz1VTraCGoIQ-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC2E9CE649; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90DA01975E; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 188EB1800D50; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0LBA83OsZdc5NiYe4eEtS2i8fh03LsyFVlbEeRAvgyM=; b=IOC+fi0KRCBRqwS+jDRVzkdXrDr7OjdA4C3wGC5DfHpHEwsezs76QUUTu5xXaTAbOZIXx8 jft25XeFTnD3dAZOWVUftOgoyeK0eFIFAMc8xNu/8w1YxM6/3g8S98Af147aNjzYf/17EK zrLuYGg7YqXjrmCRH+jjgmX7/ie4YfY= X-MC-Unique: 10kBzmYTPtSz1VTraCGoIQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 21/30] dsoundaudio: rename dsound_open() Date: Fri, 15 Jan 2021 14:21:37 +0100 Message-Id: <20210115132146.1443592-22-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Rename dsound_open() to dsound_set_cooperative_level(). The only task of that function is to set the cooperative level for DirectSound. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-21-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/dsoundaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 0fbdf770ac75..d3695f3af653 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -342,7 +342,7 @@ static void dsound_clear_sample (HWVoiceOut *hw, LPDIRE= CTSOUNDBUFFER dsb, dsound_unlock_out (dsb, p1, p2, blen1, blen2); } =20 -static int dsound_open (dsound *s) +static int dsound_set_cooperative_level(dsound *s) { HRESULT hr; HWND hwnd; @@ -673,7 +673,7 @@ static void *dsound_audio_init(Audiodev *dev) } } =20 - err =3D dsound_open (s); + err =3D dsound_set_cooperative_level(s); if (err) { dsound_audio_fini (s); return NULL; --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718402; cv=none; d=zohomail.com; s=zohoarc; b=jo0J7i1Dc6wTCLHfKD0aULuJ23VlnRHonR6m0IinIqyAT/foxTU8x2zPA0vUvLAsPPW98u5u8XGxHMWKAYISZd1NonfA1+kVSFMwUtme+6AXjpSXS5XUHDiT8IG3RqYS91tg4Bebx8SqIKvw7PgWzWPvJE8pjVMbZUwufMJLPd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718402; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HYOcwhM19OS83x0r3EaTN7pPiiX5hv/Nyz4UpIeAs5o=; b=iPGEGxeZu3ryShP1hbJ/nF4SLfLl0wRYO80G+VcrHW5nQMpape0Xdd19iB3Blj/h+wryH41YX5+a0YGR+00f9RmN+wDVECjALAqO7ZFyJJ1DhTbLsdiwarB9zfOmwGnHCS/qcEztJsrZ5CEuSkMM9Qzz6G8rpvLzKjrBKm1Qr3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718402682334.73247380245004; Fri, 15 Jan 2021 05:46:42 -0800 (PST) Received: from localhost ([::1]:48856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PR3-00080S-CG for importer@patchew.org; Fri, 15 Jan 2021 08:46:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3K-0006yo-C7 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003JJ-4E for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-pfN2gyj4NounUwctn-2ODA-1; Fri, 15 Jan 2021 08:21:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 791B7CE647; Fri, 15 Jan 2021 13:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 987635D9E8; Fri, 15 Jan 2021 13:21:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 23A3E1800D51; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HYOcwhM19OS83x0r3EaTN7pPiiX5hv/Nyz4UpIeAs5o=; b=HA1GzWaflkNIpVKsCtViB/oLqe3o9dJdrzptvGpuR/rn6ZZS2CHGAXUstJAaCspPbiZzu2 XwVJ+Dw6BzAkgWyl8dUWsUIY0F1nK6awxBo/s2MudRbI1GTgd3L45qiMB+luuhhEbq/P/N eB5A3N3sj37RraA2AvuoxQ4pdfXdUjY= X-MC-Unique: pfN2gyj4NounUwctn-2ODA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 22/30] dsoundaudio: enable f32 audio sample format Date: Fri, 15 Jan 2021 14:21:38 +0100 Message-Id: <20210115132146.1443592-23-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin Enable the f32 audio sample format for the DirectSound backend. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-22-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/audio_win_int.c | 65 +++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/audio/audio_win_int.c b/audio/audio_win_int.c index b938fd667bae..b7db34900c7c 100644 --- a/audio/audio_win_int.c +++ b/audio/audio_win_int.c @@ -5,6 +5,7 @@ =20 #define AUDIO_CAP "win-int" #include +#include #include =20 #include "audio.h" @@ -16,7 +17,6 @@ int waveformat_from_audio_settings (WAVEFORMATEX *wfx, { memset (wfx, 0, sizeof (*wfx)); =20 - wfx->wFormatTag =3D WAVE_FORMAT_PCM; wfx->nChannels =3D as->nchannels; wfx->nSamplesPerSec =3D as->freq; wfx->nAvgBytesPerSec =3D as->freq << (as->nchannels =3D=3D 2); @@ -26,11 +26,13 @@ int waveformat_from_audio_settings (WAVEFORMATEX *wfx, switch (as->fmt) { case AUDIO_FORMAT_S8: case AUDIO_FORMAT_U8: + wfx->wFormatTag =3D WAVE_FORMAT_PCM; wfx->wBitsPerSample =3D 8; break; =20 case AUDIO_FORMAT_S16: case AUDIO_FORMAT_U16: + wfx->wFormatTag =3D WAVE_FORMAT_PCM; wfx->wBitsPerSample =3D 16; wfx->nAvgBytesPerSec <<=3D 1; wfx->nBlockAlign <<=3D 1; @@ -38,6 +40,14 @@ int waveformat_from_audio_settings (WAVEFORMATEX *wfx, =20 case AUDIO_FORMAT_S32: case AUDIO_FORMAT_U32: + wfx->wFormatTag =3D WAVE_FORMAT_PCM; + wfx->wBitsPerSample =3D 32; + wfx->nAvgBytesPerSec <<=3D 2; + wfx->nBlockAlign <<=3D 2; + break; + + case AUDIO_FORMAT_F32: + wfx->wFormatTag =3D WAVE_FORMAT_IEEE_FLOAT; wfx->wBitsPerSample =3D 32; wfx->nAvgBytesPerSec <<=3D 2; wfx->nBlockAlign <<=3D 2; @@ -54,12 +64,6 @@ int waveformat_from_audio_settings (WAVEFORMATEX *wfx, int waveformat_to_audio_settings (WAVEFORMATEX *wfx, struct audsettings *as) { - if (wfx->wFormatTag !=3D WAVE_FORMAT_PCM) { - dolog ("Invalid wave format, tag is not PCM, but %d\n", - wfx->wFormatTag); - return -1; - } - if (!wfx->nSamplesPerSec) { dolog ("Invalid wave format, frequency is zero\n"); return -1; @@ -83,23 +87,42 @@ int waveformat_to_audio_settings (WAVEFORMATEX *wfx, return -1; } =20 - switch (wfx->wBitsPerSample) { - case 8: - as->fmt =3D AUDIO_FORMAT_U8; - break; + if (wfx->wFormatTag =3D=3D WAVE_FORMAT_PCM) { + switch (wfx->wBitsPerSample) { + case 8: + as->fmt =3D AUDIO_FORMAT_U8; + break; =20 - case 16: - as->fmt =3D AUDIO_FORMAT_S16; - break; + case 16: + as->fmt =3D AUDIO_FORMAT_S16; + break; =20 - case 32: - as->fmt =3D AUDIO_FORMAT_S32; - break; + case 32: + as->fmt =3D AUDIO_FORMAT_S32; + break; =20 - default: - dolog ("Invalid wave format, bits per sample is not " - "8, 16 or 32, but %d\n", - wfx->wBitsPerSample); + default: + dolog("Invalid PCM wave format, bits per sample is not " + "8, 16 or 32, but %d\n", + wfx->wBitsPerSample); + return -1; + } + } else if (wfx->wFormatTag =3D=3D WAVE_FORMAT_IEEE_FLOAT) { + switch (wfx->wBitsPerSample) { + case 32: + as->fmt =3D AUDIO_FORMAT_F32; + break; + + default: + dolog("Invalid IEEE_FLOAT wave format, bits per sample is not " + "32, but %d\n", + wfx->wBitsPerSample); + return -1; + } + } else { + dolog("Invalid wave format, tag is not PCM and not IEEE_FLOAT, " + "but %d\n", + wfx->wFormatTag); return -1; } =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718130; cv=none; d=zohomail.com; s=zohoarc; b=hdGX+EOF3Qtp+VT+BeXF/6BgkA9h0myT8yS5ransVgyK6FiHtflF270RS0taUG/6BckWzncbH8nPQZYpXITifUx+SxZ78sW5ANR9mwxo7EYFUVtdMTFlx5K1SwosoP3SSZdHLhVTGcP6E7N31m5ucgJtYwX+eewUSaqDlFLR9QQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718130; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HWdvsePq7tGzXv7zHWA7iiEIQ/CIw4M8M43yoPU/x7U=; b=lxIYNMLxeD+dh3F93YyaHtSKIl2t2MCZkqVZhs5k4C6rCESiZ98fIYEftLEvt/hrZX/kkvnkIwtcXmicNaPoKkBo7IJAPsgoTTooSPrFji+EOziEmNsGzKF+KgMvPL9b0C1zxXTxI5Gl4WYaJpgpStH9Z/1N4IaAxNViDqtKHk4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718130079170.99425263324815; Fri, 15 Jan 2021 05:42:10 -0800 (PST) Received: from localhost ([::1]:32964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PMe-0001MY-VW for importer@patchew.org; Fri, 15 Jan 2021 08:42:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3O-00077j-6X for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:43503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003Jc-E1 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356-RT4lfJt0NqC84zGPbmIq1Q-1; Fri, 15 Jan 2021 08:21:57 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B1B78030A0; Fri, 15 Jan 2021 13:21:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E0E6100AE2E; Fri, 15 Jan 2021 13:21:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2E0E51800D52; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HWdvsePq7tGzXv7zHWA7iiEIQ/CIw4M8M43yoPU/x7U=; b=DxtwYAoaM89evMWzYQeyGnAGE1Msd4S5yGBIfSGOkFoI8nGoolIa4v7l3elupPRjj1HMN4 BmEqptt9s4/JFfiX3apPegQ19ETt/1s9PaUB9SxzIdIGgqGHGjPEdTbzLtby5Z5Vrv74Oy w8pYbELvn4MehJeaNXJ0nHQyJiUDmZc= X-MC-Unique: RT4lfJt0NqC84zGPbmIq1Q-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 23/30] dsoundaudio: fix log message Date: Fri, 15 Jan 2021 14:21:39 +0100 Message-Id: <20210115132146.1443592-24-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Volker R=C3=BCmelin There is a mismatch between message and used argument. Change the argument from frequency to format. Signed-off-by: Volker R=C3=BCmelin Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de Message-Id: <20210110100239.27588-23-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/audio_win_int.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/audio_win_int.c b/audio/audio_win_int.c index b7db34900c7c..5ea8157dfcc8 100644 --- a/audio/audio_win_int.c +++ b/audio/audio_win_int.c @@ -54,7 +54,7 @@ int waveformat_from_audio_settings (WAVEFORMATEX *wfx, break; =20 default: - dolog ("Internal logic error: Bad audio format %d\n", as->freq); + dolog("Internal logic error: Bad audio format %d\n", as->fmt); return -1; } =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610719860; cv=none; d=zohomail.com; s=zohoarc; b=hNmod05EvKs3+4GhOCsfdyiat48VWOrO0FzQp3NLw2oYM7KH2qufeMFaFs8tIT8GRk4G7hRZbDaUH9hOTqP7VmBhClVDolGoR77RlL7UpxS2HBnOnF5IieqU43IatZd0sQIjoefHDRlmJdh4ELQ8HivhWRofAk1E5hzsmTuI8zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610719860; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GYqCyIo4OwaI3GXpKHpQHr16hkxGPKuMRBn/0f1Qeuk=; b=BKSXPGgrfHjEph+KXZohA4F4SABC8BocHZzFA2Zwt/1O7tP2YhQTiyEf0AzSZfKan1ILk72pEFyoY6ya+GILI0XxZFql4XdVjHbwtbXUG1tBYUhvSYpJqFlS1dRveQSrqsJ2o070MYyWCjsYRygQ0nhn30ame7jsoNP02lTGnpA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610719860806650.1969736900211; Fri, 15 Jan 2021 06:11:00 -0800 (PST) Received: from localhost ([::1]:60322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PoY-0003Qx-Gn for importer@patchew.org; Fri, 15 Jan 2021 09:10:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3Y-0007DY-Q6 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23077) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3B-0003KE-9t for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-406-yTD1UuRcMemhGIayhtp-_g-1; Fri, 15 Jan 2021 08:21:58 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C2EF2107ACFA; Fri, 15 Jan 2021 13:21:57 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4BCE419C71; Fri, 15 Jan 2021 13:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 422E11800D53; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GYqCyIo4OwaI3GXpKHpQHr16hkxGPKuMRBn/0f1Qeuk=; b=ff12enlIyAyL71gHJYNC1iYd/gFr62vKBLbz0jaz9a5pb/r7ZJzX2oPFc60Zyzi37MCOax rqPbufBSSwbah/rmI8rxhDsPFYkEyKu2Dt/mfwWAD2DqDCy2GuicEbfBrV/OUMSogK6A57 hXjXXYNWOu3YURaxcclt8dQTQq/Scxo= X-MC-Unique: yTD1UuRcMemhGIayhtp-_g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 24/30] audio: Add braces for statements/fix braces' position Date: Fri, 15 Jan 2021 14:21:40 +0100 Message-Id: <20210115132146.1443592-25-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Han , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Zhang Han Fix problems about braces: -braces are necessary for all arms of if/for/while statements -else should follow close brace '}' Signed-off-by: Zhang Han Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-2-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann --- audio/audio_template.h | 12 ++++-------- audio/alsaaudio.c | 15 +++++---------- audio/audio.c | 26 ++++++++++++-------------- audio/coreaudio.c | 3 +-- audio/dsoundaudio.c | 9 +++------ audio/ossaudio.c | 12 ++++-------- 6 files changed, 29 insertions(+), 48 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index 434df5d5e750..f77210e40435 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -47,8 +47,7 @@ static void glue(audio_init_nb_voices_, TYPE)(AudioState = *s, #ifdef DAC dolog ("Driver `%s' does not support " NAME "\n", drv->name); #endif - } - else { + } else { dolog ("Driver `%s' does not support %d " NAME " voices, max %= d\n", drv->name, glue (s->nb_hw_voices_, TYPE), @@ -387,8 +386,7 @@ static SW *glue(audio_pcm_create_voice_pair_, TYPE)( =20 if (pdo->fixed_settings) { hw_as =3D audiodev_to_audsettings(pdo); - } - else { + } else { hw_as =3D *as; } =20 @@ -498,8 +496,7 @@ SW *glue (AUD_open_, TYPE) ( if (glue (audio_pcm_sw_init_, TYPE) (sw, hw, name, as)) { goto fail; } - } - else { + } else { sw =3D glue(audio_pcm_create_voice_pair_, TYPE)(s, name, as); if (!sw) { dolog ("Failed to create voice `%s'\n", name); @@ -553,8 +550,7 @@ uint64_t glue (AUD_get_elapsed_usec_, TYPE) (SW *sw, QE= MUAudioTimeStamp *ts) =20 if (cur_ts >=3D old_ts) { delta =3D cur_ts - old_ts; - } - else { + } else { delta =3D UINT64_MAX - old_ts + cur_ts; } =20 diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 5a871aaf6b48..fcc2f62864fb 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -278,32 +278,28 @@ static snd_pcm_format_t aud_to_alsafmt (AudioFormat f= mt, int endianness) case AUDIO_FORMAT_S16: if (endianness) { return SND_PCM_FORMAT_S16_BE; - } - else { + } else { return SND_PCM_FORMAT_S16_LE; } =20 case AUDIO_FORMAT_U16: if (endianness) { return SND_PCM_FORMAT_U16_BE; - } - else { + } else { return SND_PCM_FORMAT_U16_LE; } =20 case AUDIO_FORMAT_S32: if (endianness) { return SND_PCM_FORMAT_S32_BE; - } - else { + } else { return SND_PCM_FORMAT_S32_LE; } =20 case AUDIO_FORMAT_U32: if (endianness) { return SND_PCM_FORMAT_U32_BE; - } - else { + } else { return SND_PCM_FORMAT_U32_LE; } =20 @@ -722,8 +718,7 @@ static int alsa_voice_ctl (snd_pcm_t *handle, const cha= r *typ, int ctl) alsa_logerr (err, "Could not stop %s\n", typ); return -1; } - } - else { + } else { err =3D snd_pcm_prepare (handle); if (err < 0) { alsa_logerr (err, "Could not prepare handle for %s\n", typ); diff --git a/audio/audio.c b/audio/audio.c index 34c9cb918279..6734c8af708c 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -344,8 +344,7 @@ void audio_pcm_info_clear_buf (struct audio_pcm_info *i= nfo, void *buf, int len) =20 if (info->is_signed || info->is_float) { memset(buf, 0x00, len * info->bytes_per_frame); - } - else { + } else { switch (info->bits) { case 8: memset(buf, 0x80, len * info->bytes_per_frame); @@ -584,8 +583,7 @@ static size_t audio_pcm_sw_get_rpos_in(SWVoiceIn *sw) rpos =3D hw->conv_buf->pos - live; if (rpos >=3D 0) { return rpos; - } - else { + } else { return hw->conv_buf->size + rpos; } } @@ -788,10 +786,14 @@ static int audio_is_timer_needed(AudioState *s) HWVoiceOut *hwo =3D NULL; =20 while ((hwo =3D audio_pcm_hw_find_any_enabled_out(s, hwo))) { - if (!hwo->poll_mode) return 1; + if (!hwo->poll_mode) { + return 1; + } } while ((hwi =3D audio_pcm_hw_find_any_enabled_in(s, hwi))) { - if (!hwi->poll_mode) return 1; + if (!hwi->poll_mode) { + return 1; + } } return 0; } @@ -908,8 +910,7 @@ void AUD_set_active_out (SWVoiceOut *sw, int on) audio_reset_timer (s); } } - } - else { + } else { if (hw->enabled) { int nb_active =3D 0; =20 @@ -956,8 +957,7 @@ void AUD_set_active_in (SWVoiceIn *sw, int on) } } sw->total_hw_samples_acquired =3D hw->total_samples_captured; - } - else { + } else { if (hw->enabled) { int nb_active =3D 0; =20 @@ -1532,8 +1532,7 @@ static int audio_driver_init(AudioState *s, struct au= dio_driver *drv, audio_init_nb_voices_in(s, drv); s->drv =3D drv; return 0; - } - else { + } else { if (msg) { dolog("Could not init `%s' audio driver\n", drv->name); } @@ -1848,8 +1847,7 @@ CaptureVoiceOut *AUD_add_capture( if (cap) { QLIST_INSERT_HEAD (&cap->cb_head, cb, entries); return cap; - } - else { + } else { HWVoiceOut *hw; CaptureVoiceOut *cap; =20 diff --git a/audio/coreaudio.c b/audio/coreaudio.c index 79a9d40bf8ef..408b5871261c 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -524,8 +524,7 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct au= dsettings *as, } else if (frameRange.mMaximum < frames) { core->audioDevicePropertyBufferFrameSize =3D (UInt32) frameRange.m= Maximum; dolog ("warning: Downsizing Buffer Frames to %f\n", frameRange.mMa= ximum); - } - else { + } else { core->audioDevicePropertyBufferFrameSize =3D frames; } =20 diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index d3695f3af653..e59bd83dc717 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -404,8 +404,7 @@ static void dsound_enable_out(HWVoiceOut *hw, bool enab= le) dsound_logerr (hr, "Could not stop playing buffer\n"); return; } - } - else { + } else { dolog ("warning: Voice is not playing\n"); } } @@ -509,8 +508,7 @@ static void dsound_enable_in(HWVoiceIn *hw, bool enable) dsound_logerr (hr, "Could not stop capturing\n"); return; } - } - else { + } else { dolog ("warning: Voice is not capturing\n"); } } @@ -659,8 +657,7 @@ static void *dsound_audio_init(Audiodev *dev) ); if (FAILED (hr)) { dsound_logerr (hr, "Could not create DirectSoundCapture instance\n= "); - } - else { + } else { hr =3D IDirectSoundCapture_Initialize (s->dsound_capture, NULL); if (FAILED (hr)) { dsound_logerr (hr, "Could not initialize DirectSoundCapture\n"= ); diff --git a/audio/ossaudio.c b/audio/ossaudio.c index c1db89f23300..60eff66424b9 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -142,16 +142,14 @@ static int aud_to_ossfmt (AudioFormat fmt, int endian= ness) case AUDIO_FORMAT_S16: if (endianness) { return AFMT_S16_BE; - } - else { + } else { return AFMT_S16_LE; } =20 case AUDIO_FORMAT_U16: if (endianness) { return AFMT_U16_BE; - } - else { + } else { return AFMT_U16_LE; } =20 @@ -542,16 +540,14 @@ static int oss_init_out(HWVoiceOut *hw, struct audset= tings *as, int trig =3D 0; if (ioctl (fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) { oss_logerr (errno, "SNDCTL_DSP_SETTRIGGER 0 failed\n"); - } - else { + } else { trig =3D PCM_ENABLE_OUTPUT; if (ioctl (fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) { oss_logerr ( errno, "SNDCTL_DSP_SETTRIGGER PCM_ENABLE_OUTPUT failed\n" ); - } - else { + } else { oss->mmapped =3D 1; } } --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610719979; cv=none; d=zohomail.com; s=zohoarc; b=hwl48MiLW14BwnxH0bBI1mvDIdN8AY1lI9j6ePMJaOdyFcds66rlTa2Gnskyyb4vrPaFhuQGPXTayjJw5qtF+N6u/p1rqdDH+HP/oqkmV22P4xTm6w5HuW5yCNZCt7Aa2lSbRegl9kBYlO33ANCmlZAULnt1DJHPdBI1lknNRns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610719979; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EpOOK1CspKZO58htbzpQyU23REswRuLr7U08A9xXOzU=; b=gOu9WGZq84BYuR+VX7nNAmI24lB1cM/t1dTmCnRC3gGL1e9aLeXiFhR+mHwSD44iYG3WZpVTYVlGWgrcf5ooTw4qHVlphyB8mDV6W3/CF1fsvX1eoNRcaA2H2+GXRNKhQOsUSFm0Upck7G/VYXe+3RxxUnLUSQW+a9v65Uh4/hM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161071997950330.369624947357124; Fri, 15 Jan 2021 06:12:59 -0800 (PST) Received: from localhost ([::1]:40454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PqU-0006ub-A0 for importer@patchew.org; Fri, 15 Jan 2021 09:12:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3h-0007Ec-MO for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3B-0003Kj-Pl for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:32 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-59-UFS7yLOqOluFg_Hku6EczA-1; Fri, 15 Jan 2021 08:21:59 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F20F0806660; Fri, 15 Jan 2021 13:21:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B277163746; Fri, 15 Jan 2021 13:21:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 51CBD1800D54; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EpOOK1CspKZO58htbzpQyU23REswRuLr7U08A9xXOzU=; b=b4ZiwQfYsEyQBl6ji4HJBpaCInlkq5Ilj6cVIGIVwutld1dYM26VDcyjGJYTeeWmPX+9Lj Gf6kMVpbAG4a4xOca/pSk0BqSDL127a9izr7YnJ4tMQyfjJCEzzEIDBxJJ/xgLE9wV0SXM t19U93obX5y4LPs6KL1P8aX46phw8w4= X-MC-Unique: UFS7yLOqOluFg_Hku6EczA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 25/30] audio: Add spaces around operator/delete redundant spaces Date: Fri, 15 Jan 2021 14:21:41 +0100 Message-Id: <20210115132146.1443592-26-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Han , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Zhang Han Fix problems about spaces: -operator needs spaces around it, add them. -somespaces are redundant, remove them. Signed-off-by: Zhang Han Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-3-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann --- audio/audio_template.h | 2 +- audio/coreaudio.c | 2 +- audio/dsoundaudio.c | 2 +- audio/jackaudio.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index f77210e40435..f82593bb8db2 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -208,7 +208,7 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp) QLIST_REMOVE (hw, entries); glue (hw->pcm_ops->fini_, TYPE) (hw); glue (s->nb_hw_voices_, TYPE) +=3D 1; - glue (audio_pcm_hw_free_resources_ ,TYPE) (hw); + glue (audio_pcm_hw_free_resources_ , TYPE) (hw); g_free (hw); *hwp =3D NULL; } diff --git a/audio/coreaudio.c b/audio/coreaudio.c index 408b5871261c..6ca0d79c1f5e 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -270,7 +270,7 @@ static void coreaudio_logstatus (OSStatus status) { const char *str =3D "BUG"; =20 - switch(status) { + switch (status) { case kAudioHardwareNoError: str =3D "kAudioHardwareNoError"; break; diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index e59bd83dc717..21c2891772de 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -133,7 +133,7 @@ static void dsound_log_hresult (HRESULT hr) break; #endif #ifdef DSERR_GENERIC - case DSERR_GENERIC : + case DSERR_GENERIC: str =3D "An undetermined error occurred inside the DirectSound sub= system"; break; #endif diff --git a/audio/jackaudio.c b/audio/jackaudio.c index f8afb5cc318c..3031c4e29bd4 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -277,7 +277,7 @@ static int qjack_process(jack_nframes_t nframes, void *= arg) if (likely(c->enabled)) { qjack_buffer_read_l(&c->fifo, buffers, nframes); } else { - for(int i =3D 0; i < c->nchannels; ++i) { + for (int i =3D 0; i < c->nchannels; ++i) { memset(buffers[i], 0, nframes * sizeof(float)); } } --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718446; cv=none; d=zohomail.com; s=zohoarc; b=mbWUSU+zb+ZFaWh6UMF5KYrPMHi0F0lh9fheOXqnXe8ZiIA+0fvHPgHIoPwjAaVjmj4gWIePor3LtkeWgaBUUg2w8ul+uhUGyRCDSNOxw0knUn+kNxinLCfCTpuX5HpJJ8huUfDnAVvbkI7WfKbK2bLW6ipUw35NxA1XmrkExAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718446; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yh7FnvFpRcEKg5rTGuSDzqs3YMIZFvsDfSQ26RdYsUM=; b=Dv7BtJqMpZa0GKzAHkICL5ndmWx8hLhOgVxZXJXgd8919H61rR9jnKPFGdt7YESO3p78WJv4nsunpwxsP/S+PQK5oHSzmZCAn+kYaInFjSgw5JbwLt8txsKtzayirx4ERg9YDF6d5N8LUuv3AJDhmHvn0aabGqp++9SMs5NK578= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718446686799.5492582696342; Fri, 15 Jan 2021 05:47:26 -0800 (PST) Received: from localhost ([::1]:50606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PRl-0000K2-Iu for importer@patchew.org; Fri, 15 Jan 2021 08:47:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3h-0007Ea-Lh for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3C-0003Lh-Qw for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:32 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-YhQlRL_GNKCVhKPcbUWSFA-1; Fri, 15 Jan 2021 08:21:58 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E48D7100F341; Fri, 15 Jan 2021 13:21:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A873B6F80A; Fri, 15 Jan 2021 13:21:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5C3511800D55; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yh7FnvFpRcEKg5rTGuSDzqs3YMIZFvsDfSQ26RdYsUM=; b=X4OkpcYv4SUSRdarc2AAYlMQNVKBCtqCWhpVlxeQOq4aHhRP54lkkbtZYIZa7PAS0xlGdg T1Ytudt4dpGORP3fWb56yqH28GiPx1SjFr5Mkkjm5s+RsDIWeYyWdaPtyvljKAVQtugnq5 pZv/DOgR64rO66E3QSPtkzEhuVyzssI= X-MC-Unique: YhQlRL_GNKCVhKPcbUWSFA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 26/30] audio: foo* bar" should be "foo *bar". Date: Fri, 15 Jan 2021 14:21:42 +0100 Message-Id: <20210115132146.1443592-27-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Han , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Zhang Han transfer "foo* " to "foo *" Signed-off-by: Zhang Han Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-4-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann --- audio/coreaudio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/audio/coreaudio.c b/audio/coreaudio.c index 6ca0d79c1f5e..b7c02e0e516d 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -421,12 +421,12 @@ COREAUDIO_WRAPPER_FUNC(write, size_t, (HWVoiceOut *hw= , void *buf, size_t size), /* callback to feed audiooutput buffer */ static OSStatus audioDeviceIOProc( AudioDeviceID inDevice, - const AudioTimeStamp* inNow, - const AudioBufferList* inInputData, - const AudioTimeStamp* inInputTime, - AudioBufferList* outOutputData, - const AudioTimeStamp* inOutputTime, - void* hwptr) + const AudioTimeStamp *inNow, + const AudioBufferList *inInputData, + const AudioTimeStamp *inInputTime, + AudioBufferList *outOutputData, + const AudioTimeStamp *inOutputTime, + void *hwptr) { UInt32 frameCount, pending_frames; void *out =3D outOutputData->mBuffers[0].mData; --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610719289; cv=none; d=zohomail.com; s=zohoarc; b=A98lMRrBo9RuMjVrr19efVT+2nf9doewbP9R5HIOBT5p8DCkkf7GeSKSikJBWIy2N6jFR4HphoL5kIRMQ2uyyRavsIO+3nOI0nB4W9JTqQmzbLcG/9JdVYHY7B00cgeWDZ1dH3STkcWKf3sx07JS7TYAbnJzNKKiNs8uZAhSSiM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610719289; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YZLIFVueT1RPqG4+onnpnYr9Ai41uR4lMWlYwgPMOHM=; b=kL42JPfPCM/pMNdchg/b9fax+XA7BeDHEusNlBSdt/YpHixeQvnjTpeMr+wWYzINv6v/JpGIuQbZjyLat3PzlBubm732nGfmFDrKhwYVWHQGYbD73+tpvFhkkAlq2JvzOHkvF03bG5yuKTUhAPs8KFxVRftiEjcowGRtssZuycs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610719289536932.2961606778712; Fri, 15 Jan 2021 06:01:29 -0800 (PST) Received: from localhost ([::1]:35824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PfM-0001EV-BR for importer@patchew.org; Fri, 15 Jan 2021 09:01:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3V-0007Ag-Td for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3B-0003Kc-NI for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-527-1ei_b5xROL-8ajO-U72oOQ-1; Fri, 15 Jan 2021 08:21:59 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7E71180A09B; Fri, 15 Jan 2021 13:21:57 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 752E86F991; Fri, 15 Jan 2021 13:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 66F731800D57; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YZLIFVueT1RPqG4+onnpnYr9Ai41uR4lMWlYwgPMOHM=; b=Fq1wDBorynhsTVLhhHmz8ScNvyAoR+WLbxbcscwMNAwjNfsUtmr6ZUghtrj7YEVgvjoj8j qeHQ8JKuwBwMj2H2M4wjST0c/j72nW7pgwouB8t3QQHfjYk0O3WOy75QnaP8PnjroTA1pi kokJQLmezyY9a+XQ3eFSA/uLhTZHV2I= X-MC-Unique: 1ei_b5xROL-8ajO-U72oOQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 27/30] audio: Fix lines over 90 characters Date: Fri, 15 Jan 2021 14:21:43 +0100 Message-Id: <20210115132146.1443592-28-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Han , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Zhang Han Fix the line width of code. Signed-off-by: Zhang Han Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-5-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann --- audio/dsoundaudio.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 21c2891772de..3b4afb949631 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -89,7 +89,9 @@ static void dsound_log_hresult (HRESULT hr) #endif #ifdef DSERR_ALLOCATED case DSERR_ALLOCATED: - str =3D "The request failed because resources, such as a priority = level, were already in use by another caller"; + str =3D "The request failed because resources, " + "such as a priority level, were already in use " + "by another caller"; break; #endif #ifdef DSERR_ALREADYINITIALIZED @@ -104,7 +106,8 @@ static void dsound_log_hresult (HRESULT hr) #endif #ifdef DSERR_BADSENDBUFFERGUID case DSERR_BADSENDBUFFERGUID: - str =3D "The GUID specified in an audiopath file does not match a = valid mix-in buffer"; + str =3D "The GUID specified in an audiopath file " + "does not match a valid mix-in buffer"; break; #endif #ifdef DSERR_BUFFERLOST @@ -114,22 +117,31 @@ static void dsound_log_hresult (HRESULT hr) #endif #ifdef DSERR_BUFFERTOOSMALL case DSERR_BUFFERTOOSMALL: - str =3D "The buffer size is not great enough to enable effects pro= cessing"; + str =3D "The buffer size is not great enough to " + "enable effects processing"; break; #endif #ifdef DSERR_CONTROLUNAVAIL case DSERR_CONTROLUNAVAIL: - str =3D "The buffer control (volume, pan, and so on) requested by = the caller is not available. Controls must be specified when the buffer is = created, using the dwFlags member of DSBUFFERDESC"; + str =3D "The buffer control (volume, pan, and so on) " + "requested by the caller is not available. " + "Controls must be specified when the buffer is created, " + "using the dwFlags member of DSBUFFERDESC"; break; #endif #ifdef DSERR_DS8_REQUIRED case DSERR_DS8_REQUIRED: - str =3D "A DirectSound object of class CLSID_DirectSound8 or later= is required for the requested functionality. For more information, see IDi= rectSound8 Interface"; + str =3D "A DirectSound object of class CLSID_DirectSound8 or later= " + "is required for the requested functionality. " + "For more information, see IDirectSound8 Interface"; break; #endif #ifdef DSERR_FXUNAVAILABLE case DSERR_FXUNAVAILABLE: - str =3D "The effects requested could not be found on the system, o= r they are in the wrong order or in the wrong location; for example, an eff= ect expected in hardware was found in software"; + str =3D "The effects requested could not be found on the system, " + "or they are in the wrong order or in the wrong location; " + "for example, an effect expected in hardware " + "was found in software"; break; #endif #ifdef DSERR_GENERIC @@ -154,7 +166,8 @@ static void dsound_log_hresult (HRESULT hr) #endif #ifdef DSERR_NODRIVER case DSERR_NODRIVER: - str =3D "No sound driver is available for use, or the given GUID i= s not a valid DirectSound device ID"; + str =3D "No sound driver is available for use, " + "or the given GUID is not a valid DirectSound device ID"; break; #endif #ifdef DSERR_NOINTERFACE @@ -169,12 +182,14 @@ static void dsound_log_hresult (HRESULT hr) #endif #ifdef DSERR_OTHERAPPHASPRIO case DSERR_OTHERAPPHASPRIO: - str =3D "Another application has a higher priority level, preventi= ng this call from succeeding"; + str =3D "Another application has a higher priority level, " + "preventing this call from succeeding"; break; #endif #ifdef DSERR_OUTOFMEMORY case DSERR_OUTOFMEMORY: - str =3D "The DirectSound subsystem could not allocate sufficient m= emory to complete the caller's request"; + str =3D "The DirectSound subsystem could not allocate " + "sufficient memory to complete the caller's request"; break; #endif #ifdef DSERR_PRIOLEVELNEEDED @@ -189,7 +204,9 @@ static void dsound_log_hresult (HRESULT hr) #endif #ifdef DSERR_UNINITIALIZED case DSERR_UNINITIALIZED: - str =3D "The Initialize method has not been called or has not been= called successfully before other methods were called"; + str =3D "The Initialize method has not been called " + "or has not been called successfully " + "before other methods were called"; break; #endif #ifdef DSERR_UNSUPPORTED --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610717978; cv=none; d=zohomail.com; s=zohoarc; b=M1dO6dZXVXzYRz+uqpYKNh6YmtYt2EechtUn9TafHRiN3lLniESmHrHdZ2o6mp2eeplqG6emvfMZp+EAl7R8MTwBxKY6udjfiNXF4dV9vZi2f9dGSaMa07DN9rmxvkscnVhVJJVgboiwcU/s7X35Uzf0toGvGps92BlN4iiaeC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610717978; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UaJlBs1RGlo85pE8iAhyfpmd5b7xGp0eRC8W6g+hVs0=; b=O/+j47m4EVxCLomiQqVCNfc5N1eW/Hb2gFWCFp0TERQFFFC7VepPDSty7v/YtaZJhz858CvIZdrBPKPp/b0s+SNhmwbNfpi5ourpDrAJjsDD2muLquWUquaYAlNTGwFlvf+9PFB6IZHYTJwfMhep643BuO/XsFrSlbqlKPHh2pg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610717978462665.8381326193692; Fri, 15 Jan 2021 05:39:38 -0800 (PST) Received: from localhost ([::1]:52434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PKD-00062f-4i for importer@patchew.org; Fri, 15 Jan 2021 08:39:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3N-000770-SH for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23527) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3A-0003Ji-P5 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-fbrE8W3INZaBbElZKokeZw-1; Fri, 15 Jan 2021 08:21:58 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8629180A093; Fri, 15 Jan 2021 13:21:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A87E26F963; Fri, 15 Jan 2021 13:21:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7148F1800D58; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UaJlBs1RGlo85pE8iAhyfpmd5b7xGp0eRC8W6g+hVs0=; b=LljGopQnK1hCJJb7i7FpQPA25D4iJs6+6C2g1EK2A45MGdKIf4WrG5aFPLmT9aZMk2OglM Z1JsyKuXoQquakOkOstN7Y1ZcT2w0oJCNIpqM1+XANIitUhr46CJSHBraNRdymI60HUVYI QeviHff9iGAirSAdvs7pxNBadAiCDuk= X-MC-Unique: fbrE8W3INZaBbElZKokeZw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 28/30] audio: Don't use '%#' in format strings Date: Fri, 15 Jan 2021 14:21:44 +0100 Message-Id: <20210115132146.1443592-29-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Han , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Zhang Han Use '0x' prefix instead of '%#' Signed-off-by: Zhang Han Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-6-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann --- audio/dsoundaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 3b4afb949631..cfc79c129eee 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -215,7 +215,7 @@ static void dsound_log_hresult (HRESULT hr) break; #endif default: - AUD_log (AUDIO_CAP, "Reason: Unknown (HRESULT %#lx)\n", hr); + AUD_log (AUDIO_CAP, "Reason: Unknown (HRESULT 0x%lx)\n", hr); return; } =20 --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610720204; cv=none; d=zohomail.com; s=zohoarc; b=Q3woSyf+fK8zbEOgE3BMvcH38dHew9JXfWe3Gkop6s2u1hLkFnRgwIx0Jwi+156CVaP8L6gI9dkyoiujj5DgPJm2LPZAqgSMPXjQuCxr2eIx7OiPrG767QOZWGXkL8RUMG/YNG8hn7dEhTDPJCr+cQyDGEpBhro8NNgAdm2t2qI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610720204; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3tV4h77ogbuxZUtC99xFigf8lG3OGrrMrJSIRuBasJQ=; b=OnxvnDo4oII1eC+xD4rKoHbPq251UBq4thvyEEu4QNdxooIehnSQfxkPVkdpOCW2nWuIWqVnmY67b6ZdGkJEw/r4SmSdq8J1iyjJysREu/xF4Qsj8IAJ0xvmHOWUbpix/lUekRiu0gE12z80S3OdDYENV7IpJ4RafT6XrUkZa+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610720204449466.66910463283546; Fri, 15 Jan 2021 06:16:44 -0800 (PST) Received: from localhost ([::1]:48526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Pu6-00023L-U8 for importer@patchew.org; Fri, 15 Jan 2021 09:16:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3h-0007Ei-Nq for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:48027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3I-0003M4-2j for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:33 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-KXb3hMChMr6CaNKFps8Zhw-1; Fri, 15 Jan 2021 08:22:01 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F3B6CE642; Fri, 15 Jan 2021 13:22:00 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 37DBE63747; Fri, 15 Jan 2021 13:22:00 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7BA371800D59; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3tV4h77ogbuxZUtC99xFigf8lG3OGrrMrJSIRuBasJQ=; b=BooMQ2C6VDsB19WloeUtjaxbBvvvBlIzugJlUC0lI9y8TO9SuOAnwB/c45+tOlJO6HYRdw UyQmXu3Tt9SS5p3v+inh7RlEYylkB6aL7Op1vMVA5UjFfMpGk8RxoqUu1wo3LRD9wL7SLD SmepnbQ0BjnpE3/E3ob+e4qwJHosb4w= X-MC-Unique: KXb3hMChMr6CaNKFps8Zhw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 29/30] audio: Suspect code indent for conditional statements Date: Fri, 15 Jan 2021 14:21:45 +0100 Message-Id: <20210115132146.1443592-30-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Han , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Zhang Han Fix code indent. Signed-off-by: Zhang Han Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-7-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann --- audio/paaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index 1e6f4448ce37..c97b22e970d8 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -480,7 +480,7 @@ static pa_stream *qpa_simple_new ( } =20 if (r < 0) { - goto fail; + goto fail; } =20 pa_threaded_mainloop_unlock(c->mainloop); --=20 2.29.2 From nobody Tue May 14 14:12:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610718588; cv=none; d=zohomail.com; s=zohoarc; b=EJPFMPBFkcdAXsk77epJRE732opLV5FF5GV7dLEpWga91piw+YqhKz+lZzjrgyHOMsACl1YCRxCU/5GTzvXsGaud4F73EeZclmXQCdpykF0fU/n1iXhcwjAiKuSZBwnIo67efbAl8jbMu26BAZZKsx92s1o9GcH0Sas/YyGd7eI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610718588; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ieEtz9inMaPDHP22qFuU9z212My8cb+nsAi/mVgAWmM=; b=EeHgnHJ2uRXOS6IzgyLwyDFomw+l9cD2hfy3wQyWpitiLO8jBuUrfLzn4xq6/nwWh2NJuZIknMeHY5tGeCkn/gA2VrBL7nSX+J8wu7MFihZ50WXVUdvbFgJ79+GbfCLk35IVZQpOlCIsPRkow8X0a17sOtZXGPKIiCa2+IkaEwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610718588060473.94501266439977; Fri, 15 Jan 2021 05:49:48 -0800 (PST) Received: from localhost ([::1]:59012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0PU2-0003wf-Tl for importer@patchew.org; Fri, 15 Jan 2021 08:49:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0P3j-0007FR-HV for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0P3H-0003M0-QH for qemu-devel@nongnu.org; Fri, 15 Jan 2021 08:22:35 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-573-BmDiFk5tOkuAJkUZ8Pvx_g-1; Fri, 15 Jan 2021 08:22:01 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 747B7107ACF8; Fri, 15 Jan 2021 13:22:00 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 383541002C11; Fri, 15 Jan 2021 13:22:00 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8BA121800D5A; Fri, 15 Jan 2021 14:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610716923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ieEtz9inMaPDHP22qFuU9z212My8cb+nsAi/mVgAWmM=; b=eHWAlhI9rWsR7LBUPo1HGKc0+ZEhe+QghczdEkgPT/xv1Z6CrG8WAAm9HHJIddjWOc+nsT Hvca7u9JDEDvqu0p4CBMQLmu+vkP7wuUZktJBW4F6lGMLLZt4vbPpYP+XLjE5nGOBsX2wi XKpkzCXKpyHlZSOEVaIlcRLtISIO8V8= X-MC-Unique: BmDiFk5tOkuAJkUZ8Pvx_g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 30/30] audio: space prohibited between function name and parenthesis'(' Date: Fri, 15 Jan 2021 14:21:46 +0100 Message-Id: <20210115132146.1443592-31-kraxel@redhat.com> In-Reply-To: <20210115132146.1443592-1-kraxel@redhat.com> References: <20210115132146.1443592-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Han , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Zhang Han Delete spaces between function name and open parenthesis'(' Signed-off-by: Zhang Han Message-id: 20210115012431.79533-1-zhanghan64@huawei.com Message-Id: <20210115012431.79533-8-zhanghan64@huawei.com> Signed-off-by: Gerd Hoffmann --- audio/audio_template.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index f82593bb8db2..c6714946aaed 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -203,13 +203,13 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp) =20 if (!hw->sw_head.lh_first) { #ifdef DAC - audio_detach_capture (hw); + audio_detach_capture(hw); #endif - QLIST_REMOVE (hw, entries); - glue (hw->pcm_ops->fini_, TYPE) (hw); - glue (s->nb_hw_voices_, TYPE) +=3D 1; - glue (audio_pcm_hw_free_resources_ , TYPE) (hw); - g_free (hw); + QLIST_REMOVE(hw, entries); + glue(hw->pcm_ops->fini_, TYPE) (hw); + glue(s->nb_hw_voices_, TYPE) +=3D 1; + glue(audio_pcm_hw_free_resources_ , TYPE) (hw); + g_free(hw); *hwp =3D NULL; } } --=20 2.29.2