Audio stops working after multiple iteration on dragonboard820c

Hello Team,

We are using “https://snapshots.linaro.org/96boards/dragonboard820c/linaro/debian/423/” build on Dragonboard 820c board.

With the above combination we are facing issue with Audio Codec WCD9335 during Audio playback in multiple iterations:

Please refer the script having 3 use cases for audio playback as follow:

  1. Primary Speaker

  2. Secondary Audio playback device (Headset)

  3. Both Primary and Secondary Playback device

There are two scenarios observed.
(1) if we only run the audio on primary speaker / Both speaker then after 10-12 iteration sometimes audio stops playing. This scenario is random and it produces mostly after 10 iteration. When audio stops playing after that if we play again then audio plays.

(2) If we run the audio on First primary speaker then headset and after that on both then we observed that mostly audio stops playing. If we tried to play it again then it should not played. In this situation we have to reboot the board then and then audio plays.

I am using below command script for playing the audio.

#!/bin/sh

TEST_REPORT_FILE=test_report.csv
TERMINAL_DEBUG=“enable”
TEST_REPORT_DEBUG=“enable”

PWD=$(pwd)

SUCCESS=“Success”
FAIL=“Fail”

test_TC_SC_FW_RQ05_1_Audio_Main_1_Mono_Playback(){

amixer -c 0 cset iface=MIXER,name=‘SLIM RX0 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX1 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX3 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX4 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX5 MUX’ AIF4_PB 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX6 MUX’ AIF4_PB 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX7 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT3_2 MUX’ RX5 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT4_2 MUX’ RX6 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIMBUS_6_RX Audio Mixer MultiMedia2’ 1 2>&1 >> /dev/null
x=0
while [ $x -le 2 ]
do
aplay -D hw:0,1 /usr/share/sounds/alsa/Front_Center.wav 2>&1 >> /dev/null
x=$((x + 1))
done

amixer -c 0 cset iface=MIXER,name=‘SLIM RX0 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX1 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX3 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX4 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX5 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX6 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX7 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT3_2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT4_2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIMBUS_6_RX Audio Mixer MultiMedia2’ 0 2>&1 >> /dev/null

IS_PROPER=“0”
printf "Audio played on Main speaker please press [Y/n] : "
read op1
case $op1 in
“Y”) IS_PROPER=“1”;;
“y”) IS_PROPER=“1”;;
“N”) ;;
“n”) ;;

  • ) echo “Please select one of the available options”;;
    esac

if [ “$IS_PROPER” = “1” ]
then
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Main.1_Mono-Playback : $SUCCESS”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Main.1_Mono-Playback : $SUCCESS” >> $TEST_REPORT_FILE
fi
else
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Main.1_Mono-Playback : $FAIL”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Main.1_Mono-Playback : $FAIL” >> $TEST_REPORT_FILE
fi
fi
}

test_TC_SC_FW_RQ05_1_Audio_Sub_1_Stereo_Playback(){

amixer -c 0 cset iface=MIXER,name=‘SLIM RX0 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX1 MUX’ ZERO 2>&1 >> /dev/nul
amixer -c 0 cset iface=MIXER,name=‘SLIM RX2 MUX’ ZERO 2>&1 >> /dev/nul
amixer -c 0 cset iface=MIXER,name=‘SLIM RX3 MUX’ ZERO 2>&1 >> /dev/nul
amixer -c 0 cset iface=MIXER,name=‘SLIM RX4 MUX’ ZERO 2>&1 >> /dev/nul
amixer -c 0 cset iface=MIXER,name=‘SLIM RX5 MUX’ AIF4_PB 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX6 MUX’ AIF4_PB 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX7 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT1_2 MUX’ RX5 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT2_2 MUX’ RX6 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX5 Digital Volume’ 10 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX6 Digital Volume’ 10 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIMBUS_6_RX Audio Mixer MultiMedia2’ 1 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT1 DEM MUX’ CLSH_DSM_OUT 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT2 DEM MUX’ CLSH_DSM_OUT 2>&1 >> /dev/null
aplay -D hw:0,1 “$PWD”/LRMonoPhase4.wav 2>&1 >> /dev/null

amixer -c 0 cset iface=MIXER,name=‘SLIM RX0 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX1 MUX’ ZERO 2>&1 >> /dev/nul
amixer -c 0 cset iface=MIXER,name=‘SLIM RX2 MUX’ ZERO 2>&1 >> /dev/nul
amixer -c 0 cset iface=MIXER,name=‘SLIM RX3 MUX’ ZERO 2>&1 >> /dev/nul
amixer -c 0 cset iface=MIXER,name=‘SLIM RX4 MUX’ ZERO 2>&1 >> /dev/nul
amixer -c 0 cset iface=MIXER,name=‘SLIM RX5 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX6 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX7 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX5 Digital Volume’ 0 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX6 Digital Volume’ 0 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT1_2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT2_2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIMBUS_6_RX Audio Mixer MultiMedia2’ 0 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT1 DEM MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT2 DEM MUX’ ZERO 2>&1 >> /dev/null

IS_PROPER=“0”
printf "Audio played on L channel of Sub speaker please press [Y/n] : "
read op1
case $op1 in
“Y”) IS_PROPER=“1”;;
“y”) IS_PROPER=“1”;;
“N”) ;;
“n”) ;;

  • ) echo “Please select one of the available options”;;
    esac

if [ “$IS_PROPER” = “1” ]
then
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Mono-L-Playback : $SUCCESS”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Mono-L-Playback : $SUCCESS” >> $TEST_REPORT_FILE
fi
else
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Mono-L-Playback : $FAIL”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Mono-L-Playback : $FAIL” >> $TEST_REPORT_FILE
fi
fi

IS_PROPER=“0”
printf "Audio played on R channel of Sub speaker please press [Y/n] : "
read op1
case $op1 in
“Y”) IS_PROPER=“1”;;
“y”) IS_PROPER=“1”;;
“N”) ;;
“n”) ;;

  • ) echo “Please select one of the available options”;;
    esac

if [ “$IS_PROPER” = “1” ]
then
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Mono-R-Playback : $SUCCESS”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Mono-R-Playback : $SUCCESS” >> $TEST_REPORT_FILE
fi
else
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Mono-R-Playback : $FAIL”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Mono-R-Playback : $FAIL” >> $TEST_REPORT_FILE
fi
fi

IS_PROPER=“0”
printf "Audio played on both channel of sub speaker please press [Y/n] : "
read op1
case $op1 in
“Y”) IS_PROPER=“1”;;
“y”) IS_PROPER=“1”;;
“N”) ;;
“n”) ;;

  • ) echo “Please select one of the available options”;;
    esac

if [ “$IS_PROPER” = “1” ]
then
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Stereo-Playback : $SUCCESS”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Stereo-Playback : $SUCCESS” >> $TEST_REPORT_FILE
fi
else
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Stereo-Playback : $FAIL”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Sub.1_Stereo-Playback : $FAIL” >> $TEST_REPORT_FILE
fi
fi
}

test_TC_SC_FW_RQ05_1_Audio_Both_1_Playback(){
amixer -c 0 cset iface=MIXER,name=‘RX INT1 DEM MUX’ CLSH_DSM_OUT 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT2 DEM MUX’ CLSH_DSM_OUT 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX0 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX1 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX3 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX4 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX5 MUX’ AIF4_PB 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX6 MUX’ AIF4_PB 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX7 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT1_2 MUX’ RX5 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT2_2 MUX’ RX5 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT4_2 MUX’ RX6 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIMBUS_6_RX Audio Mixer MultiMedia2’ 1 2>&1 >> /dev/null
x=0
while [ $x -le 2 ]
do
aplay -D hw:0,1 /usr/share/sounds/alsa/Front_Center.wav 2>&1 >> /dev/null
x=$((x + 1))
done

amixer -c 0 cset iface=MIXER,name=‘RX INT1 DEM MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT2 DEM MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX0 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX1 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX3 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX4 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX5 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX6 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIM RX7 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT1_2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT2_2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘RX INT4_2 MUX’ ZERO 2>&1 >> /dev/null
amixer -c 0 cset iface=MIXER,name=‘SLIMBUS_6_RX Audio Mixer MultiMedia2’ 0 2>&1 >> /dev/null

IS_PROPER=“0”
printf "Audio played on both Main speaker and sub speaker please press [Y/n] : "
read op1
case $op1 in
“Y”) IS_PROPER=“1”;;
“y”) IS_PROPER=“1”;;
“N”) ;;
“n”) ;;

  • ) echo “Please select one of the available options”;;
    esac

if [ “$IS_PROPER” = “1” ]
then
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Both.1_Playback : $SUCCESS”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Both.1_Playback : $SUCCESS” >> $TEST_REPORT_FILE
fi
else
if [ “$TERMINAL_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Both.1_Playback : $FAIL”
fi
if [ “$TEST_REPORT_DEBUG” = “enable” ]
then
echo “TC_SC_FW_RQ05.1_Audio-Both.1_Playback : $FAIL” >> $TEST_REPORT_FILE
fi
fi

}

Main script starts here

test_TC_SC_FW_RQ05_1_Audio_Main_1_Mono_Playback
test_TC_SC_FW_RQ05_1_Audio_Sub_1_Stereo_Playback
test_TC_SC_FW_RQ05_1_Audio_Both_1_Playback

Can you please help me out ?

Regards,
Pravin