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] Early wake observed while running suspend-resume with WOV #5042
After trying bisecting experiments,
Issue not reproducing with tgl/v13.0-hotfix3 and with built release tag: releases/adl/v3.0-hotfix1 issue reproduced.
3099b80 (tag: releases/adl/v3.0-hotfix1) topology: intel: use 38.4Mhz MCLK for all Bluetooth use-cases d12e4c2 pm_runtime: writeback secondary core's data before going to lps_wait b04aa4b init: secondary_core_restore possibility on boot 65cc975 schedule: add possibility to restore all schedulers 815ca11 idc: add idc_restore ed71838 lps: restore secondary cores on wake up 92ea2a3 platform: lps_wait_for_interrupt entry core check 613a57f Audio: Fix sink buffer size check in several processing components b8c99e7 topology: sof-tgl-max9357a-rt5682: add support for ADL ab6cf6e topology1: tgl-max98357a-rt5682 fix ENDPOINT_NAME macro 364f715(tag: releases/tgl/v13.0-hotfix3) buffer: alloc main buffer struct in the runtime shared zone
@keqiaozhang not sure 3034 is related as this one has a memory issue in logs unlike 3034 where the trace was just creating a wake event. I think both are different issues.
On the ADL003, we have few private patches to enable Google hotword and the issue is seen with that. Interesting is that patch itself is to move the Cmake version from 3.10 to 3.13.
So we did further investigation to conclude that this commit is indeed introducing the issue
Exp 1 : TGLv13.0-hotfix3 as is + test with INTEL CLAP == NO SPURIOUS WAKES SEEN
Exp 2 : TGLv13.0-hotfix3 + only the CMKAE update patch + test with INTEL CLAP == SPURIOUS WAKE IS SEEN
Request FW team to also replicate the issue and suggest debug steps.
CCing @cujomalainey to confirm we can share the Cmake patch here (which is currently in private repo)
With @kv2019i and @Vamshigopal we were trying to compare binaries with and without CMAKE update patch.
Here are the only significant difference in build log between tgl-013-drop-stable+cmake_patch (left) and tgl-013-drop-stable (right):
It is hard to explain for me why cmake update changes .static_log_entries section size, but still it should not introduce issue.
@bkokoszx Thanks, I also see a diff involving python in your log
-make[3]: Nothing to be done for 'CMakeFiles/genconfig.dir/build'.
+[ 9%] Generating /home/admin/Documents/sof/sof/build_tgl/generated/include/autoconfig.h^M
+cd /home/admin/Documents/sof/sof/build_tgl/generated && /usr/local/bin/cmake -E env srctree=/home/admin/Documents/sof/sof "CC_VERSION_TEXT=xt-xcc version 12.0.8" ARCH=xtensa /usr/bin/python3.5 /home/admin/Documents/sof/sof/scripts/kconfig/genconfig.py --header-path /home/admin/Documents/sof/sof/build_tgl/generated/include/autoconfig.h /home/admin/Documents/sof/sof/Kconfig^M
+warning: the int symbol CORE_COUNT (defined at src/platform/Kconfig:227) has a non-int default MP_NUM_CPUS (undefined)^M
Python is involved in the breaking change. I wonder if maybe there is a different in artifacts generated. Can we check that? Is the script just gereating the autoconfig header?
So I've found something funny with structure alignment and the build (some structures having different alignments set), probably unrelated but worth double check.
I'm seeing a delta between what rimage and SOF use for some structure sizes esp when using ALIGN_UP_COMPILE(sizeof(struct ext_man_fw_version), EXT_MAN_ALIGN),
e.g. the manifest structures are aligned on 16bytes when used but on 4 bytes when declared.
---------------------- src/include/kernel/ext_manifest.h ----------------------
index c429cbe03..06beb9cb9 100644
@@ -119,39 +119,39 @@ struct ext_man_fw_version {
/* use sof_ipc struct because of code re-use */
struct sof_ipc_fw_version version;
uint32_t flags;
-} __attribute__((packed, aligned(4)));+} __attribute__((packed, aligned(16)));
/* windows info */
struct ext_man_windows {
struct ext_man_elem_header hdr;
/* use sof_ipc struct because of code re-use */
struct sof_ipc_window window;
-} __attribute__((packed, aligned(4)));+} __attribute__((packed, aligned(16)));
/* Used C compiler description */
struct ext_man_cc_version {
struct ext_man_elem_header hdr;
/* use sof_ipc struct because of code re-use */
struct sof_ipc_cc_version cc_version;
-} __attribute__((packed, aligned(4)));+} __attribute__((packed, aligned(16)));
struct ext_man_probe_support {
struct ext_man_elem_header hdr;
/* use sof_ipc struct because of code re-use */
struct sof_ipc_probe_support probe;
-} __attribute__((packed, aligned(4)));+} __attribute__((packed, aligned(16)));
struct ext_man_dbg_abi {
struct ext_man_elem_header hdr;
/* use sof_ipc struct because of code re-use */
struct sof_ipc_user_abi_version dbg_abi;
-} __attribute__((packed, aligned(4)));+} __attribute__((packed, aligned(16)));
/** EXT_MAN_ELEM_CONFIG_DATA elements (ABI3.17) */
struct ext_man_config_data {
struct ext_man_elem_header hdr;
struct config_elem elems[];
-} __attribute__((packed, aligned(4)));+} __attribute__((packed, aligned(16)));
#endif /* __KERNEL_EXT_MANIFEST_H__ */
Binaries include the git version by default, which makes comparing binaries across git version very painful. But there is a very simple workaround: create a two-lines long sof/.tarball-version file. I always have one like this:
v1.2.3
deadbeef
For zephyr it's sof/zephyr/.tarball-version.
Don't forget to disable debug sections, they create a ton of binary noise
Unlike the very simple sof/.tarball-version, these two patches are unfortunately less inconvenient to keep when bisecting/etc.
You may also find useful the reproducible.ri file I recently added to the build.
Last but not least, the awesome apt-get install diffoscope can recurse in ELF files and compare disassembled ELF sections in Xtensa code with this PATH hack: PATH=$HOME/SOFworkspace/crosstool-ng/builds/xtensa-apl-elf/xtensa-apl-elf/bin/:$PATH
Do NOT make this PATH hack persistent or it will break a number of things including the... SOF build.
We have now test data pointing to an algorithm and dmic sensitivity issue.
Some of the observations earlier in the debug were related to thesofproject/linux#3034 . By disabling FW trace, that can be excluded from experiments.
If we then force zero input (e.g. by muting with a PGA in the pipeline) on affected systems, we no longer unexpected early/spurious wakes. Some of the bisect results earlier were done with DUTs not in fully acoustically isolated environment. With controlled environment, there results cannot be reproduced. Further, we have checked from logs that when the early wakeups have occured, the DSP irq tree status values seem as expected -> e.g. it's a real wake-up triggered by DSP algorithm code.
Waiting for bug reporter to confirm, but from SOF driver and firmware perspective, system seems to work as expected.
Activity
Vamshigopal commentedon Nov 30, 2021
dmesg.txt
sof-trace-logs.txt
Vamshigopal commentedon Nov 30, 2021
@sathyap-chrome @sathya-nujella @kv2019i @ranj063 @libinyang @keqiaozhang
Vamshigopal commentedon Nov 30, 2021
After trying bisecting experiments,
Issue not reproducing with tgl/v13.0-hotfix3 and with built release tag: releases/adl/v3.0-hotfix1 issue reproduced.
3099b80 (tag: releases/adl/v3.0-hotfix1) topology: intel: use 38.4Mhz MCLK for all Bluetooth use-cases
d12e4c2 pm_runtime: writeback secondary core's data before going to lps_wait
b04aa4b init: secondary_core_restore possibility on boot
65cc975 schedule: add possibility to restore all schedulers
815ca11 idc: add idc_restore
ed71838 lps: restore secondary cores on wake up
92ea2a3 platform: lps_wait_for_interrupt entry core check
613a57f Audio: Fix sink buffer size check in several processing components
b8c99e7 topology: sof-tgl-max9357a-rt5682: add support for ADL
ab6cf6e topology1: tgl-max98357a-rt5682 fix ENDPOINT_NAME macro
364f715 (tag: releases/tgl/v13.0-hotfix3) buffer: alloc main buffer struct in the runtime shared zone
lgirdwood commentedon Dec 1, 2021
@Vamshigopal are you able to bisect further to a single commit as the list above has several candidates taht could potentially send a wake IRQ.
keqiaozhang commentedon Dec 6, 2021
Duplicated with thesofproject/linux#3034?
sathyap-chrome commentedon Dec 6, 2021
@keqiaozhang not sure 3034 is related as this one has a memory issue in logs unlike 3034 where the trace was just creating a wake event. I think both are different issues.
sathyap-chrome commentedon Dec 6, 2021
@lgirdwood we are working on that.
sathyap-chrome commentedon Dec 6, 2021
@lgirdwood we have narrowed down further.
On the ADL003, we have few private patches to enable Google hotword and the issue is seen with that. Interesting is that patch itself is to move the Cmake version from 3.10 to 3.13.
So we did further investigation to conclude that this commit is indeed introducing the issue
Exp 1 : TGLv13.0-hotfix3 as is + test with INTEL CLAP == NO SPURIOUS WAKES SEEN
Exp 2 : TGLv13.0-hotfix3 + only the CMKAE update patch + test with INTEL CLAP == SPURIOUS WAKE IS SEEN
Request FW team to also replicate the issue and suggest debug steps.
CCing @cujomalainey to confirm we can share the Cmake patch here (which is currently in private repo)
NOTE:
Based on @kv2019i suggestion, we took his help and took his kernel : https://github.com/kv2019i/linux/tree/topic/cros/5.10-stop-dma-backport-draft -> which has latest STOP DMA fix patches, but the issue still reproduces.
cujomalainey commentedon Dec 6, 2021
Hi Satya, are you referring to the cake version jump to 3.13? That should already be upstream and in this repo.
bkokoszx commentedon Dec 7, 2021
A little update.
With @kv2019i and @Vamshigopal we were trying to compare binaries with and without CMAKE update patch.

Here are the only significant difference in build log between tgl-013-drop-stable+cmake_patch (left) and tgl-013-drop-stable (right):
It is hard to explain for me why cmake update changes .static_log_entries section size, but still it should not introduce issue.
Below, there are differences in sof.map files:


The .config files are identical.
bkokoszx commentedon Dec 7, 2021
The .static_log_entries section length difference could be probably caused by this trace:
cujomalainey commentedon Dec 7, 2021
Well, that is the last time I try to respond to a message on my phone
Can we dump a verbose build to see what the differences are in the log?
Vamshigopal commentedon Dec 8, 2021
@cujomalainey attached the verbose build logs for above observation. If you are looking for same.
build-log-with-cmake.txt
build-log-without-cmake.txt
cujomalainey commentedon Dec 8, 2021
Hi Vamshi,
Are you building with multicore enabled? If so, please disable it to help the logs align better. Thanks
bkokoszx commentedon Dec 8, 2021
Hi @cujomalainey
here are logs from building made by
make bincommandbuild-log-with-cmake-bkokoszx.txt
build-log-without-cmake-bkokoszx.txt
The main difference is in .static_log_entries section size, which I wrote above.
.
cujomalainey commentedon Dec 8, 2021
@bkokoszx Thanks, I also see a diff involving python in your log
Python is involved in the breaking change. I wonder if maybe there is a different in artifacts generated. Can we check that? Is the script just gereating the autoconfig header?
sathyap-chrome commentedon Dec 8, 2021
Will try that !!
cujomalainey commentedon Dec 8, 2021
@sathyap-chrome just to make sure I am clear, I just mean don't pass
-jto make not SOF multicoresathyap-chrome commentedon Dec 8, 2021
Oh you mean just the build to be a single thread !! got it
lgirdwood commentedon Dec 8, 2021
So I've found something funny with structure alignment and the build (some structures having different alignments set), probably unrelated but worth double check.
I'm seeing a delta between what rimage and SOF use for some structure sizes esp when using
ALIGN_UP_COMPILE(sizeof(struct ext_man_fw_version), EXT_MAN_ALIGN),e.g. the manifest structures are aligned on 16bytes when used but on 4 bytes when declared.
marc-hb commentedon Dec 9, 2021
sof/.tarball-versionfile. I always have one like this:For zephyr it's
sof/zephyr/.tarball-version.The design of the dictionary checksum is wrong, it should checksum the dictionary. I digress.
Unlike the very simple
sof/.tarball-version, these two patches are unfortunately less inconvenient to keep when bisecting/etc.You may also find useful the
reproducible.rifile I recently added to the build.Last but not least, the awesome
apt-get install diffoscopecan recurse in ELF files and compare disassembled ELF sections in Xtensa code with this PATH hack:PATH=$HOME/SOFworkspace/crosstool-ng/builds/xtensa-apl-elf/xtensa-apl-elf/bin/:$PATHDo NOT make this PATH hack persistent or it will break a number of things including the... SOF build.
kv2019i commentedon Dec 13, 2021
A quick update:
kv2019i commentedon Dec 16, 2021
We have now test data pointing to an algorithm and dmic sensitivity issue.
Some of the observations earlier in the debug were related to thesofproject/linux#3034 . By disabling FW trace, that can be excluded from experiments.
If we then force zero input (e.g. by muting with a PGA in the pipeline) on affected systems, we no longer unexpected early/spurious wakes. Some of the bisect results earlier were done with DUTs not in fully acoustically isolated environment. With controlled environment, there results cannot be reproduced. Further, we have checked from logs that when the early wakeups have occured, the DSP irq tree status values seem as expected -> e.g. it's a real wake-up triggered by DSP algorithm code.
Waiting for bug reporter to confirm, but from SOF driver and firmware perspective, system seems to work as expected.