linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [RFC] Media API
Date: Mon, 4 Jan 2010 16:14:49 +0200	[thread overview]
Message-ID: <2d5a2c101001040614o6627985ei278805369290b1b0@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1571 bytes --]

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

[-- Attachment #2: 0002-Add-media-API.patch --]
[-- Type: text/x-patch, Size: 2710 bytes --]

From 600dcbc158d1ed2f9540c9b835d9c08789c2324c Mon Sep 17 00:00:00 2001
From: Luiz Augusto Von Dentz <luiz.dentz-von@nokia.com>
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


             reply	other threads:[~2010-01-04 14:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 14:14 Luiz Augusto von Dentz [this message]
2010-01-04 23:39 ` [RFC] Media API Marcel Holtmann
2010-01-28 13:54   ` Luiz Augusto von Dentz
2010-01-28 14:15     ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d5a2c101001040614o6627985ei278805369290b1b0@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).