Skip to content

Remove audio_device and introduce policy plugin

Luiz Augusto von Dentz linux-bluetooth 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest21 patches 1 replyIn review
  2. v120 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21audio/sink: Use service user_data for private dataprofiles/audio/device.c profiles/audio/device.h profiles/audio/manager.c +2 more+54 -390 replies
2/21audio/source: Use service user_data for private dataprofiles/audio/device.h profiles/audio/manager.c profiles/audio/source.c +1 more+22 -190 replies
3/21audio/control: Use service user_data for private dataprofiles/audio/avrcp.c profiles/audio/control.c profiles/audio/control.h +2 more+56 -380 replies
4/21audio/sink: Reduce dependency on struct audio_deviceprofiles/audio/a2dp.c profiles/audio/avrcp.c profiles/audio/device.c +4 more+55 -620 replies
5/21audio/source: Reduce dependency on struct audio_deviceprofiles/audio/a2dp.c profiles/audio/device.c profiles/audio/manager.c +3 more+50 -580 replies
6/21audio/control: Reduce dependency on struct audio_deviceprofiles/audio/avrcp.c profiles/audio/control.c profiles/audio/control.h +2 more+51 -710 replies
7/21audio/AVCTP: Remove dependency on struct audio_deviceprofiles/audio/avctp.c profiles/audio/avctp.h profiles/audio/avrcp.c +2 more+62 -760 replies
8/21audio/AVDTP: Remove dependency on struct audio_deviceprofiles/audio/avdtp.c profiles/audio/avdtp.h profiles/audio/device.c +3 more+87 -900 replies
9/21audio/AVRCP: Remove dependency on struct audio_deviceprofiles/audio/avrcp.c profiles/audio/avrcp.h profiles/audio/device.c +4 more+47 -490 replies
10/21audio/control: Remove dependency on struct audio_deviceprofiles/audio/control.c profiles/audio/control.h profiles/audio/manager.c+52 -360 replies
11/21audio/A2DP: Remove dependency on struct audio_deviceprofiles/audio/a2dp.c profiles/audio/a2dp.h profiles/audio/media.c +4 more+148 -1280 replies
12/21audio/sink: Remove dependency on struct audio_deviceprofiles/audio/manager.c profiles/audio/sink.c profiles/audio/sink.h+10 -140 replies
13/21audio/source: Remove dependency on struct audio_deviceprofiles/audio/manager.c profiles/audio/source.c profiles/audio/source.h+11 -150 replies
14/21audio/media: Remove dependency on struct audio_deviceprofiles/audio/media.c+4 -50 replies
15/21audio/transport: Remove dependency on struct audio_deviceprofiles/audio/transport.c+0 -10 replies
16/21audio/manager: Remove dependency on struct audio_deviceprofiles/audio/manager.c profiles/audio/manager.h+35 -1190 replies
17/21audio/main: Remove dependency on struct audio_deviceprofiles/audio/main.c+0 -10 replies
18/21plugins/policy: Reword audio policy code in a simple pluginMakefile.plugins plugins/policy.c profiles/audio/device.c +1 more+334 -3210 replies
19/21audio/source: Move stream retry logic to policy pluginplugins/policy.c profiles/audio/source.c+61 -450 replies
20/21audio/sink: Move stream retry logic to policy pluginplugins/policy.c profiles/audio/sink.c+60 -430 replies
21/21audio/control: Enable initiate connection to CT roleprofiles/audio/control.c profiles/audio/manager.c+7 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/21] Remove audio_device and introduce policy plugin

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

audio_device is no longer needed as btd_service can be used to track connection states, in fact audio_device probably obscured direct access to some data types like btd_device and use btd_service_set_user_data to set profile private data instead of storing everything inside audio_device.

There are probably more cleanups to audio after this changes, some policies that should be moved to policy plugin and a much needed split of audio plugin into smaller plugins, but I decided to stop right here otherwise the patch-set will get too big to be properly reviewed.

Also since this refactore the audio policy quite extensively this may create some IOP issues, but I did test this with quite a few stacks including:

- iOS 6
- Android 4.2
- WP 8
- Blackberry 10
- MW600
- Nokia Purity Pro
- BlueZ 4
- BlueZ 5

They all seems to be working as before.

v2: Add patch 21/21 to enable initiating connections to CT role.

Luiz Augusto von Dentz (21):
audio/sink: Use service user_data for private data audio/source: Use service user_data for private data audio/control: Use service user_data for private data audio/sink: Reduce dependency on struct audio_device audio/source: Reduce dependency on struct audio_device audio/control: Reduce dependency on struct audio_device audio/AVCTP: Remove dependency on struct audio_device audio/AVDTP: Remove dependency on struct audio_device audio/AVRCP: Remove dependency on struct audio_device audio/control: Remove dependency on struct audio_device audio/A2DP: Remove dependency on struct audio_device audio/sink: Remove dependency on struct audio_device audio/source: Remove dependency on struct audio_device audio/media: Remove dependency on struct audio_device audio/transport: Remove dependency on struct audio_device audio/manager: Remove dependency on struct audio_device audio/main: Remove dependency on struct audio_device plugins/policy: Reword audio policy code in a simple plugin audio/source: Move stream retry logic to policy plugin audio/sink: Move stream retry logic to policy plugin audio/control: Enable initiate connection to CT role

 Makefile.plugins           |   4 +-
 plugins/policy.c           | 426 +++++++++++++++++++++++++++++++++++++++++++++
 profiles/audio/a2dp.c      | 110 ++++++------
 profiles/audio/a2dp.h      |   4 +-
 profiles/audio/avctp.c     |  69 +++-----
 profiles/audio/avctp.h     |  12 +-
 profiles/audio/avdtp.c     |  97 +++++------
 profiles/audio/avdtp.h     |  13 +-
 profiles/audio/avrcp.c     |  89 ++++++----
 profiles/audio/avrcp.h     |   8 +-
 profiles/audio/control.c   | 143 +++++++--------
 profiles/audio/control.h   |  19 +-
 profiles/audio/device.c    | 261 ---------------------------
 profiles/audio/device.h    |  43 -----
 profiles/audio/main.c      |   1 -
 profiles/audio/manager.c   | 199 +++++----------------
 profiles/audio/manager.h   |  10 --
 profiles/audio/media.c     |  39 +++--
 profiles/audio/sink.c      | 157 +++++++----------
 profiles/audio/sink.h      |  18 +-
 profiles/audio/source.c    | 158 +++++++----------
 profiles/audio/source.h    |  20 +--
 profiles/audio/transport.c | 109 +++++++-----
 profiles/audio/transport.h |   8 +-
 24 files changed, 993 insertions(+), 1024 deletions(-)
 create mode 100644 plugins/policy.c
 delete mode 100644 profiles/audio/device.c
 delete mode 100644 profiles/audio/device.h
Signature · 1 line
1.8.1.4