topology: scripts: add dmic test topology

This patch adds the dmic test case to the tplg generating script.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This commit is contained in:
Ranjani Sridharan 2018-05-31 10:34:46 -07:00 committed by Liam Girdwood
parent 1dcac3225e
commit d6e201c961
1 changed files with 69 additions and 39 deletions

View File

@ -37,51 +37,77 @@ function simple_test {
if [ $5 == "SSP" ]
then
TESTS=("${!13}")
elif [ $5 == "DMIC" ]
then
TESTS=("${!15}")
fi
for i in ${TESTS[@]}
do
if [ "$USE_XARGS" == "yes" ]
if [ $5 == "DMIC" ]
then
#if DAI type is SSP, define the SSP specific params
if [ $5 == "SSP" ]
then
if [ $i == "test-all" ]
then
TFILE="test-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1"
else
TFILE="$i-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1"
fi
#create input string for batch m4 processing
M4_STRINGS+="-DTEST_PIPE_NAME=$2,-DTEST_DAI_LINK_NAME=$3\
-DTEST_DAI_PORT=$6,-DTEST_DAI_FORMAT=$7\
-DTEST_PIPE_FORMAT=$4,-DTEST_SSP_BCLK=${10}\
-DTEST_SSP_MCLK=${11},-DTEST_SSP_PHY_BITS=$8\
-DTEST_SSP_DATA_BITS=$9,-DTEST_SSP_MODE=${12}\
-DTEST_DAI_TYPE=$5\
$i.m4,${TFILE},"
#create input string for batch processing of conf files
TEST_STRINGS+=${TFILE}","
fi
TFILE="$i-dmic$6-$2-$4-$7-48k-$1"
echo "M4 pre-processing test $i -> ${TFILE}"
m4 ${M4_FLAGS} \
-DTEST_PIPE_NAME="$2" \
-DTEST_DAI_LINK_NAME="$3" \
-DTEST_DAI_PORT=$6 \
-DTEST_DAI_FORMAT=$7 \
-DTEST_PIPE_FORMAT=$4 \
-DTEST_DAI_TYPE=$5 \
-DTEST_DMIC_DRIVER_VERSION=$8 \
-DTEST_DMIC_CLK_MIN=$9 \
-DTEST_DMIC_CLK_MAX=${10} \
-DTEST_DMIC_DUTY_MIN=${11} \
-DTEST_DMIC_DUTY_MAX=${12} \
-DTEST_PDM_ACTIVE=${13} \
-DTEST_DMIC_SAMPLE_RATE=${14} \
$i.m4 > ${TFILE}.conf
echo "Compiling test $i -> ${TFILE}.tplg"
alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg
else
#if DAI type is SSP, define the SSP specific params
if [ $5 == "SSP" ]
if [ "$USE_XARGS" == "yes" ]
then
echo "M4 pre-processing test $i -> ${TFILE}"
m4 ${M4_FLAGS} \
-DTEST_PIPE_NAME="$2" \
-DTEST_DAI_LINK_NAME="$3" \
-DTEST_DAI_PORT=$6 \
-DTEST_DAI_FORMAT=$7 \
-DTEST_PIPE_FORMAT=$4 \
-DTEST_SSP_BCLK=${10} \
-DTEST_SSP_MCLK=${11} \
-DTEST_SSP_PHY_BITS=$8 \
-DTEST_SSP_DATA_BITS=$9 \
-DTEST_SSP_MODE=${12} \
-DTEST_DAI_TYPE=$5 \
$i.m4 > ${TFILE}.conf
echo "Compiling test $i -> ${TFILE}.tplg"
alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg
#if DAI type is SSP, define the SSP specific params
if [ $5 == "SSP" ]
then
if [ $i == "test-all" ]
then
TFILE="test-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1"
else
TFILE="$i-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1"
fi
#create input string for batch m4 processing
M4_STRINGS+="-DTEST_PIPE_NAME=$2,-DTEST_DAI_LINK_NAME=$3\
-DTEST_DAI_PORT=$6,-DTEST_DAI_FORMAT=$7\
-DTEST_PIPE_FORMAT=$4,-DTEST_SSP_BCLK=${10}\
-DTEST_SSP_MCLK=${11},-DTEST_SSP_PHY_BITS=$8\
-DTEST_SSP_DATA_BITS=$9,-DTEST_SSP_MODE=${12}\
-DTEST_DAI_TYPE=$5\
$i.m4,${TFILE},"
#create input string for batch processing of conf files
TEST_STRINGS+=${TFILE}","
fi
else
#if DAI type is SSP, define the SSP specific params
if [ $5 == "SSP" ]
then
echo "M4 pre-processing test $i -> ${TFILE}"
m4 ${M4_FLAGS} \
-DTEST_PIPE_NAME="$2" \
-DTEST_DAI_LINK_NAME="$3" \
-DTEST_DAI_PORT=$6 \
-DTEST_DAI_FORMAT=$7 \
-DTEST_PIPE_FORMAT=$4 \
-DTEST_SSP_BCLK=${10} \
-DTEST_SSP_MCLK=${11} \
-DTEST_SSP_PHY_BITS=$8 \
-DTEST_SSP_DATA_BITS=$9 \
-DTEST_SSP_MODE=${12} \
-DTEST_DAI_TYPE=$5 \
$i.m4 > ${TFILE}.conf
echo "Compiling test $i -> ${TFILE}.tplg"
alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg
fi
fi
fi
done
@ -173,6 +199,10 @@ simple_test nocodec src "NoCodec" s24le SSP 4 s24le 25 24 2400000 24000000 I2S S
# Tone test: Tone component only supports s32le currently
simple_test codec tone "SSP2-Codec" s32le SSP 2 s16le 20 16 1920000 19200000 I2S TONE_TEST[@]
#DMIC Test
simple_test nocodec passthrough "DMIC0" s32le DMIC 0 s32le 1 500000 4800000\
40 60 1 48000 DMIC_TEST[@]
if [ "$USE_XARGS" == "yes" ]
then
echo "Batch processing m4 files..."