Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46f854ad authored by Saketh Sathuvalli's avatar Saketh Sathuvalli Committed by Andy Hung
Browse files

libeffects: Updated test script for higher frequencies and effects

Added test cases for testing audio effects for higher frequencies
Added test cases for different combination of effects
Removed generated *.raw files at the end of the test

Test: local native test (lvmtest)
Bug: 120910607
Change-Id: I4df654314fee39a41bac05a8398d01e8f11e1173
parent 50bd4888
Loading
Loading
Loading
Loading
+61 −22
Original line number Diff line number Diff line
@@ -20,30 +20,69 @@ adb root && adb wait-for-device remount
# location of test files
testdir="/data/local/tmp/lvmTest"

#flags="-bE -tE -eqE -csE"
flags="-csE -tE -eqE"


echo "========================================"
echo "testing lvm"
adb shell mkdir $testdir
adb shell mkdir -p $testdir
adb push $ANDROID_BUILD_TOP/cts/tests/tests/media/res/raw/sinesweepraw.raw $testdir
adb push $OUT/testcases/lvmtest/arm64/lvmtest $testdir

# run multichannel effects at different channel counts, saving only the stereo channel pair.
adb shell $testdir/lvmtest -i:$testdir/sinesweepraw.raw -o:$testdir/sinesweep_1.raw\
                          -ch:1 -fs:44100 $flags
adb shell $testdir/lvmtest -i:$testdir/sinesweepraw.raw -o:$testdir/sinesweep_2.raw\
                           -ch:2 -fs:44100 $flags
adb shell $testdir/lvmtest -i:$testdir/sinesweepraw.raw -o:$testdir/sinesweep_4.raw\
                           -ch:4 -fs:44100 $flags
adb shell $testdir/lvmtest -i:$testdir/sinesweepraw.raw -o:$testdir/sinesweep_6.raw\
                           -ch:6 -fs:44100 $flags
adb shell $testdir/lvmtest -i:$testdir/sinesweepraw.raw -o:$testdir/sinesweep_8.raw\
                           -ch:8 -fs:44100 $flags

# two channel files should be identical to higher channel computation (first 2 channels).
adb shell cmp $testdir/sinesweep_2.raw $testdir/sinesweep_2.raw
adb shell cmp $testdir/sinesweep_2.raw $testdir/sinesweep_4.raw
adb shell cmp $testdir/sinesweep_2.raw $testdir/sinesweep_6.raw
adb shell cmp $testdir/sinesweep_2.raw $testdir/sinesweep_8.raw
flags_arr=(
    "-csE"
    "-eqE"
    "-tE"
    "-csE -tE -eqE"
    "-bE"
    "-csE -tE"
    "-csE -eqE" "-tE -eqE"
    "-csE -tE -bE -eqE"
)

fs_arr=(
    8000
    11025
    12000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
)

ch_arr=(
    1
    2
    4
    6
    8
)

# run multichannel effects at different configs, saving only the stereo channel
# pair.
for flags in "${flags_arr[@]}"
do
    for fs in ${fs_arr[*]}
    do
        for ch in ${ch_arr[*]}
        do
            adb shell $testdir/lvmtest -i:$testdir/sinesweepraw.raw \
                -o:$testdir/sinesweep_$((ch))_$((fs)).raw -ch:$ch -fs:$fs $flags

            # two channel files should be identical to higher channel
            # computation (first 2 channels).
            # Do not compare cases where -bE is in flags (due to mono computation)
            if [[ $flags != *"-bE"* ]] && [ "$ch" -gt 2 ]
            then
                adb shell cmp $testdir/sinesweep_2_$((fs)).raw \
                    $testdir/sinesweep_$((ch))_$((fs)).raw
            fi

        done
    done
done

adb shell rm -r $testdir