Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 431C9C433F5 for ; Tue, 7 Dec 2021 14:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237976AbhLGOjo (ORCPT ); Tue, 7 Dec 2021 09:39:44 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:43828 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237955AbhLGOjn (ORCPT ); Tue, 7 Dec 2021 09:39:43 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9AA5021958; Tue, 7 Dec 2021 14:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1638887772; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iq7zpDwumO/J2nR5Fwq+tP1tpVuWfzPRGA6E+Fvxh8E=; b=qtRTP4XX5/CRAq4ovSgOMtBqKYBDPJvm4eo0VwHyDodaZYKDs2VVAVx/LTg2S3DXImVeEw Ae79dnP7uDZU5aDgE54aokS10mQqsObfOAG9gsvO3FZHm+2bDkSd1wrP8JnFCPrvCxDz6V +z8GebW5kFMtEfJUGOsdUY0vmkwDY/Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1638887772; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iq7zpDwumO/J2nR5Fwq+tP1tpVuWfzPRGA6E+Fvxh8E=; b=ePIn0P2So2LLZcN7bW+bZyy6/IOSGQjINg0HGPh+IEBpIYgBUEq9nXBnog7z+ZSL1FcZ0M rfxZOP/fpr6mRNCQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 87997A3B81; Tue, 7 Dec 2021 14:36:12 +0000 (UTC) Date: Tue, 07 Dec 2021 15:36:12 +0100 Message-ID: From: Takashi Iwai To: Mark Brown Cc: Shuah Khan , Jaroslav Kysela , alsa-devel@alsa-project.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2] kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest In-Reply-To: References: <20211206160305.194011-1-broonie@kernel.org> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Tue, 07 Dec 2021 15:25:00 +0100, Mark Brown wrote: > > On Tue, Dec 07, 2021 at 12:20:32PM +0900, Takashi Sakamoto wrote: > > On Mon, Dec 06, 2021 at 04:03:05PM +0000, Mark Brown wrote: > > > I think it safer to take care of volatile attribute when comparing read > > value to written value. I'm glad if you review below patch. > > Yes, that's a good spot, it was an oversight to not take care of > volatile controls - I'll roll that in if I send a new version or > I guess Takashi could apply on top of my v2? If people are mostly happy > and at Jaroslav is also preparing patches on top of this it might make > sense to get it into git sooner. > > Reviewed-by: Mark Brown I'd like to get a comment from kselftest people about this addition with the external alsa-lib. Shua, what do you think? If it's acceptable, I'd happily take the v2 patch and Sakamoto-san's additional fix to sound.git tree. > > As another topic, the runtime of alsa-lib application largely differs > > between process user due to the result of parsing text files for > > configuration space. I can easily imagine that developers unfamiliar to > > alsa-lib carelessly adds invalid or inadequate configurations to files > > under target path of alsa-lib configuration space, and they are puzzled > > since they are unaware of the fact that the kselftest is affected by > > userspace stuffs for the runtime. > > > If we respect the basic theory of test (idempotence), we can use ioctl(2) > > with requests for ALSA control interface since it's not so complicated > > (at least it is easier than ALSA PCM interface). The purpose of > > kselftest is to test kernel stuffs, not to test userspace stuffs > > including alsa-lib implementation and variety of plugins. > > Right, I was originally thinking of implementing this in terms of > tinyalsa which is much more direct (though I was amused to see that's > gained userspace plugins at some point!) partly for this reason but the > lack of widespread packaging for it was a bit of a blocker and it didn't > feel like a great idea to essentially do yet another userspace ALSA > library even if as you say it can be pretty trivial. Jaroslav's > suggestion of using a custom configuration to override the default seems > like it addresses everything though. > > I do think there's an advantage for test comprehensibility in having the > test written in terms of similar APIs to a normal userspace application > - it makes it easier to relate what the test is doing to normal usage > which is helpful when trying to understand what the test is trying to > tell you. This comes to the question again to the test with external libraries, IMO. If a self-contained test code is much preferred, we can go for implementing open-code with raw kernel ABI. The control API is relatively simple and fairly solid over years, hence it's likely feasible. OTOH, using alsa-lib is also showing the test with the actual use case, and in that sense, it's not bad at all as more practical tests. thanks, Takashi