Closed paulstelian97 closed 1 year ago
@paulstelian97 thanks for the report.
I think integration of MIXER with module_adapter is completely broken. I wonder if there are Intel users of MIXER with IPC3.
Cc: @lgirdwood @lyakh @ranj063
We have this code in module_adapter.c
:
int module_adapter_prepare(struct comp_dev *dev)
/*
» * check if the component is already active. This could happen in the case of mixer when
» * one of the sources is already active
» */
» if (dev->state == COMP_STATE_ACTIVE)
» » return 0;
ret = module_prepare(mod);
» if (ret) {
» » if (ret == PPL_STATUS_PATH_STOP)
» » » return ret;
When playing second stream dev->state will already be active and this function will return 0, but IPC3 expects PPL_STATUS_PATH_STOP.
So, quick fix would be:
@@ -181,7 +181,11 @@ int module_adapter_prepare(struct comp_dev *dev)
if (ret == COMP_STATUS_STATE_ALREADY_SET) {
comp_warn(dev, "module_adapter_prepare(): module has already been prepared");
+#if CONFIG_IPC_MAJOR_4
+ return 0;
+#else
return PPL_STATUS_PATH_STOP;
+#endif
}
But I think that there might be issues as even when we call prepare for second Mixer stream we might want to get into module_prepare
for some initialization. And let module_prepare() return COMP_STATUS_STATE_ALREADY_SET
I am positive that the mixer did work when we tried the multi-capture parts in https://github.com/thesofproject/sof/pull/6131 But that was eons ago, and since Intel doesn't test IPC3 any longer it's possible that there's a coverage gap indeed.
I don't think the mixer was using module_adapter back then, hell it still doesn't use it in our imx-stable-v2.4 branch.
Ack, it did work but we are no longer testing IPC3 code on main branch - we testing IPC3 on teh stable v2.2 branch. Focus for Intel is now testing IPC4 on our available DUTs. We cant test both IPC3/4 as the DUTs were taking a reliability hit so we needed to lower the burden on them to make then last longer (the DUTs are developer boards not and designed for 24/7 cloud CI usage).
Describe the bug
Whenever I'm trying to play back two streams on the mixer interface, I'm getting an error that prevents the second stream from loading (unable to install hardware params on the kernel side, some state issues on firmware side).
I have looked through the code and as it looks, there is no way it could possibly work. Since Intel uses IPC4 (which has the mixin/mixout code instead) this might have likely flown off the radar. On the imx_stable_v2.4 branch this doesn't happen but that is before the mixer was converted to the module interface. The detail is that mixer requests simple_copy, which module_adapter cannot do if there are multiple inputs. But then that specific issue is hidden by the fact that module_adapter_prepare returns early if the component is already active (which prevents the mixer from returning PPL_STATUS_PATH_STOP, which allows the DAI to receive a second prepare command when already active which is wrong).
(edit: just noticed that simple_copy only fails if BOTH multiple inputs and multiple outputs are there; the failure is still there though)
To Reproduce Just do regular playback on both streams. The commands below can be run in any order; the one that runs the second fails.
Reproduction Rate Consistent, 10/10.
Expected behavior I would expect that the mixer... actually worked? Yeah.
Impact Important regression.
Environment 1) Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
Screenshots or console output
Firmware error:
Userspace: