summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-02-05 20:30:20 +1100
committerjacqueline <me@jacqueline.id.au>2024-02-05 20:30:20 +1100
commitf2df12836f10719f65e9eefa1e17aa600edf49c2 (patch)
treef3934ad5781fe18ed3cb9b3ca69f2db7107b4e93 /src/drivers
parentf4d8b2b04afe0cfd025e4ea0f574f906cb79a840 (diff)
downloadtangara-fw-f2df12836f10719f65e9eefa1e17aa600edf49c2.tar.gz
tweak pipeline buffers rather than i2s dma buffer
this maintains the bluetooth changes to buffer sizes, but keeps the most important i2s buffer the same size
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/include/i2s_dac.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/drivers/include/i2s_dac.hpp b/src/drivers/include/i2s_dac.hpp
index fdd7e976..bd837ca0 100644
--- a/src/drivers/include/i2s_dac.hpp
+++ b/src/drivers/include/i2s_dac.hpp
@@ -27,10 +27,12 @@
namespace drivers {
-// We normalise to 2-channel, 16 bit audio, which gives us a max of 4092 / 2 / 2
-// (16 bits) frames. This in turn means that at 48kHz, we have about 10ms of
-// budget to fill each buffer.
-constexpr size_t kI2SBufferLengthFrames = 512;
+// DMA max buffer size for I2S is 4092. We normalise to 2-channel, 16 bit
+// audio, which gives us a max of 4092 / 2 / 2 (16 bits) frames. This in turn
+// means that at 48kHz, we have about 21ms of budget to fill each buffer.
+// We base this off of the maximum DMA size in order to minimise the amount of
+// work the CPU has to do to service the DMA callbacks.
+constexpr size_t kI2SBufferLengthFrames = 1024;
/**
* Interface for a DAC that receives PCM samples over I2S.