DP9 Network MIDI 2.0 - NAMM Preview 1
Pre-releaseImportant Note
Even more Important Note: Please use the bits from NAMM Preview 2. I've removed the installers from this release so no one wastes their time.
https://github.com/microsoft/MIDI/releases/tag/dev-preview-9-namm-2
This is a rough DAILY build with minimal testing. I recommend using this only if you plan to test or demonstrate Network MIDI 2.0 functionality. Do feel free to log any bugs you find, and note the release used as DP9 NAMM Preview 1
if you are using the entire preview.
The DP9 SDK is compatible with DP8 and DP9 services.
Installation Instructions
There are a few key fixes in the DP9 service code, but it is otherwise nearly identical to DP8. Please uninstall DP8 completely before installing this.
Please follow the DP8 install instructions with the DP9 preview bits included in this release. DP8 install instructions are here:
https://github.com/microsoft/MIDI/releases/tag/dev-preview-8
- Make sure you have run the scripts to give yourself permissions (covered in the DP8 instructions). If you have done this previously for DP8 and have not installed a new Insider build since then, there's no need to do that a second time.
- Install the In-box Service
- Install the Preview service components (currently Network MIDI 2.0)
- Install the SDK Tools and Runtime
- Replace the configuration file as per below
- Manually add midisrv.exe to your firewall exclusion list (see below)
- Restart the service from the Services control panel (right-click "restart")
Minimal Install for DP8 users
I recommend installing everything, especially if you intend to file any bugs, but if you want to use the existing DP8 service, that is possible.
- Uninstall the DP8 SDK Runtime and Tools
- Install the DP9 SDK Runtime and Tools
- Install the DP9 Service Plugin Preview installer (this includes Network MIDI 2.0)
- Follow other instructions re: config files etc.
If you run into bugs and plan to file them, please first upgrade to the full DP9 preview.
Minimal Install for In-Box users
This has not been tested with the recent in-box Canary bits, but is not expected to work with in-box bits until the at-or-after-NAMM Canary release. Please use the full installer instructions above until we release a version that has been tested with that upcoming Canary build.
Firewall
Currently, midisrv.exe
does not have permissions to poke through the firewall. As a result, Network MIDI 2.0 will not work without a Firewall exception. It is also not in the list of apps in Windows Defender Firewall, so you need to manually add it.
If you are using a third-party firewall product, you will need to use their instructions for allowing an app through.
- Search->"Allow an app through Windows Firewall"
- Click "Change settings"
- Click "Allow another app..."
- Click "Browse" to locate the exe
- Navigate to the location of
midisrv.exe
. In preview builds, this is underProgram Files\Windows MIDI Services\Service
. In in-box builds, this is under\Windows\System32
- Click "Network types..." to select the appropriate network types (for those demonstrating at NAMM or using someone else's network, you may need both Private and Public to be checked)
- Then click "Add". You will either see "midisrv.exe" or "Windows Midi Service" depending upon when you look at the list. Either is fine.
- After you have completed this step, you will be able to restart the service and connect to the network.
For those who prefer, you can also add the exclusion through the basic command-line or PowerShell:
netsh advfirewall firewall add rule name="Allow midisrv in" dir=in action=allow program="C:\Program Files\Windows MIDI Services\Service\Midisrv.exe" enable=yes
netsh advfirewall firewall add rule name="Allow midisrv out" dir=out action=allow program="C:\Program Files\Windows MIDI Services\Service\Midisrv.exe" enable=yes
Support for the command-line option is beyond the scope of this project. Information on how to use netsh may be found here: https://learn.microsoft.com/troubleshoot/windows-server/networking/netsh-advfirewall-firewall-control-firewall-behavior
Configuration File
For this preview, there is no user interface for creating Network MIDI 2.0 connections, and they cannot be created at runtime. Instead, they can be created in the configuration file located in %allusersprofile%\Microsoft\MIDI
In Insider Canary builds with Windows MIDI Services pre-installed, you may run into an issue where the configuration file cannot be edited. To fix this, open an Administrator console and issue the following:
echo %allusersprofile%
c:
cd %allusersprofile%\Microsoft\
takeown /F MIDI /R
The echo
and c:
are just to ensure you are on the correct drive, and may be omitted if you have only a single drive, or know you are already on the correct drive. The Microsoft\MIDI
folder is added by the preview installer and also by the recent Canary Insider builds.
That will give you ownership of the MIDI folder and the files it contains. We will fix this in later in-box releases. Note also that currently Canary Insider builds will overwrite the default.midiconfig.json
file, so if you make changes, please keep a backup.
Included in this release is a replacement configuration file which includes a Network MIDI host, as well as examples of a few clients definitions. There are also some loopbacks defined which you may remove if you want as long as you make sure the file is still a valid JSON file (no stray or missing commas etc.)
In this preview, these match only on the Id, which means the devices must advertise their hosts on mDNS. The ids come from running the midimdnsinfo.exe
tool which is included in the SDK runtime. That tool will, after a minute, list all advertised Network MIDI 2.0 endpoints visible on this subnet. It also lists
Example Host
You may define any number of hosts as long as you give each one a unique identifier (the GUID at the top here). I use GUID by convention, as will the tools, but you may use any unique string.
For those who used earlier Network MIDI 2.0 configuration files, the format has changed, and the old configuration file will no longer work. Note that this is still in preview and the configuration file formats are likely to change again before release.
"{090ad480-3cf8-4228-b58f-469f773e4b61}":
{
"enabled": true,
"networkProtocol": "udp",
"advertise": true,
"port": "auto",
"serviceInstanceName": "windowspreview",
"name": "Windows Network MIDI Host",
"productInstanceId": "3263827-5150Net2Preview",
"authentication": "none",
"connectionPolicyIpv4": "allowAny",
"createMidi1Ports": false
}
Property | Description |
---|---|
enabled | Set to true for this entry to be processed |
networkProtocol | Required. Must be "udp" |
advertise | Whether or not to mDNS-advertise this service. Recommended to be true |
port | A valid port number, or "auto". Recommend "auto" unless you have reason to use a specific port. |
serviceInstanceName | The unique name for this service. Each host must have its own |
name | The endpoint name advertised |
productInstanceId | The product instance id for the Windows service. Can be most anything |
authentication | Must be set to "none" for this preview |
connectionPolicyIpv4 | Must be set to "allowAny" for this preview |
createMidi1Ports | Leave this setting as false unless you are an internal user with access to the tools to enable WinMM support |
When in doubt, please refer to the Network MIDI Protocol specifications at https://midi.org
Example Clients
There are a number of clients defined in the configuration file. These are connections to remote advertised hosts. Currently, the hosts must be mDNS advertised to work. Direct IP/Port connection is not yet supported.
"{4353df3f-2ab3-47ff-bc51-dd9511047c29}":
{
"enabled": true,
"networkProtocol": "udp",
"name": "Kissbox Endpoint 21",
"match":
{
"id": "DnsSd#kb7C5D0A_1._midi2._udp.local#0"
},
"createMidi1Ports": false
},
"{893cd814-70f9-42a3-bffa-7e716c107756}":
{
"enabled": true,
"networkProtocol": "udp",
"name":"BomeBox DIN",
"match":
{
"id": "DnsSd#bomeboxdin-8q6d2z-1._midi2._udp.local#0"
},
"createMidi1Ports": false
}
Property | Description |
---|---|
enabled | Set to true for this entry to be processed |
networkProtocol | Required. Must be "udp" |
name | Name for the endpoint. Required for now, but will change in the future. |
match | Required sub object |
match->id | The id obtained by using midimdnsinfo.exe installed with the SDK tools and runtime |
createMidi1Ports | Leave this setting as false unless you are an internal user with access to the tools to enable WinMM support |
Configuration File Notes
In this preview, configuration is only read at service startup. The SDK calls to create new endpoints at runtime are not yet completed, and therefore neither the settings app nor any SDK user can create Network MIDI 2.0 endpoints.
Client vs Host Behavior
Midisrv as the Host
When midisrv is started, if one or more hosts are defined, the Network MIDI 2.0 transport spins up threads which open a socket, advertise the service, and then listen for invitations. It's also responsible for responding to out-of-band communication, such as Pings. When an invitation is received, the transport will accept it and then tell the Device Manager in the service to create appropriate MIDI endpoints. At this time, the endpoint will be visible to the MIDI SDK just like USB or any other type of MIDI 2 UMP-native device. After creating the connection, the service then performs discovery and protocol negotiation just like it would for USB, app-to-app, etc.
Midisrv as the Client
Upon service startup, the Network MIDI 2.0 transport spins up a device watcher which looks for new _midi2._udp
mDNS ads on the local subnet. When ads are found, the information is compared to the list of clients read from the configuration file. If not found there, it's retained for later client addition. The background thread which does this comparison will create a new connection, invite the remote host, and if accepted, create the UMP endpoint visible to the SDK users. As with the host worker, discovery and protocol negotiation are also initiated by the service.
Note that the mDNS advertisement must be present and visible on the subnet that the PC is set to use. Use midimdnsinfo.exe
to verify. If it's not visible to that tool, it will not be visible to the service.
midimdnsinfo.exe tool
This is a tool used to enumerate mDNS ads, specifically for the Network MIDI 2.0 protocol, visible on the current subnet. This is also where you can see the Id used in the configuration files
Endpoint Ids
We'll have some additional properties in the endpoints in future updates, but one thing you can note right now is the Id itself contains c if Windows midisrv is the client or h if Windows midisrv is the host.
Other Notes
In this preview, there's no Denial-of-Service (DOS) protection or any sort of rate-limiting or IP exclusion in the service. In addition to the protocol-specified security approaches, we intend to include basic IP filtering in the configuration file and some level of rate-limiting for pings and any other out-of-session communication. Anything more advanced can be set up through your Windows Firewall.
This preview has not been tested with IPv6 hosts or clients.
This preview does not have any authentication support for Network MIDI 2.0. There are a couple other places where it falls short of the spec as well. For example, we do not yet send out empty UMP messages during idle periods.
Retransmit buffers and responding to requests is in the code, but not yet tested.
Midisrv Host code has been tested more than client code. :)
Debugging
If you are connecting with an external device or service, I recommend using the latest Wireshark as well as the midi2 protocol filter from https://midi2.dev
Note that the plugin requires a recent version of Wireshark because they updated to a more recent version of the Lua language. I am using 4.4.2.
Misc DP9 updates
Although this release is primarily for experimenting with Network MIDI 2.0, there are a few other DP9 updates worth calling out
GroupTerminalBlock AsEquivalentFunctionBlock
function now intelligently names the function block by removing the device name if present, etc. This is to make it more useful for apps which use this information to present aggregated MIDI 1.0 ports to users- Fixed problem where the reporting functions weren't working properly (active transports, active sessions). This required updates to the MIDI Service transport.
- Updated
mididiag
to have colorized output. This doesn't impact redirecting output to a file. - Updated
mididiag
to output MIDI 1.0 information first, so that it can return useful information even when Windows MIDI Services is not installed. - Other issues marked as "fixed with DP9"
- There is no new USB MIDI 2.0 driver build. The next build of this will be in the Windows Insider Canary release around/after NAMM.
Videos
Network MIDI 2.0 working with REAPER through the older WinMM MIDI 1.0 API
https://www.youtube.com/watch?v=YL5kqaSUdfs
Quick Network MIDI 2.0 demo blasting notes from multiple clients across the network.
https://www.youtube.com/watch?v=LgolyB8_KOo
Assets
Looking for Assets? See note at the top of this release.