Apple's MIDI over Bluetooth Spec?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Has anyone been able to get Apple's MIDI over Bluetooth Spec implemented and working?

My MIDI service and characteristic are there, and the iPad sees them, but it doesn't recognize it nor connect.

It might have something to do with LEGATTDB_PERM_RELIABLE_WRITE. Even though I don't specify reliable write in my characteristic, the iOS Bluetooth logs report the BCM20736 as having the extended prop "reliable write". Is there a way to force that permission to turn off?

Here's the relevant section in my GATT database:

// Handle : MIDI Service.

        PRIMARY_SERVICE_UUID128 (HANDLE_MIDI_SERVICE_UUID, UUID_MIDI_SERVICE),

// Handle : MIDI I/O Characteristic

CHARACTERISTIC_UUID128_WRITABLE ((HANDLE_MIDI_TX_VALUE_NOTIFY - 1), HANDLE_MIDI_TX_VALUE_NOTIFY, UUID_MIDI_CHARACTERISTIC,

                               LEGATTDB_CHAR_PROP_READ | LEGATTDB_CHAR_PROP_NOTIFY | LEGATTDB_CHAR_PROP_WRITE,

                               LEGATTDB_PERM_READABLE | LEGATTDB_PERM_WRITE_CMD, BLE_MAX_PACKET_LENGTH),

            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

            // for 20 chars long (Broadcom maximum):

            0x00,0x00,0x00,0x00,

CHAR_DESCRIPTOR_UUID16_WRITABLE (HANDLE_MIDI_CLIENT_CONFIGURATION_DESCRIPTOR,

                                         UUID_DESCRIPTOR_CLIENT_CHARACTERISTIC_CONFIGURATION,

                                         LEGATTDB_PERM_READABLE | LEGATTDB_PERM_WRITE_REQ, 2),

            0x00,0x00,

Not sure if I need the CHAR_DESCRIPTOR there to enable notifications?

Here's the relevant Bluetooth logs from the iOS device (full ones attached):

0x000F Primary Service  [ UUID: 03B80E5A-EDE8-4B33-A751-6CE34EC4C700, endHandle: 0x0013 ] ID: 0x00030001
0x0010 Characteristic   [ valueHandle: 0x0011, valueUUID: 7772E5DB-3868-4112-A1A9-F2669D106BF3 properties: read responseless-writes notify extended ]

0x0011 7772E5DB-3868-4112-A1A9- [ NULL ]

0x0012 Extended Properties  [ reliable-write ]

0x0013 Client Configuration [ none ]

Anyone have any theories of how to get rid of the "Extended Properties  [ reliable-write ]" part? Or is that even what would be messing it up? Other MIDI over BLE devices that DO work do not have that property.

Also, the Apple spec says the connection must be encrypted. Does this mean I should use LEGATTDB_PERM_AUTH_READABLE and LEGATTDB_PERM_AUTH_WRITABLE with LEGATTDB_CHAR_PROP_AUTHD_WRITES? Or does encryption work without those?

Thanks!

0 Likes
1 Solution
Anonymous
Not applicable

Hello Tyler,

We apologize for not implementing this feature in our BLE family of products.

Unfortunately, we have not implemented MIDI utilizing the Bluetooth Low Energy device family.

1.  From the Apple Developer Link: Technical Q&A QA1831: Adding Bluetooth LE MIDI Support

and reviewing the MIDI Specification https://developer.apple.com/bluetooth/Apple-Bluetooth-Low-Energy-MIDI-Specification.pdf I do see that MIDI is supported between two Apple BLE enabled devices.

2.  After reviewing the specification, it appears to be possible, but has not been implemented by our team.

3.  If this situation changes, we will inform you of our implementation.

Sincerely,

JT

View solution in original post

0 Likes
7 Replies
Anonymous
Not applicable

Hello Tyler,

Let me check with the developers.

Thanks

JT

0 Likes
Anonymous
Not applicable

What happens if you remove the CHAR_DESCRIPTOR altogether?  Based on the BLE MIDI spec from Apple it doesn't appear you need anything more than the characteristic.  As far as the encryption goes, the LEGATT attributes you list shouldn't be necessary either.  This should do it:

const BLE_PROFILE_CFG hello_sensor_cfg =

{

...

    /*.encr_required                  =*/ (SECURITY_ENABLED | SECURITY_REQUEST),    // data encrypted and device sends security request on every connection

...

};

(this is from the hello_sensor app)

0 Likes
Anonymous
Not applicable

Hello Tyler,

Sorry, the Apple's MIDI is not supported on the current device.

Thanks,

JT

0 Likes
Anonymous
Not applicable

Sorry, can you explain why? Is it because there's no MTU negotiation? Or no way to send multiple packets per connection interval? I'd like to know the challenges so I can try to figure out a workaround, or if it's not possible, do you have a chip that is compatible? We have customers who really want this feature...

0 Likes
Anonymous
Not applicable

Hello Tyler,

We apologize for not implementing this feature in our BLE family of products.

Unfortunately, we have not implemented MIDI utilizing the Bluetooth Low Energy device family.

1.  From the Apple Developer Link: Technical Q&A QA1831: Adding Bluetooth LE MIDI Support

and reviewing the MIDI Specification https://developer.apple.com/bluetooth/Apple-Bluetooth-Low-Energy-MIDI-Specification.pdf I do see that MIDI is supported between two Apple BLE enabled devices.

2.  After reviewing the specification, it appears to be possible, but has not been implemented by our team.

3.  If this situation changes, we will inform you of our implementation.

Sincerely,

JT

0 Likes
Anonymous
Not applicable

Ah, whew! I thought you meant it just wasn't possible to do for some reason. I didn't expect you guys to implement it - I'm doing that. I could just use some help on a couple of the finer points:

  1. Is is possible to do MTU negotiation with an iOS device, past the 21 bytes PDU size that is hardcoded in the Broadcom libraries?
  2. Is it possible to send multiple packets per connection interval?

Thanks!    

0 Likes
Anonymous
Not applicable

Hello Tyler,

Here are a few posts that may help you:

Any support for long characteristic value reads and writes by app?

Support for very large characteristics

Yes, it is possible to send multiple packets per connection interval.

Good luck with your App - Sounds cool!

Thanks

JT

0 Likes