13
0

Do not allocate MIDI buffers for signal analysis

At this point in time MIDI buffers are vastly over-sized.
They include VST and LV2 event structure. This added about a MB per
plugin for no benefit.
This commit is contained in:
Robin Gareus 2018-11-25 17:22:46 +01:00
parent 5273c636ab
commit cf98a75558
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -913,7 +913,7 @@ PluginInsert::connect_and_run (BufferSet& bufs, samplepos_t start, samplepos_t e
//std::cerr << " streams " << internal_input_streams().n_audio() << std::endl; //std::cerr << " streams " << internal_input_streams().n_audio() << std::endl;
//std::cerr << "filling buffer with " << collect_signal_nframes << " samples at " << _signal_analysis_collected_nframes << std::endl; //std::cerr << "filling buffer with " << collect_signal_nframes << " samples at " << _signal_analysis_collected_nframes << std::endl;
_signal_analysis_inputs.set_count(input_streams()); _signal_analysis_inputs.set_count (ChanCount (DataType::AUDIO, input_streams().n_audio()));
for (uint32_t i = 0; i < input_streams().n_audio(); ++i) { for (uint32_t i = 0; i < input_streams().n_audio(); ++i) {
_signal_analysis_inputs.get_audio(i).read_from ( _signal_analysis_inputs.get_audio(i).read_from (
@ -1048,7 +1048,7 @@ PluginInsert::connect_and_run (BufferSet& bufs, samplepos_t start, samplepos_t e
//std::cerr << " output, bufs " << bufs.count().n_audio() << " count, " << bufs.available().n_audio() << " available" << std::endl; //std::cerr << " output, bufs " << bufs.count().n_audio() << " count, " << bufs.available().n_audio() << " available" << std::endl;
//std::cerr << " streams " << internal_output_streams().n_audio() << std::endl; //std::cerr << " streams " << internal_output_streams().n_audio() << std::endl;
_signal_analysis_outputs.set_count(output_streams()); _signal_analysis_outputs.set_count (ChanCount (DataType::AUDIO, output_streams().n_audio()));
for (uint32_t i = 0; i < output_streams().n_audio(); ++i) { for (uint32_t i = 0; i < output_streams().n_audio(); ++i) {
_signal_analysis_outputs.get_audio(i).read_from( _signal_analysis_outputs.get_audio(i).read_from(
@ -2063,15 +2063,20 @@ PluginInsert::configure_io (ChanCount in, ChanCount out)
_delaybuffers.configure (_configured_out, _plugins.front ()->max_latency ()); _delaybuffers.configure (_configured_out, _plugins.front ()->max_latency ());
_latency_changed = true; _latency_changed = true;
// we don't know the analysis window size, so we must work with the /* we don't know the analysis window size, so we must work with the
// current buffer size here. each request for data fills in these * current buffer size here. each request for data fills in these
// buffers and the analyser makes sure it gets enough data for the * buffers and the analyser makes sure it gets enough data for the
// analysis window * analysis window. We also only analyze audio, so we can ignore
session().ensure_buffer_set (_signal_analysis_inputs, in); * MIDI buffers.
_signal_analysis_inputs.set_count (in); */
ChanCount cc_analysis_in (DataType::AUDIO, in.n_audio());
ChanCount cc_analysis_out (DataType::AUDIO, out.n_audio());
session().ensure_buffer_set (_signal_analysis_outputs, out); session().ensure_buffer_set (_signal_analysis_inputs, cc_analysis_in);
_signal_analysis_outputs.set_count (out); _signal_analysis_inputs.set_count (cc_analysis_in);
session().ensure_buffer_set (_signal_analysis_outputs, cc_analysis_out);
_signal_analysis_outputs.set_count (cc_analysis_out);
// std::cerr << "set counts to i" << in.n_audio() << "/o" << out.n_audio() << std::endl; // std::cerr << "set counts to i" << in.n_audio() << "/o" << out.n_audio() << std::endl;