Smaller audio buffers config option#308
Conversation
adf66cb to
98e9cc7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
parameter hence allowing for differently sized bufers to be used (for instance with audio input)
This comment was marked as outdated.
This comment was marked as outdated.
|
Alright, I think this looks good. Just like other configuration, the output buffer can be configured with: #define MOZZI_OUTPUT_BUFFER_SIZE 16 // from 256 to 1, in power of two should workReducing the buffer size allows to save some ram space, which can be critical in some cases, but it also has a greater chance to run into buffer underflow. It also should reduce the latency. This option does not have an effect on all mode/platform combination. If the option is not applyable, Mozzi does not block the compilation but returns a warning. Will give me a bit of time to work on personal projects with this version, see if any unforecasted bug appears. @Meebleeps in case you have transitioned to Mozzi2, you are very welcome to try :) |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@sensorium and @tfry-git nothing against merging this? I was thinking of maybe throwing a small release just after. |
|
Hey Tom, sounds good to me. (Is that lint error OK?). Happy new year, by the way! |
tfry-git
left a comment
There was a problem hiding this comment.
Looks good to me, but left a comment on a detail.
config/mozzi_config_documentation.h
Outdated
| * Valid values are power of two from 256 downward (128, 64, …). | ||
| * Note that this might not have an effect in all modes/platforms combination as Mozzi is sometimes using an external buffer which is not always configurable. | ||
| * | ||
| * TODO: Throw a warning if config does not have an effect |
There was a problem hiding this comment.
You seem to have addressed this TODO, at least from some ports. Are there still more cases to cover?
Could it be that all such cases can actually be identified by BYPASS_MOZZI_OUTPUT_BUFFER? (And thus this could be checked, centrally?)
There was a problem hiding this comment.
Ah, no BYPASS_MOZZI_OUTPUT_BUFFER does not preclude a port from honoring this setting.
Anyway, looks to me like the TODO note can be removed.
There was a problem hiding this comment.
Indeed, that's notably the case for the RP2040.
I have remove the TODO, and fix the conflict, from a previous PR.
Ok for merging?
5d6b2a6 to
aa967f1
Compare
|
Memory usage change @ 78ebf73
Click for full report table
Click for full report CSV |
In response to #281 .
This allows to configure
#MOZZI_BUFFER_SIZEfrom the previous default value of 256 to smaller values, reducing the latency.Status: in progress
Tasks: