Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4004125imm; Mon, 14 May 2018 00:49:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrISB/tCJVs6KCYib+a/muK92sJtGplX7le5YDy8uZaUpaTOyLXRQM+lK9giomVl8SuUlrc X-Received: by 2002:a62:5d4a:: with SMTP id r71-v6mr9240209pfb.147.1526284153663; Mon, 14 May 2018 00:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526284153; cv=none; d=google.com; s=arc-20160816; b=NjT5G0EWj0ngAnHDnB8NGqA0sUA4CLpeulQQAF5WWhh4vW1G5QTd7T/iSnnXQRxlmn pvfATMCqSajAIF04qBUvK9q6/nJQRlOy8eDdOH9In7yHVp2sCR9iolrZXqwNPAcbZLoF jvZvd0nJs5vTKdMetpKX/TMR7zE8RGy0SCpvhvQDZbQp0rz1KhGzIe8wP1WFzjxWfdkJ SZTcq6APtS8WdmdXaKNlabXJXJMjGbaQCSqlyRoV6ZSORA76vazV2sGeNUdAOfUHGmr3 8nq578a3rCszmrXTN+XZtZbg/tiq4rVju5ng8wQb3kpwUKnclcPaq7SrK8B1BABt+6VN a2yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=H4FUpsxVXtxclztDwJTvxA7J+EkULg4kIyCvnGbds48=; b=iHXoog75icTPINePyFi5idN9EtaF/HSEKtT0anXR1EI14Dsa+Zx8ctuk3w/tJyLWtN NIPUiz8MotStlCt89nBW4CiT+DjKm6EkQxwA3SRPJeo7csxVPj5A4ZPCzDOEukQcaKjn TYYIgHeR2yOgMJapxd+2aAIGN3zSHNscA0ilw1/KgWiOV5Qm7s/2XoFdV+c/fBOIgUHY JQND1nNmdmhEYMhi4igLjjTob6r4jy7lDlxRc+XgZAfKaZ6Brht8EG7D+eFo8E6bFnd2 494Y6bZcLGEHXpxKGTLr+uPpcZld3+BEYsSd5fW3UPRIZwMUg4LkMdV/oSiIiLI0Jm/3 G7tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BHTnLNEq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1-v6si9275374plf.453.2018.05.14.00.48.59; Mon, 14 May 2018 00:49:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BHTnLNEq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408AbeENGvO (ORCPT + 99 others); Mon, 14 May 2018 02:51:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:57868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752022AbeENGvL (ORCPT ); Mon, 14 May 2018 02:51:11 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9452121748; Mon, 14 May 2018 06:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526280671; bh=nY3njuNWVoX2BGyAZJ4d10rsGOm/KGKdMO0eGhLOzP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BHTnLNEqGkAHZv6BooxUmEPWVlHFAyMY3c53DDZiLalEXdWWqtxU8GimLvGJaPJC1 X5pU5Bu81ThqYdw/BU6V2EyI1o27alhc7nmn+LraeA1pI2iDVgntpXBuAKw/OXlsuF jdVEAxuu5SKLlaUO4OPqajK4JgpIexCuWw68vzI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Rosengren , Takashi Iwai Subject: [PATCH 4.4 14/56] ALSA: aloop: Mark paused device as inactive Date: Mon, 14 May 2018 08:48:19 +0200 Message-Id: <20180514064756.432450083@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514064754.853201981@linuxfoundation.org> References: <20180514064754.853201981@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Robert Rosengren commit 306a4f3ca7f3c7dfa473ebd19d66e40e59d99734 upstream. Show paused ALSA aloop device as inactive, i.e. the control "PCM Slave Active" set as false. Notification sent upon state change. This makes it possible for client capturing from aloop device to know if data is expected. Without it the client expects data even if playback is paused. Signed-off-by: Robert Rosengren Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/drivers/aloop.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c @@ -296,6 +296,8 @@ static int loopback_trigger(struct snd_p cable->pause |= stream; loopback_timer_stop(dpcm); spin_unlock(&cable->lock); + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + loopback_active_notify(dpcm); break; case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: @@ -304,6 +306,8 @@ static int loopback_trigger(struct snd_p cable->pause &= ~stream; loopback_timer_start(dpcm); spin_unlock(&cable->lock); + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + loopback_active_notify(dpcm); break; default: return -EINVAL; @@ -893,9 +897,11 @@ static int loopback_active_get(struct sn [kcontrol->id.subdevice][kcontrol->id.device ^ 1]; unsigned int val = 0; - if (cable != NULL) - val = (cable->running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ? - 1 : 0; + if (cable != NULL) { + unsigned int running = cable->running ^ cable->pause; + + val = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ? 1 : 0; + } ucontrol->value.integer.value[0] = val; return 0; }