Add an initial test based on the broadcast audio source/sink samples
which runs them together and after waiting for a predefined
amount of time, checks how many audio packets has the
sink received, and if over a threshold, passes the test.
This test can be expanded after to cover more functionality from
these samples.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add support for the simulated nrf5340 and nrf52 in these samples,
as well as explicit overlays for the nrf5340dk.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Fix controller configuration overlay used when
building the controller (for nrf52 targets),
so the sample can connect to the source and get
audio through.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Instead of handling some of the configuation thru
board overlays let's handle it thru the sample Kconfig
file, which reduces the amount of duplicate lines.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
So that for both the simulated nrf5340 and real HW nrf5340dk
we build both network and application core images.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The broadcast audio samples (broadcast_audio_sink
and broadcast_audio_source) are sending mock data,
the apps are improved by using the LC3 module as
the unicast audio samples do.
Signed-off-by: Ping Wang <pinw@demant.com>
Add additional RX stats for the BAP broadcast sink so that a
user can easily follow how well the RX is working, and
for several streams.
This also adds some additional logging to better see
what we are syncing to.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In the broadcast_audio_sink sample there are two pointers defined,
both referencing the same address. We reduce this to one pointer
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
There is no reason why the capabilities
should be modified by the stack after registration,
nor any reason why a the unicast client application
needs to modify the reported remote capabilities, so
all have been marked as const.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Refactor the bt_audio_codec_cap to use flat arrays to store
metadata and codec specific capabilities.
The purpose of this is to make it easier to copy the data
between layers, but also to support non-LTV data for non-LC3
codec capabilities.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The broadcast sink API has been modified so that all scanning, etc.
will be done by the application, rather than the stack. This commit
updates the sample to use this updated API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename the bt_codec struct to bt_audio_codec_conf or
to the new struct bt_audio_codec_cap.
Rename the bt_codec_data to bt_audio_codec_data.
The purpose of this is to split the codec specific configuration
and codec capabilities into seperate structs, as they do not
reflect the same values, or used for the same purpose.
This commit depends on the preset macros workings on either
type of struct (for now), but will be modified in future updates.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from samples. It
has been deprecated since this PR:
https://github.com/zephyrproject-rtos/zephyr/pull/56183
The Kconfig symbols has been replaced by `CONFIG_LOG=y` on most of the
cases. Or it has been removed when not needed anymore.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Main now has a int return type.
Fix return values, so this sample can be compiled.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.
Most of these changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.
Signed-off-by: Keith Packard <keithp@keithp.com>
The platform nrf52_bsim was specified as an integration platform,
but was missing from the allow list.
This commit adds this platform to the allow list.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Fix broadcast audio source and sink samples' conf file to
use Broadcast ISO feature in Zephyr Bluetooth Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add support for the Scan Delegator for the Broadcast
Audio Sink sample. This include advertising connectable
as well as handling PAST.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Per the BAP specification, if the Broadcast Sink role is
supported, then the Scan Delegator shall also be supported.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If waiting on the first semaphore in the main loop times out, the main
loop starts from the beginning and attempts to start scanning for
broadcast sources. But since the first semaphore was not passed, the
scan_recv_cb callback was not called yet and thus the previously started
scanning was not stopped. As a result, an attempt to start the scanning
will fail with -EALREADY and the main thread will end. To solve this,
-EALREADY is now ignored when checking the return value of
bt_audio_broadcast_sink_scan_start.
Signed-off-by: Ladislav Podivin <ladislav.podivin@tietoevry.com>
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Imcrease the supported number of subgroups to 2 as well as the number of
streams to 2, so that it matches the default configuration of the
broadcast audio source sample.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This changes the API to use proper naming convention, as the code has
been moved out of capabilities.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The direction is used to identify the list to append the registered
capabilities. There is no need to keep it in the bt_audio_capabilities,
it can be provided as a function parameter instead.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Increase the Controller supported Advertising Data Length
Maximum so that Advertising Data set by Broadcast Audio
Source sample is accepted by the controller.
Also, tune down the supported ISO Tx PDU size to suffice the
Broadcast Audio Source usecase.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In the broadcast sink `scan_recv` which is called when we
scan for broadcast source, we now also provide the entire
AD struct to the application.
The reason for this is that the advertising data may
contain other information that is useful for the application
like the broadcaster device name or any other
vendor/application specific data.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fixed handling of k_sem_take() return codes.
Also some minor cleanup in broadcast_audio samples.
Signed-off-by: Erik Robstad <erik.robstad@nordicsemi.no>
The codec (or rather codec configuration) is now taken from the
previously received BASE. This also means that the BASE (with
the codec configurations) is now also stored statically.
When the application attempts to synk to the broadcaster
the stack will lookup the codec configuration based on the
bis index, as a BASE may have multiple subgroups
with multiple codec configurations.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for using PACS and/or capabilities for
the broadcast sink role. PACS and capabilities were
originally only supported for the unicast server
role, so the PACS callbacks were moved their own
struct, as if a device supports both the unicast
server role and the broadcast sink role, it will
only have a single PACS instance.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BT_CODEC_LC3_CONFIG_* macros had a hardcoded location
and context, which makes them a lot less usable.
Updates the macro, and the macros that used them.
This also removes the BT_CODEC_LC3_CONFIG and instead
just uses the BT_CODEC_LC3_CONFIG_N macro, which has
then been renamed to BT_CODEC_LC3_CONFIG.
As an addition, the macros and their input has
also been better documented.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Increases the scan and adv data sizes to better support
the extended advertising data and periodic advertising
data (BASE).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Clean up some of the board specific configuration files.
Removed all CONFIG_BT_CTLR* configs from the nRF5340
appcore conf files as that does not compile the controller.
Ensured that the ISO buffer in the controller for
nRF52840 can contain SDUs from all BAP LC3 minimum
requirements, as the controller does not yet
support segmentation of SDUs.
Also fixed a few bad configurations (broadcast sink not
enabling the sync support etc.).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the explicit enable of Extended and Periodic
Advertising support in Controller, the feature is no
longer experimental in the Controller and is now enabled
by default when application uses them by enabling as
Host feature.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The audio stream receive callback now contains a
recv_info struct, which contain crucial information
such as timestamps and packet validity.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:
```python
from pathlib import Path
import re
EXTENSIONS = ("c", "h", "cpp", "rst")
for p in Path(".").glob("samples/**/*"):
if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
continue
content = ""
with open(p) as f:
for line in f:
m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
if (m and
not m.group(2).startswith("zephyr/") and
(Path(".") / "include" / "zephyr" / m.group(2)).exists()):
content += (
m.group(1) +
"#include <zephyr/" + m.group(2) +">" +
m.group(3) + "\n"
)
else:
content += line
with open(p, "w") as f:
f.write(content)
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add sample for the Basic Audio Profile (BAP) broadcast
audio sink role, that can scan for a receive audio
data over ISO from BAP broadcast sources.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>