@@ -62,20 +62,20 @@ OPT_HAS_ARG['d']=1 OPT_VAL['d']=3
6262OPT_NAME[' u' ]=' relay' OPT_DESC[' u' ]=' name of usbrelay switch, default value is HURTM_2'
6363OPT_HAS_ARG[' u' ]=1 OPT_VAL[' u' ]=" HURTM_2"
6464
65- OPT_NAME[' h ' ]=' headphone' OPT_DESC[' h ' ]=' name of pcm control for headphone jack'
66- OPT_HAS_ARG[' h ' ]=1 OPT_VAL[' h ' ]=" headphone jack"
65+ OPT_NAME[' H ' ]=' headphone' OPT_DESC[' H ' ]=' name of pcm control for headphone jack'
66+ OPT_HAS_ARG[' H ' ]=1 OPT_VAL[' H ' ]=" headphone jack"
6767
68- OPT_NAME[' m ' ]=' headset' OPT_DESC[' m ' ]=' name of pcm control for headset mic jack'
69- OPT_HAS_ARG[' m ' ]=1 OPT_VAL[' m ' ]=" headset [a-z ]*jack"
68+ OPT_NAME[' M ' ]=' headset' OPT_DESC[' M ' ]=' name of pcm control for headset mic jack'
69+ OPT_HAS_ARG[' M ' ]=1 OPT_VAL[' M ' ]=" headset [a-z ]*jack"
7070
7171func_opt_parse_option " $@ "
7272
7373tplg=${OPT_VAL['t']}
7474relay=${OPT_VAL['u']}
7575loop_cnt=${OPT_VAL['l']}
7676dsp_settle_time=${OPT_VAL['d']}
77- headphone_jack_name=${OPT_VAL['h ']}
78- headset_mic_jack_name=${OPT_VAL['m ']}
77+ headphone_jack_name=${OPT_VAL['H ']}
78+ headset_mic_jack_name=${OPT_VAL['M ']}
7979
8080check_control_switch_state ()
8181{
@@ -87,6 +87,8 @@ check_control_switch_state()
8787 local expected_control_state=" $2 "
8888 local control_state
8989
90+ dlogi " Check if the state of control: $control_name is correct."
91+
9092 control_state=$( amixer -c " $SOFCARD " contents | awk -v name=" $control_name " '
9193 BEGIN { IGNORECASE=1; found=0 }
9294 /name=' \' ' / {
@@ -103,6 +105,7 @@ check_control_switch_state()
103105 if [[ " $expected_control_state " == " $control_state " ]]; then
104106 return 0
105107 else
108+ dloge " Expected control state ($expected_control_state ) but got ($control_state )."
106109 return 1
107110 fi
108111}
@@ -185,17 +188,22 @@ main()
185188 # Check if usbrelay tool is installed
186189 command -v usbrelay || {
187190 # If usbrelay package is not installed
188- skip_test " usbrelay command not found. Please install usbrelay package. "
191+ skip_test " usbrelay command not found."
189192 }
190193
191- logger_disabled || func_lib_start_log_collect
192-
193194 # display current status of relays
194- usbrelay --debug
195+ usbrelay_switch --debug || {
196+ skip_test " Failed to get usbrelay status."
197+ }
198+
199+ logger_disabled || func_lib_start_log_collect
195200
196201 dlogi " Reset - plug jack audio"
197202 usbrelay_switch " $relay " 0
198203
204+ dlogi " Headphone patten: $headphone_jack_name "
205+ dlogi " Headset mic pattern: $headset_mic_jack_name "
206+
199207 for idx in $( seq 0 $(( PIPELINE_COUNT - 1 )) )
200208 do
201209 initialize_audio_params " $idx "
0 commit comments