Skip to content

Conversation

cvinayak
Copy link
Contributor

bap_broadcast_source sample with 44100 Hz codec preset.

bap_broadcast_source sample with 44100 Hz codec preset.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@cvinayak cvinayak requested review from Copilot and Thalley August 27, 2025 16:13
Copy link

@Copilot Copilot AI left a 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.

Comment on lines +78 to +85
#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
Copy link
Preview

Copilot AI Aug 27, 2025

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
Copy link
Preview

Copilot AI Aug 27, 2025

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.

Suggested change
#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.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant