• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

src/29-Dec-2025-1,5021,155

CMakeLists.txtD29-Dec-2025363 1913

README.rstD29-Dec-20256.1 KiB11394

prj.confD29-Dec-2025367 1814

sample.yamlD29-Dec-2025378 1413

README.rst

1.. zephyr:code-sample:: bluetooth_isochronous_broadcaster_benchmark
2   :name: Isochronous Broadcaster Benchmark
3   :relevant-api: bt_iso bluetooth
4
5   Measure packet loss and sync loss of an ISO broadcaster against one or more receivers.
6
7The ISO Broadcast Benchmark sample measures and report packet loss and sync loss
8of an ISO broadcaster against one or more ISO broadcast receivers.
9
10Overview
11********
12
13The sample transmits data from the *broadcaster* to the
14*receiver* (multiple receivers may be used with no effect on the test)
15and measures the quality of the sync.
16
17The application is used as both a broadcaster and a receiver, and the mode
18can easily be changed.
19
20Requirements
21************
22
23* BlueZ running on the host, or
24* A board with Bluetooth Low Energy 5.2 support
25* A Bluetooth Controller and board that supports setting
26  CONFIG_BT_CTLR_ADV_ISO=y
27* A remote board running the same sample as the reversed role that supports
28  setting CONFIG_BT_CTLR_SYNC_ISO
29
30Building and running
31********************
32
33See :zephyr:code-sample-category:`bluetooth` samples for details.
34
35
36Testing
37=======
38
39After programming the sample to both boards, test it by performing the following
40steps:
41
421. Connect to both boards with a terminal emulator (for example, PuTTY or
43   minicom).
44#. Reset both boards.
45#. In one of the terminal emulators, type "r" to start the application on the
46   connected board in the receiver role.
47#. In the other terminal emulator, type "b" to start the application in the
48   broadcaster role.
49#. Optionally modify the broadcasting settings.
50#. Observe that the receiver synchronizes to the broadcaster.
51#. Observe the receive statistics on the receiver(s).
52
53Sample output
54==============
55The receiver will output statistics for overall (since boot), current sync
56(since the BIG was synced) and latest 1000 received packets::
57
58   *** Booting Zephyr OS build zephyr-v2.5.0-3768-g42f09317bfbe  ***
59   [00:00:00.447,845] <inf> iso_broadcast_main: Starting Bluetooth Throughput
60   Choose device role - type r (receiver role) or b (broadcaster role), or q to quit: r
61   Receiver role
62   [00:00:05.784,698] <inf> iso_broadcast_receiver: Scan started
63   [00:00:05.784,698] <inf> iso_broadcast_receiver: Waiting for periodic advertiser
64   [00:00:05.793,304] <inf> iso_broadcast_receiver: Found broadcaster with address 28:3B:AD:F5:EE:0C (random) (RSSI -33)
65   [00:00:05.793,334] <inf> iso_broadcast_receiver: Periodic advertiser found
66   [00:00:05.793,701] <inf> iso_broadcast_receiver: Scan stopped
67   [00:00:05.793,701] <inf> iso_broadcast_receiver: Creating Periodic Advertising Sync
68   [00:00:05.796,081] <inf> iso_broadcast_receiver: Waiting for periodic sync
69   [00:00:06.453,460] <err> bt_scan: Unknown handle 0x0000 for periodic advertising report
70   [00:00:06.453,979] <inf> iso_broadcast_receiver: Periodic advertisement synced
71   [00:00:06.454,010] <inf> iso_broadcast_receiver: Periodic sync established
72   [00:00:06.454,040] <inf> iso_broadcast_receiver: Waiting for BIG info
73   [00:00:08.853,485] <inf> iso_broadcast_receiver: BIGinfo received: num_bis 2, nse 1, interval 7 ms, bn 1, pto 0, irc 1, max_pdu 251, sdu_interval 7500 us, max_sdu 251, phy LE 2M, without framing, not encrypted
74   [00:00:08.853,515] <inf> iso_broadcast_receiver: Syncing to BIG
75   [00:00:08.853,973] <inf> iso_broadcast_receiver: Waiting for BIG sync
76   [00:00:11.254,211] <inf> iso_broadcast_receiver: ISO Channel 0x2000124c connected
77   [00:00:11.254,333] <inf> iso_broadcast_receiver: BIG sync established
78   [00:00:11.254,486] <inf> iso_broadcast_receiver: ISO Channel 0x20001260 connected
79   [00:00:11.639,343] <inf> iso_broadcast_receiver: Overall     : Received 99/100 (99.00%) - Total packets lost 1
80   [00:00:11.639,343] <inf> iso_broadcast_receiver: Current Sync: Received 99/100 (99.00%) - Total packets lost 1
81   [00:00:11.639,373] <inf> iso_broadcast_receiver: Latest 1000 : Received 99/100 (99.00%) - Total packets lost 1
82   [00:00:12.029,388] <inf> iso_broadcast_receiver: Overall     : Received 199/200 (99.50%) - Total packets lost 1
83   [00:00:12.029,388] <inf> iso_broadcast_receiver: Current Sync: Received 199/200 (99.50%) - Total packets lost 1
84   [00:00:12.029,388] <inf> iso_broadcast_receiver: Latest 1000 : Received 199/200 (99.50%) - Total packets lost 1
85
86
87The broadcaster will ask if any changes to the current settings are wanted.
88If y/Y is chosen, then it will create a prompt to enter changes to the settings,
89otherwise continue with the current settings. The broadcaster will then start
90the BIG and output the current counter (since the BIG was created)::
91
92   *** Booting Zephyr OS build zephyr-v2.5.0-3768-g06d4327cc601  ***
93   [00:00:00.447,845] <inf> iso_broadcast_main: Starting Bluetooth Throughput
94   Choose device role - type r (receiver role) or b (broadcaster role), or q to quit: b
95   Broadcaster role
96   Change settings (y/N)? (Current settings: rtn=2, interval=7500, latency=10, phy=2, sdu=251, packing=0, framing=0, bis_count=2)
97   [00:00:08.802,185] <inf> iso_broadcast_broadcaster: Creating Extended Advertising set
98   [00:00:08.804,260] <inf> iso_broadcast_broadcaster: Setting Extended Advertising parameters
99   [00:00:08.804,504] <inf> iso_broadcast_broadcaster: Starting Periodic Advertising
100   [00:00:08.804,870] <inf> iso_broadcast_broadcaster: Starting Extended Advertising set
101   [00:00:08.807,159] <inf> iso_broadcast_broadcaster: Creating BIG
102   [00:00:08.807,617] <inf> iso_broadcast_broadcaster: Waiting for BIG complete
103   [00:00:08.813,049] <inf> iso_broadcast_broadcaster: ISO Channel 0x20001218 connected
104   [00:00:08.813,171] <inf> iso_broadcast_broadcaster: BIG created
105   [00:00:08.813,507] <inf> iso_broadcast_broadcaster: ISO Channel 0x2000122c connected
106   [00:00:09.196,472] <inf> iso_broadcast_broadcaster: Sending value 100
107   [00:00:09.587,036] <inf> iso_broadcast_broadcaster: Sending value 200
108   [00:00:09.977,722] <inf> iso_broadcast_broadcaster: Sending value 300
109   [00:00:10.368,347] <inf> iso_broadcast_broadcaster: Sending value 400
110   [00:00:10.758,972] <inf> iso_broadcast_broadcaster: Sending value 500
111   [00:00:11.149,597] <inf> iso_broadcast_broadcaster: Sending value 600
112   [00:00:11.540,222] <inf> iso_broadcast_broadcaster: Sending value 700
113