From eac3283b4964f0753cd8840437f3522398774218 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 25 Aug 2024 00:04:17 +0200 Subject: [PATCH] Use a sensible size for DSP to GUI MIDI messages See also a1ba561cc5a. JACK2 and pipewire unconditionally report 32kB, Ardour internal backends report 8kB, also independent of the buffersize. While jack1 by default announces the audio buffersize. A sensible value assumes that the GUI reads the FIFO at a least 25fps, while also allowing MIDI ports to merge data (hence 2 * raw_buffer_size). Yet limit to 64k per track. --- libs/ardour/disk_writer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/disk_writer.cc b/libs/ardour/disk_writer.cc index 3ea33de71c..9ee351e17f 100644 --- a/libs/ardour/disk_writer.cc +++ b/libs/ardour/disk_writer.cc @@ -60,7 +60,7 @@ DiskWriter::DiskWriter (Session& s, Track& t, string const & str, DiskIOProcesso , _accumulated_capture_offset (0) , _transport_looped (false) , _transport_loop_sample (0) - , _gui_feed_fifo (AudioEngine::instance()->raw_buffer_size (DataType::MIDI)) + , _gui_feed_fifo (min (64000, max (s.sample_rate() / 10, 2 * AudioEngine::instance()->raw_buffer_size (DataType::MIDI)))) { DiskIOProcessor::init (); _xruns.reserve (128);