mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
make LV2 communication buffers independent from jack-midi buffer-size
fixes issues with plugin communication that are common with jack1 use due to its very small midi-buffers.
This commit is contained in:
parent
c4227ca706
commit
5dee49e194
1 changed files with 19 additions and 5 deletions
|
|
@ -1137,8 +1137,20 @@ LV2Plugin::write_from_ui(uint32_t index,
|
||||||
const uint8_t* body)
|
const uint8_t* body)
|
||||||
{
|
{
|
||||||
if (!_from_ui) {
|
if (!_from_ui) {
|
||||||
_from_ui = new RingBuffer<uint8_t>(
|
size_t rbs = _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS;
|
||||||
_session.engine().raw_buffer_size(DataType::MIDI) * NBUFS);
|
/* buffer data communication from plugin UI to plugin instance.
|
||||||
|
* this buffer needs to potentially hold
|
||||||
|
* (port's minimumSize) * (audio-periods) / (UI-periods)
|
||||||
|
* bytes.
|
||||||
|
*
|
||||||
|
* e.g 48kSPS / 128fpp -> audio-periods = 375 Hz
|
||||||
|
* ui-periods = 25 Hz (SuperRapidScreenUpdate)
|
||||||
|
* default minimumSize = 32K (see LV2Plugin::allocate_atom_event_buffers()
|
||||||
|
* -> 15 * 32K
|
||||||
|
* it is safe to overflow (but the plugin state may be inconsistent).
|
||||||
|
*/
|
||||||
|
rbs = min(32768u * 6, rbs);
|
||||||
|
_from_ui = new RingBuffer<uint8_t>(rbs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!write_to(_from_ui, index, protocol, size, body)) {
|
if (!write_to(_from_ui, index, protocol, size, body)) {
|
||||||
|
|
@ -1165,8 +1177,10 @@ void
|
||||||
LV2Plugin::enable_ui_emmission()
|
LV2Plugin::enable_ui_emmission()
|
||||||
{
|
{
|
||||||
if (!_to_ui) {
|
if (!_to_ui) {
|
||||||
_to_ui = new RingBuffer<uint8_t>(
|
/* see note in LV2Plugin::write_from_ui() */
|
||||||
_session.engine().raw_buffer_size(DataType::MIDI) * NBUFS);
|
size_t rbs = _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS;
|
||||||
|
rbs = min(32768u * 8, rbs);
|
||||||
|
_to_ui = new RingBuffer<uint8_t>(rbs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1901,7 +1915,7 @@ LV2Plugin::Impl::designated_input (const char* uri, void** bufptrs[], void** buf
|
||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool lv2_filter (const string& str, void *arg)
|
static bool lv2_filter (const string& str, void * /* arg*/)
|
||||||
{
|
{
|
||||||
/* Not a dotfile, has a prefix before a period, suffix is "lv2" */
|
/* Not a dotfile, has a prefix before a period, suffix is "lv2" */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue