drivers/audio: Fix audio tone generator#19225
Open
acassis wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
@xiaoxiang781216 seems like apache/nuttx-apps#1559 introduced a Breaking Change and nobody noticed it until now. |
linguini1
previously approved these changes
Jun 26, 2026
The audio tone generator stopped working with the 'echo' command since apache/nuttx-apps#1559 Before that PR: nsh> echo "t120o1l16b9n0baan0bn0bn0baaan0b9n0baan0b" > /dev/tone0 tone_write: Received 41 bytes nsh> After that PR: nsh> echo "t120o1l16b9n0baan0bn0bn0baaan0b9n0baan0b" > /dev/tone0 tone_write: Received 40 bytes tone_write: Received 1 bytes nsh> Unfortunately the Audio Tone was not block new write attempts even when it was already playing a melody. This commit fix it and avoids the issue caused by that PR. Signed-off-by: Alan C. Assis <acassis@gmail.com>
linguini1
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: Please adhere to Contributing Guidelines.
Summary
The audio tone generator stopped working with the 'echo' command since apache/nuttx-apps#1559
Before that PR:
nsh> echo "t120o1l16b9n0baan0bn0bn0baaan0b9n0baan0b" > /dev/tone0
tone_write: Received 41 bytes
nsh>
After that PR:
nsh> echo "t120o1l16b9n0baan0bn0bn0baaan0b9n0baan0b" > /dev/tone0
tone_write: Received 40 bytes
tone_write: Received 1 bytes
nsh>
Unfortunately the Audio Tone was not blocking new write attempts even when it was already playing a melody.
This commit fix it and avoids the issue caused by that PR.
Impact
Now audio tone can work again with echo command
Testing
Tested on stm32f103-minimum board