[wdmaudiodev] Re: Win7 usbaudio.sys MIDI bug?

  • From: Clemens Ladisch <clemens@xxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Mon, 30 Aug 2010 09:11:59 +0200

Daimen Duncan wrote:
> If you use a Code Index of 0x0F and just pass MIDI bytes through to USB the
> messages are corrupted if they are standard voice messages.  Sysex messages
> go through fine.

The company that wrote the USB MIDI specification built USB MIDI
synthesizers that ignore CIN 0xF.

The specification isn't quite clear on the purpose of this CIN:
| CIN=0xF, Single Byte: in some special cases, an application may prefer
| not to use parsed MIDI events. Using CIN=0xF, a MIDI data stream may
| be transferred by placing each individual byte in one 32 Bit USB-MIDI
| Event Packet. This way, any MIDI data may be transferred without being
| parsed.

Apparently, "in some special cases" is widely interpreted as "not in the
general case", which would imply "not required in a general driver".

According to the Robustness Principle, your device should never send
CIN 0xF when another CIN would be possible, i.e., 0xF should be used
only for system realtime messages.

> For example, if I send a PC change message of B0 12 using CIN 0x0F the data
> received from the Windows MIDI driver is
> B0 00
> B0 12
> Likewise if I send a CC message of C0 01 02 the data received is:
> C0 00
> C0 01
> C0 02

As Evert noted, these are not correct MIDI messages.  (Well, C0 01 02
would be two messages with running status, but this wouldn't be allowed
in one USB MIDI event packet.)

Please provide actual examples, with the USB MIDI event packets.

> If I parse the incoming messages and assemble them into packets with the
> appropriate CIN then it works fine but I don't have enough memory in the
> microcontroller

What microcontroller is this?  Even i8051-compatible ones can do this.
A state machine to convert from a MIDI byte stream to USB MIDI event
packets needs about four bytes of data and not very much code.


WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx


Other related posts: