-
-
Notifications
You must be signed in to change notification settings - Fork 296
A2DP Sink Optimizations
Different Arduino/IDF versions are using up a different amount of RAM. The more recent the version the more RAM is needed. With the latest change Espressif is also recommending to use a separate ringbuffer and task to manage the output. This option is using additional RAM. You can try to fine tune the memory requirements by calling the following methods before the start():
The BluetoothA2DPSink provides the default implementation of a Bluetooth Speaker. You can try to adjust the following parameters
- set_event_stack_size() - default value is 3K
- set_event_queue_size()
- set_task_priority()
- set_event_stack_size() - default value is 3K
- set_event_queue_size()
- set_task_priority()
- set_i2s_stack_size() - default value is 2K
- set_i2s_ringbuffer_size() - default value is 32 * 1024
- set_i2s_ringbuffer_prefetch_percent() - default 70
- set_i2s_task_priority()
- set_i2s_write_size_upto() - default 240 * 6
- set_i2s_ticks() - default 20
You can use this extended provided by the BluetoothA2DPSinkQueued class. This way you will need about 33K more RAM. This can potentially correct some lost audio depending of the combination of number of volume changes, the selected log level and the source Operating System (e.g. IOS seems to be potentially a source of trouble here).