Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Commit d6e201c

Browse files
ranj063lrgirdwo
authored andcommitted
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>
1 parent 1dcac32 commit d6e201c

1 file changed

Lines changed: 68 additions & 38 deletions

File tree

topology/test/tplg-build.sh

Lines changed: 68 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,51 +37,77 @@ function simple_test {
3737
if [ $5 == "SSP" ]
3838
then
3939
TESTS=("${!13}")
40+
elif [ $5 == "DMIC" ]
41+
then
42+
TESTS=("${!15}")
4043
fi
4144
for i in ${TESTS[@]}
4245
do
43-
if [ "$USE_XARGS" == "yes" ]
46+
if [ $5 == "DMIC" ]
4447
then
45-
#if DAI type is SSP, define the SSP specific params
46-
if [ $5 == "SSP" ]
48+
TFILE="$i-dmic$6-$2-$4-$7-48k-$1"
49+
echo "M4 pre-processing test $i -> ${TFILE}"
50+
m4 ${M4_FLAGS} \
51+
-DTEST_PIPE_NAME="$2" \
52+
-DTEST_DAI_LINK_NAME="$3" \
53+
-DTEST_DAI_PORT=$6 \
54+
-DTEST_DAI_FORMAT=$7 \
55+
-DTEST_PIPE_FORMAT=$4 \
56+
-DTEST_DAI_TYPE=$5 \
57+
-DTEST_DMIC_DRIVER_VERSION=$8 \
58+
-DTEST_DMIC_CLK_MIN=$9 \
59+
-DTEST_DMIC_CLK_MAX=${10} \
60+
-DTEST_DMIC_DUTY_MIN=${11} \
61+
-DTEST_DMIC_DUTY_MAX=${12} \
62+
-DTEST_PDM_ACTIVE=${13} \
63+
-DTEST_DMIC_SAMPLE_RATE=${14} \
64+
$i.m4 > ${TFILE}.conf
65+
echo "Compiling test $i -> ${TFILE}.tplg"
66+
alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg
67+
else
68+
if [ "$USE_XARGS" == "yes" ]
4769
then
48-
if [ $i == "test-all" ]
70+
#if DAI type is SSP, define the SSP specific params
71+
if [ $5 == "SSP" ]
4972
then
50-
TFILE="test-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1"
51-
else
52-
TFILE="$i-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1"
73+
if [ $i == "test-all" ]
74+
then
75+
TFILE="test-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1"
76+
else
77+
TFILE="$i-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1"
78+
fi
79+
#create input string for batch m4 processing
80+
M4_STRINGS+="-DTEST_PIPE_NAME=$2,-DTEST_DAI_LINK_NAME=$3\
81+
-DTEST_DAI_PORT=$6,-DTEST_DAI_FORMAT=$7\
82+
-DTEST_PIPE_FORMAT=$4,-DTEST_SSP_BCLK=${10}\
83+
-DTEST_SSP_MCLK=${11},-DTEST_SSP_PHY_BITS=$8\
84+
-DTEST_SSP_DATA_BITS=$9,-DTEST_SSP_MODE=${12}\
85+
-DTEST_DAI_TYPE=$5\
86+
$i.m4,${TFILE},"
87+
#create input string for batch processing of conf files
88+
TEST_STRINGS+=${TFILE}","
89+
fi
90+
else
91+
#if DAI type is SSP, define the SSP specific params
92+
if [ $5 == "SSP" ]
93+
then
94+
echo "M4 pre-processing test $i -> ${TFILE}"
95+
m4 ${M4_FLAGS} \
96+
-DTEST_PIPE_NAME="$2" \
97+
-DTEST_DAI_LINK_NAME="$3" \
98+
-DTEST_DAI_PORT=$6 \
99+
-DTEST_DAI_FORMAT=$7 \
100+
-DTEST_PIPE_FORMAT=$4 \
101+
-DTEST_SSP_BCLK=${10} \
102+
-DTEST_SSP_MCLK=${11} \
103+
-DTEST_SSP_PHY_BITS=$8 \
104+
-DTEST_SSP_DATA_BITS=$9 \
105+
-DTEST_SSP_MODE=${12} \
106+
-DTEST_DAI_TYPE=$5 \
107+
$i.m4 > ${TFILE}.conf
108+
echo "Compiling test $i -> ${TFILE}.tplg"
109+
alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg
53110
fi
54-
#create input string for batch m4 processing
55-
M4_STRINGS+="-DTEST_PIPE_NAME=$2,-DTEST_DAI_LINK_NAME=$3\
56-
-DTEST_DAI_PORT=$6,-DTEST_DAI_FORMAT=$7\
57-
-DTEST_PIPE_FORMAT=$4,-DTEST_SSP_BCLK=${10}\
58-
-DTEST_SSP_MCLK=${11},-DTEST_SSP_PHY_BITS=$8\
59-
-DTEST_SSP_DATA_BITS=$9,-DTEST_SSP_MODE=${12}\
60-
-DTEST_DAI_TYPE=$5\
61-
$i.m4,${TFILE},"
62-
#create input string for batch processing of conf files
63-
TEST_STRINGS+=${TFILE}","
64-
fi
65-
else
66-
#if DAI type is SSP, define the SSP specific params
67-
if [ $5 == "SSP" ]
68-
then
69-
echo "M4 pre-processing test $i -> ${TFILE}"
70-
m4 ${M4_FLAGS} \
71-
-DTEST_PIPE_NAME="$2" \
72-
-DTEST_DAI_LINK_NAME="$3" \
73-
-DTEST_DAI_PORT=$6 \
74-
-DTEST_DAI_FORMAT=$7 \
75-
-DTEST_PIPE_FORMAT=$4 \
76-
-DTEST_SSP_BCLK=${10} \
77-
-DTEST_SSP_MCLK=${11} \
78-
-DTEST_SSP_PHY_BITS=$8 \
79-
-DTEST_SSP_DATA_BITS=$9 \
80-
-DTEST_SSP_MODE=${12} \
81-
-DTEST_DAI_TYPE=$5 \
82-
$i.m4 > ${TFILE}.conf
83-
echo "Compiling test $i -> ${TFILE}.tplg"
84-
alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg
85111
fi
86112
fi
87113
done
@@ -173,6 +199,10 @@ simple_test nocodec src "NoCodec" s24le SSP 4 s24le 25 24 2400000 24000000 I2S S
173199
# Tone test: Tone component only supports s32le currently
174200
simple_test codec tone "SSP2-Codec" s32le SSP 2 s16le 20 16 1920000 19200000 I2S TONE_TEST[@]
175201

202+
#DMIC Test
203+
simple_test nocodec passthrough "DMIC0" s32le DMIC 0 s32le 1 500000 4800000\
204+
40 60 1 48000 DMIC_TEST[@]
205+
176206
if [ "$USE_XARGS" == "yes" ]
177207
then
178208
echo "Batch processing m4 files..."

0 commit comments

Comments
 (0)