On August 15, 2013 02:40:46 PM Tim E. Real wrote:
> Some further info about GUI operations:
> --------
> You'll see that when operating a midi GUI knob or slider, such as in
>  MidiStrip::ctrlChanged(), it will call audio->msgPlayMidiEvent()
>  which I have known for a while is slow - it waits for audio sync.
> I think I had planned to fix that, likely ran out of time before.
> Because now that I have added device functions like addScheduledEvent()
>  which passes events to the device via a safe ring buffer,
>  this msgPlayMidiEvent() should be unnecessary. 

Oops, tripping over my words again.
MidiDevice::addScheduledEvent() does not go through a ring buffer, 
 that's why I didn't fix it yet.
So the solution is simply to add a ring buffer for that.

>  This will also permit
>  the GUI control movement timing to be accurately and faithfully
>  reproduced when the driver gets around to them - something
>  msgPlayMidiEvent() cannot do.
> After all, I was able to achieve this goal with audio knobs and sliders,
>  so the next logical step is to take care of the midi knobs and sliders.
> Let me handle this area - kick me if I haven't fixed it soon...

Also forgot to mention, again my department, multiple threads can
 call MidiDevice::putEvent().
This is fine for Jack Midi and synth devices because it goes through a ring 
 buffer (provided I expand on our usage of ring buffers as I mentioned in 
 my first response).
But our ALSA devices don't do that - they simply pass the event
 to ALSA directly in MidiAlsaDevice::putEvent() using 
 snd_seq_event_output_direct().
Somehow I had assumed ALSA's snd_seq_event_output_direct() was 
 thread safe (of course not!), but some recent research confirmed 
 snd_seq_event_output_direct() is definitely *not* thread safe.
So I will have to add ring buffers there as well.

> Thanks.
> Tim.
> 


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer

Reply via email to