-
Notifications
You must be signed in to change notification settings - Fork 132
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
ASoC: SOF: trace: Make sure we are not missing the first host_offset … #3523
ASoC: SOF: trace: Make sure we are not missing the first host_offset … #3523
Conversation
@marc-hb, this should fix the check-sof-logger.sh issue tracked under thesofproject/sof#4333 I did managed to reproduce after all on one of my machine. |
@dbaluta, hrm, yes it looks that way. On iMX you don't use the host trigger. We can not set the state to ENABLED twice, we might want to add a new state, like STARTING and accept the position update while the dtrace is STARTING || ENABLED. I think that would cover the non host dtrace architectures also. What do you think? |
Yes, I think this would work. Can you / do you have time to implement this? I can test it somewhere at the end of the week. |
…#4333 Peter has a tentative fix in thesofproject/linux#3523, remove the workaround so it can better tested and evaluated. Signed-off-by: Marc Herbert <marc.herbert@intel.com> (cherry picked from commit 4b3f847)
@dbaluta, I'll do this first thing in the morning (tomorrow's), I hope it will fix both issue. |
We should first remove the workaround in sof-test and then resubmit this to CI, sof-test change submitted in CI is completely broken this week so maybe next week. |
SOFCI TEST |
b3af96e
to
eb80144
Compare
@dbaluta, can you take a look and test this version? It should fix iMX as well (and AMD, Intel atom, Mediatek). |
@ujfalusi let me have a look at this today. |
@ujfalusi this looks good to me. cannot test it on i.mx as we are still on 5.15 and there were a lot of changes in that area. even with 5.16 it looks like i cannot test it. will do a test when our porting team will upgrade to 5.17. |
https://sof-ci.01.org/linuxpr/PR3523/build7375/devicetest/ (run ID 11146) has a number of (hopefully unrelated) failures but the "DMA nudge" was never triggered in any check-sof-logger test. |
SOFCI TEST |
eb80144
to
f96008a
Compare
Changes since v2:
|
We have one case where the dtrace data is empty: We have one position update, it is coming way longer after the trace is enabled. It is just empty. I have added debugs to this PR, I want to see the host_offset updates: #3526 |
With the binaries from #3526 on
When the dtrace returns empty (last group - after about 30 iteration) the kernel receives the position update but the copy to user does not happen. |
@marc-hb, one thing stands out on the |
@marc-hb, managed to catch it with the new print in #3526 (to print when the
The reason for the empty dtrace from sof-logger? The read never got placed. Manually running the
|
You can 'simulate' the change with pre |
f96008a
to
c1f95e0
Compare
c1f95e0
to
2fc5773
Compare
Changes since v3:
|
2fc5773
to
9d50941
Compare
Changes since v4:
|
sound/soc/sof/ipc3-dtrace.c
Outdated
@@ -419,13 +428,16 @@ static int ipc3_dtrace_enable(struct snd_sof_dev *sdev) | |||
dev_dbg(sdev->dev, "%s: stream_tag: %d\n", __func__, params.stream_tag); | |||
|
|||
/* send IPC to the DSP */ | |||
sdev->dtrace_state = SOF_DTRACE_INITIALIZING; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully get the proposal and what happens if the IPC fails. we would still allow the client to read stuff from the buffer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart, I see. I will set the state to SOF_DTRACE_DISABLED if either the ipc or the host operation fails.
With the new state we can make sure we are not missing the first host_offset update. In case the dtrace is small, the DMA copy will be fast and depending on the moonphase it might be done before we set the sdev->dtrace_state to SOF_DTRACE_ENABLED. The DMA will start the copy as soon as the host starts the DMA. Set the dtrace to enabled before we let the DMA to run in order to avoid missing the position update. The new state is needed to cover architectures where the host side snd_sof_dma_trace_trigger() is a NOP and the dtrace in the firmware is ready as soon as the IPC message has been processed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
9d50941
to
7af8fff
Compare
Changes since v4:
|
…update
In case the dtrace is small, the DMA copy will be fast and depending on
the moonphase it might be done before we set the sdev->dtrace_state to
SOF_DTRACE_ENABLED.
The DMA will start the copy as soon as the host starts the DMA. Set the
dtrace to enabled before we let the DMA to run in order to avoid missing
the position update.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com