From b8a407aa8470ad8d92d9142edb41c17548b0cb2c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 10 Apr 2007 21:37:24 +0000 Subject: Add first step of ALSA plugin integration --- audio/ipc.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 audio/ipc.h (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h new file mode 100644 index 00000000..5b545844 --- /dev/null +++ b/audio/ipc.h @@ -0,0 +1,43 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2004-2007 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include + +#define IPC_TYPE_CONNECT 0x0001 + +struct ipc_hdr { + uint16_t id; + uint16_t type; + uint16_t seqnum; + uint16_t length; +} __attribute__ ((packed)); + +struct ipc_connect_cmd { + uint8_t src[6]; + uint8_t dst[6]; + uint16_t uuid; +} __attribute__ ((packed)); + +struct ipc_connect_evt { + uint16_t id; +} __attribute__ ((packed)); -- cgit From d2d76421ad539e2c6da87e4b4fd2a42493053f49 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sat, 26 May 2007 17:17:34 +0000 Subject: Move unix socket functionality into unix.c --- audio/ipc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 5b545844..8de85531 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -25,6 +25,8 @@ #define IPC_TYPE_CONNECT 0x0001 +#define IPC_SOCKET_NAME "/org/bluez/audio" + struct ipc_hdr { uint16_t id; uint16_t type; -- cgit From e343f2b21a2209d5713e20ad38bbcc862897380b Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sat, 26 May 2007 21:12:20 +0000 Subject: Move more common stuff to ipc.h --- audio/ipc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 8de85531..038ec4d9 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -25,7 +25,11 @@ #define IPC_TYPE_CONNECT 0x0001 -#define IPC_SOCKET_NAME "/org/bluez/audio" +#define IPC_SOCKET_NAME "\0/org/bluez/audio" + +#ifndef UNIX_PATH_MAX +#define UNIX_PATH_MAX 108 +#endif struct ipc_hdr { uint16_t id; -- cgit From 0dd153779d22cbce13c03b56b848fac8203b42d7 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sat, 26 May 2007 22:18:10 +0000 Subject: Remove initial nul from the socket name define since the snprintf's take care of not touching the first byte of the socket name --- audio/ipc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 038ec4d9..119aa7b3 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -25,7 +25,7 @@ #define IPC_TYPE_CONNECT 0x0001 -#define IPC_SOCKET_NAME "\0/org/bluez/audio" +#define IPC_SOCKET_NAME "/org/bluez/audio" #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 108 -- cgit From a551604373fc46741c44524b01353d50852b26f4 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 4 Jun 2007 22:03:21 +0000 Subject: Add experiemental code for audio service ipc. --- audio/ipc.h | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 11 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 119aa7b3..e6859a50 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -31,19 +31,71 @@ #define UNIX_PATH_MAX 108 #endif -struct ipc_hdr { - uint16_t id; - uint16_t type; - uint16_t seqnum; - uint16_t length; +/* Supported roles */ +#define PKT_ROLE_NONE 0 +#define PKT_ROLE_AUTO 1 +#define PKT_ROLE_VOICE 2 +#define PKT_ROLE_HIFI 3 + +/* Packet types */ +#define PKT_TYPE_CFG_REQ 0 +#define PKT_TYPE_CFG_RSP 1 +#define PKT_TYPE_STATUS_REQ 3 +#define PKT_TYPE_STATUS_RSP 4 +#define PKT_TYPE_CTL_REQ 5 +#define PKT_TYPE_CTL_RSP 6 + +/* Errors codes */ +#define PKT_ERROR_NONE 0 + +struct ipc_packet { + uint8_t id; /* Device id */ + uint8_t role; /* Audio role eg: voice, wifi, auto... */ + uint8_t type; /* Packet type */ + uint8_t error; /* Packet error code */ + uint8_t length; /* Payload length in bytes */ + uint8_t data[0]; /* Packet payload */ } __attribute__ ((packed)); -struct ipc_connect_cmd { - uint8_t src[6]; - uint8_t dst[6]; - uint16_t uuid; +/* File descriptor options */ +#define CFG_FD_OPT_READ 0 +#define CFG_FD_OPT_WRITE 1 +#define CFG_FD_OPT_READWRITE 2 + +struct ipc_data_cfg { + int fd; /* Stream file descriptor */ + uint8_t fd_opt; /* Stream file descriptor options: read, write or readwrite*/ + uint8_t encoding; /* Stream encoding */ + uint8_t bitpool; /* Encoding bitpool */ + uint8_t channels; /* Number of audio channel */ + uint16_t rate; /* Stream sample rate */ } __attribute__ ((packed)); -struct ipc_connect_evt { - uint16_t id; +/* Device status */ +#define STATUS_DISCONNECTED 0 +#define STATUS_CONNECTING 1 +#define STATUS_CONNECTED 2 +#define STATUS_STREAMING 3 + +struct ipc_data_status { + uint8_t status; /* Stream status */ } __attribute__ ((packed)); + +/* Supported control operations */ +#define DATA_CTL_POWER 0x40 +#define DATA_CTL_VOL_UP 0x41 +#define DATA_CTL_VOL_DOWN 0x42 +#define DATA_CTL_MUTE 0x43 +#define DATA_CTL_PLAY 0x44 +#define DATA_CTL_STOP 0x45 +#define DATA_CTL_PAUSE 0x46 +#define DATA_CTL_RECORD 0x47 +#define DATA_CTL_REWIND 0x48 +#define DATA_CTL_FAST_FORWARD 0x49 +#define DATA_CTL_EJECT 0x4A +#define DATA_CTL_FORWARD 0x4B +#define DATA_CTL_BACKWARD 0x4C + +struct ipc_data_ctl { + uint8_t operation; /* Operation ID */ +} __attribute__ ((packed)); -- cgit From 8742ce7c3e92a57cde47481281a4928f8d41a771 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 5 Jun 2007 22:44:36 +0000 Subject: Experiemental code for alsa plugin and ipc. --- audio/ipc.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index e6859a50..0cd9e620 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -40,10 +40,10 @@ /* Packet types */ #define PKT_TYPE_CFG_REQ 0 #define PKT_TYPE_CFG_RSP 1 -#define PKT_TYPE_STATUS_REQ 3 -#define PKT_TYPE_STATUS_RSP 4 -#define PKT_TYPE_CTL_REQ 5 -#define PKT_TYPE_CTL_RSP 6 +#define PKT_TYPE_STATUS_REQ 2 +#define PKT_TYPE_STATUS_RSP 3 +#define PKT_TYPE_CTL_REQ 4 +#define PKT_TYPE_CTL_RSP 5 /* Errors codes */ #define PKT_ERROR_NONE 0 @@ -68,6 +68,8 @@ struct ipc_data_cfg { uint8_t encoding; /* Stream encoding */ uint8_t bitpool; /* Encoding bitpool */ uint8_t channels; /* Number of audio channel */ + uint8_t pkt_len; /* Stream packet length */ + uint8_t sample_size; /* Sample size in bytes */ uint16_t rate; /* Stream sample rate */ } __attribute__ ((packed)); -- cgit From ddf8edc54d666f9b6f75f28b6db5375e2f0982a8 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 11 Jun 2007 23:26:24 +0000 Subject: Fix file descriptor passing. --- audio/ipc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 0cd9e620..409abfda 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -25,7 +25,7 @@ #define IPC_TYPE_CONNECT 0x0001 -#define IPC_SOCKET_NAME "/org/bluez/audio" +#define IPC_SOCKET_NAME "\0/org/bluez/audio" #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 108 -- cgit From 5ed2a3ba745856206c66d8ecb98afb8a1f9ec7b5 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 14 Jun 2007 20:36:26 +0000 Subject: Initial support for audio control plugin and some code cleanups. --- audio/ipc.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 409abfda..d340d15e 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -44,6 +44,7 @@ #define PKT_TYPE_STATUS_RSP 3 #define PKT_TYPE_CTL_REQ 4 #define PKT_TYPE_CTL_RSP 5 +#define PKT_TYPE_CTL_NTFY 6 /* Errors codes */ #define PKT_ERROR_NONE 0 @@ -83,21 +84,26 @@ struct ipc_data_status { uint8_t status; /* Stream status */ } __attribute__ ((packed)); +#define CTL_MODE_PLAYBACK 0 +#define CTL_MODE_CAPTURE 1 +#define CTL_MODE_GENERAL 2 + /* Supported control operations */ -#define DATA_CTL_POWER 0x40 -#define DATA_CTL_VOL_UP 0x41 -#define DATA_CTL_VOL_DOWN 0x42 -#define DATA_CTL_MUTE 0x43 -#define DATA_CTL_PLAY 0x44 -#define DATA_CTL_STOP 0x45 -#define DATA_CTL_PAUSE 0x46 -#define DATA_CTL_RECORD 0x47 -#define DATA_CTL_REWIND 0x48 -#define DATA_CTL_FAST_FORWARD 0x49 -#define DATA_CTL_EJECT 0x4A -#define DATA_CTL_FORWARD 0x4B -#define DATA_CTL_BACKWARD 0x4C +#define CTL_KEY_POWER 0x40 +#define CTL_KEY_VOL_UP 0x41 +#define CTL_KEY_VOL_DOWN 0x42 +#define CTL_KEY_MUTE 0x43 +#define CTL_KEY_PLAY 0x44 +#define CTL_KEY_STOP 0x45 +#define CTL_KEY_PAUSE 0x46 +#define CTL_KEY_RECORD 0x47 +#define CTL_KEY_REWIND 0x48 +#define CTL_KEY_FAST_FORWARD 0x49 +#define CTL_KEY_EJECT 0x4A +#define CTL_KEY_FORWARD 0x4B +#define CTL_KEY_BACKWARD 0x4C struct ipc_data_ctl { - uint8_t operation; /* Operation ID */ + uint8_t mode; /* Control Mode */ + uint8_t key; /* Control Key */ } __attribute__ ((packed)); -- cgit From 66d48b0ac25c85de354f26782a377d0ad91bd322 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 10 Jul 2007 13:34:57 +0000 Subject: Code cleanup. --- audio/ipc.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index d340d15e..e56dca24 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -40,8 +40,8 @@ /* Packet types */ #define PKT_TYPE_CFG_REQ 0 #define PKT_TYPE_CFG_RSP 1 -#define PKT_TYPE_STATUS_REQ 2 -#define PKT_TYPE_STATUS_RSP 3 +#define PKT_TYPE_STATE_REQ 2 +#define PKT_TYPE_STATE_RSP 3 #define PKT_TYPE_CTL_REQ 4 #define PKT_TYPE_CTL_RSP 5 #define PKT_TYPE_CTL_NTFY 6 @@ -75,13 +75,14 @@ struct ipc_data_cfg { } __attribute__ ((packed)); /* Device status */ -#define STATUS_DISCONNECTED 0 -#define STATUS_CONNECTING 1 -#define STATUS_CONNECTED 2 -#define STATUS_STREAMING 3 +#define STATE_DISCONNECTED 0 +#define STATE_CONNECTING 1 +#define STATE_CONNECTED 2 +#define STATE_STREAM_STARTING 3 +#define STATE_STREAMING 4 -struct ipc_data_status { - uint8_t status; /* Stream status */ +struct ipc_data_state { + uint8_t state; /* Stream state */ } __attribute__ ((packed)); #define CTL_MODE_PLAYBACK 0 -- cgit From 6763ebb3c231740c66a235f94d56e8d8cc213d90 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sat, 11 Aug 2007 11:05:24 +0000 Subject: Integrate A2DP work from Johan's and Luiz's GIT trees --- audio/ipc.h | 106 ++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 39 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index e56dca24..bd31abbc 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -20,11 +20,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ +#ifndef __AUDIO_IPC_H__ +#define __AUDIO_IPC_H__ #include #define IPC_TYPE_CONNECT 0x0001 +#define IPC_MTU 32 + #define IPC_SOCKET_NAME "\0/org/bluez/audio" #ifndef UNIX_PATH_MAX @@ -32,22 +36,22 @@ #endif /* Supported roles */ -#define PKT_ROLE_NONE 0 -#define PKT_ROLE_AUTO 1 -#define PKT_ROLE_VOICE 2 -#define PKT_ROLE_HIFI 3 +#define PKT_ROLE_NONE 0 +#define PKT_ROLE_AUTO 1 +#define PKT_ROLE_VOICE 2 +#define PKT_ROLE_HIFI 3 /* Packet types */ -#define PKT_TYPE_CFG_REQ 0 -#define PKT_TYPE_CFG_RSP 1 -#define PKT_TYPE_STATE_REQ 2 -#define PKT_TYPE_STATE_RSP 3 -#define PKT_TYPE_CTL_REQ 4 -#define PKT_TYPE_CTL_RSP 5 -#define PKT_TYPE_CTL_NTFY 6 +#define PKT_TYPE_CFG_REQ 0 +#define PKT_TYPE_CFG_RSP 1 +#define PKT_TYPE_STATE_REQ 2 +#define PKT_TYPE_STATE_RSP 3 +#define PKT_TYPE_CTL_REQ 4 +#define PKT_TYPE_CTL_RSP 5 +#define PKT_TYPE_CTL_NTFY 6 /* Errors codes */ -#define PKT_ERROR_NONE 0 +#define PKT_ERROR_NONE 0 struct ipc_packet { uint8_t id; /* Device id */ @@ -59,52 +63,76 @@ struct ipc_packet { } __attribute__ ((packed)); /* File descriptor options */ -#define CFG_FD_OPT_READ 0 -#define CFG_FD_OPT_WRITE 1 -#define CFG_FD_OPT_READWRITE 2 +#define CFG_FD_OPT_READ 0 +#define CFG_FD_OPT_WRITE 1 +#define CFG_FD_OPT_READWRITE 2 + +/* Audio channel mode */ +#define CFG_CHANNEL_MODE_MONO (1 << 3) +#define CFG_CHANNEL_MODE_DUAL_CHANNEL (1 << 2) +#define CFG_CHANNEL_MODE_STEREO (1 << 1) +#define CFG_CHANNEL_MODE_JOINT_STEREO 1 + +/* Codec options */ +#define CFG_CODEC_NONE 0 +#define CFG_CODEC_SBC 1 struct ipc_data_cfg { int fd; /* Stream file descriptor */ uint8_t fd_opt; /* Stream file descriptor options: read, write or readwrite*/ - uint8_t encoding; /* Stream encoding */ - uint8_t bitpool; /* Encoding bitpool */ uint8_t channels; /* Number of audio channel */ - uint8_t pkt_len; /* Stream packet length */ + uint8_t channel_mode; /* Audio channel mode*/ + uint16_t pkt_len; /* Stream packet length */ uint8_t sample_size; /* Sample size in bytes */ uint16_t rate; /* Stream sample rate */ + uint8_t codec; /* Stream codec */ + uint8_t data[0]; /* Codec payload */ +} __attribute__ ((packed)); + +/* SBC codec options */ +#define CODEC_SBC_ALLOCATION_SNR (1 << 1) +#define CODEC_SBC_ALLOCATION_LOUDNESS 1 + +struct ipc_codec_sbc { + uint8_t allocation; + uint8_t subbands; + uint8_t blocks; + uint8_t bitpool; } __attribute__ ((packed)); /* Device status */ -#define STATE_DISCONNECTED 0 -#define STATE_CONNECTING 1 -#define STATE_CONNECTED 2 -#define STATE_STREAM_STARTING 3 -#define STATE_STREAMING 4 +#define STATE_DISCONNECTED 0 +#define STATE_CONNECTING 1 +#define STATE_CONNECTED 2 +#define STATE_STREAM_STARTING 3 +#define STATE_STREAMING 4 struct ipc_data_state { uint8_t state; /* Stream state */ } __attribute__ ((packed)); -#define CTL_MODE_PLAYBACK 0 -#define CTL_MODE_CAPTURE 1 -#define CTL_MODE_GENERAL 2 +#define CTL_MODE_PLAYBACK 0 +#define CTL_MODE_CAPTURE 1 +#define CTL_MODE_GENERAL 2 /* Supported control operations */ -#define CTL_KEY_POWER 0x40 -#define CTL_KEY_VOL_UP 0x41 -#define CTL_KEY_VOL_DOWN 0x42 -#define CTL_KEY_MUTE 0x43 -#define CTL_KEY_PLAY 0x44 -#define CTL_KEY_STOP 0x45 -#define CTL_KEY_PAUSE 0x46 -#define CTL_KEY_RECORD 0x47 -#define CTL_KEY_REWIND 0x48 -#define CTL_KEY_FAST_FORWARD 0x49 -#define CTL_KEY_EJECT 0x4A -#define CTL_KEY_FORWARD 0x4B -#define CTL_KEY_BACKWARD 0x4C +#define CTL_KEY_POWER 0x40 +#define CTL_KEY_VOL_UP 0x41 +#define CTL_KEY_VOL_DOWN 0x42 +#define CTL_KEY_MUTE 0x43 +#define CTL_KEY_PLAY 0x44 +#define CTL_KEY_STOP 0x45 +#define CTL_KEY_PAUSE 0x46 +#define CTL_KEY_RECORD 0x47 +#define CTL_KEY_REWIND 0x48 +#define CTL_KEY_FAST_FORWARD 0x49 +#define CTL_KEY_EJECT 0x4A +#define CTL_KEY_FORWARD 0x4B +#define CTL_KEY_BACKWARD 0x4C struct ipc_data_ctl { uint8_t mode; /* Control Mode */ uint8_t key; /* Control Key */ } __attribute__ ((packed)); + +#endif -- cgit From 9494c146cec1df466c2f331957748beeac8d745a Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sat, 11 Aug 2007 15:52:27 +0000 Subject: Remove redundant stream fd from config response --- audio/ipc.h | 1 - 1 file changed, 1 deletion(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index bd31abbc..473efc05 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -78,7 +78,6 @@ struct ipc_packet { #define CFG_CODEC_SBC 1 struct ipc_data_cfg { - int fd; /* Stream file descriptor */ uint8_t fd_opt; /* Stream file descriptor options: read, write or readwrite*/ uint8_t channels; /* Number of audio channel */ uint8_t channel_mode; /* Audio channel mode*/ -- cgit From c2833e263d6cfc4cf82f4bfdcc59640a4071aeae Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 13 Aug 2007 08:14:22 +0000 Subject: Remove ifndef protections and includes from .h files --- audio/ipc.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 473efc05..77997496 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -20,10 +20,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ -#ifndef __AUDIO_IPC_H__ -#define __AUDIO_IPC_H__ - -#include #define IPC_TYPE_CONNECT 0x0001 @@ -78,7 +74,8 @@ struct ipc_packet { #define CFG_CODEC_SBC 1 struct ipc_data_cfg { - uint8_t fd_opt; /* Stream file descriptor options: read, write or readwrite*/ + uint8_t fd_opt; /* Stream file descriptor options: read, + write or readwrite */ uint8_t channels; /* Number of audio channel */ uint8_t channel_mode; /* Audio channel mode*/ uint16_t pkt_len; /* Stream packet length */ @@ -133,5 +130,3 @@ struct ipc_data_ctl { uint8_t mode; /* Control Mode */ uint8_t key; /* Control Key */ } __attribute__ ((packed)); - -#endif -- cgit From 73b35c403df78c10e03ded497fcb16fcb23b822e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 22 Aug 2007 21:50:59 +0000 Subject: Add skeleton for an A2DP sink element --- audio/ipc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 77997496..27ee742c 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -21,6 +21,8 @@ * */ +#include + #define IPC_TYPE_CONNECT 0x0001 #define IPC_MTU 32 -- cgit From 92f94938b981fe6a892e365670d5fa4d58c94283 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 23 Aug 2007 23:37:15 +0000 Subject: Add support for ALSA parameters --- audio/ipc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 27ee742c..7eb6e398 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -22,6 +22,7 @@ */ #include +#include #define IPC_TYPE_CONNECT 0x0001 @@ -34,10 +35,9 @@ #endif /* Supported roles */ -#define PKT_ROLE_NONE 0 -#define PKT_ROLE_AUTO 1 -#define PKT_ROLE_VOICE 2 -#define PKT_ROLE_HIFI 3 +#define PKT_ROLE_AUTO 0 +#define PKT_ROLE_VOICE 1 +#define PKT_ROLE_HIFI 2 /* Packet types */ #define PKT_TYPE_CFG_REQ 0 @@ -52,7 +52,7 @@ #define PKT_ERROR_NONE 0 struct ipc_packet { - uint8_t id; /* Device id */ + bdaddr_t bdaddr; /* Address of the remote Device */ uint8_t role; /* Audio role eg: voice, wifi, auto... */ uint8_t type; /* Packet type */ uint8_t error; /* Packet error code */ -- cgit From 97c120e3f1425d9c431c12167ca4684a0af5f844 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Aug 2007 17:46:57 +0000 Subject: Use device string for the IPC --- audio/ipc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 7eb6e398..5279fa2a 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -22,7 +22,6 @@ */ #include -#include #define IPC_TYPE_CONNECT 0x0001 @@ -52,7 +51,7 @@ #define PKT_ERROR_NONE 0 struct ipc_packet { - bdaddr_t bdaddr; /* Address of the remote Device */ + char device[18]; /* Address of the remote Device */ uint8_t role; /* Audio role eg: voice, wifi, auto... */ uint8_t type; /* Packet type */ uint8_t error; /* Packet error code */ -- cgit From b2906c4c6688ad681ea948f58d1b78b71f8f5622 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Aug 2007 18:05:37 +0000 Subject: Increase the IPC MTU size --- audio/ipc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 5279fa2a..2043b761 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -25,7 +25,7 @@ #define IPC_TYPE_CONNECT 0x0001 -#define IPC_MTU 32 +#define IPC_MTU 128 #define IPC_SOCKET_NAME "\0/org/bluez/audio" -- cgit From f803f3511095e17811c50ebc85971ddd40c55618 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 29 Aug 2007 23:44:03 +0000 Subject: Fix the ALSA plugin parameter mess --- audio/ipc.h | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 2043b761..1c26e304 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -60,36 +60,38 @@ struct ipc_packet { } __attribute__ ((packed)); /* File descriptor options */ -#define CFG_FD_OPT_READ 0 -#define CFG_FD_OPT_WRITE 1 -#define CFG_FD_OPT_READWRITE 2 +#define CFG_FD_OPT_READ 0 +#define CFG_FD_OPT_WRITE 1 +#define CFG_FD_OPT_READWRITE 2 /* Audio channel mode */ -#define CFG_CHANNEL_MODE_MONO (1 << 3) -#define CFG_CHANNEL_MODE_DUAL_CHANNEL (1 << 2) -#define CFG_CHANNEL_MODE_STEREO (1 << 1) -#define CFG_CHANNEL_MODE_JOINT_STEREO 1 +#define CFG_MODE_AUTO 0 +#define CFG_MODE_MONO 1 +#define CFG_MODE_DUAL_CHANNEL 2 +#define CFG_MODE_STEREO 3 +#define CFG_MODE_JOINT_STEREO 4 + +/* Allocation method */ +#define CFG_ALLOCATION_AUTO 0 +#define CFG_ALLOCATION_LOUDNESS 1 +#define CFG_ALLOCATION_SNR 2 /* Codec options */ -#define CFG_CODEC_NONE 0 -#define CFG_CODEC_SBC 1 +#define CFG_CODEC_NONE 0 +#define CFG_CODEC_SCO 1 +#define CFG_CODEC_SBC 2 struct ipc_data_cfg { - uint8_t fd_opt; /* Stream file descriptor options: read, + uint8_t fd_opt; /* Stream file descriptor options: read, write or readwrite */ - uint8_t channels; /* Number of audio channel */ - uint8_t channel_mode; /* Audio channel mode*/ uint16_t pkt_len; /* Stream packet length */ - uint8_t sample_size; /* Sample size in bytes */ + uint8_t sample_size; /* Sample size in bytes */ + uint8_t mode; /* Audio channel mode */ uint16_t rate; /* Stream sample rate */ - uint8_t codec; /* Stream codec */ - uint8_t data[0]; /* Codec payload */ + uint8_t codec; /* Stream codec */ + uint8_t data[0]; /* Codec payload */ } __attribute__ ((packed)); -/* SBC codec options */ -#define CODEC_SBC_ALLOCATION_SNR (1 << 1) -#define CODEC_SBC_ALLOCATION_LOUDNESS 1 - struct ipc_codec_sbc { uint8_t allocation; uint8_t subbands; -- cgit From d4e24bf6a3d8af6479abce92fbbf1869a59669aa Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 21 Nov 2007 20:24:11 +0000 Subject: Integrate new ipc API implementation. --- audio/ipc.h | 367 ++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 260 insertions(+), 107 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 1c26e304..0384cfd6 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -4,132 +4,285 @@ * * Copyright (C) 2004-2007 Marcel Holtmann * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ -#include +/* + Message sequence chart of streaming sequence for A2DP transport + + Audio daemon User + on snd_pcm_open + <--BT_GETCAPABILITIES_REQ + + BT_GETCAPABILITIES_RSP--> + + on snd_pcm_hw_params + <--BT_SETCONFIGURATION_REQ + + BT_SETCONFIGURATION_RSP--> + + on snd_pcm_prepare + <--BT_STREAMSTART_REQ + + + BT_STREAMSTART_RSP--> -#define IPC_TYPE_CONNECT 0x0001 + BT_STREAMFD_IND --> -#define IPC_MTU 128 + < streams data > + .......... -#define IPC_SOCKET_NAME "\0/org/bluez/audio" + on snd_pcm_drop/snd_pcm_drain -#ifndef UNIX_PATH_MAX -#define UNIX_PATH_MAX 108 + <--BT_STREAMSTOP_REQ + + + BT_STREAMSTOP_RSP--> + + on IPC close or appl crash + + + */ + +#ifndef BT_AUDIOCLIENT_H +#define BT_AUDIOCLIENT_H + +#ifdef __cplusplus +extern "C" { #endif -/* Supported roles */ -#define PKT_ROLE_AUTO 0 -#define PKT_ROLE_VOICE 1 -#define PKT_ROLE_HIFI 2 - -/* Packet types */ -#define PKT_TYPE_CFG_REQ 0 -#define PKT_TYPE_CFG_RSP 1 -#define PKT_TYPE_STATE_REQ 2 -#define PKT_TYPE_STATE_RSP 3 -#define PKT_TYPE_CTL_REQ 4 -#define PKT_TYPE_CTL_RSP 5 -#define PKT_TYPE_CTL_NTFY 6 - -/* Errors codes */ -#define PKT_ERROR_NONE 0 - -struct ipc_packet { - char device[18]; /* Address of the remote Device */ - uint8_t role; /* Audio role eg: voice, wifi, auto... */ - uint8_t type; /* Packet type */ - uint8_t error; /* Packet error code */ - uint8_t length; /* Payload length in bytes */ - uint8_t data[0]; /* Packet payload */ -} __attribute__ ((packed)); +#include +#include +#include +#include +#include +#include + +#define BT_AUDIO_IPC_PACKET_SIZE 128 +#define BT_IPC_SOCKET_NAME "\0/org/bluez/audio" -/* File descriptor options */ -#define CFG_FD_OPT_READ 0 -#define CFG_FD_OPT_WRITE 1 -#define CFG_FD_OPT_READWRITE 2 - -/* Audio channel mode */ -#define CFG_MODE_AUTO 0 -#define CFG_MODE_MONO 1 -#define CFG_MODE_DUAL_CHANNEL 2 -#define CFG_MODE_STEREO 3 -#define CFG_MODE_JOINT_STEREO 4 - -/* Allocation method */ -#define CFG_ALLOCATION_AUTO 0 -#define CFG_ALLOCATION_LOUDNESS 1 -#define CFG_ALLOCATION_SNR 2 - -/* Codec options */ -#define CFG_CODEC_NONE 0 -#define CFG_CODEC_SCO 1 -#define CFG_CODEC_SBC 2 - -struct ipc_data_cfg { - uint8_t fd_opt; /* Stream file descriptor options: read, - write or readwrite */ - uint16_t pkt_len; /* Stream packet length */ - uint8_t sample_size; /* Sample size in bytes */ - uint8_t mode; /* Audio channel mode */ - uint16_t rate; /* Stream sample rate */ - uint8_t codec; /* Stream codec */ - uint8_t data[0]; /* Codec payload */ +/* Generic message header definition */ +typedef struct { + uint8_t msg_type; +} __attribute__ ((packed)) bt_audio_msg_header_t; + +/* Messages list */ +#define BT_GETCAPABILITIES_REQ 0 +#define BT_GETCAPABILITIES_RSP 1 + +#define BT_SETCONFIGURATION_REQ 2 +#define BT_SETCONFIGURATION_RSP 3 + +#define BT_STREAMSTART_REQ 4 +#define BT_STREAMSTART_RSP 5 + +#define BT_STREAMSTOP_REQ 6 +#define BT_STREAMSTOP_RSP 7 + +#define BT_STREAMSUSPEND_IND 8 +#define BT_STREAMRESUME_IND 9 + +#define BT_CONTROL_REQ 10 +#define BT_CONTROL_RSP 11 +#define BT_CONTROL_IND 12 + +#define BT_STREAMFD_IND 13 + +/* BT_GETCAPABILITIES_REQ */ + +#define BT_CAPABILITIES_TRANSPORT_A2DP 0 +#define BT_CAPABILITIES_TRANSPORT_SCO 1 +#define BT_CAPABILITIES_TRANSPORT_ANY 2 + +#define BT_CAPABILITIES_ACCESS_MODE_READ 1 +#define BT_CAPABILITIES_ACCESS_MODE_WRITE 2 +#define BT_CAPABILITIES_ACCESS_MODE_READWRITE 3 + +struct bt_getcapabilities_req { + bt_audio_msg_header_t h; + char device[18]; /* Address of the remote Device */ + uint8_t transport; /* Requested transport */ + uint8_t access_mode; /* Requested access mode */ } __attribute__ ((packed)); -struct ipc_codec_sbc { - uint8_t allocation; +/* BT_GETCAPABILITIES_RSP */ + +/** + * SBC Codec parameters as per A2DP profile 1.0 § 4.3 + */ + +#define BT_A2DP_SAMPLING_FREQ_16000 (1 << 3) +#define BT_A2DP_SAMPLING_FREQ_32000 (1 << 2) +#define BT_A2DP_SAMPLING_FREQ_44100 (1 << 1) +#define BT_A2DP_SAMPLING_FREQ_48000 1 + +#define BT_A2DP_CHANNEL_MODE_MONO (1 << 3) +#define BT_A2DP_CHANNEL_MODE_DUAL_CHANNEL (1 << 2) +#define BT_A2DP_CHANNEL_MODE_STEREO (1 << 1) +#define BT_A2DP_CHANNEL_MODE_JOINT_STEREO 1 +#define BT_A2DP_CHANNEL_MODE_AUTO 0 + +#define BT_A2DP_BLOCK_LENGTH_4 (1 << 3) +#define BT_A2DP_BLOCK_LENGTH_8 (1 << 2) +#define BT_A2DP_BLOCK_LENGTH_12 (1 << 1) +#define BT_A2DP_BLOCK_LENGTH_16 1 + +#define BT_A2DP_SUBBANDS_4 (1 << 1) +#define BT_A2DP_SUBBANDS_8 1 + +#define BT_A2DP_ALLOCATION_SNR (1 << 1) +#define BT_A2DP_ALLOCATION_LOUDNESS 1 +#define BT_A2DP_ALLOCATION_AUTO 0 + +typedef struct { + uint8_t channel_mode; + uint8_t frequency; + uint8_t allocation_method; uint8_t subbands; - uint8_t blocks; - uint8_t bitpool; + uint8_t block_length; + uint8_t min_bitpool; + uint8_t max_bitpool; +} __attribute__ ((packed)) sbc_capabilities_t; + +/* To be defined */ +typedef struct { +} __attribute__ ((packed)) mpeg_capabilities_t; + +struct bt_getcapabilities_rsp { + bt_audio_msg_header_t h; + uint8_t posix_errno; + uint8_t transport; /* Granted transport */ + uint8_t access_mode; /* Granted access mode */ + uint16_t link_mtu; /* Max length that transport supports */ + sbc_capabilities_t sbc_capabilities; /* A2DP only */ + mpeg_capabilities_t mpeg_capabilities; /* A2DP only */ + uint16_t sampling_rate; /* SCO only */ +} __attribute__ ((packed)); + +/* BT_SETCONFIGURATION_REQ */ +struct bt_setconfiguration_req { + bt_audio_msg_header_t h; + char device[18]; /* Address of the remote Device */ + sbc_capabilities_t sbc_capabilities; /* A2DP only - only one of this field + and next one must be filled */ + mpeg_capabilities_t mpeg_capabilities; /* A2DP only */ +} __attribute__ ((packed)); + +/* BT_SETCONFIGURATION_RSP */ +struct bt_setconfiguration_rsp { + bt_audio_msg_header_t h; + uint8_t posix_errno; +} __attribute__ ((packed)); + +/* BT_STREAMSTART_REQ */ +#define BT_STREAM_ACCESS_READ 0 +#define BT_STREAM_ACCESS_WRITE 1 +#define BT_STREAM_ACCESS_READWRITE 2 +struct bt_streamstart_req { + bt_audio_msg_header_t h; +} __attribute__ ((packed)); + +/* BT_STREAMSTART_RSP */ +struct bt_streamstart_rsp { + bt_audio_msg_header_t h; + uint8_t posix_errno; +} __attribute__ ((packed)); + +/* BT_STREAMFD_IND */ +/* This message is followed by one byte of data containing the stream data fd + as ancilliary data */ +struct bt_datafd_ind { + bt_audio_msg_header_t h; +} __attribute__ ((packed)); + +/* BT_STREAMSTOP_REQ */ +struct bt_streamstop_req { + bt_audio_msg_header_t h; +} __attribute__ ((packed)); + +/* BT_STREAMSTOP_RSP */ +struct bt_streamstop_rsp { + bt_audio_msg_header_t h; + uint8_t posix_errno; } __attribute__ ((packed)); -/* Device status */ -#define STATE_DISCONNECTED 0 -#define STATE_CONNECTING 1 -#define STATE_CONNECTED 2 -#define STATE_STREAM_STARTING 3 -#define STATE_STREAMING 4 +/* BT_STREAMSUSPEND_IND */ +struct bt_streamsuspend_ind { + bt_audio_msg_header_t h; +} __attribute__ ((packed)); -struct ipc_data_state { - uint8_t state; /* Stream state */ +/* BT_STREAMRESUME_IND */ +struct bt_streamresume_ind { + bt_audio_msg_header_t h; } __attribute__ ((packed)); -#define CTL_MODE_PLAYBACK 0 -#define CTL_MODE_CAPTURE 1 -#define CTL_MODE_GENERAL 2 - -/* Supported control operations */ -#define CTL_KEY_POWER 0x40 -#define CTL_KEY_VOL_UP 0x41 -#define CTL_KEY_VOL_DOWN 0x42 -#define CTL_KEY_MUTE 0x43 -#define CTL_KEY_PLAY 0x44 -#define CTL_KEY_STOP 0x45 -#define CTL_KEY_PAUSE 0x46 -#define CTL_KEY_RECORD 0x47 -#define CTL_KEY_REWIND 0x48 -#define CTL_KEY_FAST_FORWARD 0x49 -#define CTL_KEY_EJECT 0x4A -#define CTL_KEY_FORWARD 0x4B -#define CTL_KEY_BACKWARD 0x4C - -struct ipc_data_ctl { - uint8_t mode; /* Control Mode */ - uint8_t key; /* Control Key */ -} __attribute__ ((packed)); +/* BT_CONTROL_REQ */ + +#define BT_CONTROL_KEY_POWER 0x40 +#define BT_CONTROL_KEY_VOL_UP 0x41 +#define BT_CONTROL_KEY_VOL_DOWN 0x42 +#define BT_CONTROL_KEY_MUTE 0x43 +#define BT_CONTROL_KEY_PLAY 0x44 +#define BT_CONTROL_KEY_STOP 0x45 +#define BT_CONTROL_KEY_PAUSE 0x46 +#define BT_CONTROL_KEY_RECORD 0x47 +#define BT_CONTROL_KEY_REWIND 0x48 +#define BT_CONTROL_KEY_FAST_FORWARD 0x49 +#define BT_CONTROL_KEY_EJECT 0x4A +#define BT_CONTROL_KEY_FORWARD 0x4B +#define BT_CONTROL_KEY_BACKWARD 0x4C + +struct bt_control_req { + bt_audio_msg_header_t h; + uint8_t mode; /* Control Mode */ + uint8_t key; /* Control Key */ +} __attribute__ ((packed)); + +/* BT_CONTROL_RSP */ +struct bt_control_rsp { + bt_audio_msg_header_t h; + uint8_t posix_errno; + uint8_t mode; /* Control Mode */ + uint8_t key; /* Control Key */ +} __attribute__ ((packed)); + +/* BT_CONTROL_IND */ +struct bt_control_ind { + bt_audio_msg_header_t h; + uint8_t mode; /* Control Mode */ + uint8_t key; /* Control Key */ +} __attribute__ ((packed)); + +/* Function declaration */ + +/* Opens a connection to the audio service: return a socket descriptor */ +int bt_audio_service_open(); + +/* Closes a connection to the audio service */ +int bt_audio_service_close(int sk); + +/* Receives stream data file descriptor : must be called after a +BT_STREAMFD_IND message is returned */ +int bt_audio_service_get_data_fd(int sk); + +/* Human readable message type string */ +const char *bt_audio_strmsg(int type); + +#ifdef __cplusplus +} +#endif + +#endif /* BT_AUDIOCLIENT_H */ -- cgit From 2934e194f3ffe754e18477113c870a7b98f88454 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 3 Dec 2007 22:41:29 +0000 Subject: Handle new ipc messages properly and adapt the plugins. --- audio/ipc.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 0384cfd6..096c29f1 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -115,7 +115,6 @@ struct bt_getcapabilities_req { bt_audio_msg_header_t h; char device[18]; /* Address of the remote Device */ uint8_t transport; /* Requested transport */ - uint8_t access_mode; /* Requested access mode */ } __attribute__ ((packed)); /* BT_GETCAPABILITIES_RSP */ @@ -165,8 +164,6 @@ struct bt_getcapabilities_rsp { bt_audio_msg_header_t h; uint8_t posix_errno; uint8_t transport; /* Granted transport */ - uint8_t access_mode; /* Granted access mode */ - uint16_t link_mtu; /* Max length that transport supports */ sbc_capabilities_t sbc_capabilities; /* A2DP only */ mpeg_capabilities_t mpeg_capabilities; /* A2DP only */ uint16_t sampling_rate; /* SCO only */ @@ -176,6 +173,8 @@ struct bt_getcapabilities_rsp { struct bt_setconfiguration_req { bt_audio_msg_header_t h; char device[18]; /* Address of the remote Device */ + uint8_t transport; /* Requested transport */ + uint8_t access_mode; /* Requested access mode */ sbc_capabilities_t sbc_capabilities; /* A2DP only - only one of this field and next one must be filled */ mpeg_capabilities_t mpeg_capabilities; /* A2DP only */ @@ -184,6 +183,9 @@ struct bt_setconfiguration_req { /* BT_SETCONFIGURATION_RSP */ struct bt_setconfiguration_rsp { bt_audio_msg_header_t h; + uint8_t transport; /* Granted transport */ + uint8_t access_mode; /* Granted access mode */ + uint16_t link_mtu; /* Max length that transport supports */ uint8_t posix_errno; } __attribute__ ((packed)); -- cgit From d51c190ddd0c2774509d0284979b24b9b0f3524a Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 4 Dec 2007 19:42:00 +0000 Subject: Fix error messages. (thanks to fchevalier for the patch) --- audio/ipc.h | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 096c29f1..3e1200fa 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -74,11 +74,17 @@ extern "C" { #define BT_AUDIO_IPC_PACKET_SIZE 128 #define BT_IPC_SOCKET_NAME "\0/org/bluez/audio" -/* Generic message header definition */ +/* Generic message header definition, except for RSP messages */ typedef struct { uint8_t msg_type; } __attribute__ ((packed)) bt_audio_msg_header_t; +/* Generic message header definition, for all RSP messages */ +typedef struct { + bt_audio_msg_header_t msg_h; + uint8_t posix_errno; +} __attribute__ ((packed)) bt_audio_rsp_msg_header_t; + /* Messages list */ #define BT_GETCAPABILITIES_REQ 0 #define BT_GETCAPABILITIES_RSP 1 @@ -161,12 +167,11 @@ typedef struct { } __attribute__ ((packed)) mpeg_capabilities_t; struct bt_getcapabilities_rsp { - bt_audio_msg_header_t h; - uint8_t posix_errno; - uint8_t transport; /* Granted transport */ - sbc_capabilities_t sbc_capabilities; /* A2DP only */ - mpeg_capabilities_t mpeg_capabilities; /* A2DP only */ - uint16_t sampling_rate; /* SCO only */ + bt_audio_rsp_msg_header_t rsp_h; + uint8_t transport; /* Granted transport */ + sbc_capabilities_t sbc_capabilities; /* A2DP only */ + mpeg_capabilities_t mpeg_capabilities; /* A2DP only */ + uint16_t sampling_rate; /* SCO only */ } __attribute__ ((packed)); /* BT_SETCONFIGURATION_REQ */ @@ -182,11 +187,10 @@ struct bt_setconfiguration_req { /* BT_SETCONFIGURATION_RSP */ struct bt_setconfiguration_rsp { - bt_audio_msg_header_t h; - uint8_t transport; /* Granted transport */ - uint8_t access_mode; /* Granted access mode */ - uint16_t link_mtu; /* Max length that transport supports */ - uint8_t posix_errno; + bt_audio_rsp_msg_header_t rsp_h; + uint8_t transport; /* Granted transport */ + uint8_t access_mode; /* Granted access mode */ + uint16_t link_mtu; /* Max length that transport supports */ } __attribute__ ((packed)); /* BT_STREAMSTART_REQ */ @@ -199,14 +203,13 @@ struct bt_streamstart_req { /* BT_STREAMSTART_RSP */ struct bt_streamstart_rsp { - bt_audio_msg_header_t h; - uint8_t posix_errno; + bt_audio_rsp_msg_header_t rsp_h; } __attribute__ ((packed)); /* BT_STREAMFD_IND */ /* This message is followed by one byte of data containing the stream data fd as ancilliary data */ -struct bt_datafd_ind { +struct bt_streamfd_ind { bt_audio_msg_header_t h; } __attribute__ ((packed)); @@ -217,8 +220,7 @@ struct bt_streamstop_req { /* BT_STREAMSTOP_RSP */ struct bt_streamstop_rsp { - bt_audio_msg_header_t h; - uint8_t posix_errno; + bt_audio_rsp_msg_header_t rsp_h; } __attribute__ ((packed)); /* BT_STREAMSUSPEND_IND */ @@ -255,10 +257,9 @@ struct bt_control_req { /* BT_CONTROL_RSP */ struct bt_control_rsp { - bt_audio_msg_header_t h; - uint8_t posix_errno; - uint8_t mode; /* Control Mode */ - uint8_t key; /* Control Key */ + bt_audio_rsp_msg_header_t rsp_h; + uint8_t mode; /* Control Mode */ + uint8_t key; /* Control Key */ } __attribute__ ((packed)); /* BT_CONTROL_IND */ -- cgit From 9ae63b37bb909c66a931ee3934af1ad87047f326 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 23 Jan 2008 13:11:07 +0000 Subject: Initial support of mpeg12 codec. --- audio/ipc.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 3e1200fa..64ed65a7 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -162,8 +162,14 @@ typedef struct { uint8_t max_bitpool; } __attribute__ ((packed)) sbc_capabilities_t; -/* To be defined */ typedef struct { + uint8_t channel_mode; + uint8_t crc; + uint8_t layer; + uint8_t frequency; + uint8_t mpf; + uint8_t vbr; + uint16_t bitrate; } __attribute__ ((packed)) mpeg_capabilities_t; struct bt_getcapabilities_rsp { -- cgit From 489c2e0dbd76d9cecec62d19fafd9e7baddb72e7 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 23 Jan 2008 13:16:02 +0000 Subject: Add mpeg12 sep registration. --- audio/ipc.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 64ed65a7..3768dcfb 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -129,10 +129,10 @@ struct bt_getcapabilities_req { * SBC Codec parameters as per A2DP profile 1.0 § 4.3 */ -#define BT_A2DP_SAMPLING_FREQ_16000 (1 << 3) -#define BT_A2DP_SAMPLING_FREQ_32000 (1 << 2) -#define BT_A2DP_SAMPLING_FREQ_44100 (1 << 1) -#define BT_A2DP_SAMPLING_FREQ_48000 1 +#define BT_SBC_SAMPLING_FREQ_16000 (1 << 3) +#define BT_SBC_SAMPLING_FREQ_32000 (1 << 2) +#define BT_SBC_SAMPLING_FREQ_44100 (1 << 1) +#define BT_SBC_SAMPLING_FREQ_48000 1 #define BT_A2DP_CHANNEL_MODE_MONO (1 << 3) #define BT_A2DP_CHANNEL_MODE_DUAL_CHANNEL (1 << 2) @@ -152,6 +152,17 @@ struct bt_getcapabilities_req { #define BT_A2DP_ALLOCATION_LOUDNESS 1 #define BT_A2DP_ALLOCATION_AUTO 0 +#define BT_MPEG_SAMPLING_FREQ_16000 (1 << 5) +#define BT_MPEG_SAMPLING_FREQ_22050 (1 << 4) +#define BT_MPEG_SAMPLING_FREQ_24000 (1 << 3) +#define BT_MPEG_SAMPLING_FREQ_32000 (1 << 2) +#define BT_MPEG_SAMPLING_FREQ_44100 (1 << 1) +#define BT_MPEG_SAMPLING_FREQ_48000 1 + +#define BT_MPEG_LAYER_1 (1 << 2) +#define BT_MPEG_LAYER_2 (1 << 1) +#define BT_MPEG_LAYER_3 1 + typedef struct { uint8_t channel_mode; uint8_t frequency; @@ -168,7 +179,6 @@ typedef struct { uint8_t layer; uint8_t frequency; uint8_t mpf; - uint8_t vbr; uint16_t bitrate; } __attribute__ ((packed)) mpeg_capabilities_t; -- cgit From 9fa2613525721908ec43189794fe99828b8a4f51 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 30 Jan 2008 11:44:57 +0000 Subject: Add autoconnect config option to IPC and alsa --- audio/ipc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 3768dcfb..4da7d2ae 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -117,10 +117,13 @@ typedef struct { #define BT_CAPABILITIES_ACCESS_MODE_WRITE 2 #define BT_CAPABILITIES_ACCESS_MODE_READWRITE 3 +#define BT_FLAG_AUTOCONNECT 1 + struct bt_getcapabilities_req { bt_audio_msg_header_t h; char device[18]; /* Address of the remote Device */ uint8_t transport; /* Requested transport */ + uint8_t flags; /* Requested flags */ } __attribute__ ((packed)); /* BT_GETCAPABILITIES_RSP */ -- cgit From e823c15e43a6f924779e466d434c51157002d9ee Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:37:05 +0000 Subject: Update copyright information --- audio/ipc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 4da7d2ae..80deea57 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2004-2007 Marcel Holtmann + * Copyright (C) 2004-2008 Marcel Holtmann * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public -- cgit From 8fbc804e08629e5450d2641b4ba660f111dedbb2 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 14 Feb 2008 21:22:38 +0000 Subject: Make use of parameters selected in alsa plugin and fix auto selection. --- audio/ipc.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'audio/ipc.h') diff --git a/audio/ipc.h b/audio/ipc.h index 80deea57..c900fcd1 100644 --- a/audio/ipc.h +++ b/audio/ipc.h @@ -141,7 +141,6 @@ struct bt_getcapabilities_req { #define BT_A2DP_CHANNEL_MODE_DUAL_CHANNEL (1 << 2) #define BT_A2DP_CHANNEL_MODE_STEREO (1 << 1) #define BT_A2DP_CHANNEL_MODE_JOINT_STEREO 1 -#define BT_A2DP_CHANNEL_MODE_AUTO 0 #define BT_A2DP_BLOCK_LENGTH_4 (1 << 3) #define BT_A2DP_BLOCK_LENGTH_8 (1 << 2) @@ -153,7 +152,6 @@ struct bt_getcapabilities_req { #define BT_A2DP_ALLOCATION_SNR (1 << 1) #define BT_A2DP_ALLOCATION_LOUDNESS 1 -#define BT_A2DP_ALLOCATION_AUTO 0 #define BT_MPEG_SAMPLING_FREQ_16000 (1 << 5) #define BT_MPEG_SAMPLING_FREQ_22050 (1 << 4) -- cgit