You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG][Smart_Amp] ipc timeout in smart_amp pipelines test #3249
Describe the bug
Run command arecord -Dhw:0,2 -f dat /dev/null -vvv & aplay -Dhw:0,2 -f dat /dev/zero, Everything is fine at the first run. but io error in terminal and ipc timeout in dmesg at the second run. If you are lucky, you may see ipc time out at the first run. Once issue happened, playback on other pipeline fails with 'unable to install hw params'
To Reproduce
reboot
run command arecord -Dhw:0,2 -f dat /dev/null -vvv & aplay -Dhw:0,2 -f dat /dev/zero several times
Reproduction Rate
very very high
Impact
Hardware echo reference work abnormally.
Environment
Branch name and commit hash of the 2 repositories:
@aiChaoSONG This is because echo reference capture only works when playback has data output first.
"aplay & arecord " will start at same time, might arecord first also. So got this issue.
So need using command "aplay & sleep 0.5; arecord " for echo reference test.
Such as aplay -Dhw:0,0 -f s16_le -c 2 -r 48000 sine_48k_16bit_10s_stereo_l5_r2.wav & sleep 0.5; arecord -Dhw:0,6 -f s16_le -c 2 -r 48000 echorefe.wav -d 7
changed the title [-][BUG][HWEchoRef] ipc timeout in smart_amp pipelines test[/-][+][BUG][Smart_Amp] ipc timeout in smart_amp pipelines test[/+]on Jul 29, 2020
@aiChaoSONG
Are you able to reproduce it also with codec topology (sof-tgl-max98373-rt5682.tplg)?
Is sof-tgl-codec-ci.tplg on master? Is this the same as sof-tgl-codec.tplg?
@aiChaoSONG
Did you build firmware for chrome configuration?
Is there any special konfig for building above kernel? Is below command sufficient?
bash ./scripts/kconfig/merge_config.sh .config $KCONFIG_PATH/base-defconfig $KCONFIG_PATH/sof-defconfig $KCONFIG_PATH/sof-mach-driver-defconfig $KCONFIG_PATH/hdaudio-codecs-defconfig
@aiChaoSONG
Did you build firmware for chrome configuration?
Is there any special konfig for building above kernel? Is below command sufficient?
bash ./scripts/kconfig/merge_config.sh .config $KCONFIG_PATH/base-defconfig $KCONFIG_PATH/sof-defconfig $KCONFIG_PATH/sof-mach-driver-defconfig $KCONFIG_PATH/hdaudio-codecs-defconfig
, which means that the latest trace point value is 0x6000 (TRIGGER_START). I have suspicion
that TRIGGER_STOP mentioned in previous comment, did not come to the FW. Is it
possible?
, which means that the latest trace point value is 0x6000 (TRIGGER_START). I have suspicion
that TRIGGER_STOP mentioned in previous comment, did not come to the FW. Is it
possible?
I would suspect that the firmware is somehow hang or crashed after trigger started so didn't get the subsequent trigger stop IPC, need more debugging about what has happened after trigger started.
@bkokoszx@keyonjie@aiChaoSONG the timing between START and STOP is small suggesting a XRUN (i.e. position has not moved so driver automatically stops the stream). @keyonjie can you add debug in driver to check is stream position updates at all ?
Hi @lgirdwood I think @bkokoszx has found the cause here, the FW hangs on demux_copy() after trigger started, that's why the STOP IPC got timeout. We had PR like #2788 previously on release branch to avoid the format un-alignment and this kind of hang issues, we might need similar logic for the master.
As @keyonjie wrote, we have misalignment in buffer's frame_fmt parameters. We have hardcoded format for feedback buffer:
/* TODO: * ATM feedback buffer frame_fmt is hardcoded to s32_le. It should be * removed when parameters negotiation between pipelines will prepared */sad->feedback_buf->stream.frame_fmt=SOF_IPC_FRAME_S32_LE
as ATM our pipeline propagation do not cover whole DSM topology case (parameters do not reach feedback buffer).
@aiChaoSONG
Could you try to test master + PR #2788 in order to reproduce this issue?
@bkokoszx@keyonjie I tried #2788, and I think situation become worse. DSP panic at the very beginning of running the DSM case, sof-logger exit immediately without showing any trace message.
@bkokoszx I tried your pr2788-rebased tree, test result is pretty good. But if I apply #2788 directly to master, test result is worse like I described above. Seems your commit bkokoszx@27906fb makes a lot of difference.
Activity
ClarexZhou commentedon Jul 29, 2020
@aiChaoSONG This is because echo reference capture only works when playback has data output first.
"aplay & arecord " will start at same time, might arecord first also. So got this issue.
So need using command "aplay & sleep 0.5; arecord " for echo reference test.
Such as
aplay -Dhw:0,0 -f s16_le -c 2 -r 48000 sine_48k_16bit_10s_stereo_l5_r2.wav & sleep 0.5; arecord -Dhw:0,6 -f s16_le -c 2 -r 48000 echorefe.wav -d 7ClarexZhou commentedon Jul 29, 2020
Do we able to close this?
aiChaoSONG commentedon Jul 29, 2020
@ClarexZhou No, This is in fact DSM, Pierre give it the name HW EchoRef, Echo reference is actually FWEchoRef
[-][BUG][HWEchoRef] ipc timeout in smart_amp pipelines test[/-][+][BUG][Smart_Amp] ipc timeout in smart_amp pipelines test[/+]bkokoszx commentedon Aug 10, 2020
@aiChaoSONG
Are you able to reproduce it also with codec topology (sof-tgl-max98373-rt5682.tplg)?
Is sof-tgl-codec-ci.tplg on master? Is this the same as sof-tgl-codec.tplg?
aiChaoSONG commentedon Aug 11, 2020
@bkokoszx I tried on TGL with codec and sof-tgl-max98373-rt5682.tplg, issue also reproduced. sof-tgl-codec-ci.tplg is here: #3212
error message when issue reproduced on TGL with codec
dmesg.txt
aiChaoSONG commentedon Aug 11, 2020
@bkokoszx if you cannot reproduce this issue with the command in the description, Please try our test case.
cd sof-testsudo visudo, change%sudo ALL=(ALL:ALL) ALLto%sudo ALL=(ALL:ALL) NOPASSWD:ALLTPLG=/lib/firmware/intel/sof-tplg/sof-tgl-max98373-rt5682.tplg test-case/check-smart-amplifier.shbkokoszx commentedon Aug 11, 2020
@aiChaoSONG
Did you build firmware for chrome configuration?
Is there any special konfig for building above kernel? Is below command sufficient?
bash ./scripts/kconfig/merge_config.sh .config $KCONFIG_PATH/base-defconfig $KCONFIG_PATH/sof-defconfig $KCONFIG_PATH/sof-mach-driver-defconfig $KCONFIG_PATH/hdaudio-codecs-defconfig
Thanks
PS
I see following error during topology build with #3212 :
https://sof-ci.01.org/sofpr/PR3212/build6794/build/tools.txt
Is there a special way to build it?
keyonjie commentedon Aug 12, 2020
We are using force-nocodec mode for this testing, just use the kconfig-sof-nocodec.sh below directly for the kconfig:
https://github.com/thesofproject/kconfig/blob/master/kconfig-sof-nocodec.sh
I don't think so, usually we just run ./scripts/build-tools.sh to build it, @xiulipan can you help to check this?
5 remaining items
keyonjie commentedon Aug 18, 2020
usually it is because of there is no data captured after started for e.g. 500ms timeout.
bkokoszx commentedon Aug 18, 2020
@keyonjie
I've added following trace points to the firmware master.
I've made arecord & aplay and reproduced issue. After
root@audiodspTGL:~# hexdump /sys/kernel/debug/sof/regsI get:
, which means that the latest trace point value is
0x6000(TRIGGER_START). I have suspicionthat
TRIGGER_STOPmentioned in previous comment, did not come to the FW. Is itpossible?
keyonjie commentedon Aug 19, 2020
I would suspect that the firmware is somehow hang or crashed after trigger started so didn't get the subsequent trigger stop IPC, need more debugging about what has happened after trigger started.
lgirdwood commentedon Aug 20, 2020
@bkokoszx @keyonjie @aiChaoSONG the timing between START and STOP is small suggesting a XRUN (i.e. position has not moved so driver automatically stops the stream).
@keyonjie can you add debug in driver to check is stream position updates at all ?
keyonjie commentedon Aug 20, 2020
Hi @lgirdwood I think @bkokoszx has found the cause here, the FW hangs on demux_copy() after trigger started, that's why the STOP IPC got timeout. We had PR like #2788 previously on release branch to avoid the format un-alignment and this kind of hang issues, we might need similar logic for the master.
bkokoszx commentedon Aug 25, 2020
As @keyonjie wrote, we have misalignment in buffer's frame_fmt parameters. We have hardcoded format for feedback buffer:
as ATM our pipeline propagation do not cover whole DSM topology case (parameters do not reach feedback buffer).
@aiChaoSONG
Could you try to test master + PR #2788 in order to reproduce this issue?
aiChaoSONG commentedon Aug 25, 2020
@bkokoszx @keyonjie I tried #2788, and I think situation become worse. DSP panic at the very beginning of running the DSM case, sof-logger exit immediately without showing any trace message.
sof_error.log
bkokoszx commentedon Aug 26, 2020
@aiChaoSONG
Did you rebase it with master or use #2788 directly? If you do not use rebased version, you can try: https://github.com/bkokoszx/sof/tree/pr2788-rebased
I do not have platform yet, I will try it also as soon as possible.
aiChaoSONG commentedon Aug 27, 2020
@bkokoszx I tried your pr2788-rebased tree, test result is pretty good. But if I apply #2788 directly to master, test result is worse like I described above. Seems your commit bkokoszx@27906fb makes a lot of difference.
bkokoszx commentedon Aug 27, 2020
@aiChaoSONG
Yes, I've removed in this commit hardcoded frame format value for smart amplifier.
It should be merged just after #2788
jajanusz commentedon Sep 15, 2020
@bkokoszx @aiChaoSONG is it fixed with #2788 ?
aiChaoSONG commentedon Sep 15, 2020
With #2788 and #3404, issue fixed. close