summaryrefslogtreecommitdiff
path: root/Makefile.plugins
diff options
context:
space:
mode:
authorFelipe F. Tonello <eu@felipetonello.com>2017-01-03 17:30:06 +0000
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-01-04 12:05:14 +0200
commit5b8353e90e5bffd22e4c2cbc354b7c638c6bebd0 (patch)
treecbb95fae2e0d96ef95f6aeced594b97e71c9f32b /Makefile.plugins
parenta9c5bb9ff10072433dd63c1e2e6da9fd72de5f65 (diff)
downloadbluez-5b8353e90e5bffd22e4c2cbc354b7c638c6bebd0.tar.gz
profiles/midi: Added MIDI over BLE profile implementation
This plugin implements the Central role of MIDI over Bluetooth Low-Energy (BLE-MIDI) 1.0 specification as published by MMA in November/2015. It was implmemented as a bluetoothd plugin because of latency requirements of MIDI. There are still room for improvements on this regard. Like previsouly mentioned, it only implements the Central role, but since all parsing and state-machine code is in libmidi.[hc] it should be simple to implement the Peripheral role as a GATT service as well. Files added: * profiles/midi/midi.c: Actual GATT plugin * profiles/midi/libmidi.[ch]: MIDI parsers Techinal notes ============== This plugin doesn't require any new threads. It relies on notifications from a device to parse and render proper events that are queued in the kernel, causing no blocks at all. Even if an error occur, it will be handled and returned control to bluetoothd. It also adds a new file descriptor to be read using struct io. That is necessary to read events from applications and render raw BLE packets to be sent to the device with a write without response command. It doesn't block as well. This patch introduces ALSA as dependency. But this feature is disabled by default. To enable it, pass --enable-midi to the configure script. Even though this introduces ALSA dependency, it is not an audio plugin. It is rather a MIDI plugin, which is a byte stream protocol with low throughput but requires low-latency. Observations ============ I have tested on a normal laptop Arch-linux (x86_64) and a Raspberry Pi 2 (ARM Cortex-A8) and it works very well. As I mentioned, the latency can always be improved. I will still maintain a personal branch on my github[1] so others can contribute there and I can test before sending to BlueZ. IMPORTAT: the timestamp support is incomplete since ALSA doesn't support the way MIDI over BLE expects (asign timestamp to an event without scheduling). We are working on ALSA to support this. Credits ======= I would like to send kudos to ROLI Ltd. which allowed my to work on this as part of my full-time job. [1] https://github.com/ftonello/bluez/
Diffstat (limited to 'Makefile.plugins')
-rw-r--r--Makefile.plugins8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile.plugins b/Makefile.plugins
index 59342c0cb..3a9e27c65 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -95,6 +95,14 @@ builtin_sources += profiles/scanparam/scan.c
builtin_modules += deviceinfo
builtin_sources += profiles/deviceinfo/deviceinfo.c
+if MIDI
+builtin_modules += midi
+builtin_sources += profiles/midi/midi.c \
+ profiles/midi/libmidi.h \
+ profiles/midi/libmidi.c
+builtin_ldadd += @ALSA_LIBS@
+endif
+
if SIXAXIS
plugin_LTLIBRARIES += plugins/sixaxis.la
plugins_sixaxis_la_SOURCES = plugins/sixaxis.c