AudioOutput.h : 387 - Available Buffer 0 too small 64: requested: 128 -> increase the buffer size #1601
-
Now trying to run my little program that worked perfectly last summer, but after I ran the "Year's" update of the library, I'm put back to the start!..In this little program, I use OutputMixer to send one signal out to the speaker (something which only works if there is a signal in and not otherwise!..). I have accepted that it is not possible to do this with this library. But after the update, I get the following error when you start streaming the guitar or spotify sound to the program!.. ERROR:[W] AudioOutput.h : 387 - Available Buffer 0 too small 64: requested: 128 -> increase the buffer size PS: Everything worked perfectly before this year's update! The main parts of the program selection: #include <AudioConfig.h>
#include <AudioTools.h>
#include <ESP_I2S.h>
#include <BluetoothA2DPSink.h>
#include <AudioLibs/AudioRealFFT.h>
const uint8_t I2S_SCK = 32;
const uint8_t I2S_WS = 33;
const uint8_t I2S_SDOUT = 22;
I2SClass OutI2S;
BluetoothA2DPSink a2dp_sink(OutI2S);
// Apply Effects on an Input Stream
AudioInfo info(44100, 2, 16);
SineWaveGenerator<int16_t> sineWave(10000);
GeneratedSoundStream<int16_t> Sound(sineWave);
OutputMixer<int16_t> mixer(OutI2S, 2); // Output mixer with 2 - outputs mixing to AudioKitStream
const int buffer_size = 128; // <<<===== Split up the output into small slices 2 * 128 = 256
uint8_t sound_buffer[buffer_size];
// A2DP Sink with output to FFT...
AudioRealFFT FFT_DATA; // or any other supported inplementation
#define NUM_LEDS 15 // Number of (15)-LEDs used for the VU meter.
auto FFT_Conf = FFT_DATA.defaultConfig();
FFT_Conf.length = 1024;
FFT_Conf.copyFrom(info);
a2dp_sink.set_raw_stream_reader(Write_Data_Stream); // Register callback FFT
a2dp_sink.set_stream_reader(Read_Data_Stream, false);
mixer.begin(buffer_size); // setup Output mixer with min necessary memory |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 3 replies
-
Did you try to increase the buffer size ? |
Beta Was this translation helpful? Give feedback.
-
No matter what you set, you get this error!.. const int buffer_size = 4096; [W] AudioOutput.h : 387 - Available Buffer 1 too small 2048: requested: 4096 -> increase the buffer size |
Beta Was this translation helpful? Give feedback.
-
Have now update the library!. The error message disappeared and I have set the value back to 128. But no sound gets through!.. |
Beta Was this translation helpful? Give feedback.
-
I tested with this sketch and I also reduced the copy size to 128 and mixer buffer size with mixer.begin(128); This was working w/o any issues. If I remember right the issue was that mixer.begin(n) did allocate a buffer with n samples instead of n bytes . Did you try with mixer.begin(128 * 2) ? |
Beta Was this translation helpful? Give feedback.
-
No Sound Out!Have tried some values, but do not get sound through when using OutputMixer!... const int buffer_size = 1024; Or is the OutputMixer functionality deleted from the library and this is no longer supported in the new library version?. |
Beta Was this translation helpful? Give feedback.
-
Can you provide a simple example that demonstrates the issue ? |
Beta Was this translation helpful? Give feedback.
-
You can only try your own code!.. You cannot use your MacBook development machine for this. Install VritualBox with a clean machine with only Arduino installed and your library. Then you will quickly see what errors we users/amateurs experience from errors! You really need to perform a quality check and cleanup of your code!. const uint8_t I2S_SCK = 32; BluetoothA2DPSink a2dp_sink(OutI2S); |
Beta Was this translation helpful? Give feedback.
I also committed a correction that would allow an output if one channel is empty: In the test case one copy line commented out and the mixer.flushMixer() uncommented