From: Takashi Iwai Subject: Re: Requiring the same sample rate for playback and record? Date: Mon, 23 Jun 2008 13:00:02 +0200 Message-ID: References: <485C0042.4050008@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 (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 434F110382C for ; Mon, 23 Jun 2008 13:00:03 +0200 (CEST) In-Reply-To: <485C0042.4050008@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 development List-Id: alsa-devel@alsa-project.org At Fri, 20 Jun 2008 14:08:50 -0500, Timur Tabi wrote: > > In my driver, how do I tell ALSA that the sample rate for playback must be the > same as for capture? > > I know I can have my driver remember the sample rate for the first stream open, > and then if the second stream doesn't specify the same sample rate, it can > reject it, but this is inelegant. I'm hoping there's a more straightforward way. Right now there is no "elegant" way for this, unfortunately. A common way many drivers use is to remember the rate of the first stream, then add it to hw_constraint of the secondary streams. But, this could be also a bit racy (unavoidable due to its design) although practically it seems working. Takashi