[RFC 1/1] sound: allow waveform selection

Simon Glass sjg at chromium.org
Tue Dec 6 00:55:18 CET 2022


Hi Heinrich,

On Mon, 5 Dec 2022 at 13:38, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> * Allow the sound command to select the sine or the square waveform.
> * Allow to play multiple tones with one command.
> * Adjust documentation.
> * Adjust unit test.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
> This would be the alternative to
> [v2,6/7] sound: add CONFIG_SOUND_SINE symbol
> For testing with the sandbox remove this line
>
>     arch/sandbox/dts/test.dts:969
>     sandbox,silent; /* Don't emit sounds while testing */
>
> run the sand box with './u-boot -T' and issue the following commands
>
>     sound play
>     sound play -s
>     sound play -s 600 500 -q
>     sound play -s 500 1047 500 880 500 0 500 1047 500 880 500 0 500 784 500 698 500 784 1000 698
>
> Listening to the output demonstrates why patch 7/7 is needed.
> ---
>  arch/sandbox/include/asm/test.h |  7 ++++
>  cmd/sound.c                     | 60 ++++++++++++++++++++++++++-------
>  doc/usage/cmd/sound.rst         | 28 ++++++++++++++-
>  drivers/sound/sandbox.c         |  7 ++++
>  drivers/sound/sound-uclass.c    | 19 +++++++++--
>  include/sound.h                 | 21 +++++++++---
>  test/dm/sound.c                 | 45 ++++++++++++++++---------
>  7 files changed, 151 insertions(+), 36 deletions(-)

This seems OK to me. Perhaps add a few run_command() tests as well?

Regards,
Simon


More information about the U-Boot mailing list