[wdmaudiodev] Re: Starting to dev. a virtual Midi Port

  • From: Revan Foly <xaseriii@xxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Sat, 14 Jul 2012 00:51:26 +0200

Hi,

So I see I have different approaches available. Even though my program doesn't 
transmit any sound just NoteOn/Off and CC data, latency is a very important 
issue, therefore I'd like to try the most performant method, i it is reasonable 
for me to try getting it to work. If I'm correct that would be the Kernel 
Streaming method which is also the newer method and can also be expected to 
work with windows 8?

On the other hand, if you Google "virtual MIDI driver", you'll find
    that there are lot of people who have ready-made solutions.

The only one that seemed to be exactly what i needed and also free was 
virtualMIDI, however the author didn't respond on a request mail I sent him 
earlier.

Are you saying you just ran mpu401.sys at a command line?

Well I admit it was kinda foolish but from what I read in the WDK 
Documentation, all that was necessary to test the driver was to configure a 
remote computer and then select the correct debugger in visual Studio 2012 RC 
and press "start debugging" - so I thought just selecting local debugging mode 
would be a thing worth trying. Maybe VS2012 would handle everything by itself.

Every WDK sample includes one, and there is certainly documentation
    for them.

Well I think you said it before but I definitely can't find a prepared INF file 
in this sample:
http://code.msdn.microsoft.com/Audio-Adapters-Samples-a61b6d06/view/SourceCode#content



    I'm not sure from what viewpoint you are asking this.  In a kernel
    driver, the Kernel Streaming system creates the user-accessible
    device objects for you, when you initialize Kernel Streaming.  In
    portcls drivers (like MPU401 and FMSynth), the Port Class driver
    does that for you, using the information you return to it.

So if in both cases the port that other programs can connect to via midiIn and 
midiOut are created by the "allready there part" of the driver, what exactly do 
I have to submit to the driver. just the link between my application and the 
driver?


Thank you very much for your help already, its greatly appreciated and I think 
if I hadn't got an answer on my first mail, I would have given up already ;)



Date: Fri, 13 Jul 2012 14:49:50 -0700
From: timr@xxxxxxxxx
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: Starting to dev. a virtual Midi Port


  
    
  
  
    Revan Foly wrote:
    
      
      
        

        right, so i used the time to read into the WDK a bit more and it
        actually confused me more than get me anywhere. It looks like I
        need a Kernel Driver to access Kernel Streaming.

      
    
    

    Well, more accurately, you need a kernel driver if you plan to
    provide Kernel Streaming services.  However, that's not the only way
    to provide MIDI data.  It is still possible to create a user-mode
    driver using the WINMM "installable driver" model.  In that case,
    you write a user-mode DLL that handles the midiIn and midiOut
    functions almost directly.  There's a thread here that talks a
    little more about this:

        http://www.osronline.com/showthread.cfm?link=185751

    

    The problem is, the last DDK that contained a sample was NT 4, but
    that simple still builds and works.

    

    On the other hand, if you Google "virtual MIDI driver", you'll find
    that there are lot of people who have ready-made solutions.

    

    

    
      
        How are you starting and debugging it?

          

        
        I selected the local debugger and simply started debugging. I
        didn't see the point in configuring a testing machine.

      
    
    

    Are you saying you just ran mpu401.sys at a command line?  You
    didn't copy it to \Windows\System32\Drivers and create a service
    entry for it?  Drivers have to be configured, and then started by
    the operating system.  You don't get to run them yourself.

    

    

    
      
        kernel drivers, so they have to be installed with an
          INF file

          

        
        Again WDK wasn't much help in finding out how to write one /
        generate one.

      
    
    

    Every WDK sample includes one, and there is certainly documentation
    for them.  Now, I will freely admit that INF writing is a bit of a
    dark art, especially for audio drivers, but the samples are there.

    

    

    
      My biggest problem atm is that I probably simply
        don't see in the samples where the MIDI Port is created and how
        data is passed to it. Any suggestions on where to start?

      
    
    

    I'm not sure from what viewpoint you are asking this.  In a kernel
    driver, the Kernel Streaming system creates the user-accessible
    device objects for you, when you initialize Kernel Streaming.  In
    portcls drivers (like MPU401 and FMSynth), the Port Class driver
    does that for you, using the information you return to it.

    -- 
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
                                          

Other related posts: