AudioRecordQueue limited to 53 blocks? Why 53?

Status
Not open for further replies.

chipaudette

Well-known member
Hi,

Why is the AudioRecordQueue limited to 53 blocks? I understand why one might want to limit the depth of the queue, but why 53?

If I wanted to, could I change the code to increase it to 100 (for use on a Teensy 3.6, for instance) without unintended issues?

Thanks,

Chip
 
Hi,

Why is the AudioRecordQueue limited to 53 blocks? I understand why one might want to limit the depth of the queue, but why 53?

If I wanted to, could I change the code to increase it to 100 (for use on a Teensy 3.6, for instance) without unintended issues?

Thanks,

Chip
Chip,
maybe some life-history related number?

Seriously, AFAIK, there is no reason to limit to 53. In fact I decided to make my own Template based queue and use up to 550 audio blocks on a T3.6 for my recorder.
I know you can handle this Template implementation but for others: here is a link to a modified record queue, that is named different to avoid interferences with audio library.
It is used line this:
Code:
  #include "input_adc.h"
  AudioInputAnalog    acq(ADC_PIN);
  #include "m_queue.h"
  mRecordQueue<int16_t, MQUEU> queue1;
  AudioConnection     patchCord1(acq, queue1);
 
There is indeed an arbitrary limit of 53 within the code, which allows for about 150 ms to be buffered in the queue.

Internally the queue uses an array of pointers to keep track of the buffered blocks.

Code:
        audio_block_t * volatile queue[53];
        audio_block_t *userblock;
        volatile uint8_t head, tail, enabled;
 
WMXZ, thanks for the real-world feedback, and for the code. I've been looking at your audio recorder as I, too, am struggling with the less-then-speedy performance of the default SD libraray. As I was so focused on the SD issue, though, I had failed to notice that you had also expanded the queue in your code. Cool!

There is indeed an arbitrary limit of 53 within the code, which allows for about 150 ms to be buffered in the queue.

Internally the queue uses an array of pointers to keep track of the buffered blocks.

Code:
        audio_block_t * volatile queue[53];
        audio_block_t *userblock;
        volatile uint8_t head, tail, enabled;

And, presumably, in addition to changing 53 in the *.h file (as quoted above), I'll probably need to change all of the "53" that are hard-coded in the *.cpp. Roger.

Chip
 
Status
Not open for further replies.
Back
Top