Repository navigation
test-case: add equalizer test case #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| #!/bin/bash | ||
|
|
||
| ## | ||
| ## Case Name: check-audio-equalizer.sh | ||
| ## Preconditions: | ||
| ## SOF Topology should have EQ component(s) in any pipeline | ||
| ## Description: | ||
| ## check IIR/FIR config working | ||
| ## Case step: | ||
| ## 1. Check if the topology has a EQ component in it | ||
| ## 2. Test with IIR config list | ||
| ## 3. Test with FIR config list | ||
| ## Expect result: | ||
| ## sof-ctl and aplay should return 0 | ||
| ## | ||
|
|
||
| # source from the relative path of current folder | ||
| source $(dirname ${BASH_SOURCE[0]})/../case-lib/lib.sh | ||
|
|
||
| OPT_OPT_lst['t']='tplg' OPT_DESC_lst['t']='tplg file, default value is env TPLG: $TPLG' | ||
| OPT_PARM_lst['t']=1 OPT_VALUE_lst['t']="$TPLG" | ||
|
|
||
| OPT_OPT_lst['d']='duration' OPT_DESC_lst['d']='aplay duration in second' | ||
| OPT_PARM_lst['d']=1 OPT_VALUE_lst['d']=5 | ||
|
|
||
| OPT_OPT_lst['l']='loop' OPT_DESC_lst['l']='loop count' | ||
| OPT_PARM_lst['l']=1 OPT_VALUE_lst['l']=1 | ||
|
|
||
| OPT_OPT_lst['s']='sof-logger' OPT_DESC_lst['s']="Open sof-logger trace the data will store at $LOG_ROOT" | ||
| OPT_PARM_lst['s']=0 OPT_VALUE_lst['s']=1 | ||
|
|
||
| func_opt_parse_option $* | ||
| tplg=${OPT_VALUE_lst['t']} | ||
| duration=${OPT_VALUE_lst['d']} | ||
| loop_cnt=${OPT_VALUE_lst['l']} | ||
|
|
||
| # TODO: direct import only EQ pipeline | ||
| func_pipeline_export $tplg "type:playback" | ||
| sofcard=${SOFCARD:-0} | ||
|
|
||
| # Test equalizer | ||
| func_test_eq() | ||
| { | ||
| local id=$1 | ||
| local conf=$2 | ||
|
|
||
| [ ! -f $conf ] && dloge "$conf not exist" && exit 1 | ||
|
|
||
| dlogc "sof-ctl -Dhw:$sofcard -n $id -s $conf" | ||
| sof-ctl -Dhw:$sofcard -n $id -s $conf | ||
| if [ $? -ne 0 ]; then | ||
| dloge "Equalizer setting failure with $conf" | ||
| return 1 | ||
| fi | ||
| # test with aplay | ||
| dlogc "aplay -D$dev -f $fmt -c $channel -r $rate /dev/zero -d $duration" | ||
| aplay -D$dev -f $fmt -c $channel /dev/zero -d $duration | ||
| if [ $? -ne 0 ]; then | ||
| dloge "Equalizer test failure with $conf" | ||
| return 1 | ||
| fi | ||
| sleep 1 | ||
| } | ||
|
|
||
| current_dir=$(dirname ${BASH_SOURCE[0]}) | ||
|
|
||
| # initialized with negative value. If none of test is performed the test result will be failed. | ||
| result=1 | ||
| failed_cnt=0 | ||
|
|
||
| # TODO: direct import only EQ pipeline and loop for EQ pipeline only | ||
| for idx in $(seq 0 $(expr $PIPELINE_COUNT - 1)) | ||
|
fredoh9 marked this conversation as resolved.
Resolved
|
||
| do | ||
| dlogi "$idx - total pipeline= $PIPELINE_COUNT" | ||
| dev=$(func_pipeline_parse_value $idx dev) | ||
| channel=$(func_pipeline_parse_value $idx channel) | ||
| rate=$(func_pipeline_parse_value $idx rate) | ||
| fmt=$(func_pipeline_parse_value $idx fmt) | ||
| eq_support=$(func_pipeline_parse_value $idx eq) | ||
| if [ -z "$eq_support" ]; then | ||
| dlogi "None of FIR/IIF filter is available in this pipeline, skip" | ||
| continue | ||
| fi | ||
| dlogi "eq_support= $eq_support" | ||
| is_iir=$(echo $eq_support | grep -i iir | wc -l) | ||
| is_fir=$(echo $eq_support | grep -i fir | wc -l) | ||
| if [ $is_iir -ne $is_fir ]; then | ||
| dlogi "no FIR or IIF filter is available in this pipeline, skip" | ||
| continue | ||
| fi | ||
|
|
||
| dlogi "0. Get amixer control id for IIR and FIR" | ||
| IIRid=`amixer -D hw:$sofcard controls | grep EQIIR| head -1| sed 's/numid=\([0-9]*\),.*/\1/'` | ||
| if [ -z $IIRid ]; then | ||
| dloge "can't find IIR filter" | ||
| exit 1 | ||
| fi | ||
|
|
||
| FIRid=`amixer -D hw:$sofcard controls | grep EQFIR| head -1| sed 's/numid=\([0-9]*\),.*/\1/'` | ||
| if [ -z $FIRid ]; then | ||
| dloge "can't find FIR filter" | ||
| exit 1 | ||
| fi | ||
|
|
||
| declare -a IIRList=($(ls -d ${current_dir}/eqctl/eq_iir_*.txt)) | ||
| nIIRList=${#IIRList[@]} | ||
| dlogi "IIR list $nIIRList ${IIRList[*]}" | ||
| declare -a FIRList=($(ls -d ${current_dir}/eqctl/eq_fir_*.txt)) | ||
| nFIRList=${#FIRList[@]} | ||
| dlogi "FIR list $nFIRList ${FIRList[*]}" | ||
| if [ $nIIRList == 0 ] || [ $nFIRList == 0 ]; then | ||
| dloge "IIR or FIR flter coeff list error!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| for i in $(seq 1 $loop_cnt) | ||
| do | ||
| dlogi "[$i/$loop_cnt] 1. Test IIR config list, IIR amixer control id=$IIRid" | ||
| for config in ${IIRList[@]}; do | ||
| func_test_eq $IIRid $current_dir/$config | ||
| result=$? | ||
| if [[ $result -ne 0 ]]; then | ||
| dloge "Failed at $config" | ||
| let failed_cnt++ | ||
| fi | ||
| done | ||
|
|
||
| dlogi "[$i/$loop_cnt] 2. Test FIR config list, FIR amixer control id=$FIRid" | ||
| for config in ${FIRList[@]}; do | ||
| func_test_eq $FIRid $current_dir/$config | ||
| result=$? | ||
| if [[ $result -ne 0 ]]; then | ||
| dloge "Failed at $config" | ||
| let failed_cnt++ | ||
| fi | ||
| done | ||
| dlogi "EQ test done: failed_cnt is $failed_cnt" | ||
| if [ $failed_cnt -gt 0 ]; then | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| done | ||
|
|
||
| exit $result | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,56,50331648,0,0,0,0,56,65538,0,0,0,0,0,4294901764,0,0,0,0,16384,0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,256,50331648,0,0,0,0,256,131076,0,0,0,0,65537,65537,4294901764,0,0,0,0,16384,0,88,0,0,0,0,3535366939,119016436,49938453,30147089,30343698,30409180,29426121,27328945,25428369,23921015,22479202,20906315,19267889,17826074,16646407,15663350,14745832,13762777,12845259,11862204,10879149,10027167,9175186,8388742,7602298,6946927,6291557,5636187,5046354,4522057,3997761,3539002,3145779,2752557,2424872,2162723,1900575,1638427,1441815,1245204,1048593,917519,720909,7, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,216,50331648,0,0,0,0,216,65538,0,0,0,0,0,65620,0,0,0,0,1216113787,4258079667,3890735935,4020759377,4107596501,4148819496,4185192544,4218550909,4245879886,4266982846,4282777302,4294049699,6488112,11010187,13303997,13893842,13435090,12189892,10617006,8847509,7143546,5570657,4194378,3014711,2097190,1310746,786448,393224,65539,4294901760,4294836222,4294836221,4294770684,4294836221,4294836221,4294901757,4294901758,4294901758,4294967295,4294967295,4294967295,0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,56,50331648,0,0,0,0,56,65538,0,0,0,0,4294967295,4294901764,0,0,0,0,16384,0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,116,50331648,0,0,0,0,116,2,1,0,0,0,0,0,0,2,2,0,0,0,0,3316150158,2048164275,513807534,3267352229,513807534,0,16384,3867454526,1191025347,38870735,77741469,38870735,4294967292,24197, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,116,50331648,0,0,0,0,116,2,1,0,0,0,0,0,0,2,2,0,0,0,0,3227172081,2141520527,536653443,3221660410,536653443,0,16384,3260252783,2107733822,161646111,3961037800,172645501,4294967294,27910, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,88,50331648,0,0,0,0,88,2,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,538145694,0,32690, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,204,50331648,0,0,0,0,204,4,2,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,538145694,0,32690,3,3,0,0,0,0,3237960220,2130690484,297056159,3694463533,303476880,0,16384,3302357025,2064935920,245217319,3776455865,274003881,0,16384,4106268671,4130185751,69182517,4179658584,365641401,4294967292,25468, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4607827,0,88,50331648,0,0,0,0,88,2,1,0,0,0,0,4294967295,4294967295,1,1,0,0,0,0,0,0,0,0,538145694,0,32690, |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.