From: Mark Brown Subject: Re: [PATCH - alsa-lib 2/3] tlv: Handle 'holes' in SND_CTL_TLVT_DB_RANGE array Date: Mon, 19 Jul 2010 17:24:17 +0100 Message-ID: <20100719162416.GD7002@sirena.org.uk> References: <1279523646-4987-1-git-send-email-peter.ujfalusi@nokia.com> <1279523646-4987-3-git-send-email-peter.ujfalusi@nokia.com> <20100719160109.GC7002@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cassiel.sirena.org.uk (cassiel.sirena.org.uk [80.68.93.111]) by alsa0.perex.cz (Postfix) with ESMTP id 06E12244D5 for ; Mon, 19 Jul 2010 18:24:18 +0200 (CEST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org, Peter Ujfalusi List-Id: alsa-devel@alsa-project.org On Mon, Jul 19, 2010 at 06:11:30PM +0200, Takashi Iwai wrote: > Well, one remaining question is how to handle if the hardware has > really no value in a certain range (a hole). Fixing in alsa-lib is a > sort of workaround, but it doesn't sound right, especially if the > range info can be provided correctly in the source. I guess it depends on what you're thinking of for an inexact match - if we're doing inexact matches within the range we're already saying that we're not giving 100% accuracy (and remember that some hardware has very coarse control). It seems wrong that we'd fail to match with a slighy inaccuracy when the requested value happens to be just outside the range but accept any old accuracy level from coarse grained steps. > If kernel changes would become too messy, then yes, we can reconsider > fixing this only in alsa-lib, though. Personally I'd rather the kernel just provided a mapping between control values and dB scales and then the application layer can decide what it thinks an appropriate match is. Decisions about how accurate a match is needed seem very policy like and therefore userspaceish and it seems wrong to be coding the data tables in the kernel in a way that works around the particular match algorithm in the application layer.