You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Implement SOF_IPC4_FW_PARAM_SYSTEM_TIME to sync host and FW timestamps #8016
Is your feature request related to a problem? Please describe.
Host is sending SOF_IPC4_FW_PARAM_SYSTEM_TIME to synchronize the host and DSP timestamps so that timestamps in logs can be compared directly.
Describe the solution you'd like
Implement IPC4 handle to set the timestamp epoch and implement a custom timestamp generator and set this using Zephyr log_set_timestamp_func() (in order for logging subsystem to use this timestamp).
Describe alternatives you've considered
Setting the Zephyr kernel time is one option, but there is currently no API to do this from applications and this could create many issues (i.e. time going back for kernel code).
Additional context
Add any other context or screenshots about the feature request here.
@kv2019i IIUC, driver is sending the message but we need to make sure we get teh message to Zephyr. @abonislawski@mwasko@nashif we will need this for PSS.
The epoch is adjusted as per specification, but I'm no longer sure if we should do that and just send the time directly.
@ujfalusi we need the kernel and FW work in the same time domain. In kernel log, the time is increased from the OS boot up, but the time sent for fw is UTC, epoch is 1601-01-01 00:00:00, so the time domain is still different, can we change the time to kernel log so that easy for us to check the time between kernel log and fw log ?
We can spell this out with some comments if needed. TBH using an epoch in FW is a waste of cycles, we shoulds use native timer value and do any epoch conversion in host.
Activity
kv2019i commentedon Aug 8, 2023
@btian1 this is one potential, please assign to yourself if you have bandwidth
plbossart commentedon Aug 8, 2023
@ujfalusi and I already discussed this, I can't recall what the outcome was and where this discussion took place.
ujfalusi commentedon Aug 9, 2023
@plbossart , @kv2019i, the kernel is sending the time when the mtrace is enabled.
The message setup starts here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/sof/ipc4-mtrace.c#n433
and the send is
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/sof/ipc4-mtrace.c#n444
The epoch is adjusted as per specification, but I'm no longer sure if we should do that and just send the time directly.
ujfalusi commentedon Aug 9, 2023
This is the SOF/Zephyr side handling of the message, right?
lgirdwood commentedon Aug 16, 2023
@kv2019i IIUC, driver is sending the message but we need to make sure we get teh message to Zephyr. @abonislawski @mwasko @nashif we will need this for PSS.
kv2019i commentedon Sep 6, 2023
@alex-cri @lgirdwood @mengdonglin proposing to move to v2.8 . work not yet started, so this did not make the v2.7 cut
RanderWang commentedon Nov 7, 2023
@ujfalusi we need the kernel and FW work in the same time domain. In kernel log, the time is increased from the OS boot up, but the time sent for fw is UTC, epoch is 1601-01-01 00:00:00, so the time domain is still different, can we change the time to kernel log so that easy for us to check the time between kernel log and fw log ?
ujfalusi commentedon Nov 7, 2023
The IPC4 specification is explicitly tells that the epoch for the set time is 1601-01-01 00:00:00, this is why the kernel driver converts it.
lgirdwood commentedon Nov 10, 2023
We can spell this out with some comments if needed. TBH using an epoch in FW is a waste of cycles, we shoulds use native timer value and do any epoch conversion in host.
kv2019i commentedon Dec 1, 2023
No consensus in the review this week, pushing to v2.9, but let's try to get to main this month in any case.
marc-hb commentedon Jan 12, 2024
All merged, close?