From: Takashi Iwai Subject: Re: How do I tell ALSA that my driver supports every possible sample rate? Date: Wed, 25 Jul 2007 12:18:27 +0200 Message-ID: References: <46A4CF38.3050107@freescale.com> <1185210867.7590.1201603759@webmail.messagingengine.com> <46A4E503.50207@freescale.com> <1185261264.6647.1201715813@webmail.messagingengine.com> <46A612A0.6000807@freescale.com> <46A65355.4040101@freescale.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id D70F31038BC for ; Wed, 25 Jul 2007 12:18:27 +0200 (CEST) In-Reply-To: <46A65355.4040101@freescale.com> 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: Timur Tabi Cc: ALSA devel List-Id: alsa-devel@alsa-project.org At Tue, 24 Jul 2007 14:30:29 -0500, Timur Tabi wrote: > > Takashi Iwai wrote: > > >> #define SNDRV_PCM_RATE_ALL (SNDRV_PCM_RATE_8000_192000 | SNDRV_PCM_RATES_5512) > > > > I'd prefer 5512_19200. The word "ALL" may vary in future. > > That's the point. It's supposed to indicate all sample rates no matter what they are or > will be. However, that may be a moot point ... > > > Anyway, the bits SND_PCM_RATES_[0-9]* are ignored when _CONTINUOUS or > > _KNOT is passed. Only the values in rate_min/rate_max fields are > > referred as actual min/max rates. > > Ah! I wish this stuff were documented in the source files. > > So can I do this? > > static const struct snd_pcm_hardware mpc86xx_pcm_hardware = { > > .rates = SNDRV_PCM_RATE_CONTINUOUS, > .rate_min = 1, > .rate_max = (unsigned int) -1, In theory, yes, but these rate_min and rate_max are nothing but confusing in practice. Your hardware won't support definitely such rates, but the application can't know. Set some reasonable values there. Takashi