-
Notifications
You must be signed in to change notification settings - Fork 349
Description
Name of component: SOF/ALSA
Brief: When doing ALSA test for SOF built sound-open-firmware-private branch, codec_adapter receives wrong source/sink parameters.
Environment:
TGL + tgl-012-drop-stable + WAVES
Detailed:
Usual way of doing alsa conformance test is running python script:
./alsa_conformance_test.py -D hw:0,0 --rate-err-criteria 100 --log-file alsa_test_log.txt
Output of this command is attached: alsa_test_output_.txt.
From alsa_test_log.txt is is clear what sequence of executions of alsa_conformance_test performs python script.
Also it is clear that test snd_pcm_hw_params fails when setting sample format S24_LE and S32_LE, but is passing on S16_LE.
INFO:root:Set format S16_LE
INFO:root:Execute command: alsa_conformance_test -P hw:0,0 -d 0.1 -r 48000 -c 2 -f S16_LE -p 240
INFO:root:pass
INFO:root:Set format S24_LE
INFO:root:Execute command: alsa_conformance_test -P hw:0,0 -d 0.1 -r 48000 -c 2 -f S24_LE -p 240
INFO:root:fail - snd_pcm_hw_params: Input/output error
INFO:root:Set format S32_LE
INFO:root:Execute command: alsa_conformance_test -P hw:0,0 -d 0.1 -r 48000 -c 2 -f S32_LE -p 240
INFO:root:fail - snd_pcm_hw_params: Input/output error
After investigating it for a bit I can tell that:
- if executing same sequence of calls that python script does, but with 5 seconds time gap between them, there is no smd-pcm-hw-params error.
So this means when they are executed rapidly one after anothe, something changes. - building debug SOF with logs shows exactly the issue, sink and source buffers that arrive to codec_adapter have different format which is not expected.
alsa_conformance_test -P hw:0,0 -d 0.1 -r 48000 -c 2 -f S16_LE -p 240
source and sink are 16 bit
alsa_conformance_test -P hw:0,0 -d 0.1 -r 48000 -c 2 -f S24_LE -p 240
source is 16 bit and sink is 24 bit
alsa_conformance_test -P hw:0,0 -d 0.1 -r 48000 -c 2 -f S32_LE -p 240
source is 16 bit and sink is 32 bit
this looks like a bug, no matter the time difference between alsa_conformance_tests execution, result should be the same, as do the stream parameters that comes to codec_adapter.
alsa_test_log.txt
alsa_test_output.txt