aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-12-19 09:29:55 -0500
committerTom Rini <trini@konsulko.com>2022-12-21 13:09:01 -0500
commit14f43797d0a696248c09d298e2f2809dded345ba (patch)
tree23fc5bc462689f07f389cc0b8e7f7bedd35253ff /arch/sandbox
parent9c955393f7a27ded250fef7688e0065b44a3343f (diff)
parent2243922edca9f56a9d5519b9d6e36f5d7a18434d (diff)
downloadu-boot-14f43797d0a696248c09d298e2f2809dded345ba.zip
u-boot-14f43797d0a696248c09d298e2f2809dded345ba.tar.gz
u-boot-14f43797d0a696248c09d298e2f2809dded345ba.tar.bz2
Merge tag 'v2023.01-rc4' into next
Prepare v2023.01-rc4 Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/cpu/sdl.c11
-rw-r--r--arch/sandbox/include/asm/test.h10
2 files changed, 15 insertions, 6 deletions
diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
index f4ca36b..2c570ed 100644
--- a/arch/sandbox/cpu/sdl.c
+++ b/arch/sandbox/cpu/sdl.c
@@ -441,7 +441,6 @@ void sandbox_sdl_fill_audio(void *udata, Uint8 *stream, int len)
{
struct buf_info *buf;
int avail;
- bool have_data = false;
int i;
for (i = 0; i < 2; i++) {
@@ -453,10 +452,9 @@ void sandbox_sdl_fill_audio(void *udata, Uint8 *stream, int len)
}
if (avail > len)
avail = len;
- have_data = true;
- SDL_MixAudio(stream, buf->data + buf->pos, avail,
- SDL_MIX_MAXVOLUME);
+ memcpy(stream, buf->data + buf->pos, avail);
+ stream += avail;
buf->pos += avail;
len -= avail;
@@ -466,7 +464,8 @@ void sandbox_sdl_fill_audio(void *udata, Uint8 *stream, int len)
else
break;
}
- sdl.stopping = !have_data;
+ memset(stream, 0, len);
+ sdl.stopping = !!len;
}
int sandbox_sdl_sound_init(int rate, int channels)
@@ -484,7 +483,7 @@ int sandbox_sdl_sound_init(int rate, int channels)
wanted.freq = rate;
wanted.format = AUDIO_S16;
wanted.channels = channels;
- wanted.samples = 1024; /* Good low-latency value for callback */
+ wanted.samples = 960; /* Good low-latency value for callback */
wanted.callback = sandbox_sdl_fill_audio;
wanted.userdata = NULL;
diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index 0406085..568738c 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -189,6 +189,16 @@ int sandbox_get_setup_called(struct udevice *dev);
int sandbox_get_sound_active(struct udevice *dev);
/**
+ * sandbox_get_sound_count() - Read back the count of the sound data so far
+ *
+ * This data is provided to the sandbox driver by the sound play() method.
+ *
+ * @dev: Device to check
+ * Return: count of audio data
+ */
+int sandbox_get_sound_count(struct udevice *dev);
+
+/**
* sandbox_get_sound_sum() - Read back the sum of the sound data so far
*
* This data is provided to the sandbox driver by the sound play() method.