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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2A488C433EF for ; Wed, 8 Dec 2021 14:28:24 +0000 (UTC) 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 009372590; Wed, 8 Dec 2021 15:27:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 009372590 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1638973702; bh=At067VN0BXU9Fi/s+BFOpD6lhsUpQplu98V/NQKzryk=; h=In-Reply-To:References:Date:From:To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aVZBZ2bmeoFMEFYnhnRXaEvdBIH6X4BmrRRRSB9bKl2Dj0s/Pu6vfCsHewlgrBCc/ e2BPDgiqpesDa54tBl/S/UaWRUNFFDbh2FiC6vils/oZbZJvhtZqzdFPLoouySquXx P2OTRMpOM5QjCGqmKvLRTopiu5zBtiFF6KcbcmP4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 84FD5F80217; Wed, 8 Dec 2021 15:27:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 212E1F804CC; Wed, 8 Dec 2021 15:27:30 +0100 (CET) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 55193F80103 for ; Wed, 8 Dec 2021 15:27:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 55193F80103 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="YTVu1fTg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="L+83eAt0" Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D29D03201D40; Wed, 8 Dec 2021 09:27:20 -0500 (EST) Received: from imap41 ([10.202.2.91]) by compute3.internal (MEProxy); Wed, 08 Dec 2021 09:27:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=6ORq/SgBvFOuBcZ0HewAIDGw0gFBrj4 g3+zfdCb8Sac=; b=YTVu1fTgsRJ/Dv2EyO96L0qUzP2tRqaxQad7BsXeGw7yQTx BPI7rqXsFX6emq3SaavbslkAy/YFHzDRPXQ3otgkZ6TCKv5px573mLuqySvELr0H j7ADOwMq5i2BCJi3xqBgv4raBZDBneGx+lvF1luAsWb+ZLpZx18t415xCPfI4UZk qmpx5rGZRw3yQ9JnDwIlqqmpMbkOCdgtGE69z8zv0gMWPL5KE6KxtvS6z+pmEGK0 J1zp+kCZp3pLhhuIu/CvGeGoqn0RQFx/5GiNXOtqqgdion+xNIQXPszhDyTG55MJ 2+O5Xc4KXruxBBe5YRrFscrQEIb3AGTNcJQNKsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=6ORq/S gBvFOuBcZ0HewAIDGw0gFBrj4g3+zfdCb8Sac=; b=L+83eAt01a0hjes9LgK3v7 y3Lj528fms5d5Cvwvl1U6pT6Cuzxtw91aUxvhEYvqU+WjODx418HXVw++ePALxGk siR1rmXtgivRFoWkPCY7VAL8eagWfxTEGtGM91920CRw0JAp3Ess11uR3NFj1t/+ j6+PeipnLQuiQbXsGUMjfjfCEMj6QjU4gGxTzAkNb8JdCm+EsI69wqGS6pEjdfnk 8krl/ysQktnWO6IYcktAAGWezIUDoZsttWPYC+IRtX7++tWJxDiR9vq3A+nBrsKZ L6x4S6dcaSNP4DNd+TS7b+WZK4pQ1OYGidEw7aytDeQh07oR8E52f6NjRTnCYi3g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjeekgdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfvfgrkhgr shhhihcuufgrkhgrmhhothhofdcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhih drjhhpqeenucggtffrrghtthgvrhhnpeekkefgtdeigffgheefleduveefvdevgeehffet jefghfejheffudduieevvedvieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E70EC3C031B; Wed, 8 Dec 2021 09:27:19 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4492-g121c2470aa-fm-20211206.001-g121c2470 Mime-Version: 1.0 Message-Id: <85e0af0d-6f7e-47b0-b09c-c6006ee50662@www.fastmail.com> In-Reply-To: References: <20211206160305.194011-1-broonie@kernel.org> Date: Wed, 08 Dec 2021 23:26:59 +0900 From: "Takashi Sakamoto" To: "Mark Brown" , "Takashi Iwai" , "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 Content-Type: text/plain 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 Tue, Dec 7, 2021, at 23:25, 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 Feel free to append it for your new version with or without my sign-off. If keeping it, I could review your respun one by receiving according to To or Cc. >> 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. In my opinion, test is merely test. It's not a sample program. What important is what is tested. and how to assist developers if failed. If more suitable for the direction, we should do it, even if using raw ioctl in the case. For your information, `check_event()` in `test/user-ctl-element-set.c`, my rough implementation of test for event triggered by tlv operation, might be helpful to you or start point t to discuss about event check. Regards Takashi Sakamoto