Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp373660yba; Fri, 5 Apr 2019 08:22:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwywRIVPfVfHE/khnpBg/33bo5zwefC4Plu2X7WCvroi65ePz20fpr1Np4HKU9fUyI4myaO X-Received: by 2002:a63:3d4c:: with SMTP id k73mr12744471pga.154.1554477739039; Fri, 05 Apr 2019 08:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554477739; cv=none; d=google.com; s=arc-20160816; b=dZjHwkZHdqUR7Hsw4b07OX05OzTdm6wCOGAFuEQ1MIUnt/112m/rRgAGesXuaUPGFY 80G72DxWqTl1d1lii+6o0DqIspvOPqr+t/ZyNHi/Nbgsm8+ToynjQYZNGyj2/sjy5WXJ qB6q9RdDXej2Czy6i0pR/QzKG5uRG9walB+ROV8r+qWjR3W+wSKeABupmtw6mc7BXiys kQGd1e+dtj120h42H8AlU+s9jfXPxpoF44zdL7ihK0rCRpboeOeXEfcq5gvFJUX6UfuM +81pr+aRepQcsgHlpCuQrzfNPnEwZCbtWjJH1VXft5GCiNFm06QI8eLiR1p8vu5TKffe N5Jg== 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:subject:cc:to:from:message-id:date; bh=nwiG/8StMLbiKM/NICxBs/BmXKETD/fDtvQFuKen8lc=; b=TXTKD+RT2dW1VdSM3q0LGDfbSSxoh2DZs3F3TjmGdGDqh+qqpwiFhu7mA/kasFcLeZ ZZGrc0l54aGneGDJOFzWy9g7pu887liK/QOIrOQQFo3XNMT2cejW2dYXadZK+nRxiStg ASyjuV7SqkfQueVPnp8YoqBFeS2St1Tk5OboQRZi3pRS6obKrzw6CvAaI8ODHp52Mvhg GrNqNI/ykxQGHX4N/TuE6joBMdFOUPPYuA9mevamftSM8lG2JZXdNVBSgigurqM64zya b6GS6nqIhHkMHbNJvni+3cOMJpfV4LSBm4+k+92HlrMg5XyurId4j0RR0YcwP80amhAH Qo6Q== ARC-Authentication-Results: i=1; mx.google.com; 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 u22si11466424plq.193.2019.04.05.08.22.03; Fri, 05 Apr 2019 08:22:19 -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; 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 S1731483AbfDEPVT (ORCPT + 99 others); Fri, 5 Apr 2019 11:21:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:36080 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726291AbfDEPVT (ORCPT ); Fri, 5 Apr 2019 11:21:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3C228AD9C; Fri, 5 Apr 2019 15:21:17 +0000 (UTC) Date: Fri, 05 Apr 2019 17:21:15 +0200 Message-ID: From: Takashi Iwai To: Timo Wischer Cc: , , , Subject: Re: [PATCH 09/10] ALSA: pcm: Add snd_pcm_ops for snd_pcm_link() In-Reply-To: <00d97a34-c055-c7ef-dbfd-e17c0f6cfff3@de.adit-jv.com> References: <1553529644-5654-1-git-send-email-twischer@de.adit-jv.com> <1553586574-18608-1-git-send-email-twischer@de.adit-jv.com> <1553586574-18608-5-git-send-email-twischer@de.adit-jv.com> <3ad5c313-ba2c-b541-8930-3f2515dfca72@de.adit-jv.com> <68cfbf7a-5f1e-50d2-2b97-4d3c5d360b36@de.adit-jv.com> <00f4c8db-44cf-b555-f3ca-42916b1e7ceb@de.adit-jv.com> <00d97a34-c055-c7ef-dbfd-e17c0f6cfff3@de.adit-jv.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=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 04 Apr 2019 12:18:33 +0200, Timo Wischer wrote: > > >>> In principle, the PCM ops is supposed to be safe for operating a > >>> certain stuff. If a state change may happen during the operation, > >>> this should be called inside PCM stream lock. So the design of the > >>> new callback itself is fragile. > >>> > >>> then, it comes to a point to re-setup the timer at the link change. > >>> The idea is interesting, but it's a wrong usage of PCM link feature, > >>> to be honest. > >>> > >>> That said, I find the changes up to patch 8 are acceptable (with some > >>> fixes expected), but the link feature isn't. > > Hi Takashi, > > could you provide your feedback to the other patches? The patch 4 must be superfluous, at least. The trigger callback is called within the stream lock, so you really don't need to save flags. The patch 8 needs more consideration. I'm not fond of the current way to select the timer source. For example, the ALSA timer source isn't necessarily bound with cards. It can be a hrtimer, or system timer backend ALSA global timer, too. This can't be chosen in the suggested way. Also, the use of tasklet is superfluous. The timer instance can be called via tasklet by itself if you pass the flag properly. > I would like to apply these 8 patches first and then I would provide > an addition patch to get an ALSA control to select the sound timer. > I fear this would be the best idea (replacing the snd_pcm_link() > feature) because the ALSA control is accessible by any audio user and > we could use ALSA hooks to select the right sound timer when opening > an ALSA device. It depends on the implementation. Usually you "lock" such a control that is bound with a PCM stream at opening, so that other process won't be able to change. Such a trick is used for the dynamic routing via control element for emu10k1, for example. But, whether it's really usable, I don't know. Let's see. thanks, Takashi