-
Notifications
You must be signed in to change notification settings - Fork 7.8k
samples: Bluetooth: bap_broadcast_source with 44100 Hz codec preset #95079
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_broadcast_source with 44100 Hz codec preset #95079
Conversation
bap_broadcast_source sample with 44100 Hz codec preset. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
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 adds support for 44.1 kHz audio codec preset to the Bluetooth BAP broadcast source sample. The changes enable the sample to use the BT_BAP_LC3_BROADCAST_PRESET_441_2_1 preset configuration for higher quality audio broadcasting.
Key changes:
- Adds CONFIG_BAP_BROADCAST_441_2_1 configuration option
- Implements 44.1 kHz codec preset with appropriate frame duration settings
- Includes debug logging for frequency and frame duration
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
samples/bluetooth/bap_broadcast_source/src/main.c | Adds 44.1 kHz codec preset support with proper configuration and debug output |
samples/bluetooth/bap_broadcast_source/Kconfig | Adds new configuration option for the 441_2_1 preset |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
#define MAX_FRAME_DURATION_US 10000 | ||
#elif defined(CONFIG_BAP_BROADCAST_24_2_1) | ||
#define MAX_SAMPLE_RATE 24000 | ||
#endif | ||
#define MAX_FRAME_DURATION_US 10000 | ||
#elif defined(CONFIG_BAP_BROADCAST_441_2_1) | ||
#define MAX_SAMPLE_RATE 44100 | ||
#define MAX_FRAME_DURATION_US 10884 | ||
#endif |
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.
The MAX_FRAME_DURATION_US definition is duplicated for both CONFIG_BAP_BROADCAST_16_2_1 and CONFIG_BAP_BROADCAST_24_2_1 conditions. Consider consolidating these identical definitions to reduce code duplication.
Copilot uses AI. Check for mistakes.
#define MAX_FRAME_DURATION_US 10000 | ||
#elif defined(CONFIG_BAP_BROADCAST_441_2_1) | ||
#define MAX_SAMPLE_RATE 44100 |
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.
The frame duration value 10884 microseconds appears to be a calculated value specific to 44.1 kHz sampling. Consider adding a comment explaining how this value was derived or its relationship to the 44.1 kHz sample rate.
#define MAX_SAMPLE_RATE 44100 | |
#define MAX_SAMPLE_RATE 44100 | |
/* For 44.1 kHz, LC3 frame duration is (480 samples / 44100 Hz) * 1,000,000 ≈ 10884 μs */ |
Copilot uses AI. Check for mistakes.
|
bap_broadcast_source sample with 44100 Hz codec preset.