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

module: cadence: don't return on non-fatal error #9046

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

LaurentiuM1234
Copy link
Contributor

Assuming the following pipeline:

HOST ---> MA (CADENCE [MP3 DECODER]) ---> DAI

for native Zephyr SOF, data is first copied from the host component to MA and then from Linux to the host component. This means that the first chunk of data will be 0s (since the host DMA buffer is zero'd via host_prepare()) instead of useful data. Because of this, the XA_CMD_TYPE_INIT_PROCESS command will return a non-fatal error (i.e:
XA_MP3DEC_EXECUTE_NONFATAL_NEXT_SYNC_NOT_FOUND). This is not the case for non-native SOF since data is first copied from Linux to host and then from host to MA so the aforementioned command will get actual data instead of 0s.

Instead of having to alter the flow of data for native Zephyr SOF (i.e: change the order in which data is copied), which could impact other components and bits of the firmware, the fix is to not return if the command returns a non-fatal error. This way, the first chunk (i.e: the 0s) will be consumed and the processing can start with the next chunk.

@LaurentiuM1234 LaurentiuM1234 marked this pull request as ready for review April 15, 2024 10:42
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.

Good fix - can we comment this so its obvious from code and also in logs too.

Assuming the following pipeline:

   HOST ---> MA (CADENCE [MP3 DECODER]) ---> DAI

for native Zephyr SOF, data is first copied from the host
component to MA and then from Linux to the host component.
This means that the first chunk of data will be 0s (since
the host DMA buffer is zero'd via host_prepare()) instead
of useful data. Because of this, the `XA_CMD_TYPE_INIT_PROCESS`
command will return a non-fatal error (i.e:
`XA_MP3DEC_EXECUTE_NONFATAL_NEXT_SYNC_NOT_FOUND`). This
is not the case for non-native SOF since data is first copied
from Linux to host and then from host to MA so the aforementioned
command will get actual data instead of 0s.

Instead of having to alter the flow of data for native Zephyr
SOF (i.e: change the order in which data is copied), which
could impact other components and bits of the firmware, the
fix is to not return if the command returns a non-fatal error.
This way, the first chunk (i.e: the 0s) will be consumed and
the processing can start with the next chunk.

Signed-off-by: Laurentiu Mihalcea <[email protected]>
@LaurentiuM1234
Copy link
Contributor Author

Good fix - can we comment this so its obvious from code and also in logs too.

yep, done

@dbaluta
Copy link
Collaborator

dbaluta commented Apr 15, 2024

good catch! thanks @LaurentiuM1234 !

@kv2019i kv2019i merged commit c592f78 into thesofproject:main Apr 15, 2024
43 of 45 checks passed
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.

4 participants