User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - How to close MIDI Yoke Port left open by dead app. »
Welcome, Guest. Please Login or Register.
Oct 18th, 2024, 8:28am


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI Yoke
   MIDI Yoke NT
(Moderator: Jamie OConnell)
   How to close MIDI Yoke Port left open by dead app.
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: How to close MIDI Yoke Port left open by dead app.  (Read 1053 times)
markwa
Member
**



MIDI-OX Rules!

   


Posts: 11
How to close MIDI Yoke Port left open by dead app.
« on: Sep 19th, 2004, 8:48pm »
Quote Quote Modify Modify

I've been using MIDI Ox and MIDI Yoke for debugging a MIDI app I'm working on.  Sometimes my app crashes (blush) during debugging.  If the app had opened a MIDI Yoke port, but doesn't close the port because of the crash.  The next time I try to run the app, the Windows midiInOpen or midiOutOpen for the MIDI Yoke port fails with "invalid handle".  The only solution for the problem is to reboot Windows.
 
Is there a faster way than rebooting Windows to free up the MIDI Yoke drivers that the app didn't close because it crashed?
 
Most MIDI drivers don't have this problem.  However, I have had this same problem with the MIDI driver for a Midiman Keystation 49 keyboard.  That got to be such a problem that I just threw the Midiman keyboard in a closest and never use it any more during software development.
 
Cheers
-- Mark
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: How to close MIDI Yoke Port left open by dead
« Reply #1 on: Sep 20th, 2004, 12:10pm »
Quote Quote Modify Modify

The MIDI Yoke driver tries to clean itself up, the next time it is opened after a crash.  This can cause problems under a debugger (NTDLL breakpoint).  The work-around is to open MIDI-OX with a selected MIDI Yoke port, after stopping the debugged application.  MIDI-OX will open the driver and allow it to cleanup.  You can then close MIDI-OX (thus closing the cleaned up MIDI Yoke) and relaunch your debugee client.
 
IP Logged

--Jamie
Music is its own reward.

markwa
Member
**



MIDI-OX Rules!

   


Posts: 11
Re: How to close MIDI Yoke Port left open by dead
« Reply #2 on: Sep 20th, 2004, 9:24pm »
Quote Quote Modify Modify

If I wanted to clean up all 16 MIDI Yoke In and Out Ports, should I just prepare MIDI-OX / MIDI Device / Preset that opens all 16 MIDI Yoke In and Out Ports, and then closes them?
 
Or, could I just implement a quickie app that opens and closes all 16 of the ports?
 
Cheers
-- Mark
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: How to close MIDI Yoke Port left open by dead
« Reply #3 on: Sep 21st, 2004, 12:26pm »
Quote Quote Modify Modify

You only have to reopen and close one port to cleanup all 16.  I don't think it matters if it's an input or an output, but I would recommend attaching an input.
IP Logged

--Jamie
Music is its own reward.

markwa
Member
**



MIDI-OX Rules!

   


Posts: 11
Re: How to close MIDI Yoke Port left open by dead
« Reply #4 on: Sep 21st, 2004, 2:49pm »
Quote Quote Modify Modify

I have now written the above proposed "MIDI Yoke Reset" app, but it fails the same way my main app fails.  The call to the Windows midiInOpen fails with an "invalid handle" error in NTDLL.DLL when trying to open MIDI Yoke NT 1 for input.
 
I can't make sense out of the wording of the "invalid handle" message.  midiInOpen is supposed to _return_ a HMIDIIN handle for the opened port. The error message instead makes it sound like midiInOpen was expecting a HMIDIIN handle as an input parameter and found it invalid.  
 
Any suggestions about how I can reset the MIDI Yoke port?  
 
Do you have a reset tool yourself that you could share?
 
Thanks
-- Mark
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: How to close MIDI Yoke Port left open by dead
« Reply #5 on: Sep 21st, 2004, 6:27pm »
Quote Quote Modify Modify

Quote:
The call to the Windows midiInOpen fails with an "invalid handle" error in NTDLL.DLL when trying to open MIDI Yoke NT 1 for input.  

 
How are you determining this?  You certainly can't run this tool in a debugger or you'll repeat the same result that caused the original failure.
 
Quote:
Any suggestions about how I can reset the MIDI Yoke port?  
 
Do you have a reset tool yourself that you could share?  

 
As I said in my original post, I use MIDI-OX to clean up a crashed MIDI Yoke.  My default configuration includes MIDI Yoke 1 as an input port.  I have MIDI-OX setup as a quick launch from the Task Bar.  I click once to open it and then I click once to close it.  After that, MIDI Yoke is fine.
« Last Edit: Sep 21st, 2004, 6:28pm by Jamie OConnell » IP Logged

--Jamie
Music is its own reward.

markwa
Member
**



MIDI-OX Rules!

   


Posts: 11
Re: How to close MIDI Yoke Port left open by dead
« Reply #6 on: Sep 22nd, 2004, 7:03pm »
Quote Quote Modify Modify

Jamie,
 
Thanks.  You're right.  Running MIDI-OX and then exiting it does nicely reset the MIDI Yoke NT driver.  
 
Cheers
-- Mark
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


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