[alsa-devel] Requiring the same sample rate for playback and record?

Timur Tabi timur at freescale.com
Fri Jul 25 21:55:32 CEST 2008


Takashi Iwai wrote:

> Then you can call like:
> 
>      snd_pcm_hw_constraint_minmax(substream->runtime,
> 		SNDRV_PCM_HW_PARAM_RATE, fixed_rate, fixed_rate);

Ok, I think I got this working.  However, I'm not sure how to handle the sample
size.  I have this:

	struct snd_pcm_runtime *first_runtime =
		ssi_private->first_stream->runtime;

	snd_pcm_hw_constraint_minmax(substream->runtime,
		SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
		first_runtime->sample_bits, first_runtime->sample_bits);

Is SNDRV_PCM_HW_PARAM_SAMPLE_BITS for the logical or physical width?  That is,
if my first stream is playing S24_BE samples, do I restrict the second stream to
24 bits or 32 bits?

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the Alsa-devel mailing list