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

nxaudio: fix audio stop logic to prevent buffer addition after STOP signal #2830

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

W-Mai
Copy link
Contributor

@W-Mai W-Mai commented Nov 7, 2024

Summary

  • Ensure AUDIO_STOP via ioctrl is followed by mq_send STOP without race conditions.
  • Modify loop condition to correctly handle running = false upon receiving STOP signal.
  • Resolve potential issue where AUDIO_MSG_DEQUEUE could still accept buffers after STOP signal due to timing.

Before:

  • nxaudio_stop would call ioctrl AUDIO_STOP followed by mq_send STOP, which might lead to AUDIO_MSG_DEQUEUE accepting buffers after STOP.

After:

  • Synchronized the sequence of ioctrl AUDIO_STOP and mq_send STOP to prevent buffer addition after STOP.
  • Enhanced loop condition to accurately reflect the STOP state.

Impact

N/A

Testing

N/A

…ignal

- Ensure `AUDIO_STOP` via `ioctrl` is followed by `mq_send STOP` without race conditions.
- Modify loop condition to correctly handle `running = false` upon receiving STOP signal.
- Resolve potential issue where `AUDIO_MSG_DEQUEUE` could still accept buffers after STOP signal due to timing.

Before:
- `nxaudio_stop` would call `ioctrl AUDIO_STOP` followed by `mq_send STOP`, which might lead to `AUDIO_MSG_DEQUEUE` accepting buffers after STOP.

After:
- Synchronized the sequence of `ioctrl AUDIO_STOP` and `mq_send STOP` to prevent buffer addition after STOP.
- Enhanced loop condition to accurately reflect the STOP state.

Signed-off-by: xinbingnan <[email protected]>
@lupyuen
Copy link
Member

lupyuen commented Nov 7, 2024

Sorry I have to cancel the CI Check, there's a problem with CI Test:

@W-Mai
Copy link
Contributor Author

W-Mai commented Nov 7, 2024

Sorry I have to cancel the CI Check, there's a problem with CI Test:

That's OK, let's wait for the issue to be resolved

@xiaoxiang781216 xiaoxiang781216 merged commit febd738 into apache:master Nov 7, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants