Skip to content
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

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

Open
singalsu opened this issue Oct 14, 2020 · 4 comments
Assignees
Labels
False Pass / green failure P2 Critical bugs or normal features type:bug Something doesn't work as expected type:test coverage gap This requires a new test case, not just fixing one

Comments

@singalsu
Copy link
Contributor

singalsu commented Oct 14, 2020

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!


@singalsu singalsu added type:bug Something doesn't work as expected P2 Critical bugs or normal features labels Oct 14, 2020
@singalsu singalsu self-assigned this Oct 14, 2020
@singalsu
Copy link
Contributor Author

I think I can fix this with some initialization code copied from check-volume-levels.sh.

@aiChaoSONG
Copy link

I think I cannot see this issue on our daily report, can we close? @singalsu

@singalsu
Copy link
Contributor Author

I still get this issue on my SOF PR thesofproject/sof#3783 .

2021-01-25 13:44:53 UTC [REMOTE_INFO] Starting /usr/bin/sof-logger -t -l /etc/sof/sof-byt.ldc -o /home/ubuntu/sof-test/logs/check-alsabat/2021-01-25-13:44:52-194/slogger.txt
2021-01-25 13:44:53 UTC [REMOTE_INFO] check the PCMs before alsabat test
2021-01-25 13:44:55 UTC [REMOTE_COMMAND] alsabat -Phw:sofnocodec,0 --standalone -n 240000 -r 48000 -c 2 -F 997
2021-01-25 13:44:56 UTC [REMOTE_COMMAND] alsabat -Chw:sofnocodec,0 -c 2 -r 48000 -F 997
WARNING: Signal overflow!
 FAIL: Peak freq too high 2991.21 Hz
 FAIL: Peak freq too high 4984.86 Hz
 FAIL: Peak freq too high 6979.25 Hz
 FAIL: Peak freq too high 8972.90 Hz
 FAIL: Peak freq too high 10967.29 Hz
 FAIL: Peak freq too high 12960.94 Hz
 FAIL: Peak freq too high 14955.32 Hz
 FAIL: Peak freq too high 15098.88 Hz
 FAIL: Peak freq too high 16948.97 Hz
alsa-utils version 1.2.2

@singalsu
Copy link
Contributor Author

singalsu commented Jan 26, 2021

@marc-hb marc-hb added False Pass / green failure type:test coverage gap This requires a new test case, not just fixing one labels Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Pass / green failure P2 Critical bugs or normal features type:bug Something doesn't work as expected type:test coverage gap This requires a new test case, not just fixing one
Projects
None yet
Development

No branches or pull requests

3 participants