-
Notifications
You must be signed in to change notification settings - Fork 7.4k
samples: Bluetooth: BAP Unicast samples improvements #90039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
samples: Bluetooth: BAP Unicast samples improvements #90039
Conversation
Make the reporting interval configurable to make it easier to actually follow. Improve what gets reported. Add check for SDU size to ensure correctness when not using LIBLC3. Signed-off-by: Emil Gydesen <[email protected]>
02797d2
to
78a8b2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves reporting information in the Bluetooth BAP Unicast samples and fixes a few issues in audio data handling. Key changes include enhanced logging for transmission and reception (with configurable reporting intervals) and a restructuring of sink and source stream variables to better track transmitted and received SDUs.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/bsim/bluetooth/audio_samples/bap_unicast_client/Kconfig | Adds configuration file for the unicast client test sample. |
samples/bluetooth/bap_unicast_server/src/main.c | Updates audio stream handling and logging, along with refactoring of sink/source stream structures. |
samples/bluetooth/bap_unicast_server/Kconfig | Introduces the INFO_REPORTING_INTERVAL configuration option. |
samples/bluetooth/bap_unicast_client/src/stream_tx.c | Enhances transmission logic with assertions and improved logging. |
samples/bluetooth/bap_unicast_client/src/stream_lc3.c | Adds logging for LC3 encoding failures. |
samples/bluetooth/bap_unicast_client/src/main.c | Improves reception logging and resets counters on stream start. |
samples/bluetooth/bap_unicast_client/Kconfig | Adds configuration for INFO_REPORTING_INTERVAL for the unicast client. |
Comments suppressed due to low confidence (1)
samples/bluetooth/bap_unicast_client/src/stream_tx.c:93
- [nitpick] Consider rephrasing the assertion message to indicate that the configured SDU length exceeds the available mock data size, which may improve clarity when the assertion fires.
__ASSERT(bap_stream->qos->sdu <= ARRAY_SIZE(mock_data), "Configured codec SDU len %u does not match mock data size %zu", bap_stream->qos->sdu, ARRAY_SIZE(mock_data));
Please enable the below kconfig for local target testing if the peripheral data sampling clock is not compensated for drifting Central sleep clock. zephyr/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf Lines 144 to 145 in e48c907
The samples in this PR use ‘k_work_schedule’ with delay as sampling clock which will go out of sync with the Central sleep clock. The Controller will drop sending data with packet sequence numbers that eventually does not meet the time-of-arrival in both Central and Peripheral side. Do not use OS delay or timeouts as sampling clock, use Number of Completed Packets related callback or drift compensate the sampling clock. Example of sampling clock drift compensation can be found here: |
I will update the server sample to use the number of completed packets approach that we use in the BAP unicast client sample (and to some extend the BAP broadcast source sample) in a separate PR |
78a8b2a
to
06aa4a4
Compare
Improve reporting by introducing a configurable reporting interval and make the report text more useful. Change TX to always send the same size, as that is what is expected/required by LE Audio. Signed-off-by: Emil Gydesen <[email protected]>
06aa4a4
to
c7516a6
Compare
Followup PR to improve TX on the server side: #90052 |
|
Tested with rebased to #89845. Client Log:
Server log:
|
Improve reporting information in the samples and fix a few issues.