Hi, The idea is to complete replace the existing audio IPC with DBus. Johan and I discussed this a few times in the past and today we finally archive something, so here are some design choices so far: 1. Codec capabilities and configuration are blobs (array of bytes or 'ay'), so there is no attempt to format codec structures into dbus structures, this make it easier for both end points as well as bluetoothd and also enables proprietary codecs. (suggested by Marcel in the last BlueZ meeting) 2. The spec is not a2dp specific. So it should be possible to register end points for HFP and VDP. 3. There is no representation of remote end points, so end points in this spec always refer to local end points. This is to minimize object creation, which adds more round trips not necessary with the current design as capabilities is now fully available to bluetoothd. 4. Stream object is the only new object which is created by bluetoothd, this is necessary so end point process can pull the file descriptor from bluetoothd. Note that Acquire/Release should works differently depending on the profile, for A2DP it actually resume/start the stream on Acquire and suspend/stop the stream on Release while for HFP it should open sco socket on Acquire and closes it on Release. 5. Stream.Acquire will return an error if the StreamEndPoint.SetConfiguration has not returned yet, this is to avoid any chance of a process block waiting the Acquire reply while SetConfigure is in place. -- Luiz Augusto von Dentz Engenheiro de Computação
From 600dcbc158d1ed2f9540c9b835d9c08789c2324c Mon Sep 17 00:00:00 2001 From: Luiz Augusto Von Dentz <luiz.dentz-von@xxxxxxxxx> Date: Mon, 4 Jan 2010 14:51:28 +0200 Subject: [PATCH 2/2] Add media API Media API is a replacement for the internal audio IPC which is no longer necessary as DBUS 1.4 and newer are capable of tranfering file descriptors. --- doc/audio-api.txt | 16 +++++++++++++++ doc/media-api.txt | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 0 deletions(-) create mode 100644 doc/media-api.txt diff --git a/doc/audio-api.txt b/doc/audio-api.txt index 1f09cd5..59efdc8 100644 --- a/doc/audio-api.txt +++ b/doc/audio-api.txt @@ -456,3 +456,19 @@ properties boolean Connected [readonly] uint16 MicrophoneGain [readonly] The speaker gain when available. + +Stream hierarchy +================ + +Service org.bluez +Interface org.bluez.Stream +Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/streamX + +Methods int Acquire(object endpoint) + + Acquire stream file descriptor using end point type + property as access type. + + void Release(object endpoint) + + Releases file descriptor diff --git a/doc/media-api.txt b/doc/media-api.txt new file mode 100644 index 0000000..9818cda --- /dev/null +++ b/doc/media-api.txt @@ -0,0 +1,55 @@ +BlueZ D-Bus Media API description +********************************* + +Media hierarchy +=============== + +Service org.bluez +Interface org.bluez.Media +Object path [variable prefix]/{hci0,hci1,...} + +Methods void RegisterStreamEndPoint(object endpoint, dict properties) + + Register a local end point to sender, the sender can + register as many end points as it likes. + + Note: If the sender disconnects the end points are + automatically unregistered. + + void UnregisterStreamEndPoint(object endpoint) + + Unregister sender end point + +StreamEndPoint hierarchy +======================== + +Service unique name +Interface org.bluez.StreamEndPoint +Object path freely definable + +Methods dict GetProperties() + + Returns all properties for the interface. See the + properties section for available properties. + + void SetConfiguration(object stream, array{bytes} configuration) + + Set configuration for the stream + + void ClearConfiguration() + + Clear any configuration set. + +Properties string Media [readonly] + + Possible values: "audio" or "video" + + string Type [readonly] + + Possible values: "source", "sink" or "?" + + array{bytes} Capabilities [readonly] + + Capabilities blob as in avdtp spec. This is copied as + it is to avdtp GET_CAPABILITIES command, so the size + and byte order must match. -- 1.6.3.3