!examples/audio_rtttl: Implement example using RTTTL library#3633
Conversation
|
If the PR passes I'll open one to document the application & a configuration for it on the RPi4B |
acassis
left a comment
There was a problem hiding this comment.
Please just confirm it still working on other boards with audio codec instead of PWM
I'm not even sure how the last version worked. It appeared to be tailored to only one board and there were no docs for it. |
Which board are you citing? I think spresense:fmsynth uses it because it calls fmsynth/mmlplayer_main.c calls: #include <audioutils/mml_parser.h> |
The spresense board, which is the only one that implements the functions I can't confirm that the example still works on the spresense board, again because there's no documentation on how to use it but I also don't have a spresense board. My goal was to make the RTTL player work for any board by using user-space interfaces instead. Anyone depending on this for spresense would have to add a patch to add a player for the spresense interfaces. EDIT: I marked this as breaking with the quick-fix notes for people using Spresense to restore the previous behaviour. |
This commit fixes the audio_rtttl example (which was undocumented and previously used kernel-level functions) such that now it uses the RTTTL parsing library. Contributors can implement 'players' for different types of audio sinks. Currently, PWM is supported. BREAKING: The previous version of this example only supported a single board (Spresense) and uses public interfaces from the kernel code. Now it only uses user-space interfaces and supports any board implementing those interfaces. Users who relied on the old behaviour should submit a patch to add a new player to this application which uses the desired audio sink for the Spresense through user-space interfaces. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Maybe @jerpelea know how this work. Sony has a great Documentation page about NuttX. A quick search didn't return anything. |
Summary
This commit fixes the audio_rtttl example (which was undocumented and previously used kernel-level functions) such that now it uses the RTTTL parsing library. Contributors can implement 'players' for different types of audio sinks. Currently, PWM is supported.
BREAKING: The previous version of this example only supported a single board (Spresense) and uses public interfaces from the kernel code. Now it only uses user-space interfaces and supports any board implementing those interfaces. Users who relied on the old behaviour should submit a patch to add a new player to this application which uses the desired audio sink for the Spresense through user-space interfaces.
Impact
Can play RTTL with different devices! PWM supported for now, which a lot of
small boards have.
Closes #3621
Testing
Tested on the Rpi4B PWM-enabled audio jack. I confirm I heard the scale. I also
tested with the Simpson's example from the RTTL library and it worked.