Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 00/12] Add functional tests for A2DP and BAP
@ 2026-09-09 19:22 Luiz Augusto von Dentz
  2026-09-09 19:22 ` [PATCH BlueZ v1 01/12] build: add doc/test-functional.rst to EXTRA_DIST Luiz Augusto von Dentz
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: Luiz Augusto von Dentz @ 2026-09-09 19:22 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds functional tests for A2DP and BAP, driven through
bluetoothctl, together with the endpoint registration scripts they use
and the documentation describing what each of them does.

The test documentation is reworked to describe every case as setup,
steps, expected outcome and notes, so a test can be reproduced and
reviewed without reading its source, and the reason behind the way it
is written is not lost. The setup of each case includes a topology
diagram showing how many hosts are used and the role each of them
takes. Tests of a profile need more context than the core ones, so they
are documented separately, in doc/functional-<profile>.rst.

The cases added are:

- A2DP: a transport is created on both sides once the stream is
  configured, and the central can acquire it.

- BAP unicast: the initiator configures the remote PAC Sink endpoint,
  a transport is created per audio location, and acquiring all of them
  establishes the CIS. All the transports of a CIG have to be acquired,
  as the CIS are only created once every CIS of the CIG is ready.

- BAP broadcast: a Broadcast Sink scans, syncs to a Broadcast Source
  on its own and acquires a transport, for a plain broadcast and for a
  Public Broadcast Profile one.

- BAP broadcast assistant: a Broadcast Assistant colocated with a
  Broadcast Source shares its own broadcast with a Scan Delegator,
  which syncs using PAST. The topology where the assistant relays a
  source it scanned, which does not use PAST, needs the assistant on a
  third host and can be added later.

Writing the tests exposed two issues, which are fixed here as well:

- Registering an A2DP endpoint prompted for Locations, Supported
  Context, Context, CIG and CIS, which are LE Audio specific and have
  no meaning for A2DP. Answering Locations with a single location also
  pushes an LC3_CHAN_COUNT LTV into the capabilities, corrupting the
  SBC capabilities.

- A Broadcast Sink established a PA sync to read the BASE, closed it,
  and established a new one to sync to the BIG, delaying the start of
  the stream. The sync is now reused, but only while there is nothing
  else to discover, and it is released once another Broadcast Source
  is probed or after a grace timeout.

The broadcast tests also depend on the following kernel fix, without
which the BIS connections are not notified to the listening socket and
the transport acquire never completes:

  Bluetooth: ISO: set BT_LISTEN before requesting a BIG sync

Note that the broadcast tests are still occasionally slow: the first
LE BIG Create Sync may expire after 20 seconds and only the retry
succeeds, which is being looked at separately.

Luiz Augusto von Dentz (12):
  build: add doc/test-functional.rst to EXTRA_DIST
  doc: describe the functional test cases
  client: do not prompt for LE Audio settings on A2DP endpoints
  client: add A2DP endpoint registration scripts
  test: functional: add A2DP tests
  client: rename media endpoint scripts to include the codec
  client: add BAP endpoint registration scripts
  doc: bluetoothctl: document init script option and scripts
  test: functional: add BAP unicast tests
  test: functional: add BAP broadcast tests
  test: functional: add BAP broadcast assistant test
  bap: reuse the PA sync established to discover a Broadcast Source

 Makefile.am                       |   6 +
 client/player.c                   |  15 +-
 client/scripts/a2dp-sink-sbc.bt   |  19 ++
 client/scripts/a2dp-source-sbc.bt |  24 +++
 client/scripts/bap-sink-lc3.bt    |  32 +++
 client/scripts/bap-source-lc3.bt  |  34 +++
 doc/bluetoothctl.rst              | 105 +++++++++
 doc/functional-a2dp.rst           |  99 +++++++++
 doc/functional-avrcp.rst          |  64 ++++++
 doc/functional-bap.rst            | 290 +++++++++++++++++++++++++
 doc/functional-obex.rst           |  90 ++++++++
 doc/functional-testing.rst        | 340 ++++++++++++++++++++++++++++++
 profiles/audio/bap.c              | 115 +++++++++-
 test/functional/test_a2dp.py      | 144 +++++++++++++
 test/functional/test_bap.py       | 318 ++++++++++++++++++++++++++++
 15 files changed, 1685 insertions(+), 10 deletions(-)
 create mode 100644 client/scripts/a2dp-sink-sbc.bt
 create mode 100644 client/scripts/a2dp-source-sbc.bt
 create mode 100644 client/scripts/bap-sink-lc3.bt
 create mode 100644 client/scripts/bap-source-lc3.bt
 create mode 100644 doc/functional-a2dp.rst
 create mode 100644 doc/functional-avrcp.rst
 create mode 100644 doc/functional-bap.rst
 create mode 100644 doc/functional-obex.rst
 create mode 100644 doc/functional-testing.rst
 create mode 100644 test/functional/test_a2dp.py
 create mode 100644 test/functional/test_bap.py

-- 
2.55.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-09-10 20:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09 19:22 [PATCH BlueZ v1 00/12] Add functional tests for A2DP and BAP Luiz Augusto von Dentz
2026-09-09 19:22 ` [PATCH BlueZ v1 01/12] build: add doc/test-functional.rst to EXTRA_DIST Luiz Augusto von Dentz
2026-09-10 18:28   ` Add functional tests for A2DP and BAP bluez.test.bot
2026-09-09 19:22 ` [PATCH BlueZ v1 02/12] doc: describe the functional test cases Luiz Augusto von Dentz
2026-09-09 19:22 ` [PATCH BlueZ v1 03/12] client: do not prompt for LE Audio settings on A2DP endpoints Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 04/12] client: add A2DP endpoint registration scripts Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 05/12] test: functional: add A2DP tests Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 06/12] client: rename media endpoint scripts to include the codec Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 07/12] client: add BAP endpoint registration scripts Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 08/12] doc: bluetoothctl: document init script option and scripts Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 09/12] test: functional: add BAP unicast tests Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 10/12] test: functional: add BAP broadcast tests Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 11/12] test: functional: add BAP broadcast assistant test Luiz Augusto von Dentz
2026-09-09 19:23 ` [PATCH BlueZ v1 12/12] bap: reuse the PA sync established to discover a Broadcast Source Luiz Augusto von Dentz
2026-09-10 20:50 ` [PATCH BlueZ v1 00/12] Add functional tests for A2DP and BAP patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox