View Issue Details

IDProjectCategoryView StatusLast Update
0003838ardourbugspublic2020-04-19 20:15
Reportercth103 Assigned Tocth103  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version3.0-beta1 
Summary0003838: MIDI panic crashes Ardour when JACK buffer size is 128
DescriptionThere is not enough room to copy the panic data into the JACK output buffers, so an assert trips.
TagsNo tags attached.

Activities

steph5150

2011-03-07 19:02

reporter   ~0010316

Last edited: 2011-03-08 01:13

proposal:

Give some more time to the panics data to be transmitted, don't make it immediate at all cost(in this case, at the cost of a crash).

And, you could give this issue a high priority cause Panic is very usefull at this time, because, when you hit Stop, nothing sends the right note-off messages to kill those everlasting notes...

At last, 2*128 samples buffer is NOT that low when you record/play direct from a midi master keyboard, 2*256 is quite still acceptable(not if you play fast phrases), 2*512 makes you feel you play way too far from the speakers ;-) (latency).

steph5150

2011-03-08 23:13

reporter   ~0010321

Last edited: 2011-03-08 23:23

As of svn 9096, when you hit stop there's no more hanging notes.

Something has been changed ? Anyway...thanks

There's still one case when hanging notes occurs :
(It's not that urgent to solve/modify, just my thought)
If you mute a midi track after some note-on are played (between note-on and note-off).

Shouldn't the right behavior be to send corresponding notes-off & sutain/hold controllers-reset when you mute a midi track ?
But that means you should also re-send those controllers when you hit play (their last state before the play point).

steph5150

2011-03-09 14:11

reporter   ~0010324

Last edited: 2011-03-09 14:17

Update !!!

With some midi tracks (empty) in ardour3, change the latency (via jack menu) to a upper value, and then click PANIC... it crashes... OK and now what ?!
Now reload the same session and go to the latency setting, it reports 32...Then set it to 128, and now click PANIC : it works !!!

Any idea ?

The Panic crash comes back as soon as you add a new midi track...so you have torepeat the steps above to workaround the problem...

steph5150

2011-03-18 22:00

reporter   ~0010371

Last edited: 2011-03-18 22:02

In svn 9096 and above (actually svn 9168), replacing line 61( in void
MidiBuffer::resize(size_t size) ) in /libs/ardour/midi_buffer.cc by :
    _capacity = size * 2;//(instead of : _capacity = size;)

seams to do the trick for me...Am I wrong doing that ?

steph5150

2011-03-18 22:16

reporter   ~0010372

I got my answer, buffer becomes corrupt after a while...

steph5150

2011-03-22 20:18

reporter   ~0010377

Can anyone else confirm the bug ?
Am I the only one to have this ?

cth103

2011-03-22 20:38

administrator   ~0010378

It is indeed confirmed.

steph5150

2011-03-22 21:11

reporter   ~0010379

Last edited: 2011-03-22 22:16

thanks,

Some more informations:
Even if I set the JACK buffer size to a upper value(say 1024), then clicking Panic many times (say >30) always end up to this:

ardour-3.0: ../libs/ardour/midi_ring_buffer.cc :111 : size_t ARDOUR::MidiRingBuffer<T>::read(ARDOUR::MidiBuffer&, ARDOUR::framepos_t, ARDOUR::framepos_t, ARDOUR::framecnt_t) [with T = long int, size_t = long unsigned int, ARDOUR::framepos_t = long int, ARDOUR::framecnt_t = long int]: L'assertion « success » a échoué.

Toying with an "auto-midi-buffer-resize" patch in MidiBuffer::read_from function (JACK buffer size to 128) I only got the problem to be delayed, Panic works for a while with some "MRB: Unable to reserve space in buffer, event skipped" and it ends the same way...

Monitoring the '_capacity' value (size_t) I saw that it jumps from 484 to aprox 16384 (not sure for this one) then back to 484 etc... could it be that this value is modified by other functions (aka audio buffer gesture) outside midi buffer context ?

paul

2011-03-23 22:32

administrator   ~0010390

Last edited: 2011-03-23 22:33

the best workaround for this problem (not a fix, but a workaround) is to use the -M argument to JACK itself, thus specifying your own MIDI port buffer size. see the jack man page for details.

i agree that it needs a more sophisticated solution.

steph5150

2011-03-23 22:44

reporter   ~0010395

Last edited: 2011-03-23 23:11

Thanks for the info Paul ! Will give it a try.

note: tried it and it seems to work. Is it suposed to add midi latency (for direct playing/recording [master keyb => some virtual synth]) ? ...Anyway, thanks again for the tip.

cth103

2011-08-14 15:33

administrator   ~0011344

This should be fixed "properly" now in SVN. Please re-open this bug if you are still having problems. Thanks!

system

2020-04-19 20:15

developer   ~0022443

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2011-03-07 15:37 cth103 New Issue
2011-03-07 15:37 cth103 cost => 0.00
2011-03-07 19:02 steph5150 Note Added: 0010316
2011-03-08 01:11 steph5150 Note Edited: 0010316
2011-03-08 01:13 steph5150 Note Edited: 0010316
2011-03-08 23:13 steph5150 Note Added: 0010321
2011-03-08 23:15 steph5150 Note Edited: 0010321
2011-03-08 23:19 steph5150 Note Edited: 0010321
2011-03-08 23:22 steph5150 Note Edited: 0010321
2011-03-08 23:23 steph5150 Note Edited: 0010321
2011-03-09 14:11 steph5150 Note Added: 0010324
2011-03-09 14:12 steph5150 Note Edited: 0010324
2011-03-09 14:17 steph5150 Note Edited: 0010324
2011-03-18 22:00 steph5150 Note Added: 0010371
2011-03-18 22:02 steph5150 Note Edited: 0010371
2011-03-18 22:16 steph5150 Note Added: 0010372
2011-03-22 20:18 steph5150 Note Added: 0010377
2011-03-22 20:38 cth103 Note Added: 0010378
2011-03-22 20:38 cth103 Status new => confirmed
2011-03-22 21:11 steph5150 Note Added: 0010379
2011-03-22 22:16 steph5150 Note Edited: 0010379
2011-03-23 22:32 paul Note Added: 0010390
2011-03-23 22:33 paul Note Edited: 0010390
2011-03-23 22:44 steph5150 Note Added: 0010395
2011-03-23 23:05 steph5150 Note Edited: 0010395
2011-03-23 23:11 steph5150 Note Edited: 0010395
2011-08-14 15:33 cth103 Note Added: 0011344
2011-08-14 15:33 cth103 Status confirmed => resolved
2011-08-14 15:33 cth103 Resolution open => fixed
2011-08-14 15:33 cth103 Assigned To => cth103
2020-04-19 20:15 system Note Added: 0022443
2020-04-19 20:15 system Status resolved => closed