From patchwork Sat May 6 16:37:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778032 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KRB59Q/w; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCvv3Nj5z213r for ; Sun, 7 May 2023 02:40:11 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKuu-0000ol-AM; Sat, 06 May 2023 12:37:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKus-0000oL-F4 for qemu-devel@nongnu.org; Sat, 06 May 2023 12:37:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKuq-0003u4-UW for qemu-devel@nongnu.org; Sat, 06 May 2023 12:37:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391067; 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=vEsdInr11R7MES8DB3cC0QDiQG9fD71pr/Jhqm8Hwo8=; b=KRB59Q/wVHvt9GSSb7QpXTPYsXMUoEFejW8YjAQitfVPiEAVVmxdXHzlXISTcDnCLOYAha ZdZX7zqmVQVb8eRIG2QAuxlHd7WPNcbiSq8exgxVMJLvZCEKo58YBVEOz3jjq90fCKRW63 WOWqWXFX+zk0YIjIxKGUYy6hzQx+aWk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-465-EpH9SFrqORqw_4C8MtrB5w-1; Sat, 06 May 2023 12:37:44 -0400 X-MC-Unique: EpH9SFrqORqw_4C8MtrB5w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2536F868C8D; Sat, 6 May 2023 16:37:44 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4562B492B00; Sat, 6 May 2023 16:37:42 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 01/12] libvirt-ci: update submodule to cover pipewire Date: Sat, 6 May 2023 20:37:24 +0400 Message-Id: <20230506163735.3481387-2-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau List of upstream changes: Abdulwasiu Apalowo (6): commandline: add default tag information to image argument containers: add tag parameter to image_exists method lcitool: edit error message during container run (or shell) operation. containers: change the mode bits of --script argument containers: mount temporary directory to user's home in the container containers: always change workdir to the user's home Ani Sinha (1): mappings: add new package mappings for mformat and xorriso Erik Skultety (17): docs: mappings: Add a section on the preferred mapping naming scheme facts: projects: nbdkit: Replace zstd mapping with libzstd facts: mappings: Drop 'zstd' mapping facts: targets: Add Fedora 38 gitlab-ci.yml: Add Fedora 38 target facts: targets: Drop Fedora 36 target Add a pytest.ini tests: commands: Consolidate the installed package/run from git tests Add tox.ini configuration file test-requirements: Rename to dev-requirements.txt requirements: Add tox to dev-requirements.txt and drop pytest and flake dev-requirements: Reference VM requirements gitignore: Add the default .tox directory tox: Allow running with custom pytest options with {posargs} gitlab-ci.yml: Start using tox for testing .gitlab-ci.yml: Always test against installed lcitool docs: testing: Update contents with tox Marc-André Lureau (1): facts/mappings & qemu: add pipewire Signed-off-by: Marc-André Lureau --- tests/lcitool/libvirt-ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index 85487e1404..2e0571c3e0 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit 85487e140415b2ac54b01a9a6b600fd7c21edc2f +Subproject commit 2e0571c3e0722c79b90decb2c7fd9fa1deebbd46 From patchwork Sat May 6 16:37:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UR5ANLlp; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCt73Q01z214Q for ; Sun, 7 May 2023 02:38:37 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKuv-0000p9-TH; Sat, 06 May 2023 12:37:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKuu-0000oq-Gv for qemu-devel@nongnu.org; Sat, 06 May 2023 12:37:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKus-0003uG-Oq for qemu-devel@nongnu.org; Sat, 06 May 2023 12:37:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391070; 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=xwejv7DYvVSWvwi8Ow5ac4qwO62V0YHQNUH8Kwj5O1g=; b=UR5ANLlpbTfKUwXy74ErkQur8nUZDTG0lbfNm/ufhs85PwQXZW9e7X1yLIpzeIO1IZE8Y/ Qt1xkIPx71XYIHcOEb/lFUwXIOvrx7bztTG4Jh8/rX5eAZBNJglNlwgNuwhoLdARvZcUgV UPoODRkgDK0PPhCPuSLtxxpG3x6LgUc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-416-NPtXl0kvN5miPmSEVn_RLg-1; Sat, 06 May 2023 12:37:48 -0400 X-MC-Unique: NPtXl0kvN5miPmSEVn_RLg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 673F4878521; Sat, 6 May 2023 16:37:48 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCEA41401C51; Sat, 6 May 2023 16:37:46 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 02/12] tests/lcitool: add pipewire Date: Sat, 6 May 2023 20:37:25 +0400 Message-Id: <20230506163735.3481387-3-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- tests/docker/dockerfiles/alpine.docker | 1 + tests/docker/dockerfiles/centos8.docker | 1 + tests/docker/dockerfiles/debian-amd64-cross.docker | 1 + tests/docker/dockerfiles/debian-amd64.docker | 1 + tests/docker/dockerfiles/debian-arm64-cross.docker | 1 + tests/docker/dockerfiles/debian-armel-cross.docker | 1 + tests/docker/dockerfiles/debian-armhf-cross.docker | 1 + tests/docker/dockerfiles/debian-mips64el-cross.docker | 1 + tests/docker/dockerfiles/debian-mipsel-cross.docker | 1 + tests/docker/dockerfiles/debian-ppc64el-cross.docker | 1 + tests/docker/dockerfiles/debian-s390x-cross.docker | 1 + tests/docker/dockerfiles/fedora.docker | 1 + tests/docker/dockerfiles/opensuse-leap.docker | 1 + tests/docker/dockerfiles/ubuntu2204.docker | 1 + tests/lcitool/projects/qemu.yml | 1 + 15 files changed, 15 insertions(+) diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker index 81c70aeaf9..d47101e042 100644 --- a/tests/docker/dockerfiles/alpine.docker +++ b/tests/docker/dockerfiles/alpine.docker @@ -77,6 +77,7 @@ RUN apk update && \ numactl-dev \ openssh-client \ pcre-dev \ + pipewire-dev \ pixman-dev \ pkgconf \ pulseaudio-dev \ diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker index 1a6a9087c1..f7d46ebd9c 100644 --- a/tests/docker/dockerfiles/centos8.docker +++ b/tests/docker/dockerfiles/centos8.docker @@ -90,6 +90,7 @@ RUN dnf distro-sync -y && \ openssh-clients \ pam-devel \ pcre-static \ + pipewire-devel \ pixman-devel \ pkgconfig \ pulseaudio-libs-devel \ diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/docker/dockerfiles/debian-amd64-cross.docker index 2e7eb445f1..26109fe4d6 100644 --- a/tests/docker/dockerfiles/debian-amd64-cross.docker +++ b/tests/docker/dockerfiles/debian-amd64-cross.docker @@ -114,6 +114,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnfs-dev:amd64 \ libnuma-dev:amd64 \ libpam0g-dev:amd64 \ + libpipewire-0.3-dev:amd64 \ libpixman-1-dev:amd64 \ libpmem-dev:amd64 \ libpng-dev:amd64 \ diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker index 28e2fa81b1..8ba1c13d8d 100644 --- a/tests/docker/dockerfiles/debian-amd64.docker +++ b/tests/docker/dockerfiles/debian-amd64.docker @@ -70,6 +70,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnuma-dev \ libpam0g-dev \ libpcre2-dev \ + libpipewire-0.3-dev \ libpixman-1-dev \ libpmem-dev \ libpng-dev \ diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker index f558770f84..f560ed6044 100644 --- a/tests/docker/dockerfiles/debian-arm64-cross.docker +++ b/tests/docker/dockerfiles/debian-arm64-cross.docker @@ -114,6 +114,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnfs-dev:arm64 \ libnuma-dev:arm64 \ libpam0g-dev:arm64 \ + libpipewire-0.3-dev:arm64 \ libpixman-1-dev:arm64 \ libpng-dev:arm64 \ libpulse-dev:arm64 \ diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/docker/dockerfiles/debian-armel-cross.docker index f3d7e07cce..41f9f67417 100644 --- a/tests/docker/dockerfiles/debian-armel-cross.docker +++ b/tests/docker/dockerfiles/debian-armel-cross.docker @@ -114,6 +114,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnfs-dev:armel \ libnuma-dev:armel \ libpam0g-dev:armel \ + libpipewire-0.3-dev:armel \ libpixman-1-dev:armel \ libpng-dev:armel \ libpulse-dev:armel \ diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/docker/dockerfiles/debian-armhf-cross.docker index 531c556ad5..1a095c6506 100644 --- a/tests/docker/dockerfiles/debian-armhf-cross.docker +++ b/tests/docker/dockerfiles/debian-armhf-cross.docker @@ -114,6 +114,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnfs-dev:armhf \ libnuma-dev:armhf \ libpam0g-dev:armhf \ + libpipewire-0.3-dev:armhf \ libpixman-1-dev:armhf \ libpng-dev:armhf \ libpulse-dev:armhf \ diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/docker/dockerfiles/debian-mips64el-cross.docker index 816dbd2911..de001a7532 100644 --- a/tests/docker/dockerfiles/debian-mips64el-cross.docker +++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker @@ -113,6 +113,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnfs-dev:mips64el \ libnuma-dev:mips64el \ libpam0g-dev:mips64el \ + libpipewire-0.3-dev:mips64el \ libpixman-1-dev:mips64el \ libpng-dev:mips64el \ libpulse-dev:mips64el \ diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/docker/dockerfiles/debian-mipsel-cross.docker index b115b29af3..993de380d7 100644 --- a/tests/docker/dockerfiles/debian-mipsel-cross.docker +++ b/tests/docker/dockerfiles/debian-mipsel-cross.docker @@ -113,6 +113,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnfs-dev:mipsel \ libnuma-dev:mipsel \ libpam0g-dev:mipsel \ + libpipewire-0.3-dev:mipsel \ libpixman-1-dev:mipsel \ libpng-dev:mipsel \ libpulse-dev:mipsel \ diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker index 301bddb536..5120b29634 100644 --- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker +++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker @@ -114,6 +114,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnfs-dev:ppc64el \ libnuma-dev:ppc64el \ libpam0g-dev:ppc64el \ + libpipewire-0.3-dev:ppc64el \ libpixman-1-dev:ppc64el \ libpng-dev:ppc64el \ libpulse-dev:ppc64el \ diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/docker/dockerfiles/debian-s390x-cross.docker index 5d27c91c17..cef629f68d 100644 --- a/tests/docker/dockerfiles/debian-s390x-cross.docker +++ b/tests/docker/dockerfiles/debian-s390x-cross.docker @@ -114,6 +114,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnfs-dev:s390x \ libnuma-dev:s390x \ libpam0g-dev:s390x \ + libpipewire-0.3-dev:s390x \ libpixman-1-dev:s390x \ libpng-dev:s390x \ libpulse-dev:s390x \ diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index b698b7595d..4e087cc2f9 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -98,6 +98,7 @@ exec "$@"\n' > /usr/bin/nosync && \ openssh-clients \ pam-devel \ pcre-static \ + pipewire-devel \ pixman-devel \ pkgconfig \ pulseaudio-libs-devel \ diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker index afb9f5419f..2f13d446d2 100644 --- a/tests/docker/dockerfiles/opensuse-leap.docker +++ b/tests/docker/dockerfiles/opensuse-leap.docker @@ -88,6 +88,7 @@ RUN zypper update -y && \ openssh \ pam-devel \ pcre-devel-static \ + pipewire-devel \ pkgconfig \ python39-base \ python39-pip \ diff --git a/tests/docker/dockerfiles/ubuntu2204.docker b/tests/docker/dockerfiles/ubuntu2204.docker index 3f7d30e5d0..8ebb2ee1d6 100644 --- a/tests/docker/dockerfiles/ubuntu2204.docker +++ b/tests/docker/dockerfiles/ubuntu2204.docker @@ -70,6 +70,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libnuma-dev \ libpam0g-dev \ libpcre2-dev \ + libpipewire-0.3-dev \ libpixman-1-dev \ libpmem-dev \ libpng-dev \ diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml index af3700379a..117c872f62 100644 --- a/tests/lcitool/projects/qemu.yml +++ b/tests/lcitool/projects/qemu.yml @@ -84,6 +84,7 @@ packages: - pam - pcre-static - pixman + - pipewire - pkg-config - pulseaudio - python3 From patchwork Sat May 6 16:37:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778029 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SL2Dbs7f; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCvV5x92z214M for ; Sun, 7 May 2023 02:39:50 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKv4-0000q2-Eh; Sat, 06 May 2023 12:38:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKv0-0000pX-Vf for qemu-devel@nongnu.org; Sat, 06 May 2023 12:37:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKuz-0003uv-8e for qemu-devel@nongnu.org; Sat, 06 May 2023 12:37:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391076; 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=CDtn4bI9tWUbVUdKV9Jvn0quuetWap17IQM/cU2XGLo=; b=SL2Dbs7fzcVU9BVD2ZXmghU2EH1Qsi48zbCvcJaMhev2cY5a9MOJxuPedGKSpqr9zBzqki EaD2GILKjKDQHaVvY0zqtPaWDuJYMhvvYUbQYHIm3WdgoqC5x0ji2IcgaXefqRDYaBvQGt ArYSg5ia/ySUSf8cKM6Lq2Fk/529I34= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-632-TKmEfzkyOfmSgSh7g_uamQ-1; Sat, 06 May 2023 12:37:53 -0400 X-MC-Unique: TKmEfzkyOfmSgSh7g_uamQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34955185A78B; Sat, 6 May 2023 16:37:53 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F97D2026D25; Sat, 6 May 2023 16:37:51 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 03/12] audio/pw: Pipewire->PipeWire case fix for user-visible text Date: Sat, 6 May 2023 20:37:26 +0400 Message-Id: <20230506163735.3481387-4-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau "PipeWire" is the correct case. Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin Reviewed-by: Philippe Mathieu-Daudé --- meson.build | 2 +- qapi/audio.json | 12 ++++++------ audio/pwaudio.c | 10 +++++----- audio/trace-events | 2 +- meson_options.txt | 2 +- qemu-options.hx | 4 ++-- scripts/meson-buildoptions.sh | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index 229eb585f7..4c44736bd4 100644 --- a/meson.build +++ b/meson.build @@ -3988,7 +3988,7 @@ if targetos == 'linux' summary_info += {'ALSA support': alsa} summary_info += {'PulseAudio support': pulse} endif -summary_info += {'Pipewire support': pipewire} +summary_info += {'PipeWire support': pipewire} summary_info += {'JACK support': jack} summary_info += {'brlapi support': brlapi} summary_info += {'vde support': vde} diff --git a/qapi/audio.json b/qapi/audio.json index e03396a7bc..b5c1af2b91 100644 --- a/qapi/audio.json +++ b/qapi/audio.json @@ -327,17 +327,17 @@ ## # @AudiodevPipewirePerDirectionOptions: # -# Options of the Pipewire backend that are used for both playback and +# Options of the PipeWire backend that are used for both playback and # recording. # # @name: name of the sink/source to use # -# @stream-name: name of the Pipewire stream created by qemu. Can be -# used to identify the stream in Pipewire when you -# create multiple Pipewire devices or run multiple qemu +# @stream-name: name of the PipeWire stream created by qemu. Can be +# used to identify the stream in PipeWire when you +# create multiple PipeWire devices or run multiple qemu # instances (default: audiodev's id) # -# @latency: latency you want Pipewire to achieve in microseconds +# @latency: latency you want PipeWire to achieve in microseconds # (default 46000) # # Since: 8.1 @@ -352,7 +352,7 @@ ## # @AudiodevPipewireOptions: # -# Options of the Pipewire audio backend. +# Options of the PipeWire audio backend. # # @in: options of the capture stream # diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 1d108bdebb..9eb69bfd18 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -1,5 +1,5 @@ /* - * QEMU Pipewire audio driver + * QEMU PipeWire audio driver * * Copyright (c) 2023 Red Hat Inc. * @@ -800,21 +800,21 @@ qpw_audio_init(Audiodev *dev) assert(dev->driver == AUDIODEV_DRIVER_PIPEWIRE); pw->dev = dev; - pw->thread_loop = pw_thread_loop_new("Pipewire thread loop", NULL); + pw->thread_loop = pw_thread_loop_new("PipeWire thread loop", NULL); if (pw->thread_loop == NULL) { - error_report("Could not create Pipewire loop"); + error_report("Could not create PipeWire loop"); goto fail; } pw->context = pw_context_new(pw_thread_loop_get_loop(pw->thread_loop), NULL, 0); if (pw->context == NULL) { - error_report("Could not create Pipewire context"); + error_report("Could not create PipeWire context"); goto fail; } if (pw_thread_loop_start(pw->thread_loop) < 0) { - error_report("Could not start Pipewire loop"); + error_report("Could not start PipeWire loop"); goto fail; } diff --git a/audio/trace-events b/audio/trace-events index 85dbb506b2..ab04f020ce 100644 --- a/audio/trace-events +++ b/audio/trace-events @@ -24,7 +24,7 @@ pw_read(int32_t avail, uint32_t index, size_t len) "avail=%d index=%u len=%zu" pw_write(int32_t filled, int32_t avail, uint32_t index, size_t len) "filled=%d avail=%d index=%u len=%zu" pw_vol(const char *ret) "set volume: %s" pw_period(uint64_t quantum, uint32_t rate) "period =%" PRIu64 "/%u" -pw_audio_init(void) "Initialize Pipewire context" +pw_audio_init(void) "Initialize PipeWire context" # audio.c audio_timer_start(int interval) "interval %d ms" diff --git a/meson_options.txt b/meson_options.txt index ae2017702a..8dd786c1a4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -256,7 +256,7 @@ option('oss', type: 'feature', value: 'auto', option('pa', type: 'feature', value: 'auto', description: 'PulseAudio sound support') option('pipewire', type: 'feature', value: 'auto', - description: 'Pipewire sound support') + description: 'PipeWire sound support') option('sndio', type: 'feature', value: 'auto', description: 'sndio sound support') diff --git a/qemu-options.hx b/qemu-options.hx index 42b9094c10..be7317d455 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -963,10 +963,10 @@ SRST to honor this value but actual latencies may be lower or higher. ``-audiodev pipewire,id=id[,prop[=value][,...]]`` - Creates a backend using Pipewire. This backend is available on + Creates a backend using PipeWire. This backend is available on most systems. - Pipewire specific options are: + PipeWire specific options are: ``in|out.latency=usecs`` Desired latency in microseconds. diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 0e888e6ecd..ba697207f4 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -137,7 +137,7 @@ meson_options_help() { printf "%s\n" ' oss OSS sound support' printf "%s\n" ' pa PulseAudio sound support' printf "%s\n" ' parallels parallels image format support' - printf "%s\n" ' pipewire Pipewire sound support' + printf "%s\n" ' pipewire PipeWire sound support' printf "%s\n" ' png PNG support with libpng' printf "%s\n" ' pvrdma Enable PVRDMA support' printf "%s\n" ' qcow1 qcow1 image format support' From patchwork Sat May 6 16:37:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZrK1Mew6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCtT3LDHz214M for ; Sun, 7 May 2023 02:38:57 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKv6-0000qR-1e; Sat, 06 May 2023 12:38:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKv4-0000q3-RL for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKv3-0003vC-Cn for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391080; 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=ZA4EwvHQidFMH3xvcnGopTum5LFN04GT1qui3WfojWw=; b=ZrK1Mew6Xy/mlClwuTl1kb+RogH86nIcnXniS7pPNalFBVv8g0lx7qGDLD8BLlz42cjE83 sk3Wp1NOpEiXp6N8N5xBF4RWzJ31pJJ8XkvsxoXJwsz4SRxGzJLxk5GURbDRFrPwyyE+64 jaZInZr8cL5ELylHljDZPuOZCz61tVo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-314-1oxhXPYvOESR76B1_XrwgA-1; Sat, 06 May 2023 12:37:57 -0400 X-MC-Unique: 1oxhXPYvOESR76B1_XrwgA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 31D2280080E; Sat, 6 May 2023 16:37:57 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 278C01401C51; Sat, 6 May 2023 16:37:55 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 04/12] audio/pw: drop needless case statement Date: Sat, 6 May 2023 20:37:27 +0400 Message-Id: <20230506163735.3481387-5-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin --- audio/pwaudio.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 9eb69bfd18..51cfc0b052 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -197,16 +197,6 @@ on_stream_state_changed(void *data, enum pw_stream_state old, trace_pw_state_changed(pw_stream_get_node_id(v->stream), pw_stream_state_as_string(state)); - - switch (state) { - case PW_STREAM_STATE_ERROR: - case PW_STREAM_STATE_UNCONNECTED: - break; - case PW_STREAM_STATE_PAUSED: - case PW_STREAM_STATE_CONNECTING: - case PW_STREAM_STATE_STREAMING: - break; - } } static const struct pw_stream_events capture_stream_events = { From patchwork Sat May 6 16:37:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778022 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fJMZuiPW; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCtM01Kgz214M for ; Sun, 7 May 2023 02:38:50 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKv9-0000qj-KP; Sat, 06 May 2023 12:38:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKv8-0000qb-PG for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKv7-0003vU-Fb for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391084; 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=ob1cq3THj1mi9YXFyqyeop1OuoQTQQg9JTwTEvCCLgI=; b=fJMZuiPWFMSmrp2qh58z2j1b48xuD4rSG5l+mxSBCVC4YyiHCHyclsMXgTbnylcw+jfPeG LAdUk6MWMTkvmvlcQOAwHIsv3qYLLMj35pbdY24isvQj3tH/YyaMdqB5hrhXWMl8YipS25 M/WHlGGr+6aklnZ6VHonBQmA5qht3Y8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-265-KUjoLv20NdyFqSynhOjIOA-1; Sat, 06 May 2023 12:38:01 -0400 X-MC-Unique: KUjoLv20NdyFqSynhOjIOA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 090A2885623; Sat, 6 May 2023 16:38:01 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E66DC15BA0; Sat, 6 May 2023 16:38:00 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 05/12] audio/pw: needless check for NULL Date: Sat, 6 May 2023 20:37:28 +0400 Message-Id: <20230506163735.3481387-6-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau g_clear_pointer() already checks for NULL. Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin --- audio/pwaudio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 51cfc0b052..6ca4ef4f62 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -834,12 +834,8 @@ fail: if (pw->thread_loop) { pw_thread_loop_stop(pw->thread_loop); } - if (pw->context) { - g_clear_pointer(&pw->context, pw_context_destroy); - } - if (pw->thread_loop) { - g_clear_pointer(&pw->thread_loop, pw_thread_loop_destroy); - } + g_clear_pointer(&pw->context, pw_context_destroy); + g_clear_pointer(&pw->thread_loop, pw_thread_loop_destroy); return NULL; } From patchwork Sat May 6 16:37:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RqrKRgBD; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCtc48vqz214M for ; Sun, 7 May 2023 02:39:04 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKvF-0000rK-UC; Sat, 06 May 2023 12:38:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvD-0000r6-HS for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvC-0003vy-6J for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391089; 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=mRjiwsbL9Zg6dR43Y5m6ku6dEw2FGOakJHK490cT2zk=; b=RqrKRgBDL46iHGDlivQDdJ6/KBj2foIf1NqDZ7qG4QEyiIHFTqnTZdpu84h6dzJqy0lX7x eFmCYxywlkqqhj1gFXZw++ixdRtLdHe3wWm+2Rv24GHRPcPZKITMrq+xr60uwsMfanD126 kY4HS4sDLTvTgAeZ8qMrJ7ReDfm9V8w= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-558-ivgonIcLPKqs6wbfgpu9vA-1; Sat, 06 May 2023 12:38:05 -0400 X-MC-Unique: ivgonIcLPKqs6wbfgpu9vA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A4C23C025CD; Sat, 6 May 2023 16:38:05 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D62FC15BA0; Sat, 6 May 2023 16:38:03 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 06/12] audio/pw: trace during init before calling pipewire API Date: Sat, 6 May 2023 20:37:29 +0400 Message-Id: <20230506163735.3481387-7-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin Reviewed-by: Philippe Mathieu-Daudé --- audio/pwaudio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 6ca4ef4f62..2b12b40934 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -784,10 +784,11 @@ static void * qpw_audio_init(Audiodev *dev) { g_autofree pwaudio *pw = g_new0(pwaudio, 1); - pw_init(NULL, NULL); - trace_pw_audio_init(); assert(dev->driver == AUDIODEV_DRIVER_PIPEWIRE); + trace_pw_audio_init(); + + pw_init(NULL, NULL); pw->dev = dev; pw->thread_loop = pw_thread_loop_new("PipeWire thread loop", NULL); From patchwork Sat May 6 16:37:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PQVZNCsv; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCt72xnnz214M for ; Sun, 7 May 2023 02:38:37 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKvJ-0000sJ-5r; Sat, 06 May 2023 12:38:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvH-0000re-BI for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvF-0003yj-Vz for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391093; 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=MhF7m7kFscsaWhVEZveqwEFEAiJmODc3uKbrEXgeqCM=; b=PQVZNCsvpJX9sYcWRZlwEcXmjujaDqBKh09srOlOu9bDmwTskgSCwrX0yrOB0JmWlmzGan J4tU8VKkfgg4LKuUCBzehE3eq6msec6kg7UyvV/SfpsYDJmF0FOHnC3HulLp9XIVGZGFz9 13YHdVshHlC7cf+NpGSzOQkRQ+I0eLc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-PqGtU4XuOcWD7Ws0FE3i9w-1; Sat, 06 May 2023 12:38:10 -0400 X-MC-Unique: PqGtU4XuOcWD7Ws0FE3i9w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C8BA2381459B; Sat, 6 May 2023 16:38:09 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9D1C2166B31; Sat, 6 May 2023 16:38:08 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 07/12] audio/pw: add more details on error Date: Sat, 6 May 2023 20:37:30 +0400 Message-Id: <20230506163735.3481387-8-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau PipeWire uses errno to report error details. Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin --- audio/pwaudio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 2b12b40934..d0bc4680a6 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -750,6 +750,7 @@ static int wait_resync(pwaudio *pw) } return 0; } + static void on_core_error(void *data, uint32_t id, int seq, int res, const char *message) { @@ -793,19 +794,19 @@ qpw_audio_init(Audiodev *dev) pw->dev = dev; pw->thread_loop = pw_thread_loop_new("PipeWire thread loop", NULL); if (pw->thread_loop == NULL) { - error_report("Could not create PipeWire loop"); + error_report("Could not create PipeWire loop: %s", g_strerror(errno)); goto fail; } pw->context = pw_context_new(pw_thread_loop_get_loop(pw->thread_loop), NULL, 0); if (pw->context == NULL) { - error_report("Could not create PipeWire context"); + error_report("Could not create PipeWire context: %s", g_strerror(errno)); goto fail; } if (pw_thread_loop_start(pw->thread_loop) < 0) { - error_report("Could not start PipeWire loop"); + error_report("Could not start PipeWire loop: %s", g_strerror(errno)); goto fail; } From patchwork Sat May 6 16:37:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GyUwnjm6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCts4Grrz214M for ; Sun, 7 May 2023 02:39:17 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKvP-0000tQ-Hz; Sat, 06 May 2023 12:38:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvN-0000t4-7l for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvL-00041L-IB for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391098; 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=DSiBYtkg23qajy6CBc1hd0LBHS3qyBtHW1cfIuhjnB0=; b=GyUwnjm6QCxUNXjJIV8iVZLk6BtVrV0ltqeCgHdBlAgbn88w4CGZ7ZQou1PZlPAcGOEdN7 0jh+zP6LST18zLDA6lE0pbsEHefaTRm8h+aj1/DEHhXpmdAXd5V2Cq7Te8IfrYNS2KTx74 vYAkL1Vw/kBmcS1PEuUY9zTxhszkCyg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-589-tbh9k-5kNvWTolnBhgRtJg-1; Sat, 06 May 2023 12:38:14 -0400 X-MC-Unique: tbh9k-5kNvWTolnBhgRtJg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DEFD1185A79C; Sat, 6 May 2023 16:38:13 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7133492B07; Sat, 6 May 2023 16:38:12 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 08/12] audio/pw: factorize some common code Date: Sat, 6 May 2023 20:37:31 +0400 Message-Id: <20230506163735.3481387-9-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin --- audio/pwaudio.c | 85 ++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 51 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index d0bc4680a6..67df53948c 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -66,6 +66,9 @@ typedef struct PWVoiceIn { PWVoice v; } PWVoiceIn; +#define PW_VOICE_IN(v) ((PWVoiceIn*)v) +#define PW_VOICE_OUT(v) ((PWVoiceOut*)v) + static void stream_destroy(void *data) { @@ -630,62 +633,55 @@ qpw_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) } static void -qpw_fini_out(HWVoiceOut *hw) +qpw_voice_fini(PWVoice *v) { - PWVoiceOut *pw = (PWVoiceOut *) hw; - PWVoice *v = &pw->v; + pwaudio *c = v->g; - if (v->stream) { - pwaudio *c = v->g; - pw_thread_loop_lock(c->thread_loop); - pw_stream_destroy(v->stream); - v->stream = NULL; - pw_thread_loop_unlock(c->thread_loop); + if (!v->stream) { + return; } + pw_thread_loop_lock(c->thread_loop); + pw_stream_destroy(v->stream); + v->stream = NULL; + pw_thread_loop_unlock(c->thread_loop); } static void -qpw_fini_in(HWVoiceIn *hw) +qpw_fini_out(HWVoiceOut *hw) { - PWVoiceIn *pw = (PWVoiceIn *) hw; - PWVoice *v = &pw->v; + qpw_voice_fini(&PW_VOICE_OUT(hw)->v); +} - if (v->stream) { - pwaudio *c = v->g; - pw_thread_loop_lock(c->thread_loop); - pw_stream_destroy(v->stream); - v->stream = NULL; - pw_thread_loop_unlock(c->thread_loop); - } +static void +qpw_fini_in(HWVoiceIn *hw) +{ + qpw_voice_fini(&PW_VOICE_IN(hw)->v); } static void -qpw_enable_out(HWVoiceOut *hw, bool enable) +qpw_voice_set_enabled(PWVoice *v, bool enable) { - PWVoiceOut *po = (PWVoiceOut *) hw; - PWVoice *v = &po->v; pwaudio *c = v->g; pw_thread_loop_lock(c->thread_loop); pw_stream_set_active(v->stream, enable); pw_thread_loop_unlock(c->thread_loop); } +static void +qpw_enable_out(HWVoiceOut *hw, bool enable) +{ + qpw_voice_set_enabled(&PW_VOICE_OUT(hw)->v, enable); +} + static void qpw_enable_in(HWVoiceIn *hw, bool enable) { - PWVoiceIn *pi = (PWVoiceIn *) hw; - PWVoice *v = &pi->v; - pwaudio *c = v->g; - pw_thread_loop_lock(c->thread_loop); - pw_stream_set_active(v->stream, enable); - pw_thread_loop_unlock(c->thread_loop); + qpw_voice_set_enabled(&PW_VOICE_IN(hw)->v, enable); } static void -qpw_volume_out(HWVoiceOut *hw, Volume *vol) +qpw_voice_set_volume(PWVoice *v, Volume *vol) { - PWVoiceOut *pw = (PWVoiceOut *) hw; - PWVoice *v = &pw->v; pwaudio *c = v->g; int i, ret; @@ -707,28 +703,15 @@ qpw_volume_out(HWVoiceOut *hw, Volume *vol) } static void -qpw_volume_in(HWVoiceIn *hw, Volume *vol) +qpw_volume_out(HWVoiceOut *hw, Volume *vol) { - PWVoiceIn *pw = (PWVoiceIn *) hw; - PWVoice *v = &pw->v; - pwaudio *c = v->g; - int i, ret; - - pw_thread_loop_lock(c->thread_loop); - v->volume.channels = vol->channels; - - for (i = 0; i < vol->channels; ++i) { - v->volume.values[i] = (float)vol->vol[i] / 255; - } - - ret = pw_stream_set_control(v->stream, - SPA_PROP_channelVolumes, v->volume.channels, v->volume.values, 0); - trace_pw_vol(ret == 0 ? "success" : "failed"); + qpw_voice_set_volume(&PW_VOICE_OUT(hw)->v, vol); +} - v->muted = vol->mute; - float val = v->muted ? 1.f : 0.f; - ret = pw_stream_set_control(v->stream, SPA_PROP_mute, 1, &val, 0); - pw_thread_loop_unlock(c->thread_loop); +static void +qpw_volume_in(HWVoiceIn *hw, Volume *vol) +{ + qpw_voice_set_volume(&PW_VOICE_IN(hw)->v, vol); } static int wait_resync(pwaudio *pw) From patchwork Sat May 6 16:37:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778028 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a7dOTYys; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCvN2hVQz214M for ; Sun, 7 May 2023 02:39:44 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKvS-0000tv-7t; Sat, 06 May 2023 12:38:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvQ-0000tS-CC for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvO-00042s-TT for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391102; 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=a9VsTi3yWTMuvUupXgIuWf22ehlHX8XGVReO1on2CKs=; b=a7dOTYysScL8srNKED0UHGZBbICvH9wd/u+40caccygqFKtT/vA9OpTN9MTu4nDCu3eXVI IBRMFTPPGztyVR/YX8Mm35dHqZzKG9MFuLOsI4uuI1qI3qfq4nQwFWcbO8vriulpzW4AH3 ZEiNCH+NutXJnaXrrMHX8gb7NdACRLc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-NultMqQOM1KLb1r1beBYMw-1; Sat, 06 May 2023 12:38:18 -0400 X-MC-Unique: NultMqQOM1KLb1r1beBYMw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0220C1C06EEE; Sat, 6 May 2023 16:38:18 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EEC51121314; Sat, 6 May 2023 16:38:16 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 09/12] audio/pw: add more error reporting Date: Sat, 6 May 2023 20:37:32 +0400 Message-Id: <20230506163735.3481387-10-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin --- audio/pwaudio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 67df53948c..5c706a9fde 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -429,6 +429,10 @@ create_stream(pwaudio *c, PWVoice *v, const char *stream_name, struct pw_properties *props; props = pw_properties_new(NULL, NULL); + if (!props) { + error_report("Failed to create PW properties: %s", g_strerror(errno)); + return -1; + } /* 75% of the timer period for faster updates */ buf_samples = (uint64_t)v->g->dev->timer_period * v->info.rate @@ -441,8 +445,8 @@ create_stream(pwaudio *c, PWVoice *v, const char *stream_name, pw_properties_set(props, PW_KEY_TARGET_OBJECT, name); } v->stream = pw_stream_new(c->core, stream_name, props); - if (v->stream == NULL) { + error_report("Failed to create PW stream: %s", g_strerror(errno)); return -1; } @@ -470,6 +474,7 @@ create_stream(pwaudio *c, PWVoice *v, const char *stream_name, PW_STREAM_FLAG_MAP_BUFFERS | PW_STREAM_FLAG_RT_PROCESS, params, n_params); if (res < 0) { + error_report("Failed to connect PW stream: %s", g_strerror(errno)); pw_stream_destroy(v->stream); return -1; } From patchwork Sat May 6 16:37:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PRebTJWA; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCvd6w07z214M for ; Sun, 7 May 2023 02:39:57 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKvV-0000uh-PI; Sat, 06 May 2023 12:38:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvT-0000tx-Sx for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvS-000449-97 for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391105; 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=Pe2s/uDqRflXhELDMB82guoOho7E/nfVEtQ5clZC4uE=; b=PRebTJWAW1ZjlzNm2qSy1AGUJx4DpAPnxy7N/IGkvqyinv5imi3v7GPXcfo9lwzhOPxAiO J4iWQobM+dX3hTjXqSqAGUMf4T9QYQiF7BxZajvsPVcHnVg6MiDula7HVU0JeQp6ihRbNR EHaxT8ixo+rpDJ6wvxDhfhmircwymZI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-97-KRVOFcssNX2lc2UdYjVCww-1; Sat, 06 May 2023 12:38:22 -0400 X-MC-Unique: KRVOFcssNX2lc2UdYjVCww-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E184B185A79C; Sat, 6 May 2023 16:38:21 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2707492B00; Sat, 6 May 2023 16:38:20 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 10/12] audio/pw: simplify error reporting in stream creation Date: Sat, 6 May 2023 20:37:33 +0400 Message-Id: <20230506163735.3481387-11-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau create_stream() now reports on all error paths. Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin --- audio/pwaudio.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 5c706a9fde..38905f5be2 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -486,8 +486,6 @@ static int qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name, const char *name, enum spa_direction dir) { - int r; - switch (v->info.channels) { case 8: v->info.position[0] = SPA_AUDIO_CHANNEL_FL; @@ -540,13 +538,7 @@ qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name, } /* create a new unconnected pwstream */ - r = create_stream(c, v, stream_name, name, dir); - if (r < 0) { - AUD_log(AUDIO_CAP, "Failed to create stream."); - return -1; - } - - return r; + return create_stream(c, v, stream_name, name, dir); } static int @@ -577,7 +569,6 @@ qpw_init_out(HWVoiceOut *hw, struct audsettings *as, void *drv_opaque) r = qpw_stream_new(c, v, ppdo->stream_name ? : c->dev->id, ppdo->name, SPA_DIRECTION_OUTPUT); if (r < 0) { - error_report("qpw_stream_new for playback failed"); pw_thread_loop_unlock(c->thread_loop); return -1; } @@ -621,7 +612,6 @@ qpw_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) r = qpw_stream_new(c, v, ppdo->stream_name ? : c->dev->id, ppdo->name, SPA_DIRECTION_INPUT); if (r < 0) { - error_report("qpw_stream_new for recording failed"); pw_thread_loop_unlock(c->thread_loop); return -1; } From patchwork Sat May 6 16:37:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778027 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BACdJFeo; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCvN36SSz214P for ; Sun, 7 May 2023 02:39:44 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKvX-0000vF-Qu; Sat, 06 May 2023 12:38:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvW-0000ul-3W for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvU-00045J-N4 for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391108; 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=2i2NASwkEEgV1reJJcJ37RsdEES4PO1+G+0R9iX6+w4=; b=BACdJFeoSdCXiJlUzw0S3rg8Tg2Z3EOrcxyBYhe4kwYbpz9rFXtlYmeq4jMH7YKcv84sJO WoQ2ls1oQ3chzm0FLRKZEDdsujY4JdmwKnU8Sud2gvb/h0T8+bQcu3q97AG+qQ3fFB80qi mE5tTLIB5qiwgZY4NmZSRqsm8HciTv0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-227-KIyl1ZKmMiGXBMc53GCVaw-1; Sat, 06 May 2023 12:38:26 -0400 X-MC-Unique: KIyl1ZKmMiGXBMc53GCVaw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 62D4085A588; Sat, 6 May 2023 16:38:26 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40659492C13; Sat, 6 May 2023 16:38:24 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 11/12] audio/pw: remove wrong comment Date: Sat, 6 May 2023 20:37:34 +0400 Message-Id: <20230506163735.3481387-12-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau The stream is actually created connected. Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin --- audio/pwaudio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 38905f5be2..f74d506ec6 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -537,7 +537,6 @@ qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name, break; } - /* create a new unconnected pwstream */ return create_stream(c, v, stream_name, name, dir); } From patchwork Sat May 6 16:37:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1778030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=E6GhWmot; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QDCvb2ggyz214M for ; Sun, 7 May 2023 02:39:55 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvKvg-00016j-HB; Sat, 06 May 2023 12:38:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvc-00012d-EO for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvKvZ-000470-1F for qemu-devel@nongnu.org; Sat, 06 May 2023 12:38:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683391112; 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=sRBsSFPQUNom8zCXwU2PFYMU5zu3L19EbvriFS9BoxI=; b=E6GhWmotVZbbiAb+xA7ftvDimWVkGWCh6BAxaH2iC7y7GZZozoVHU0DmKFDE95ibtOPnXD tvivVRIfmvPizqnGr8NED6T9p0qGC0E/uKNRlaBAy0KZwwMd3iyDlEtRCWz2+iW+CbvJb+ Nm2igmv/7de7fFc6C+sqRVfa+XEqKuU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-588-1E_Pnw7ZNYarNlb5rcP7Jg-1; Sat, 06 May 2023 12:38:31 -0400 X-MC-Unique: 1E_Pnw7ZNYarNlb5rcP7Jg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A8C5680080E; Sat, 6 May 2023 16:38:30 +0000 (UTC) Received: from localhost (unknown [10.39.208.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B1B1C15BA0; Sat, 6 May 2023 16:38:29 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Wainer dos Santos Moschetta , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , dbassey@redhat.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eric Blake , Paolo Bonzini Subject: [PATCH 12/12] audio/pw: improve channel position code Date: Sat, 6 May 2023 20:37:35 +0400 Message-Id: <20230506163735.3481387-13-marcandre.lureau@redhat.com> In-Reply-To: <20230506163735.3481387-1-marcandre.lureau@redhat.com> References: <20230506163735.3481387-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.161, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau Follow PulseAudio backend comment and code, and only implement the channels QEMU actually supports at this point, and add the same comment about limits and future mappings. Simplify a bit the code. Signed-off-by: Marc-André Lureau Reviewed-by: Volker Rümelin --- audio/pwaudio.c | 75 +++++++++++++++++-------------------------------- 1 file changed, 26 insertions(+), 49 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index f74d506ec6..062610a704 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -417,8 +417,8 @@ pw_to_audfmt(enum spa_audio_format fmt, int *endianness, } static int -create_stream(pwaudio *c, PWVoice *v, const char *stream_name, - const char *name, enum spa_direction dir) +qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name, + const char *name, enum spa_direction dir) { int res; uint32_t n_params; @@ -482,62 +482,37 @@ create_stream(pwaudio *c, PWVoice *v, const char *stream_name, return 0; } -static int -qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name, - const char *name, enum spa_direction dir) +static void +qpw_set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS]) { - switch (v->info.channels) { + memcpy(position, (uint32_t[SPA_AUDIO_MAX_CHANNELS]) { SPA_AUDIO_CHANNEL_UNKNOWN, }, + sizeof(uint32_t) * SPA_AUDIO_MAX_CHANNELS); + /* + * TODO: This currently expects the only frontend supporting more than 2 + * channels is the usb-audio. We will need some means to set channel + * order when a new frontend gains multi-channel support. + */ + switch (channels) { case 8: - v->info.position[0] = SPA_AUDIO_CHANNEL_FL; - v->info.position[1] = SPA_AUDIO_CHANNEL_FR; - v->info.position[2] = SPA_AUDIO_CHANNEL_FC; - v->info.position[3] = SPA_AUDIO_CHANNEL_LFE; - v->info.position[4] = SPA_AUDIO_CHANNEL_RL; - v->info.position[5] = SPA_AUDIO_CHANNEL_RR; - v->info.position[6] = SPA_AUDIO_CHANNEL_SL; - v->info.position[7] = SPA_AUDIO_CHANNEL_SR; - break; + position[6] = SPA_AUDIO_CHANNEL_SL; + position[7] = SPA_AUDIO_CHANNEL_SR; + /* fallthrough */ case 6: - v->info.position[0] = SPA_AUDIO_CHANNEL_FL; - v->info.position[1] = SPA_AUDIO_CHANNEL_FR; - v->info.position[2] = SPA_AUDIO_CHANNEL_FC; - v->info.position[3] = SPA_AUDIO_CHANNEL_LFE; - v->info.position[4] = SPA_AUDIO_CHANNEL_RL; - v->info.position[5] = SPA_AUDIO_CHANNEL_RR; - break; - case 5: - v->info.position[0] = SPA_AUDIO_CHANNEL_FL; - v->info.position[1] = SPA_AUDIO_CHANNEL_FR; - v->info.position[2] = SPA_AUDIO_CHANNEL_FC; - v->info.position[3] = SPA_AUDIO_CHANNEL_LFE; - v->info.position[4] = SPA_AUDIO_CHANNEL_RC; - break; - case 4: - v->info.position[0] = SPA_AUDIO_CHANNEL_FL; - v->info.position[1] = SPA_AUDIO_CHANNEL_FR; - v->info.position[2] = SPA_AUDIO_CHANNEL_FC; - v->info.position[3] = SPA_AUDIO_CHANNEL_RC; - break; - case 3: - v->info.position[0] = SPA_AUDIO_CHANNEL_FL; - v->info.position[1] = SPA_AUDIO_CHANNEL_FR; - v->info.position[2] = SPA_AUDIO_CHANNEL_LFE; - break; + position[2] = SPA_AUDIO_CHANNEL_FC; + position[3] = SPA_AUDIO_CHANNEL_LFE; + position[4] = SPA_AUDIO_CHANNEL_RL; + position[5] = SPA_AUDIO_CHANNEL_RR; + /* fallthrough */ case 2: - v->info.position[0] = SPA_AUDIO_CHANNEL_FL; - v->info.position[1] = SPA_AUDIO_CHANNEL_FR; + position[0] = SPA_AUDIO_CHANNEL_FL; + position[1] = SPA_AUDIO_CHANNEL_FR; break; case 1: - v->info.position[0] = SPA_AUDIO_CHANNEL_MONO; + position[0] = SPA_AUDIO_CHANNEL_MONO; break; default: - for (size_t i = 0; i < v->info.channels; i++) { - v->info.position[i] = SPA_AUDIO_CHANNEL_UNKNOWN; - } - break; + dolog("Internal error: unsupported channel count %d\n", channels); } - - return create_stream(c, v, stream_name, name, dir); } static int @@ -555,6 +530,7 @@ qpw_init_out(HWVoiceOut *hw, struct audsettings *as, void *drv_opaque) v->info.format = audfmt_to_pw(as->fmt, as->endianness); v->info.channels = as->nchannels; + qpw_set_position(as->nchannels, v->info.position); v->info.rate = as->freq; obt_as.fmt = @@ -601,6 +577,7 @@ qpw_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) v->info.format = audfmt_to_pw(as->fmt, as->endianness); v->info.channels = as->nchannels; + qpw_set_position(as->nchannels, v->info.position); v->info.rate = as->freq; obt_as.fmt =