[alsa-devel] ASoC:Question rate constraint between the dais

James Courtier-Dutton james.dutton at gmail.com
Mon Mar 19 17:12:42 CET 2012

On 15 March 2012 09:53, Ramesh Babu <ramesh.babu at linux.intel.com> wrote:
> Hi
> I would like to understand how to handle the different sampling rates
> between dais.
> I need to make sure that all simultaneous playback and capture (across the
> all dai_links) needs to be of same frequency family.
> If the sampling frequency of  a new request is different from ongoing
> playback/capture, then it needs to be rejected.
> How do I handle it in machine driver?

A more deterministic method to do this would be have a mixer setting
to select the sample rate on a card wide bases.
Then all applications will only have one sample rate to choose from.
FYI: All EMU sound cards do it this way.
If the user wishes to change the sample rate, they close down all the
applications using the old rate, change the mixer setting, and then
start the apps up at the new rate.
Then applications that wish to use different sample rates, will need
to provide a sample rate conversion function.
A majority of the sound cards out there do 48KHz well, but not so well
on other rates, so defaulting to 48KHz is probably the best choice.
I know pulseaudio falls over hopelessly if it is set to 44.1KHz and
some USB web cam can only do 48KHz for the MIC.
Setting everything to 48KHz cures a lot of problems.
One of the most difficult things is getting 44.1KHz MP3s etc.
resampled to 48KHz, but most MP3 playing apps support good resamplers
so they can still talk to pulseaudio at 48KHz.

Kind Regards


More information about the Alsa-devel mailing list