On Thu, 2019-04-04 at 17:20 +0200, Guennadi Liakhovetski wrote:
which first of all is absolutely theoretical - the SOF *always* writes position updates to the stream mailbox and all platforms have it, secondly - why does it use posn.comp_id in the "true" branch instead of msg_id as in the "false" branch? Can those IDs be different?
You are assuming that SOF will only ever run on a single platform. Some platforms have HW registers to propagate stream position, some have shared memory, some have neither hence the need to support position readback via various methods.
Actually I'm trying to do the opposite - I'm trying to move all platform-specific code out of the core to make the code easier to port. And the very check above "if (sdev->stream_box.size == 0)" seems quite hardware specific to me.
Agree, the naming also implies some HW coupling (but it is a FW concept). It would be good to move this into platform code but it would need to be done with an option to get host DMA position (default) or all position data (full structure with DAI endpoint position and timestamps too). The trace API would need to use this call too for trace position IIRC.
Liam