]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00180390 ESAI: add amixer ASRC p2p API(ALSALIB)
authorChen Liangjun <b36089@freescale.com>
Tue, 5 Jun 2012 08:47:26 +0000 (16:47 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:12:03 +0000 (14:12 +0200)
commitc9ca13262f5e1f39edadd45f1bfbe911cd674692
treefa47e4872d3cf016aab14e732999b88c965e9f04
parent9fa564e685f7c24f13790a6fe929f43b57f6a8ec
ENGR00180390 ESAI: add amixer ASRC p2p API(ALSALIB)

If we want to use ESAI call ASRC, we need to know the input sample
rate as well as the output sample rate. however, cause of ALSA-LIB,
the input sample rate pass down to ALSA-DRIVER is not accurate. For
example, if the ALSA-DRIVER only support 48KHz playback and we want
to play an 16KHz audio file, the sample rate params the ALSA DRIVER
see is 48KHz but not 16KHz. So, the ALSA-DRIVER do not know the
original sample rate, and thus unable to config ASRC properly.

In this patch, we add an amixer control interface for alsa lib plugin to
config the input sample rate before playback. If no plugin, user
can call the amixer control interface to manually use ASRC for rate
convert.

For example, if we need to playback an 24bit_24K audio wav file without
call the plug. The sound card is 0.
1 Get the ASRC capability: amixer sget "ASRC"
1 Set the input samplerate: amixer sset "ASRC" "24KHz"
2 Play; aplay -Dhw:0 audio_24k24S-S24_LE.wav

Signed-off-by: Chen Liangjun <b36089@freescale.com>
sound/soc/imx/imx-cs42888.c
sound/soc/imx/imx-esai.c
sound/soc/imx/imx-pcm-dma-mx2.c
sound/soc/imx/imx-pcm.h