Skip to content

drivers/audio: Fix audio tone generator#19225

Open
acassis wants to merge 1 commit into
apache:masterfrom
acassis:fix_audio_tone
Open

drivers/audio: Fix audio tone generator#19225
acassis wants to merge 1 commit into
apache:masterfrom
acassis:fix_audio_tone

Conversation

@acassis

@acassis acassis commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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

@acassis acassis requested a review from jerpelea as a code owner June 26, 2026 13:57
@github-actions github-actions Bot added Size: S The size of the change in this PR is small Area: Audio labels Jun 26, 2026
@acassis

acassis commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@xiaoxiang781216 seems like apache/nuttx-apps#1559 introduced a Breaking Change and nobody noticed it until now.

linguini1
linguini1 previously approved these changes Jun 26, 2026
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

Comment thread drivers/audio/tone.c Outdated
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Audio Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants