-
Notifications
You must be signed in to change notification settings - Fork 8k
Bluetooth: Classic: Feature/impl a2dp samples #95010
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?
Bluetooth: Classic: Feature/impl a2dp samples #95010
Conversation
b07d375
to
9ce89f2
Compare
@MarkWangChinese What's in the music.h file? Github cannot handle files of that size |
It is a piece of one public music. NXP SDK examples used it, I put it here too. People can hear the music from the peer's headsets. I think it has better experience than sine. I have the sine.h file too. If Zephyr can't has this file, I can remove it and only keep sine.h. |
https://docs.zephyrproject.org/latest/contribute/bin_blobs.html |
9ce89f2
to
d8935b7
Compare
OK, I have removed the music.h from this pr. If needed, I will add the music.h back as blob in another pr. |
@MarkWangChinese since I'm not familiar with A2DP or any classic audio, I'm not sure if my review will be worth a lot. I'll keep myself oriented about this PR, and if I do find some spare time in the near future, I will do a proper review, given that I'm the Maintainer of the LE Audio, but for now I hope some people more familiar with classic can review this :) |
d8935b7
to
1a27cd8
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 adds complete A2DP sample implementations for both source and sink roles, fixes the SBC channel mode constant typo from "STREO" to "STEREO", and implements remaining SBC codec helper APIs. The implementation includes functional audio encoding/decoding with optional codec support for hardware playback.
- Fixes misspelled constant from A2DP_SBC_CH_MODE_STREO to A2DP_SBC_CH_MODE_STEREO
- Implements remaining A2DP SBC codec helper functions for block length, subband number, allocation method, and channel mode
- Adds complete A2DP source sample with SBC encoding, device discovery, and audio streaming
- Adds complete A2DP sink sample with SBC decoding and optional hardware codec playback support
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
subsys/bluetooth/host/classic/shell/a2dp.c | Fixes spelling of STREO to STEREO constant |
subsys/bluetooth/host/classic/a2dp_codec_sbc.c | Implements missing SBC helper functions and fixes constant spelling |
samples/bluetooth/classic/a2dp_source/* | Complete A2DP source sample implementation with encoding and streaming |
samples/bluetooth/classic/a2dp_sink/* | Complete A2DP sink sample implementation with decoding and codec support |
include/zephyr/bluetooth/classic/a2dp_codec_sbc.h | Adds function declarations for new SBC helper functions |
include/zephyr/bluetooth/classic/a2dp.h | Fixes constant spelling and adds doxygen documentation |
doc/connectivity/bluetooth/api/* | Adds A2DP API documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bt_shell_print(" Dual "); | ||
} | ||
if (0U != (codec_ie[0U] & A2DP_SBC_CH_MODE_STREO)) { | ||
if (0U != (codec_ie[0U] & A2DP_SBC_CH_MODE_STEREO)) { |
Copilot
AI
Sep 4, 2025
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 constant name was corrected from 'STREO' to 'STEREO' which fixes the spelling error.
Copilot uses AI. Check for mistakes.
1a27cd8
to
b7f33bf
Compare
implement the remaining API of a2dp_codec_sbc.h Signed-off-by: Mark Wang <[email protected]>
implement the a2dp source sample. Signed-off-by: Mark Wang <[email protected]>
b7f33bf
to
7f24796
Compare
implement the a2dp sink sample, only mimxrt1170_evk@B board's codec is supported now. Signed-off-by: Mark Wang <[email protected]>
add a2dp to the doc Signed-off-by: Mark Wang <[email protected]>
7f24796
to
b1bdc60
Compare
|
add BT_A2DP_STREAM_BUF_MTU_RESERVE to let app to know how many bytes are reserved from l2cap mtu.
implement the remaining API of a2dp_codec_sbc.h
implement the a2dp source sample.
implement the a2dp sink sample, only mimxrt1170_evk@B board's codec is supported now.