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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 B8D81C83000 for ; Tue, 28 Apr 2020 15:45:30 +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 41849206C0 for ; Tue, 28 Apr 2020 15:45:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="UGjRZeVY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41849206C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 75F661682; Tue, 28 Apr 2020 17:44:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 75F661682 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1588088728; bh=SkOI/F8Tnpf6EJuQuEMm3KWINvfVbiD4kIGZh78mXE4=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UGjRZeVYw8gHsH6HE8x9BoxacJki7N8b9IKJTeEIBKf6umyh37/Z4a4Un9fHs3vuD KuQVsNLqKCKLC4YFzhvMqda4Kv10L34oWCEo9mGnWM4SbDer9OOvtd3DyXbFTuhMvx k/BtXcmWn47nx/aXq+FfxU788bKcJLjMYLRLDg4M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 028B6F80136; Tue, 28 Apr 2020 17:44:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 164EFF801DB; Tue, 28 Apr 2020 17:44:36 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9F770F8010A for ; Tue, 28 Apr 2020 17:44:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9F770F8010A X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9E01CAFB7; Tue, 28 Apr 2020 15:44:26 +0000 (UTC) Date: Tue, 28 Apr 2020 17:44:26 +0200 Message-ID: From: Takashi Iwai To: Jaroslav Kysela Subject: Re: Functionality of pcm_notify in snd-aloop? In-Reply-To: References: <61d837f1-de1a-7aa6-ca8f-d0cfaa36ea69@perex.cz> <28a05a44-55bf-1831-aa3c-875e0499caea@ivitera.com> <28063dd1-71ab-a313-04b8-f4d97312b1b5@ivitera.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Pavel Hofman , "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" On Mon, 30 Mar 2020 17:09:58 +0200, Jaroslav Kysela wrote: > > Dne 30. 03. 20 v 16:43 Pavel Hofman napsal(a): > > > > Dne 26. 03. 20 v 18:59 Pavel Hofman napsal(a): > >> Dne 26. 03. 20 v 18:44 Jaroslav Kysela napsal(a): > >>> Dne 26. 03. 20 v 18:19 Pavel Hofman napsal(a): > >>>> Hi, > >>>> > >>>> Please how is the module params pcm_notify supposed to be used, to do > >>>> what the documentation says: Break capture when PCM format/rate/channels > >>>> changes? > >>>> > >>>> Breaking capture side operation when the playback side changes the > >>>> params is very useful, but I cannot find a way to use this param > >>>> properly. When the capture side is open, the playback side cannot use a > >>>> different parameter than the one currently used by the capture side (the > >>>> configuration space is limited) > >>> > >>> Really? Then it's a bug introduced by the last changes. > >>> > >>> If you look to sources: > >>> > >>>       if (get_notify(dpcm)) > >>>                 runtime->hw = loopback_pcm_hardware; > >>>         else > >>>                 runtime->hw = cable->hw; > >>> > >>> And: > >>> > >>>       if (!(cable->valid & ~(1 << substream->stream)) || > >>>             (get_setup(dpcm)->notify && > >>>              substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) > >>>                 params_change(substream); > >>> > >>> So the functionality should be there. > >> > >> I am using older kernels (4.15 and 3.16), but this is an old functionality. > >> > >> modprobe snd-aloop pcm_substreams=1 pcm_notify=1,1 > >> > > > > Please is there any way to solve this issue? Thanks a lot for your patience. > > I can reproduce this. It appears that the driver should be fixed, but > I don't have a solution at the moment. > > It seems that 898dfe4687f460ba337a01c11549f87269a13fa2 from Takashi > broke this functionality (tied the cable parameters more strictly, so > the playback cannot set freely own parameters for the pcm_notify=1 > case). We need to find another way to detach capture stream in this > case. I believe the missing piece here is a generic way to tell user-space that the stream got invalidated. This would be useful not only for aloop but can be applied in general when a stream becomes temporarily unavailable (e.g. the HDMI monitor disconnected or the DSP route switched). Currently we may return -EPIPE for xrun, but this doesn't really tell the situation correctly. The xrun should be recoverable by simple PREPARE call, but the case like aloop would need the complete re-setup or reopen of the stream. thanks, Takashi