1Misc notes 2========== 3 4- **MPU401 kernel module.** If your soundcard supports MIDI input and 5 output, chances are that it is powered by an MPU401 chip. Because 6 this interface is so popular, BeOS comes with a kernel module that 7 makes it easy to write drivers for the MPU401. Thanks to Greg Crain, 8 we now have an open source version of this kernel module. 9 10 The mpu401 module lives in ``src/add-ons/kernel/generic/mpu401``. It 11 supports both the v1 and (undocumented) v2 protocols, although v2 is 12 not complete since we don't really know how it works. Unfortunately, 13 almost no existing drivers use v1; most of the drivers provided by Be 14 require v2. Currently, the module returns B_ERROR when a MIDI device 15 is opened with v2. 16 17 For an example on how to use the MPU401 module in your own driver, 18 see the source code for the "emuxki" driver elsewhere in the source 19 tree. 20 21- **Clients without a BApplication.** Sometimes the midi_server's debug 22 output shows an "Application -1 not registered" error message. This 23 means it cannot figure out which app an incoming BMessage came from. 24 The server ignores those messages. 25 26 How can this happen? libmidi2 has two ways of sending messages to the 27 midi_server: it either expects a reply back or not. In the first 28 case, it is obvious to the midi_server what the reply address of the 29 message is. In the second case, even though it is not necessary for 30 the server to send a message back, it still uses the reply address to 31 determine which app the message came from. For this, BMessenger uses 32 be_app_messenger of the client app. 33 34 However, if the client app has no BApplication object, there is no 35 be_app_messenger either. Now, the midi_server cannot determine where 36 the message came from and will ignore it. Is this important? For 37 example, when such a client app Release()'s its endpoints, it sends a 38 message to the server without a return address. Now the server 39 ignores that message and does not remove the endpoint from the 40 roster. Of course, after the client app has died, the endpoints will 41 be removed eventually. Does all of this matter? Not really, because 42 only trivial apps will have no BApplication object. 43