From patchwork Mon Jun 22 13:15:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hills X-Patchwork-Id: 192379 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=-10.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 7FF1BC433E2 for ; Mon, 22 Jun 2020 13:21:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 096CF2068F for ; Mon, 22 Jun 2020 13:21:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="nBLVgoDS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=pogo.org.uk header.i=@pogo.org.uk header.b="xJRWm/W9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 096CF2068F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xwax.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 91D9D16C2; Mon, 22 Jun 2020 15:20:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 91D9D16C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592832078; bh=l1gZqnBDPEgRgG6VPKUlnuRh8mioWgeTUdgREpPEXQk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nBLVgoDSLWI3lwb4CTANapF7xkDJO3clwMjqsugy3ltBMfmc5Pw9WvOjgUd12pgac wmq4n7TWAgwhVqVdATmWPILjCSx0OP3IpN+2ivW9x7l7XPhSkO9JIX1tmSkNCHijzf MNWfGceZ3E6kngP/11QhgsfSdr8MDi5Rm5anNkNk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A71E3F802F8; Mon, 22 Jun 2020 15:16:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 21999F802A0; Mon, 22 Jun 2020 15:16:15 +0200 (CEST) Received: from jazz.pogo.org.uk (jazz.pogo.org.uk [213.138.114.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7B3CBF802A0 for ; Mon, 22 Jun 2020 15:15:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7B3CBF802A0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=pogo.org.uk header.i=@pogo.org.uk header.b="xJRWm/W9" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pogo.org.uk ; s=a; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mgHkLLSwxX2bsoTwh7T6kbqlwvmX5Q6zaDcW8z23lxw=; b=xJRWm/W909aqO0OIQoDqSGhNsx 54Bi4Q6A4QjFLbe8mOndqv5Xxy/JNe37CDn+zNheYXBkM1edSO1DJVbfg3uxpKCBl7n1o650EbksI ahDqimBuQa3z2NFw9WuAF7tzpDNWao9zjOvTrGrFqiqBJDeZU6qPXSCmVvdSwGe4eVZB72rJtWHLU 8of+0UAKpZgUbn6++OvYbqMTFY6y1UWxn66PGee8FhT1DO7/daQluF4aZA/7eP0aQhXhs5nHyxFow 9Vt8QvkOG5N2oiFTajghb07Qo7DmHn1xHkuHBRJzYHbjbLpATUNTu/EOha6qSWFNkq47eWUR+mPEj 5pYR45Tw==; Received: from cpc1-hari17-2-0-cust102.20-2.cable.virginm.net ([86.18.4.103] helo=stax.localdomain) by jazz.pogo.org.uk with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1jnMI7-000BwL-HL; Mon, 22 Jun 2020 14:15:15 +0100 Received: from mark by stax.localdomain with local (Exim 4.84) (envelope-from ) id 1jnMI7-000663-4y; Mon, 22 Jun 2020 14:15:15 +0100 From: Mark Hills To: Jaroslav Kysela Subject: [PATCH 4/9] dsnoop: The delay presented to snd_pcm_status_delay() was incorrect Date: Mon, 22 Jun 2020 14:15:10 +0100 Message-Id: <20200622131515.23385-4-mark@xwax.org> X-Mailer: git-send-email 2.17.5 In-Reply-To: <2006221356390.20421@stax.localdomain> References: <2006221356390.20421@stax.localdomain> Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This was the original bug that caused me to start looking at the ring buffer functions. In the API this is documented as: "Delay is distance between current application frame position and sound frame position. It's positive and less than buffer size in normal situation, negative on playback underrun and greater than buffer size on capture overrun. " Because dsnoop was returning the buffer space available to the hardware the return value was always quite large, and moved in the wrong direction. With this patch, dsnoop now gives results which are comparable to using the "hw" device directly. My test case was with snd-echo3g (Layla3G). Signed-off-by: Mark Hills --- src/pcm/pcm_local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h index 89d4125b..1fa8e61d 100644 --- a/src/pcm/pcm_local.h +++ b/src/pcm/pcm_local.h @@ -589,7 +589,7 @@ static inline snd_pcm_uframes_t snd_pcm_mmap_playback_delay(snd_pcm_t *pcm) static inline snd_pcm_uframes_t snd_pcm_mmap_capture_delay(snd_pcm_t *pcm) { - return snd_pcm_mmap_capture_hw_avail(pcm); + return snd_pcm_mmap_capture_avail(pcm); } static inline snd_pcm_sframes_t snd_pcm_mmap_delay(snd_pcm_t *pcm) From patchwork Mon Jun 22 13:15:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hills X-Patchwork-Id: 192381 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=-10.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 2CA1EC43458 for ; Mon, 22 Jun 2020 13:21:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 80FDE20760 for ; Mon, 22 Jun 2020 13:18:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="UDYBXDP5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=pogo.org.uk header.i=@pogo.org.uk header.b="v8183TzI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80FDE20760 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xwax.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F0AB016DE; Mon, 22 Jun 2020 15:17:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F0AB016DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592831930; bh=dvQIQwPtrE3Is3/5G1/W0lX7v95Je2Mj0rKDOyj4g7c=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UDYBXDP5nyv/2u+XYXItDpU1epJW1WjyyrDwYWsrrWxuQKhxc06LPBMulc1BU7wg1 6GRxG3OztSzwsKmDvhxUxUp6eTnGgobvqqYi0d6COEm4sS1nbGA3GK9IRGzVPWhDVd WLE69wc2LAgk47o9ch7jxmVB4+SyWXrub+Lcuabg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0895AF802D2; Mon, 22 Jun 2020 15:16:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7F0C4F801DB; Mon, 22 Jun 2020 15:15:35 +0200 (CEST) Received: from jazz.pogo.org.uk (jazz.pogo.org.uk [213.138.114.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A7990F80162 for ; Mon, 22 Jun 2020 15:15:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A7990F80162 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=pogo.org.uk header.i=@pogo.org.uk header.b="v8183TzI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pogo.org.uk ; s=a; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KjxRTpjsOx14lhh+BLgwsTDvD1d6N5d26/Jt4B88mgw=; b=v8183TzIPBjsZTgaF8sMW6PLMI JviwD8DmQbn/loz68WZa6v20bMQOUVLMBfg1Vl2+YW1lUrLNw8n2zUpyHJvGZgFWBAlH5hVeqCJ3W ZO4TOgRY3pHR+Qglbu8FJBcm6zmTvrMZhVFcaS6ff/roKDTOwcjqPUh9KUzUTvADIaF0BmttZ5/AC +uuaJvdFRUdNzepWS8/LZBAfTwKelRdhBFOGFUrOXkM1bPbx+SpMtwe/DBB63xQDq+F87RCJmyPs+ f+ikVAu/3bb8iuuplMZeO5Pr6ILHcNWDEGzlxI9dr8MQ0oASmW1wWD2TUspk9ITAeL6FU3PL/HZnZ 0ts8fNXQ==; Received: from cpc1-hari17-2-0-cust102.20-2.cable.virginm.net ([86.18.4.103] helo=stax.localdomain) by jazz.pogo.org.uk with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1jnMI7-000BwN-IM; Mon, 22 Jun 2020 14:15:15 +0100 Received: from mark by stax.localdomain with local (Exim 4.84) (envelope-from ) id 1jnMI7-00066D-5s; Mon, 22 Jun 2020 14:15:15 +0100 From: Mark Hills To: Jaroslav Kysela Subject: [PATCH 6/9] dsnoop: The stop threshold was not implemented correctly Date: Mon, 22 Jun 2020 14:15:12 +0100 Message-Id: <20200622131515.23385-6-mark@xwax.org> X-Mailer: git-send-email 2.17.5 In-Reply-To: <2006221356390.20421@stax.localdomain> References: <2006221356390.20421@stax.localdomain> Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The previous implementation would mean that stop_threshold behaved erratically. The intent is to detect that the buffer is too full, and stop. In practice, I don't think this was a bug in practice for applications which don't adjust the stop_threshold. The line above catches those cases. Signed-off-by: Mark Hills --- src/pcm/pcm_dsnoop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c index c64df381..790d944c 100644 --- a/src/pcm/pcm_dsnoop.c +++ b/src/pcm/pcm_dsnoop.c @@ -165,7 +165,7 @@ static int snd_pcm_dsnoop_sync_ptr(snd_pcm_t *pcm) // printf("sync ptr diff = %li\n", diff); if (pcm->stop_threshold >= pcm->boundary) /* don't care */ return 0; - if ((avail = snd_pcm_mmap_capture_hw_avail(pcm)) >= pcm->stop_threshold) { + if ((avail = snd_pcm_mmap_capture_avail(pcm)) >= pcm->stop_threshold) { gettimestamp(&dsnoop->trigger_tstamp, pcm->tstamp_type); dsnoop->state = SND_PCM_STATE_XRUN; dsnoop->avail_max = avail; From patchwork Mon Jun 22 13:15:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hills X-Patchwork-Id: 192380 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=-10.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 3F4A8C43460 for ; Mon, 22 Jun 2020 13:21:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 1D9C4206D4 for ; Mon, 22 Jun 2020 13:20:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="T9nFKFf/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=pogo.org.uk header.i=@pogo.org.uk header.b="sviGoMOM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D9C4206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xwax.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A4A6D168E; Mon, 22 Jun 2020 15:19:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A4A6D168E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592832035; bh=5DUZPgwn/zwalRpur+X/AsGfwRNlBanJL2WtFf/8TYs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=T9nFKFf/8G/2nsQL8x6sA6Me4OddoNaz24y+u85dfFq4NX6DnkZ2PCHFDFImai7zG CqDp9q/jrmLZirURt+BuOkg1LLvD4KUmkips9nwN9Eb0ecggzrGZkfnfqwWAoc4nSg 3wlM2fazuDN8/sRTSjA1OerRAzj3iu/MQy/QWPMw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 841CBF802EC; Mon, 22 Jun 2020 15:16:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 17832F8015A; Mon, 22 Jun 2020 15:16:15 +0200 (CEST) Received: from jazz.pogo.org.uk (jazz.pogo.org.uk [213.138.114.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8C71AF801F2 for ; Mon, 22 Jun 2020 15:15:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8C71AF801F2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=pogo.org.uk header.i=@pogo.org.uk header.b="sviGoMOM" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pogo.org.uk ; s=a; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8cU1UkvPEE3dgwW86w1iNdExXcQr4WWcypzmRmDBv5Q=; b=sviGoMOMegrdJ7ZQeI5lxm0gBE BwxBgKcRPXKxyZy25cOFKNXhLS8WvROI9QaQraJQKg0VPg/gBGumstQbSSt3Z1ueSfYhSst51m9Lw hZdoWWasM2FuxkoHrBy8pMEcxS4T0p14r5etVdgcgcVtkElBFryWyIJvUPWj6mOcI9zBZRx1z9Cmk xT5Bf2Poo5vC7egrL9dX/5wm85SkgTZhtkUR7taVpSWqEWBTomILIlchgO3l2We1YDLK7XI4rpF78 x/AlrBSku26Dp5sKKcRwAkCZAl7Fv7TipjWl1kKQEdONW6CYDy1pBTpcC490gcIRkMzG4LLFqoMhO lM/dhPvA==; Received: from cpc1-hari17-2-0-cust102.20-2.cable.virginm.net ([86.18.4.103] helo=stax.localdomain) by jazz.pogo.org.uk with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1jnMI7-000BwO-IC; Mon, 22 Jun 2020 14:15:15 +0100 Received: from mark by stax.localdomain with local (Exim 4.84) (envelope-from ) id 1jnMI7-00066I-6K; Mon, 22 Jun 2020 14:15:15 +0100 From: Mark Hills To: Jaroslav Kysela Subject: [PATCH 7/9] dsnoop: Another bug where the empty, not full, part of the ringbuffer was observed Date: Mon, 22 Jun 2020 14:15:13 +0100 Message-Id: <20200622131515.23385-7-mark@xwax.org> X-Mailer: git-send-email 2.17.5 In-Reply-To: <2006221356390.20421@stax.localdomain> References: <2006221356390.20421@stax.localdomain> Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This looks like a simple mistake dating back to 2003 (commit 7470a5b9) where code originated from dmix. Signed-off-by: Mark Hills --- src/pcm/pcm_dsnoop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c index 790d944c..3588eb91 100644 --- a/src/pcm/pcm_dsnoop.c +++ b/src/pcm/pcm_dsnoop.c @@ -241,7 +241,7 @@ static int snd_pcm_dsnoop_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp) /* Fall through */ case SNDRV_PCM_STATE_PREPARED: case SNDRV_PCM_STATE_SUSPENDED: - *delayp = snd_pcm_mmap_capture_hw_avail(pcm); + *delayp = snd_pcm_mmap_capture_avail(pcm); return 0; case SNDRV_PCM_STATE_XRUN: return -EPIPE; From patchwork Mon Jun 22 13:15:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Hills X-Patchwork-Id: 192382 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=-10.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 562A1C433FB for ; Mon, 22 Jun 2020 13:17:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 64FFD20768 for ; Mon, 22 Jun 2020 13:17:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="dDaIQpne"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=pogo.org.uk header.i=@pogo.org.uk header.b="0WDHvl7W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64FFD20768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xwax.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F20C616AA; Mon, 22 Jun 2020 15:16:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F20C616AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592831829; bh=7rCpMp9Rp+FqySWIb7GWHLRiPGRWfT1zUsHrHxzex4U=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dDaIQpneRwz/sxMHo+8IQ/2tcVSeCgxsyXTcBAahzSJHtEdHG+SbID4knn02dIVTe RVDW7DPG8FeFQ3cr9PTjsBTI28Zxk/jBQRMoxHlUTstsVA3eiy52mvL6dKNmk5gA6f p2n2LALSsLdxiwgCQjeDC2fCtMV+FuVZnxyRviGY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7D18CF80157; Mon, 22 Jun 2020 15:15:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2DD04F802A2; Mon, 22 Jun 2020 15:15:24 +0200 (CEST) Received: from jazz.pogo.org.uk (jazz.pogo.org.uk [213.138.114.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A4538F8015B for ; Mon, 22 Jun 2020 15:15:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A4538F8015B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=pogo.org.uk header.i=@pogo.org.uk header.b="0WDHvl7W" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pogo.org.uk ; s=a; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vEejpRzBFTJ0ZNMAC69VSODSqA0qVvaW7DAqw5N5mBo=; b=0WDHvl7Wt5BXpFAgIcG6+ENy3r UMvtFXYBv1EkkBwUfa0N9i0pSU7Lv2h/nfmwHdmy+Vbs/AmHxDoZp0a4XWsh9y7089LNC1fojqSL7 Ity7/g9R7uShg7iLXl3ku2w2H5n9wqJk79itGNzNa1UDSr1KElYqR+KLxTI7d65Z+QXQfGf5+VRLe p9HNzFJl52KMSa3+D296p0+AxoLG7aiAzIN1vKVVmDEdrWYIs2WcMzCKQQwF8EXf4FXjjBlV/jVl/ 6M4IUw2XuZqEgRnq72kbzu36Wi33K2uB2PA7madjWLG8UpjvcpS3nFr3vow31DcP51qGaloVJMDTs LG8U+BsA==; Received: from cpc1-hari17-2-0-cust102.20-2.cable.virginm.net ([86.18.4.103] helo=stax.localdomain) by jazz.pogo.org.uk with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1jnMI7-000BwP-GW; Mon, 22 Jun 2020 14:15:15 +0100 Received: from mark by stax.localdomain with local (Exim 4.84) (envelope-from ) id 1jnMI7-00066N-6h; Mon, 22 Jun 2020 14:15:15 +0100 From: Mark Hills To: Jaroslav Kysela Subject: [PATCH 8/9] dsnoop: Make use of the (previously unused) function Date: Mon, 22 Jun 2020 14:15:14 +0100 Message-Id: <20200622131515.23385-8-mark@xwax.org> X-Mailer: git-send-email 2.17.5 In-Reply-To: <2006221356390.20421@stax.localdomain> References: <2006221356390.20421@stax.localdomain> Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Match the equivalent funciton for playback. This is on the assumption that values should be capped at zero, which is what _rewindable() implements. Signed-off-by: Mark Hills --- src/pcm/pcm_dsnoop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c index 3588eb91..7904314c 100644 --- a/src/pcm/pcm_dsnoop.c +++ b/src/pcm/pcm_dsnoop.c @@ -352,7 +352,7 @@ static int snd_pcm_dsnoop_pause(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int enable ATTR static snd_pcm_sframes_t snd_pcm_dsnoop_rewindable(snd_pcm_t *pcm) { - return snd_pcm_mmap_capture_hw_avail(pcm); + return snd_pcm_mmap_capture_hw_rewindable(pcm); } static snd_pcm_sframes_t snd_pcm_dsnoop_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)