Skip to content

ASoC: SOF: ipc4/Intel: Improve pcm delay reporting - #4851

Merged
ujfalusi merged 16 commits into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/ipc4_delay_reporting_batch_01
Mar 20, 2024
Merged

ASoC: SOF: ipc4/Intel: Improve pcm delay reporting#4851
ujfalusi merged 16 commits into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/ipc4_delay_reporting_batch_01

Conversation

@ujfalusi

@ujfalusi ujfalusi commented Mar 7, 2024

Copy link
Copy Markdown
Collaborator

Hi,
this PR is a new implementation of the closed #4791, providing (I hope) more robust support.

main highlights:

  • fix for pause/resume and xrun handling: re-read the start offset from firmware
  • callback for reading host accessible LLP has been renamed and
  • new host DMA position query callback added
  • the delay calculation itself is fixed by using the up-to-date host position, wrapping the LLP with the host boundary and to special case the time while the first frame is still within the DSP processing pipeline

With these patches and an improved audio conformance test (to take the delay into account) we are passing the test quite nicely on hw:0,0, hw:0,31 and DSPless/legacy mode (the later passed before, but indicates that the improved conformance test is not regressing):

command line for the test runs:
./alsa_conformance_test/alsa_conformance_test -P hw:0,X --iterations=20 -B4800 -p4800-d2

hw:0,0

----------RUN RESULT----------
number of recorders: 20
number of points: 1214559
step average: 1.496892
step min: 1
step max: 7
rate average: 47999.996679
rate min: 47999.991852
rate max: 48000.001621
rate error average: 0.290328
rate error min: 0.288493
rate error max: 0.291660
number of underrun: 0
number of overrun: 0

hw:0,31 (100ms deep buffer)

----------RUN RESULT----------
number of recorders: 20
number of points: 582554
step average: 3.001928
step min: 1
step max: 9
rate average: 47999.988525
rate min: 47999.967958
rate max: 48000.006057
rate error average: 0.101782
rate error min: 0.083003
rate error max: 0.115703
number of underrun: 0
number of overrun: 0

Note on the steps for the DB case: it is max 9 despite the fact that the DMA jumps 4800 first then 4608 frames at each burst. This is because the test now takes the delay into account which 'corrects' this jumping.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

snd_pcm_delay() reporting unexpected values

4 participants