-
Notifications
You must be signed in to change notification settings - Fork 322
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
[BUG] host-zephyr.c: DMA copy size alignment may result in frames been split between LL cycles #9301
Comments
@serhiy-katsyuba-intel any update here ? We are going to have jitter in the DMA vs timer, but this should always be leading rather than trailing vs the timer (since timer has to fire IRQ, handler runs, pipeline infra wakes up etc before FW read DMA position). |
No update, nobody is working on it. For typical stereo streams this should not cause any problem. The problem might happen for big frame size, e.g., for less typical streams with many channels. |
Ok, fwiw @iuliana-prodan came across something similar with a large "frame" size being used for HiFi SIMD, she did encounter a non aligned HiFi frame size mismatch. It could be coming from here... |
I think by design, the host copier should not push partial frames into the audio pipeline. OTOH, in the audio pipeline, components can express alignment constraints with a separate API, so this is potentially handled there (but depends on the every audio module/component to declare constraints correctly. So I think this is a valid bug, but might be in practise hard to hit (and could be also fixed in the module by implementing constraints correctly). @singalsu any inputs on this? |
No owner, moving to v2.12. |
Yep, the components are not capable to process partial frames. Having such buffers passed to components could trigger bugs in components if they don't correctly calculate what is available. We could have a testbench test mode with simulated host/dai-copier (file component) to catch issues like this in components. |
host_get_copy_bytes_normal() in host-zephyr.c aligns down copy bytes to DMA specific value:
For some frame sizes, this can lead to a split first and/or last frame: one part of the frame is processed during one LL cycle, while the remaining portion is processed in the subsequent LL cycle. This could be a problem for components that assume the first sample in the buffer belongs to the first channel. Even if such components consume full frames, they could be bound on a fly as additional copier sinks or additional mixin sources or sinks, causing them to start processing from the wrong channel.
The text was updated successfully, but these errors were encountered: