[RFC 1/1] sound: allow waveform selection

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Tue Dec 6 09:53:07 CET 2022



On 12/6/22 00:55, Simon Glass wrote:
> 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?

Hello Simon,

thanks for reviewing.

I have created a pull request for the bug fixes to go into 2023.01. As 
it is late in the cycle I don't want to introduce bigger changes.

On a system with multiple sound devices playback on the sandbox hangs in 
sandbox_sdl_sound_stop() waiting for sdl.stopping. This needs further 
investigation.

Best regards

Heinrich

> 
> Regards,
> Simon


More information about the U-Boot mailing list