Skip to content

Conversation

@golowanow
Copy link
Member

Introduce latency tests using JACK Audio Connection Kit:
run jackd audio service, connect ports with loopback and run jack_iodelay to collect latency measurements, calculate and save statistics in a json report file.

@golowanow golowanow added the type:enhancement New framework feature or request label May 22, 2025
@golowanow golowanow requested a review from marc-hb May 23, 2025 09:42
@golowanow golowanow changed the title [SKIP SOF-TEST] test-case: latency-baseline: introduce latency tests [SKIP SOF-TEST] test-case: latency-metrics: introduce latency tests May 23, 2025
Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor code style suggestions, all the rest LGTM.

Some audio expert must review the actual logic, I did not.

@golowanow golowanow force-pushed the latency_20250522 branch 2 times, most recently from 42bb830 to 7d8cb92 Compare May 24, 2025 11:39
@golowanow
Copy link
Member Author

25/May changes:

  • detect and report xruns;
  • some renames for better integration with CI;
  • coding style improvements.

@golowanow
Copy link
Member Author

26/May changes (should be the last significant change in this PR):

  • add ALSA pcm-s parameters to run on SDW.
  • add 'trial' mode: repeat latency measurements gradually reducing buffer size (frames) to find the smallest latency achievable.
  • set alsa parameters to the same as check-alsabat.sh does.
  • allow to set a max number of ignored 'xruns' (per each run).
  • run mode with loopback set at the JACK to estimate its latency.

@golowanow golowanow marked this pull request as ready for review May 26, 2025 20:55
@golowanow golowanow requested review from a team and lgirdwood as code owners May 26, 2025 20:55
@golowanow golowanow requested a review from marc-hb May 27, 2025 04:33
@golowanow
Copy link
Member Author

27/May changes:
after more experiments with 'trial' mode and reproduceable xrun's, I've recognized that these errors are actually from jackd, and it needs its own log parser (in the very early versions of this test jackd and iodelay had the same output stream).

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, some audio expert should review the logic.

@golowanow
Copy link
Member Author

28/May changes - address review comments:

  • keep command line pieces in arrays for better control on expansion;
  • use printf instead of echo;

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some audio expert must review.

@golowanow golowanow requested a review from kv2019i May 28, 2025 17:33
Copy link
Contributor

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @golowanow , looks great! Good comments in code, this will be good basis to build on other tests.

@golowanow golowanow requested a review from marc-hb June 3, 2025 09:16
Introduce latency tests using `JACK` Audio Connection Kit:
run `jackd` audio service, connect ports with loopback
and run `jack_iodelay` to collect latency measurements,
detect xrun-s, calculate and save statistics into a json
report file.
Optionally, run in 'trial' mode repeating measurements with
gradually reduced buffers to find the smallest latency possible.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
@golowanow golowanow changed the title [SKIP SOF-TEST] test-case: latency-metrics: introduce latency tests test-case: latency-metrics: introduce latency tests Jun 4, 2025
@golowanow
Copy link
Member Author

SOFCI TEST

@golowanow golowanow merged commit 20a47bc into thesofproject:main Jun 4, 2025
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement New framework feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants