#1393 MIDI Recording, Thru Latency

None
closed
None
5
2013-10-09
2013-07-07
Ted Felix
No

S. Christian Collins reports that while MIDI recording is now working fine for him for intense 30 minute improv sessions, there is a delay in the MIDI thru while recording.

My best guess without looking is that the processing required for recording is somehow getting in the way of the MIDI thru loop. Can ALSA do thru directly for us? That might be a smarter approach that gets rg out of the loop. Otherwise we'll need to make sure the MIDI thru loop is more responsive.

Discussion

  • Ted Felix

    Ted Felix - 2013-09-18

    At this point, my theory is that AlsaDriver::processMidiOut()'s locking is causing the delay for MIDI thru. It appears that during recording only, processMidiOut() gets called constantly by one thread while the other thread is trying to send out the MIDI thru. But the thru has to wait for the other thread to finish and release the lock. This theory is consistent with the random MIDI thru delay that I've noticed. More digging is in order....

     
  • Ted Felix

    Ted Felix - 2013-09-18

    Nope, it was simpler than that. Turns out there was this pretty obvious line which I saw a week or so ago:

    outputTime = alsaTimeNow + RealTime(0, 10000000);
    

    But, knowing how looks can be deceiving I decided to continue my investigation. Turns out that that line was indeed the culprit. Changing it to this:

    outputTime = alsaTimeNow;
    

    ...fixes the MIDI thru latency problem. The question is, "What does it break?" Since there are no comments anywhere to be found, who knows?

     
  • Ted Felix

    Ted Felix - 2013-09-19

    Fixed in r13414. Need to get Christian to retest for us.

     
  • Ted Felix

    Ted Felix - 2013-10-09
    • status: open --> closed
     
  • Ted Felix

    Ted Felix - 2013-10-09

    Christian has retested and he says it's working perfectly now.

    Except for how it goes bonkers when it tries to expand the composition when you record past the end. I thought I saw a similar feature request WRT segments just recently. Anyway, I'm going to move this to the top of my list as I do admit it's a pretty obvious and blatant issue.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks