module: cadence: don't return on non-fatal error #9046
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.