Skip to content

samples/subsys/audio/sof: fix sys-ticks-per-sec to 15000 #46744

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

Merged

Conversation

kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Jun 21, 2022

The value of CONFIG_SYS_CLOCK_TICKS_PER_SEC has side-effects that
are not expected with tickless kernel mode. In bug #46378, application
code is shown to run slower with higher sys clock tick value. In SOF
bug #5921, audio quality issues were root-caused to k_timer inaccuracy
with 50000 sys clock tick.

Set the the value to 15000 for all SOF applications. All existing
test cases pass with this value.

BugLink: #46378
BugLink: thesofproject/sof#5921
Signed-off-by: Kai Vehmanen [email protected]

The value of CONFIG_SYS_CLOCK_TICKS_PER_SEC has side-effects that
are not expected with tickless kernel mode. In bug zephyrproject-rtos#46378, application
code is shown to run slower with higher sys clock tick value. In SOF
bug zephyrproject-rtos#5921, audio quality issues were root-caused to k_timer inaccuracy
with 50000 sys clock tick.

Set the the value to 15000 for all SOF applications. All existing
test cases pass with this value.

BugLink: zephyrproject-rtos#46378
BugLink: thesofproject/sof#5921
Signed-off-by: Kai Vehmanen <[email protected]>
Copy link
Collaborator

@andyross andyross left a comment

Choose a reason for hiding this comment

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

No complaints here. Maybe 16 kHz would be aesthetically nicer as it divides by common sampling rates? But then maybe the asynchrony is good?


# Fix the sys ticks value until following bugs are solved:
# - https://github.com/zephyrproject-rtos/zephyr/issues/46378
CONFIG_SYS_CLOCK_TICKS_PER_SEC=15000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure you really need the comment. 15 kHz seems like a very reasonable choice for timer precision in an audio application (just ~3 samples!). It's not clear to me why 50 kHz was chosen anyway, though personally I liked seeing the number as an exercise of the "tick rate is just an arbitrary precision" concept.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@andyross I put the comment, because like you said, this should not really matter. Once we understand #46378 , we can make a more sensible decision where this should be set.

@carlescufi carlescufi merged commit 855adb1 into zephyrproject-rtos:main Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants