bluez5: implement Bluetooth MIDI nodes

Implement BLE MIDI node, providing an input and output port.  MIDI data
received is normalized and produced on output port.  Data from input
port is converted to BLE MIDI and sent to the device.

Event timestamps come from device clock, whose offset to wall clock we
determine by correlating packet reception times with their timestamps.
The jitter in packet reception is likely much larger than device clock
error, so we average over that.
This commit is contained in:
Pauli Virtanen 2022-10-30 16:54:57 +02:00 committed by Wim Taymans
parent fe3ca50818
commit fe11bfdba0
3 changed files with 1912 additions and 0 deletions

View file

@ -33,6 +33,7 @@ bluez5_sources = [
'dbus-monitor.c', 'dbus-monitor.c',
'midi-enum.c', 'midi-enum.c',
'midi-parser.c', 'midi-parser.c',
'midi-node.c',
] ]
bluez5_data = ['bluez-hardware.conf'] bluez5_data = ['bluez-hardware.conf']

File diff suppressed because it is too large Load diff

View file

@ -36,6 +36,7 @@ extern const struct spa_handle_factory spa_sco_source_factory;
extern const struct spa_handle_factory spa_a2dp_sink_factory; extern const struct spa_handle_factory spa_a2dp_sink_factory;
extern const struct spa_handle_factory spa_a2dp_source_factory; extern const struct spa_handle_factory spa_a2dp_source_factory;
extern const struct spa_handle_factory spa_bluez5_midi_enum_factory; extern const struct spa_handle_factory spa_bluez5_midi_enum_factory;
extern const struct spa_handle_factory spa_bluez5_midi_node_factory;
SPA_EXPORT SPA_EXPORT
int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
@ -71,6 +72,9 @@ int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t
case 8: case 8:
*factory = &spa_bluez5_midi_enum_factory; *factory = &spa_bluez5_midi_enum_factory;
break; break;
case 9:
*factory = &spa_bluez5_midi_node_factory;
break;
default: default:
return 0; return 0;
} }