Skip to contentSkip to conversation

android: Add initial Android Bluetooth Audio protocol API doc

PATCH In review Luiz Augusto von Dentz 2 participants 4 messages Dec 16, 2013 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH v2 1/1 android: Add initial Android Bluetooth Audio protocol API doc

From: Luiz Augusto von Dentz <[email protected]>

This IPC is used to communicate Android BlueZ daemon and AudioFlinger plugin.
---
v2: Rework IPC commands to match Android Audio HAL

 android/Makefile.am       |  3 +-
 android/audio-ipc-api.txt | 85 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 android/audio-ipc-api.txt
android/Makefile.am +2 -1
index 79f30d7..ac00bb2 100644
@@ -111,4 +111,5 @@ EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
 		android/pixit-gap.txt android/pixit-hid.txt \
 		android/pixit-opp.txt android/pixit-pan.txt \
 		android/pixit-pbap.txt android/pts-gap.txt android/pts-hid.txt \
-		android/pts-opp.txt android/pts-pbap.txt
+		android/pts-opp.txt android/pts-pbap.txt \
+		android/audio-ipc-api.txt
android/audio-ipc-api.txt new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw

Hi Luiz,

Quoted 51 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This IPC is used to communicate Android BlueZ daemon and AudioFlinger plugin.
---
v2: Rework IPC commands to match Android Audio HAL

 android/Makefile.am       |  3 +-
 android/audio-ipc-api.txt | 85 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 android/audio-ipc-api.txt
android/Makefile.am +2 -1
index 79f30d7..ac00bb2 100644
@@ -111,4 +111,5 @@ EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
                android/pixit-gap.txt android/pixit-hid.txt \
                android/pixit-opp.txt android/pixit-pan.txt \
                android/pixit-pbap.txt android/pts-gap.txt android/pts-hid.txt \
-               android/pts-opp.txt android/pts-pbap.txt
+               android/pts-opp.txt android/pts-pbap.txt \
+               android/audio-ipc-api.txt
android/audio-ipc-api.txt new file +22 -0
new file mode 100644
index 0000000..e9a2136
@@ -0,0 +1,85 @@
+Bluetooth Audio Plugin
+======================
+
+The audio plugin happen to be in a different socket but all the rules for
+HAL socket apply here as well, the abstract socket name is
+"\0bluez_audio_socket" (tentative):
+
+       .--Android--.                             .---Audio---.
+       |  daemon   |                             |   Plugin  |
+       |           |          Command            |           |
+       |           | <-------------------------- |           |
+       |           |                             |           |
+       |           | --------------------------> |           |
+       |           |          Response           |           |
+       |           |                             |           |
+       |           |                             |           |
+       |           |                             |           |
+       '-----------'                             '-----------'
+
+
+       Audio HAL                               Daemon
+       ----------------------------------------------------

android/audio-ipc-api.txt line 32

Quoted 10 lines
android/audio-ipc-api.txt new file +10 -0
+
+       call dev->open()                    --> command 0x01
+       return dev->open()                  <-- response 0x01
+
+       call dev->open_output_stream()      --> command 0x03
+       return dev->open_output_stream()    <-- response 0x03
+
+       call stream_in->read()              --> command 0x05
+       return stream_in->read()            <-- response 0x05
+

I think it should be stream_out->write() here.

android/audio-ipc-api.txt line 35

Quoted 3 lines
android/audio-ipc-api.txt new file +3 -0
+       call stream_in->common.standby()    --> command 0x06
+       return  stream_in->common.standby() <-- response 0x06
+

Also here: stream_out->common.standby()

Quoted 51 lines
android/audio-ipc-api.txt new file +50 -1
+       call dev->close_output_stream()     --> command 0x04
+       return dev->close_output_stream()   <-- response 0x04
+
+       call dev->close()                   --> command 0x02
+       return dev->close()                 <-- response 0x02
+
+Identifier: "audio" (BT_AUDIO_ID)
+
+       Opcode 0x00 - Error response
+
+               Response parameters: Status (1 octet)
+
+       Opcode 0x01 - Open Audio Endpoint commmand
+
+               Command parameters: Service UUID (16 octets)
+                                   Codec ID (1 octets)
+                                   Codec capabilities length (1 octets)
+                                   Codec capabilities (variable)
+                                   Number of codec presets (1 octets)
+                                   Codec preset # length (1 octets)
+                                   Codec preset # configuration (variable)
+                                   ...
+               Response parameters: Endpoint ID (1 octets)
+
+       Opcode 0x02 - Close Audio Endpoint command
+
+               Command parameters: Endpoint ID (1 octets)
+               Response parameters: <none>
+
+       Opcode 0x03 - Open Stream command
+
+               Command parameters: Endpoint ID (1 octets)
+               Response parameters: Codec configuration length (1 octets)
+                                    Codec configuration (1 octets)
+                                    File descriptor (inline)
+
+       Opcode 0x04 - Close Stream command
+
+               Command parameters: Endpoint ID (1 octets)
+               Response parameters: <none>
+
+       Opcode 0x05 - Resume Stream command
+
+               Command parameters: Endpoint ID (1 octets)
+               Response parameters: <none>
+
+       Opcode 0x06 - Suspend Stream command
+
+               Command parameters: Endpoint ID (1 octets)
+               Response parameters: <none>
--
Quoted 2 lines

1.8.3.1

Otherwise looks ok to me.

BR
Lukasz

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#2 lore raw

Hi Lukasz,

Quoted 68 lines · Lukasz Rymanowski

Hi Luiz,

Quoted 51 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This IPC is used to communicate Android BlueZ daemon and AudioFlinger plugin.
---
v2: Rework IPC commands to match Android Audio HAL

 android/Makefile.am       |  3 +-
 android/audio-ipc-api.txt | 85 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 android/audio-ipc-api.txt
android/Makefile.am +2 -1
index 79f30d7..ac00bb2 100644
@@ -111,4 +111,5 @@ EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
                android/pixit-gap.txt android/pixit-hid.txt \
                android/pixit-opp.txt android/pixit-pan.txt \
                android/pixit-pbap.txt android/pts-gap.txt android/pts-hid.txt \
-               android/pts-opp.txt android/pts-pbap.txt
+               android/pts-opp.txt android/pts-pbap.txt \
+               android/audio-ipc-api.txt
android/audio-ipc-api.txt new file +22 -0
new file mode 100644
index 0000000..e9a2136
@@ -0,0 +1,85 @@
+Bluetooth Audio Plugin
+======================
+
+The audio plugin happen to be in a different socket but all the rules for
+HAL socket apply here as well, the abstract socket name is
+"\0bluez_audio_socket" (tentative):
+
+       .--Android--.                             .---Audio---.
+       |  daemon   |                             |   Plugin  |
+       |           |          Command            |           |
+       |           | <-------------------------- |           |
+       |           |                             |           |
+       |           | --------------------------> |           |
+       |           |          Response           |           |
+       |           |                             |           |
+       |           |                             |           |
+       |           |                             |           |
+       '-----------'                             '-----------'
+
+
+       Audio HAL                               Daemon
+       ----------------------------------------------------

android/audio-ipc-api.txt line 32

Quoted 10 lines
android/audio-ipc-api.txt new file +10 -0
+
+       call dev->open()                    --> command 0x01
+       return dev->open()                  <-- response 0x01
+
+       call dev->open_output_stream()      --> command 0x03
+       return dev->open_output_stream()    <-- response 0x03
+
+       call stream_in->read()              --> command 0x05
+       return stream_in->read()            <-- response 0x05
+

I think it should be stream_out->write() here.

Quoted 4 lines

android/audio-ipc-api.txt line 35

Quoted 3 lines
android/audio-ipc-api.txt new file +3 -0
+       call stream_in->common.standby()    --> command 0x06
+       return  stream_in->common.standby() <-- response 0x06
+

Also here: stream_out->common.standby()

I guess it should work both ways, but perhaps Android is never meant to sink role nevertheless I would not limit the IPC to just source as it could be useful and it doesn't need that much to work.

Signature · 1 line
Luiz Augusto von Dentz
#3 lore raw

Hi Luiz,

Quoted 72 lines · Luiz Augusto von Dentz

Hi Lukasz,

Quoted 68 lines · Lukasz Rymanowski

Hi Luiz,

Quoted 51 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This IPC is used to communicate Android BlueZ daemon and AudioFlinger plugin.
---
v2: Rework IPC commands to match Android Audio HAL

 android/Makefile.am       |  3 +-
 android/audio-ipc-api.txt | 85 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 android/audio-ipc-api.txt
android/Makefile.am +2 -1
index 79f30d7..ac00bb2 100644
@@ -111,4 +111,5 @@ EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
                android/pixit-gap.txt android/pixit-hid.txt \
                android/pixit-opp.txt android/pixit-pan.txt \
                android/pixit-pbap.txt android/pts-gap.txt android/pts-hid.txt \
-               android/pts-opp.txt android/pts-pbap.txt
+               android/pts-opp.txt android/pts-pbap.txt \
+               android/audio-ipc-api.txt
android/audio-ipc-api.txt new file +22 -0
new file mode 100644
index 0000000..e9a2136
@@ -0,0 +1,85 @@
+Bluetooth Audio Plugin
+======================
+
+The audio plugin happen to be in a different socket but all the rules for
+HAL socket apply here as well, the abstract socket name is
+"\0bluez_audio_socket" (tentative):
+
+       .--Android--.                             .---Audio---.
+       |  daemon   |                             |   Plugin  |
+       |           |          Command            |           |
+       |           | <-------------------------- |           |
+       |           |                             |           |
+       |           | --------------------------> |           |
+       |           |          Response           |           |
+       |           |                             |           |
+       |           |                             |           |
+       |           |                             |           |
+       '-----------'                             '-----------'
+
+
+       Audio HAL                               Daemon
+       ----------------------------------------------------

android/audio-ipc-api.txt line 32

Quoted 10 lines
android/audio-ipc-api.txt new file +10 -0
+
+       call dev->open()                    --> command 0x01
+       return dev->open()                  <-- response 0x01
+
+       call dev->open_output_stream()      --> command 0x03
+       return dev->open_output_stream()    <-- response 0x03
+
+       call stream_in->read()              --> command 0x05
+       return stream_in->read()            <-- response 0x05
+

I think it should be stream_out->write() here.

Quoted 9 lines
Quoted 4 lines

android/audio-ipc-api.txt line 35

Quoted 3 lines
android/audio-ipc-api.txt new file +3 -0
+       call stream_in->common.standby()    --> command 0x06
+       return  stream_in->common.standby() <-- response 0x06
+

Also here: stream_out->common.standby()

I guess it should work both ways, but perhaps Android is never meant to sink role nevertheless I would not limit the IPC to just source as it could be useful and it doesn't need that much to work.

I agree that it should work for stream in as well, and actually I can imagine product based on Android acting as SINK on A2DP. Anyway, maybe it would be better to point it out directly and keep HAL calls example for stream out.

/Łukasz

Quoted 2 lines

--
Luiz Augusto von Dentz