Skip to content

Script check-alsabat.sh fails with capture pipeline with volume scale max above 0 dB #436

@singalsu

Description

@singalsu

While checking SOF PR thesofproject/sof#3509 problem in CI I realised that the script fails when volume is set to max (+30 dB). In SOF the microphone capture pipelines have usually possibility for more than 0 dB gain.

If the script is sensitive to volume level it should set the gains to such value that the test is meaningful. E.g. walk trough each PGA and set their gain to 0 dB. Also possible volume switch should be set to "on" to avoid a muted PGA to fail the test.

# amixer cset name='PGA2.0 2 Master Capture Volume' 100%
numid=2,iface=MIXER,name='PGA2.0 2 Master Capture Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=80,step=0
  : values=80,80
  | dBscale-min=-50.00dB,step=1.00dB,mute=1

# ./check-alsabat.sh -p hw:0,0 -c hw:0,0
2020-10-14 12:01:38 UTC [INFO] Starting /usr/local/bin/sof-logger -t -l /etc/sof/sof-byt.ldc -o /home/singalsu/softest/test_2020-10-12/sof-test/logs/check-alsabat/2020-10-14-15:01:37-19795/slogger.txt
2020-10-14 12:01:38 UTC [INFO] check the PCMs before alsabat test
2020-10-14 12:01:40 UTC [COMMAND] alsabat -Pplughw:0,0 --standalone -n 240000 -F 997
alsa-utils version 1.2.2

Entering playback thread (ALSA).
Get period size: 1896  buffer size: 15038
Playing generated audio sine wave
2020-10-14 12:01:41 UTC [COMMAND] alsabat -Cplughw:0,0 -F 997
alsa-utils version 1.2.2

Entering capture thread (ALSA).
Get period size: 1896  buffer size: 15038
Recording ...
Capture completed.

BAT analysis: signal has 65536 frames at 44100 Hz, 1 channels, 2 bytes per sample.

Channel 1 - Checking for target frequency 997,00 Hz
Amplitude: 48895,3; Percentage: [149]
WARNING: Signal overflow!
Detected peak at 997,26 Hz of 34,68 dB
 Total 40,3 dB from 985,82 to 1006,00 Hz
 PASS: Peak detected at target frequency
Detected peak at 2991,10 Hz of 30,68 dB
 Total 41,0 dB from 2989,08 to 2991,77 Hz
 FAIL: Peak freq too high 2991,10 Hz
Detected peak at 4984,94 Hz of 28,30 dB
 Total 41,2 dB from 4984,94 to 4985,61 Hz
 FAIL: Peak freq too high 4984,94 Hz
Detected peak at 6978,78 Hz of 25,80 dB
 Total 41,5 dB from 6978,10 to 6980,12 Hz
 FAIL: Peak freq too high 6978,78 Hz
Detected peak at 8973,29 Hz of 23,77 dB
 Total 41,6 dB from 8972,62 to 8973,96 Hz
 FAIL: Peak freq too high 8973,29 Hz
Detected peak at 10967,13 Hz of 23,45 dB
 Total 41,7 dB from 10967,13 to 10967,13 Hz
 FAIL: Peak freq too high 10967,13 Hz
Detected peak at 12960,97 Hz of 22,33 dB
 Total 41,7 dB from 12960,97 to 12960,97 Hz
 FAIL: Peak freq too high 12960,97 Hz
Detected peak at 14954,81 Hz of 20,43 dB
 Total 41,8 dB from 14954,81 to 14954,81 Hz
 FAIL: Peak freq too high 14954,81 Hz
Detected at least 8 signal(s) in total

Return value is -1003
2020-10-14 12:01:45 UTC [ERROR] Starting func_exit_handler(), exit status=21, FUNCNAME stack:
2020-10-14 12:01:45 UTC [ERROR]  main()  @  ./check-alsabat.sh
2020-10-14 12:01:45 UTC [INFO] pkill -TERM sof-logger
Terminated
Playback completed.

Return value is 0
2020-10-14 12:01:47 UTC [INFO] nlines=406 /home/singalsu/softest/test_2020-10-12/sof-test/logs/check-alsabat/2020-10-14-15:01:37-19795/slogger.txt
2020-10-14 12:01:47 UTC [INFO] Unknown exit code: 21

The test passes if I set the same PGA to 0 dB

# amixer cset name='PGA2.0 2 Master Capture Volume' 50
numid=2,iface=MIXER,name='PGA2.0 2 Master Capture Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=80,step=0
  : values=50,50
  | dBscale-min=-50.00dB,step=1.00dB,mute=1

# ./check-alsabat.sh -p hw:0,0 -c hw:0,0
2020-10-14 13:07:03 UTC [INFO] Starting /usr/local/bin/sof-logger -t -l /etc/sof/sof-byt.ldc -o /home/singalsu/softest/test_2020-10-12/sof-test/logs/check-alsabat/2020-10-14-16:07:02-13735/slogger.txt
2020-10-14 13:07:03 UTC [INFO] check the PCMs before alsabat test
2020-10-14 13:07:05 UTC [COMMAND] alsabat -Pplughw:0,0 --standalone -n 240000 -F 997
alsa-utils version 1.2.2

Entering playback thread (ALSA).
Get period size: 1896  buffer size: 15038
Playing generated audio sine wave
2020-10-14 13:07:06 UTC [COMMAND] alsabat -Cplughw:0,0 -F 997
alsa-utils version 1.2.2

Entering capture thread (ALSA).
Get period size: 1896  buffer size: 15038
Recording ...
Capture completed.

BAT analysis: signal has 65536 frames at 44100 Hz, 1 channels, 2 bytes per sample.

Channel 1 - Checking for target frequency 997,00 Hz
Amplitude: 28486,1; Percentage: [86]
Detected peak at 997,26 Hz of 37,29 dB
 Total 41,8 dB from 990,53 to 1002,64 Hz
 PASS: Peak detected at target frequency
Detected at least 1 signal(s) in total

Return value is 0
2020-10-14 13:07:10 UTC [INFO] pkill -TERM sof-logger
Terminated
Playback completed.

Return value is 0
2020-10-14 13:07:12 UTC [INFO] nlines=508 /home/singalsu/softest/test_2020-10-12/sof-test/logs/check-alsabat/2020-10-14-16:07:02-13735/slogger.txt
2020-10-14 13:07:12 UTC [INFO] Test Result: PASS!


Metadata

Metadata

Assignees

Labels

False Pass / green failureP2Critical bugs or normal featurestype:bugSomething doesn't work as expectedtype:test coverage gapThis requires a new test case, not just fixing one

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions