Thanks, @styro! Good to see you are making progress with your PreenFM2-Synth port.
I did not test CI2SSoundBaseDevice with that small chunk sizes, but I guess, if you want to use a chunk size of 32 for small latency, you have to decrease the "TX Request Level" in the "DREQ_A" register of the PCM / I2S block like that:
Code: Select all
diff --git a/lib/i2ssoundbasedevice.cpp b/lib/i2ssoundbasedevice.cpp
index 75114ae..43bc78a 100644
@@ -71,6 +71,9 @@
#define TXC_A_CH2POS__SHIFT 4
#define TXC_A_CH2WID__SHIFT 0
+#define DREQ_A_TX__SHIFT 8
+#define DREQ_A_TX__MASK (0x7F << 8)
// DMA controller
@@ -263,6 +266,8 @@ boolean CI2SSoundBaseDevice::Start (void)
// enable I2S DMA operation
+ write32 (ARM_PCM_DREQ_A, (read32 (ARM_PCM_DREQ_A) & ~DREQ_A_TX__MASK)
+ | (0x18 << DREQ_A_TX__SHIFT));
write32 (ARM_PCM_CS_A, read32 (ARM_PCM_CS_A) | CS_A_DMAEN);
See page 134 of this document
for a description of the "DREQ_A" register.
I think, the current meeting point for Circle stuff is in this forum. The message frequency has been relatively low so far, so I'm not sure, if a separate discussion platform does make sense.
BTW. Circle issues should be reported here