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

Revert "ipc3: override type field once comp_driver found" #9518

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

lyakh
Copy link
Collaborator

@lyakh lyakh commented Sep 27, 2024

This reverts commit b53573a. This commit broke cmocka unit tests.

This reverts commit b53573a. This
commit broke cmocka unit tests.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
@singalsu
Copy link
Collaborator

@cujomalainey Fixing this needs more time. Fixing in testbench topology parser file component type to expected SOF_COMP_MODULE_ADAPTER causes the ipc3/helper.c comp_specific_builder() to fail to copy file init IPC. Then the garbage init crashes testbench. Fixing for cmocka the type similarly for fir, iir, works but not for mux/demux that operates incorrectly in test.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cujomalainey it looks like we need another solution to catch invalid type before its goes to the next stage in processing.
@lyakh @singalsu could we add an extra bool param to get_drv() that enforces the type check for those when its needed ?

@cujomalainey
Copy link
Member

@cujomalainey it looks like we need another solution to catch invalid type before its goes to the next stage in processing.

This was why I was considering my other solution. Wasn't as correct but it would intheory allow a lot of previous mistakes to pass.

@lyakh @singalsu could we add an extra bool param to get_drv() that enforces the type check for those when its needed ?

It's always needed, both the module adapter and the ipc layer parse the enum currently.

@cujomalainey
Copy link
Member

@cujomalainey Fixing this needs more time. Fixing in testbench topology parser file component type to expected SOF_COMP_MODULE_ADAPTER causes the ipc3/helper.c comp_specific_builder() to fail to copy file init IPC. Then the garbage init crashes testbench. Fixing for cmocka the type similarly for fir, iir, works but not for mux/demux that operates incorrectly in test.

Agreed, we have gotten ourselves into a bit of sticky situation here.

@singalsu
Copy link
Collaborator

singalsu commented Oct 1, 2024

@cujomalainey Fixing this needs more time. Fixing in testbench topology parser file component type to expected SOF_COMP_MODULE_ADAPTER causes the ipc3/helper.c comp_specific_builder() to fail to copy file init IPC. Then the garbage init crashes testbench. Fixing for cmocka the type similarly for fir, iir, works but not for mux/demux that operates incorrectly in test.

Agreed, we have gotten ourselves into a bit of sticky situation here.

I think I will have today fix for cmocka unit tests. There's an actual issue in module adapter version of mux that I need to fix as well. The mux mode becomes always demux when comp type is actually module adapter. Just fixing that wasn't enough and it still fails, trying to find out why.

@singalsu
Copy link
Collaborator

singalsu commented Oct 1, 2024

Unit tests fix is in #9529

@singalsu
Copy link
Collaborator

singalsu commented Oct 1, 2024

@cujomalainey @dbaluta I'd need help from you. I'm trying to fix testbench to pass CI without this revert, and got file and process components to pass the added check from #9496. But I still have problem with other module adapter components with other than process type init IPC (version 3). e.g. volume. It in testbench registers as SOF_COMP_MODULE_ADAPTER. But init IPC from tplg_parse sets to the type to SOF_COMP_VOLUME, so the added check fails. It seems that Linux kernel also uses SOF_COMP_VOLUME in function sof_ipc3_widget_setup_comp_pga(). Have you been able to check if IPC3 with current kernel and current git main firmware build can load components like volume, src, mux, demux?

@iuliana-prodan
Copy link
Contributor

@cujomalainey @dbaluta I'd need help from you. I'm trying to fix testbench to pass CI without this revert, and got file and process components to pass the added check from #9496. But I still have problem with other module adapter components with other than process type init IPC (version 3). e.g. volume. It in testbench registers as SOF_COMP_MODULE_ADAPTER. But init IPC from tplg_parse sets to the type to SOF_COMP_VOLUME, so the added check fails. It seems that Linux kernel also uses SOF_COMP_VOLUME in function sof_ipc3_widget_setup_comp_pga(). Have you been able to check if IPC3 with current kernel and current git main firmware build can load components like volume, src, mux, demux?

I get the following error with latest SOF/main:

[   20.376424] sof-audio-of-imx8m 3b6e8000.dsp: DT DSP detected
[   20.490607] sof-audio-of-imx8m 3b6e8000.dsp: Firmware info: version 2:11:99-64cb1
[   20.499149] sof-audio-of-imx8m 3b6e8000.dsp: Firmware: ABI 3:29:1 Kernel ABI 3:23:0
[   20.511154] sof-audio-of-imx8m 3b6e8000.dsp: unknown sof_ext_man header type 3 size 0x30
[   20.523399] sof-audio-of-imx8m 3b6e8000.dsp: Firmware info: version 2:11:99-64cb1
[   20.536285] sof-audio-of-imx8m 3b6e8000.dsp: Firmware: ABI 3:29:1 Kernel ABI 3:23:0
[   20.640071] sof-audio-of-imx8m 3b6e8000.dsp: Topology: ABI 3:29:1 Kernel ABI 3:23:0
[   20.650033] asoc-simple-card sof-sound-wm8960: ASoC: Parent card not yet available, widget card binding deferred
[   20.660590] sof-audio-of-imx8m 3b6e8000.dsp: tplg: config SAI3 fmt 0x1 mclk 12288000 width 32 slots 2 mclk id 0
[   20.670788] sof-audio-of-imx8m 3b6e8000.dsp: tplg: config SAI3 fmt 0x1 mclk 12288000 width 32 slots 2 mclk id 0
[   20.688555] sof-audio-of-imx8m 3b6e8000.dsp: ipc tx error for 0x30010000 (msg/reply size: 100/0): -22
[   20.699664] sof-audio-of-imx8m 3b6e8000.dsp: Failed to setup widget PGA2.0
[   20.717273] sof-audio-of-imx8m 3b6e8000.dsp: error: tplg component load failed -22
[   20.725898] sof-audio-of-imx8m 3b6e8000.dsp: error: failed to load DSP topology -22
[   20.734215] sof-audio-of-imx8m 3b6e8000.dsp: ASoC: error at snd_soc_component_probe on 3b6e8000.dsp: -22
[   20.744468] asoc-simple-card sof-sound-wm8960: ASoC: failed to instantiate card -22
[   20.752481] asoc-simple-card: probe of sof-sound-wm8960 failed with error -22

I have an older kernel - 6.6

@singalsu
Copy link
Collaborator

singalsu commented Oct 1, 2024

I get the following error with latest SOF/main:

[   20.376424] sof-audio-of-imx8m 3b6e8000.dsp: DT DSP detected
[   20.490607] sof-audio-of-imx8m 3b6e8000.dsp: Firmware info: version 2:11:99-64cb1
[   20.499149] sof-audio-of-imx8m 3b6e8000.dsp: Firmware: ABI 3:29:1 Kernel ABI 3:23:0
[   20.511154] sof-audio-of-imx8m 3b6e8000.dsp: unknown sof_ext_man header type 3 size 0x30
[   20.523399] sof-audio-of-imx8m 3b6e8000.dsp: Firmware info: version 2:11:99-64cb1
[   20.536285] sof-audio-of-imx8m 3b6e8000.dsp: Firmware: ABI 3:29:1 Kernel ABI 3:23:0
[   20.640071] sof-audio-of-imx8m 3b6e8000.dsp: Topology: ABI 3:29:1 Kernel ABI 3:23:0
[   20.650033] asoc-simple-card sof-sound-wm8960: ASoC: Parent card not yet available, widget card binding deferred
[   20.660590] sof-audio-of-imx8m 3b6e8000.dsp: tplg: config SAI3 fmt 0x1 mclk 12288000 width 32 slots 2 mclk id 0
[   20.670788] sof-audio-of-imx8m 3b6e8000.dsp: tplg: config SAI3 fmt 0x1 mclk 12288000 width 32 slots 2 mclk id 0
[   20.688555] sof-audio-of-imx8m 3b6e8000.dsp: ipc tx error for 0x30010000 (msg/reply size: 100/0): -22
[   20.699664] sof-audio-of-imx8m 3b6e8000.dsp: Failed to setup widget PGA2.0
[   20.717273] sof-audio-of-imx8m 3b6e8000.dsp: error: tplg component load failed -22
[   20.725898] sof-audio-of-imx8m 3b6e8000.dsp: error: failed to load DSP topology -22
[   20.734215] sof-audio-of-imx8m 3b6e8000.dsp: ASoC: error at snd_soc_component_probe on 3b6e8000.dsp: -22
[   20.744468] asoc-simple-card sof-sound-wm8960: ASoC: failed to instantiate card -22
[   20.752481] asoc-simple-card: probe of sof-sound-wm8960 failed with error -22

I have an older kernel - 6.6

Thanks! I think that kernel should be similar for IPC3. Have you checked if this revert fixes the issue?

@cujomalainey
Copy link
Member

@cujomalainey @dbaluta I'd need help from you. I'm trying to fix testbench to pass CI without this revert, and got file and process components to pass the added check from #9496. But I still have problem with other module adapter components with other than process type init IPC (version 3). e.g. volume. It in testbench registers as SOF_COMP_MODULE_ADAPTER. But init IPC from tplg_parse sets to the type to SOF_COMP_VOLUME, so the added check fails. It seems that Linux kernel also uses SOF_COMP_VOLUME in function sof_ipc3_widget_setup_comp_pga(). Have you been able to check if IPC3 with current kernel and current git main firmware build can load components like volume, src, mux, demux?

@lgirdwood @lyakh looks like we have a lot of history here that broke. Lets land the revert and see if we can get more coverage in a draft PR to see better the blast radius of this fix

@cujomalainey cujomalainey merged commit a2cbd74 into thesofproject:main Oct 1, 2024
46 of 47 checks passed
@iuliana-prodan
Copy link
Contributor

I get the following error with latest SOF/main:

[   20.376424] sof-audio-of-imx8m 3b6e8000.dsp: DT DSP detected
[   20.490607] sof-audio-of-imx8m 3b6e8000.dsp: Firmware info: version 2:11:99-64cb1
[   20.499149] sof-audio-of-imx8m 3b6e8000.dsp: Firmware: ABI 3:29:1 Kernel ABI 3:23:0
[   20.511154] sof-audio-of-imx8m 3b6e8000.dsp: unknown sof_ext_man header type 3 size 0x30
[   20.523399] sof-audio-of-imx8m 3b6e8000.dsp: Firmware info: version 2:11:99-64cb1
[   20.536285] sof-audio-of-imx8m 3b6e8000.dsp: Firmware: ABI 3:29:1 Kernel ABI 3:23:0
[   20.640071] sof-audio-of-imx8m 3b6e8000.dsp: Topology: ABI 3:29:1 Kernel ABI 3:23:0
[   20.650033] asoc-simple-card sof-sound-wm8960: ASoC: Parent card not yet available, widget card binding deferred
[   20.660590] sof-audio-of-imx8m 3b6e8000.dsp: tplg: config SAI3 fmt 0x1 mclk 12288000 width 32 slots 2 mclk id 0
[   20.670788] sof-audio-of-imx8m 3b6e8000.dsp: tplg: config SAI3 fmt 0x1 mclk 12288000 width 32 slots 2 mclk id 0
[   20.688555] sof-audio-of-imx8m 3b6e8000.dsp: ipc tx error for 0x30010000 (msg/reply size: 100/0): -22
[   20.699664] sof-audio-of-imx8m 3b6e8000.dsp: Failed to setup widget PGA2.0
[   20.717273] sof-audio-of-imx8m 3b6e8000.dsp: error: tplg component load failed -22
[   20.725898] sof-audio-of-imx8m 3b6e8000.dsp: error: failed to load DSP topology -22
[   20.734215] sof-audio-of-imx8m 3b6e8000.dsp: ASoC: error at snd_soc_component_probe on 3b6e8000.dsp: -22
[   20.744468] asoc-simple-card sof-sound-wm8960: ASoC: failed to instantiate card -22
[   20.752481] asoc-simple-card: probe of sof-sound-wm8960 failed with error -22

I have an older kernel - 6.6

Thanks! I think that kernel should be similar for IPC3. Have you checked if this revert fixes the issue?

Sorry for the late replay, but yes, reverting the patch fixes the issue.
So, now, with latest sof/main we are good on i.MX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants