Skip to content
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

[v2.8-branch] applications: nrf5340_audio: Fix audio sync timer off by one tick #19410

Draft
wants to merge 3 commits into
base: v2.8-branch
Choose a base branch
from

Conversation

cvinayak
Copy link
Contributor

Fix audio sync timer off by one tick when TASKS_CAPTURE and
TASKS_CLEAR are in a race condition.

TASKS_CAPTURE is prioritized hence can have +30 us more when
RTC tick to trigger TASKS_CLEAR overlap with the capture of
the value.

The fix here initiates the RTC and TIMER sync only when a
capture is requested by the audio subsystem or the timestamp
request. This is in contrast to earlier implementation when
TIMER was sync on every RTC tick.

If a capture is requested in short duration of 30 us then
the race will still be present, but a subsequent fix for it
will be provided in a new commit.

Minor refactor audio sync timer for correct logging and
improved order of the source code.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Dec 11, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Dec 11, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 3

Inputs:

Sources:

more details

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (0)

Outputs:

Toolchain

Version:
Build docker image:

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ❌ Toolchain
  • ❌ Build twister
  • ❌ Integration tests

Note: This message is automatically posted and updated by the CI

Fix audio sync timer off by one tick when TASKS_CAPTURE and
TASKS_CLEAR are in a race condition.

TASKS_CAPTURE is prioritized hence can have +30 us more when
RTC tick to trigger TASKS_CLEAR overlap with the capture of
the value.

The fix here initiates the RTC and TIMER sync only when a
capture is requested by the audio subsystem or the timestamp
request. This is in contrast to earlier implementation when
TIMER was sync on every RTC tick.

If a capture is requested in short duration of 30 us then
the race will still be present, but a subsequent fix for it
will be provided in a new commit.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@cvinayak cvinayak force-pushed the github_ncs_nrf5340_audio_sync_timer_off_by_one_fix_2_8_0 branch from 5bcc223 to 0f7a92d Compare December 11, 2024 07:59
@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publish GitHub Action.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ cvinayak
❌ desinord
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants