plutek
Joined: Oct 24, 2014 Posts: 3 Location: toronto
|
Posted: Fri Oct 24, 2014 5:31 am Post subject:
MIDI persistence Subject description: having problems with maintaining persistent MIDI connections |
|
|
greetings! i've posted on the mailing list with no answer yet, so thought i'd try here... ...this is all on my main system (crunchbang debian-SID (64-bit), jack2, RME multiface on ExpressCard), which is a tested production environment and is generally reliable at 44100/128/2 for live use. i've usually used puredata, but am testing ChucK 1.3.4.0....
starting with chuck --loop, if i then add this shred, everything works fine, and xruns are minimal (i see updated values for "beat", calculated from incoming MIDI, and then i see the "done" message after 30s:
Code: |
// set up MIDI
MidiIn min;
MidiOut mout;
MidiMsg msgin;
MidiMsg msgout;
// connect to port 1 and print result
<<<"MIDI in: ",min.open(1)>>>;
<<<"MIDI out: ",mout.open(1)>>>;
dur beat;
now + 30::second => time later;
while( now <later> now;
while( min.recv(msgin) ){
( msgin.data3 + 10 ) * 50::ms => beat;
<<<beat>>>;
}
}
<<<"done">>>;
|
note, however, that when the shred exits the connection from MIDI-in to ChucK persists, while the one to MIDI-out disappears (observed in qjackctl).
then, if i add the same shred again, ChucK claims to have made both MIDI connections (i.e. i see "1" for both the min.open(1) and mout.open(1) debug prints), but the connections window in qjackctl remains unchanged, showing only a connection from MIDI-in to ChucK, and showing no MIDI-out port from ChucK at all. also, the shred gets stuck there -- i don't see any updated values of "beat" upon MIDI input, and the shred never reaches "done". the shred just persists forever, without doing anything.
if i use a version of the shred with no min.open or mout.open statements (hoping to re-use the MIDI-in connections which seems to persist), the same hung behaviour as above ensues...
so, it seems that when the first shred finishes, the MIDI port system is left in some kind of dysfunctional state! am i missing something about how to deal with MIDI connections around stopping and starting shreds? (i see there is no .close event for MidiIn or MidiOut, so we can't explicitly take down our connections on shred exit.)
...or is this some issue related to the ALSA/Jack subsystem or a hardware problem?
thanks again for any help anyone can offer... cheers!
.pltk. |
|
plutek
Joined: Oct 24, 2014 Posts: 3 Location: toronto
|
Posted: Fri Oct 24, 2014 12:43 pm Post subject:
|
|
|
another strange thing (possibly related):
if i start up the engine with "chuck --loop", and then do a "chuck --probe", the MIDI output port list is incomplete (lists only the first MIDI out port). the MIDI input list is fine. however, that second instance of chuck segfaults after giving the incomplete list.
i guess it's a different situation, since i'm starting another engine rather than just another shred, but the symptom seems pretty similar, so i thought it might be useful information...
anyone else seeing these sorts of things?
is there another, better way to deal with MIDI for multiple shreds or engines?
cheers!
.pltk. |
|