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=-7.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 1325BC07E96 for ; Thu, 8 Jul 2021 14:53:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9D6E61154 for ; Thu, 8 Jul 2021 14:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231910AbhGHO4O (ORCPT ); Thu, 8 Jul 2021 10:56:14 -0400 Received: from mail1.perex.cz ([77.48.224.245]:39948 "EHLO mail1.perex.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbhGHO4N (ORCPT ); Thu, 8 Jul 2021 10:56:13 -0400 Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id E7812A003F; Thu, 8 Jul 2021 16:53:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz E7812A003F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1625756009; bh=50Pcd5aTX9wikvo2sIBF0vJ6IcrjySrof/14/tpqP8k=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=phgeDJEeL3CJ2C+r+weBuDGCtGDMtCBf8XucknY8xtRV+9n1UxbGse81CzdL9m7Ru AntvgEqAMSaowOfV+vTJPwyqirFmSYAYpmlhCPFRLL4DZVRlhH4VHxn85oxOFgnFsJ gt6H/bNUob/HValmw35d8rWFyLg9tbCG5ViZFM0Q= Received: from p1gen2.localdomain (unknown [192.168.100.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Thu, 8 Jul 2021 16:53:20 +0200 (CEST) Subject: Re: [Patch v2] ALSA: compress: allow to leave draining state when pausing in draining To: Robert Lee , Takashi Iwai Cc: vkoul@kernel.org, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, carterhsu@google.com, zxinhui@google.com, bubblefang@google.com References: <20210708020815.3489365-1-lerobert@google.com> From: Jaroslav Kysela Message-ID: Date: Thu, 8 Jul 2021 16:53:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08. 07. 21 15:47, Robert Lee wrote: > Hi Takashi, > > It is a little complex to describe the design in detail, but try to > explain simply > what issue we meet. > > If w/o the change, after user resumes from the pause, our system would call > snd_compr_drain() or snd_compr_partial_drain() again after it returns from > previous drain (when EOF reaches). Then it will block in this drain and no one > wake it up because EOF has already reached. I add this change to return from > the previous drain. It looks like that the driver does not call snd_compr_drain_notify() so the state is not updated to SETUP on EOF. > Actually, I am wondering how the pause-during-drain can keep the state in > DRAINING. It should have a different design. :) I already proposed to add a new state (because it's a new state), but the conservative way was elected to avoid user space changes. Jaroslav -- Jaroslav Kysela Linux Sound Maintainer; ALSA Project; Red Hat, Inc.