From patchwork Thu Jun 11 10:55:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoffrey McRae X-Patchwork-Id: 280656 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=-6.0 required=3.0 tests=DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS 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 EB49FC433E0 for ; Fri, 12 Jun 2020 00:23:32 +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 B718520835 for ; Fri, 12 Jun 2020 00:23:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=hostfission.com header.i=@hostfission.com header.b="YjeknWPY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B718520835 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=hostfission.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjXTn-0008Bu-RA for qemu-devel@archiver.kernel.org; Thu, 11 Jun 2020 20:23:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjXSt-0006yo-8E for qemu-devel@nongnu.org; Thu, 11 Jun 2020 20:22:35 -0400 Received: from mail1.hostfission.com ([139.99.139.48]:33196) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjXSr-0001I5-LO for qemu-devel@nongnu.org; Thu, 11 Jun 2020 20:22:34 -0400 Received: from moya.office.hostfission.com (office.hostfission.com [220.233.29.71]) by mail1.hostfission.com (Postfix) with ESMTP id E9CFE444BE; Fri, 12 Jun 2020 10:16:12 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hostfission.com; s=mail; t=1591920972; bh=BTNWhWjpxI/xGtBTerQqtN0TeU/W0mUOO+TVisdGLMA=; h=From:Date:Subject:To:Cc:From; b=YjeknWPYIK8KYYwz4p74mfbxlQ9UGFsQu5olJZ4x5/n5bZ6bH4em36lWySGHVE2+b v91ZMys2iOPglJ+E9ZmDAKZVinJ87qYGU3mWU4oqy3KG7AXB1VoKAJyxIDrc8fpMqy MGGL560OloDfBlt9rmCtXDO3LGTf5QHRTVWfVQZ0= Received: by moya.office.hostfission.com (Postfix, from userid 0) id BCF003A016F; Fri, 12 Jun 2020 10:16:12 +1000 (AEST) From: Geoffrey McRae Date: Thu, 11 Jun 2020 20:55:47 +1000 Subject: [PATCH 1/6] audio/jack: fix invalid minimum buffer size check To: Cc: X-Mailer: mail (GNU Mailutils 3.5) Message-Id: <20200612001612.BCF003A016F@moya.office.hostfission.com> Received-SPF: pass client-ip=139.99.139.48; envelope-from=geoff@hostfission.com; helo=mail1.hostfission.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/11 20:16:15 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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" Signed-off-by: Geoffrey McRae --- audio/jackaudio.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/audio/jackaudio.c b/audio/jackaudio.c index 722ddb1dfe..d0b6f748f2 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -434,17 +434,6 @@ static int qjack_client_init(QJackClient *c) jack_set_xrun_callback(c->client, qjack_xrun, c); jack_on_shutdown(c->client, qjack_shutdown, c); - /* - * ensure the buffersize is no smaller then 512 samples, some (all?) qemu - * virtual devices do not work correctly otherwise - */ - if (c->buffersize < 512) { - c->buffersize = 512; - } - - /* create a 2 period buffer */ - qjack_buffer_create(&c->fifo, c->nchannels, c->buffersize * 2); - /* allocate and register the ports */ c->port = g_malloc(sizeof(jack_port_t *) * c->nchannels); for (int i = 0; i < c->nchannels; ++i) { @@ -468,6 +457,17 @@ static int qjack_client_init(QJackClient *c) jack_activate(c->client); c->buffersize = jack_get_buffer_size(c->client); + /* + * ensure the buffersize is no smaller then 512 samples, some (all?) qemu + * virtual devices do not work correctly otherwise + */ + if (c->buffersize < 512) { + c->buffersize = 512; + } + + /* create a 2 period buffer */ + qjack_buffer_create(&c->fifo, c->nchannels, c->buffersize * 2); + qjack_client_connect_ports(c); c->state = QJACK_STATE_RUNNING; return 0; From patchwork Thu Jun 11 10:56:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoffrey McRae X-Patchwork-Id: 280648 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=-6.0 required=3.0 tests=DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 2A5DCC433DF for ; Fri, 12 Jun 2020 02:05:22 +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 E8C58204EC for ; Fri, 12 Jun 2020 02:05:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=hostfission.com header.i=@hostfission.com header.b="yzgpYfRo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8C58204EC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=hostfission.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjZ4L-0007CS-5f for qemu-devel@archiver.kernel.org; Thu, 11 Jun 2020 22:05:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjZ3T-0005Wp-Ou for qemu-devel@nongnu.org; Thu, 11 Jun 2020 22:04:28 -0400 Received: from mail1.hostfission.com ([139.99.139.48]:34034) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjZ3R-0004tF-Cf for qemu-devel@nongnu.org; Thu, 11 Jun 2020 22:04:26 -0400 Received: from moya.office.hostfission.com (office.hostfission.com [220.233.29.71]) by mail1.hostfission.com (Postfix) with ESMTP id 702B9443E9; Fri, 12 Jun 2020 12:04:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hostfission.com; s=mail; t=1591927462; bh=RNNL30Zvo3TCBbXKHnWUPwoWE8O3KEkEzYlBipDJ+Zw=; h=From:Date:Subject:To:Cc:From; b=yzgpYfRouxoqccwDp7cyNrcjUG843IUM2pyx4akM+85FAbX6XZMB95SJfEsVeKRoE rfXLuK6kOlcFK7fQcoz7AnBozXORRwLAxj2EURZN+fc5ZhmkmJz8JULLGJPTRt2uYs RMPdx9fuE8pPlFwMuf1d0OgYeHe68REefMsUrgZw= Received: by moya.office.hostfission.com (Postfix, from userid 0) id 591623A0172; Fri, 12 Jun 2020 12:04:22 +1000 (AEST) From: Geoffrey McRae Date: Thu, 11 Jun 2020 20:56:54 +1000 Subject: [PATCH 2/6] audio/jack: remove unused stopped state To: Cc: X-Mailer: mail (GNU Mailutils 3.5) Message-Id: <20200612020422.591623A0172@moya.office.hostfission.com> Received-SPF: pass client-ip=139.99.139.48; envelope-from=geoff@hostfission.com; helo=mail1.hostfission.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/11 20:16:15 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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" Signed-off-by: Geoffrey McRae --- audio/jackaudio.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/audio/jackaudio.c b/audio/jackaudio.c index d0b6f748f2..fb8efd7af7 100644 --- a/audio/jackaudio.c +++ b/audio/jackaudio.c @@ -38,7 +38,6 @@ struct QJack; typedef enum QJackState { QJACK_STATE_DISCONNECTED, - QJACK_STATE_STOPPED, QJACK_STATE_RUNNING, QJACK_STATE_SHUTDOWN } @@ -549,9 +548,6 @@ static void qjack_client_fini(QJackClient *c) { switch (c->state) { case QJACK_STATE_RUNNING: - /* fallthrough */ - - case QJACK_STATE_STOPPED: for (int i = 0; i < c->nchannels; ++i) { jack_port_unregister(c->client, c->port[i]); }