]> 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)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:47 +0000 (08:34 +0200)
commit6be9925a4c139191ac8410ce964162172eff5fd0
treefa47e4872d3cf016aab14e732999b88c965e9f04
parentaac9956cf6c9e2c4b245e1ae34f6f92a989f123e
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