From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5D90C433E0 for ; Wed, 24 Feb 2021 17:32:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F382E64F16 for ; Wed, 24 Feb 2021 17:32:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F382E64F16 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=crudebyte.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEy1F-0007Yt-MI for qemu-devel@archiver.kernel.org; Wed, 24 Feb 2021 12:32:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lExyu-0006Ee-Co for qemu-devel@nongnu.org; Wed, 24 Feb 2021 12:29:49 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]:55189) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lExyp-0000a5-Bu for qemu-devel@nongnu.org; Wed, 24 Feb 2021 12:29:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=cfld9iqQqB8zEmqw3OtX+VEwv5dIhK7gDXNdydRlBRc=; b=MlrQYFCLpq9DCxugQNSJarKUs6 b6E2XBdPDM7w3E69/Oc5zOl7GEqaqAy/hU1K9+UTbxcjor0ulzadfI8Yahvc/gyRHs0pCC/XmqoJX Jsasxy0fF9pjqC0n/yULoe2JD/hklB2A4vAYJHuXXt64+jIjwWpkuP4PoGt7oRNwqM7QcJMUDpjDA Wacb4UsI7aZXvAwgQuEe/j5egnCvdrEEarDeWk0MgG8eAbJCFX/7y77+tZbZj01TQYxAFh0CdFHgV R4AmY68SS9OP8uFpGmyDMSQoYy9VRrUU3YHtCDLXshOOSBvinjK++YzIyHYS9kQvpiY4aFe2pQQkQ amNCgfd+2Yy/3wV125EF7UpQRdKvwJNeYFVmFawiSGsob9rxvT8XrJ4bkYu9P7y61gfN4141LrkrF gxcHPbsyQxXPl6VjhR3T+lSkMGj692jZPEOSOs99AbrTqbObY03JdTlqQd2ZpUP+JW7ajn4whmHc7 XXrbfdpn00qdAPrYq6hLPS7TIMDD1hKSwJUBEXQJ4Pib//1l+MmytX1eN/N895I9L/kRypQihfB4S wVg6KB/TAmzHPQfo0MSTfACzYRUPu7XNzfFKlIywnIvXad66fKcWykhda9/Q9EMNBo2xQ++udbW1u 1IULmOKhV6SiVptG10vFNJQRo5a3KJ2YTf9WshgK8=; From: Christian Schoenebeck To: qemu-devel@nongnu.org Cc: =?ISO-8859-1?Q?Jos=E9_Ram=F3n_Mu=F1oz?= Pekkarinen , Geoffrey McRae , kraxel@redhat.com Subject: Re: [PATCH] Autoconnect jack ports by default Date: Wed, 24 Feb 2021 18:29:34 +0100 Message-ID: <10027779.MNeJ0xqg2j@silver> In-Reply-To: References: <20210224154901.23901-1-koalinux@gmail.com> <4436341.rU913LdL3d@silver> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Received-SPF: pass client-ip=5.189.157.229; envelope-from=qemu_oss@crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mittwoch, 24. Februar 2021 17:47:03 CET Jos=E9 Ram=F3n Mu=F1oz Pekkarine= n wrote: > On Wed, 24 Feb 2021 at 18:40, Christian Schoenebeck > wrote: > > On Mittwoch, 24. Februar 2021 17:16:58 CET Jos=E9 Ram=F3n Mu=F1oz Pekka= rinen > >=20 > > wrote: > > > On Wed, 24 Feb 2021 at 17:49, Jos=E9 Pekkarinen > >=20 > > wrote: > > > > This patch provides a default value to connect > > > > jack ports when the user don't specify connect-ports. > > > >=20 > > > > Buglink: https://bugs.launchpad.net/qemu/+bug/1908832 > > > >=20 > > > > Signed-off-by: Jos=E9 Pekkarinen > > > > --- > > > >=20 > > > > audio/jackaudio.c | 15 ++++++++++++--- > > > > 1 file changed, 12 insertions(+), 3 deletions(-) > > > >=20 > > > > diff --git a/audio/jackaudio.c b/audio/jackaudio.c > > > > index 3031c4e29b..a29b1ccba2 100644 > > > > --- a/audio/jackaudio.c > > > > +++ b/audio/jackaudio.c > > > > @@ -369,14 +369,23 @@ static size_t qjack_read(HWVoiceIn *hw, void > >=20 > > *buf, > >=20 > > > > size_t len) > > > >=20 > > > > static void qjack_client_connect_ports(QJackClient *c) > > > > { > > > >=20 > > > > - if (!c->connect_ports || !c->opt->connect_ports) { > > > > + if (!c->connect_ports) { > > > >=20 > > > > return; > > > > =20 > > > > } > > > > =20 > > > > c->connect_ports =3D false; > > > > const char **ports; > > > >=20 > > > > - ports =3D jack_get_ports(c->client, c->opt->connect_ports, NUL= L, > > > > - c->out ? JackPortIsInput : JackPortIsOutput); > > > > + if (c->out) { > > > > + ports =3D jack_get_ports(c->client, > > > > + c->opt->connect_ports ? "system:capture_.*" > > > > + : c->opt->connect_ports, > >=20 > > I think that should be the other way around: > > c->opt->connect_ports ? c->opt->connect_ports : > > "system:capture_.*" >=20 > I was thinking exactly the same when I was reading > the patch, but in the way you hint it doesn't make it, so > somewhere we may be taking the logic inverted. I guess that's because the RegEx patterns are interchanged as well. Try: if (c->out) { ... c->opt->connect_ports ? c->opt->connect_ports : "system:playback_.*" ... } else { ... c->opt->connect_ports ? c->opt->connect_ports : "system:capture_.*" ... } Best regards, Christian Schoenebeck