[alsa-devel] ALSA hw sample rate conversion support

Koul, Vinod vinod.koul at intel.com
Wed Mar 30 17:32:40 CEST 2011


Aisheng Dong wrote:
> Hi ALL,
> 
> Does ALSA core support hw sample rate conversion now?
> Our soc has a HW sample rate converter module inside,
> I wonder if current ALSA core provide interface to support hw sample
> rate conversion?
> 
Assuming the SRC is inside SoC and you are converting sampling rate of stream
and sending at different rate, then I have a patch for you.
Basically the soc side hw_params should call a new API which call
codec_set_params() and sets the matching rate.

Something like this in soc-core

+int snd_soc_codec_set_params(struct snd_soc_codec *codec, unsigned int param)
+{
+       if (codec->driver->set_params)
+               return codec->driver->set_params(codec, param);
+       else
+               return -EINVAL;
+}
+EXPORT_SYMBOL_GPL(snd_soc_codec_set_params);

Mark,
Would you okay with such a patch where DSP is doing some conversion and codec
will get different params from what stream is set up? And we make sure 
conversion is synced

~Vinod


More information about the Alsa-devel mailing list