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

Commit fc4a1813 authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "AudioEffect: explicitly show errors in lvmtest"

parents 1c81145d 175fbd38
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ fs_arr=(

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

            shell_ret=$?
            if [ $shell_ret -ne 0 ]; then
                echo "error: $shell_ret"
                ((++error_count))
            fi


            # 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)
@@ -82,8 +90,17 @@ do
                    $testdir/sinesweep_$((chMask))_$((fs)).raw -thr:90.308998
            fi

            # both cmp and snr return EXIT_FAILURE on mismatch.
            shell_ret=$?
            if [ $shell_ret -ne 0 ]; then
                echo "error: $shell_ret"
                ((++error_count))
            fi

        done
    done
done

adb shell rm -r $testdir
echo "$error_count errors"
exit $error_count
+3 −1
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ int main(int argc, const char *argv[]) {
    printf("\nError: missing input/reference files\n");
    return -1;
  }
  int ret = EXIT_SUCCESS;
  auto sn = pcm_format == 0
      ? getSignalNoise<short>(finp, fref)
      : getSignalNoise<float>(finp, fref);
@@ -92,6 +93,7 @@ int main(int argc, const char *argv[]) {
    // compare the measured snr value with threshold
    if (snr < thr) {
      printf("%.6f less than threshold %.6f\n", snr, thr);
      ret = EXIT_FAILURE;
    } else {
      printf("%.6f\n", snr);
    }
@@ -99,5 +101,5 @@ int main(int argc, const char *argv[]) {
  fclose(finp);
  fclose(fref);

  return 0;
  return ret;
}