MIDI-OX User Forum (http://www.midiox.com/cgi-bin/yabb/YaBB.pl)
MIDI-OX >> Questions and Discussion >> Closing MidiOutDevs needs a lot of time....
(Message started by: TabSel on Aug 25th, 2001, 3:19pm)

Title: Closing MidiOutDevs needs a lot of time....
Post by TabSel on Aug 25th, 2001, 3:19pm
Hi all,

I am using a RME Hammerfall DSP cardbus card on a laptop here. MidiOX/Yoke does a great job routing/monitoring midi data on this machine, thanks again, jamie.
As I need to unplug the HDSP and plug in an ethernet/isdn cardbus card often, I quit MIDIOX, give the HDSP an "I want to unplug you"-signal (!?!), the unplug it and after a couple of seconds I get a a bluescreen....

I analyzed this and came to this: When I quit MIDIOX, there is a midiox.exe process still active! I think this is due to midiox releasing the midioutdevs. Now when I unplug the hdsp, midiox tries to release the hdsp midi ports and boom...

My question is: why does it take so long not just for midiox but for any application to release a midioutdev?

TabSel

Title: Re: Closing MidiOutDevs needs a lot of time....
Post by JamieOConnell on Aug 25th, 2001, 7:59pm
The time it takes to close MIDI devices is dependent on the drivers and the number of SysEx buffers allocated.

Actually the MIDI Output devices should be released pretty quickly, and it would take more time to release the MIDI Input devices.  The reason is because MIDI-OX supplies the input devices with all of the SysEx buffers.  Before an Input driver is closed, the application must issue a MIDI reset to tell the driver to give back the buffers.  The application must wait for the buffers to be released, and then free them before closing the port.

On my machine is doesn't take long at all to close MIDI-OX ports (it's fairly instantaneous). Perhaps there is some weird interaction with the Hammerfall?  Try closing the ports before closing MIDI-OX and see if that makes a difference (when you do this, is there still an instance in the task manager?)

Title: Re: Closing MidiOutDevs needs a lot of time....
Post by TabSel on Aug 28th, 2001, 8:58am
I don't think that it has something to do with the hammerfall. In fact, it occurs on other machines as well even on those, that do not have any other midi device driver than yokes...

Whenever midiox closes its ports, for example when loading another (or the same....) midi device setup or quitting midiox, it takes a lot of time and the amount of time is dependant on the number of I/Os are to be closed...

Its not a "bug" or anything with midiox. The same occurs within reaktor for example. When I insert a midiport to be used, there is no delay, but whenever I remove the device again, it takes about a few seconds for reaktor to have the device removed (closed). Wondering!

TabSel

Title: Re: Closing MidiOutDevs needs a lot of time....
Post by JamieOConnell on Aug 28th, 2001, 10:42pm
I wasn't suggesting that there was a problem with the Hammerfall, only that there might be some strange interaction occuring, but apparently that's not the case. I am still wondering a few things:

  • How many buffers are assigned to each device?
  • When you close the ports before exiting MIDI-OX, does it still appear in the task manager?
  • Is this happening on Windows 2000?


Title: Re: Closing MidiOutDevs needs a lot of time....
Post by TabSel on Aug 29th, 2001, 2:23am
Thanks Jamie for your efforts.
to answer your questions:
* yes, running on w2k
* no, midiox.exe-process quits immediately when closing the ports before quitting midiox
* how may I determine the number of buffers assigned to each device, to help you?

It really isn't that much of a problem once I get used to wait a little before unplugging a card prior to plug in another, so please don't spend too much of your time, if any....

Title: Re: Closing MidiOutDevs needs a lot of time....
Post by JamieOConnell on Aug 29th, 2001, 9:40am

on 08/29/01 at 02:23:15, TabSel wrote:
* how may I determine the number of buffers assigned to each device, to help you?

The number of buffers that need to be allocated and freed, can be accessed in 2 places: the SysEx View  SysEx | Configure...  and the main menu Options | Configure Buffers.  In both cases, the Num field controls the number of buffers allocated.  We recommend 16 - 32 buffers.

Title: Re: Closing MidiOutDevs needs a lot of time....
Post by TabSel on Aug 29th, 2001, 1:34pm
I did not alter the default settings by installation:
16 In- and out Buffer with 256 Bytes, 60ms Delay between buffers and also 60ms after F7...

The full amount of supported yoke I/O devices are in use, plus the two hammerfall I/Os if the card's plugged in...

Did some testing
started each test with neither In- nor Out-port, changed settings and meassured the time until the MIDI port activity window got refreshed to reflect the new amount of I/O ports (opening the devices - (a) ) and then changed settings back to no port at all and meassured this time again (closing ports - (b) )

Test 1) Setup devices to one Input Port only
(a) no delay noticed, (b) about a second 'til refresh!

2) SetUp devices to one output port only
(a)  no delay noticed, (b) no delay noticed

3) SetUp devices to use all eight yoke input devices
(a) no delay noticed, (b) about 10 seconds to release all ports...

TabSel

Title: Re: Closing MidiOutDevs needs a lot of time....
Post by JamieOConnell on Aug 29th, 2001, 5:37pm
Thanks for the data.  This agrees with what I see under Win 2000 also.  I usually don't hook up anymore input devices than I'm using, and that reduces the time needed.

Interestingly, attaching and detaching the same devices under Win 98 is almost instananeous: clearly the MME stuff under Windows NT OS's is a different implementation  :o from 9x.

I do appreciate the report though, and I may add some code to keep the app visible until it's actually ready to exit, so that you don't get hosed by the Task Manager.



MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.