-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Implement the sbc encoder and decoder based on Android Bluetooth SBC #88865
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?
Implement the sbc encoder and decoder based on Android Bluetooth SBC #88865
Conversation
MarkWangChinese
commented
Apr 21, 2025
- It is based on Android Bluetooth SBC.
- The Android Bluetooth SBC is being proposed as an external library in submodule repo (libsbc).
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 added project Note: This message is automatically posted and updated by the Manifest GitHub Action. |
85f9924
to
4a7d78d
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.
Some comments on function return values
modules/libsbc/sbc.c
Outdated
if (encoder == NULL) { | ||
return -1; | ||
} |
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.
Do you really want to return -EPERM
here, since EPERM
is defined as 1
? That's how this would get interpreted by the caller assuming that this function is returning negative posix error codes (like you're doing with -EINVAL
and -EOVERFLOW
in other places of the function).
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.
Fixed them all. I changed to use the negative posix error codes, but missed some.
modules/libsbc/sbc.c
Outdated
encoder_params->s16SamplingFreq = 3; | ||
break; | ||
default: | ||
return -1; |
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.
Same here
modules/libsbc/sbc.c
Outdated
uint32_t ret; | ||
|
||
if ((encoder == NULL) || (in_data == NULL) || (out_data == NULL)) { | ||
return -1; |
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.
This function returns uint32_t
so it doesn't make sense to try to return a negative value.
modules/libsbc/sbc.c
Outdated
OI_STATUS status; | ||
|
||
if (decoder == NULL) { | ||
return -1; |
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.
Same as -EPERM
, i.e. probably not what you want.
Use the Android Bluetooth SBC encoder and decoder. The Android Bluetooth SBC is put as external library (libsbc). sbc.c/sbc.h implement the interface that is compliant with Zephyr style and can be used by Zephyr's other modules ( like A2DP). Signed-off-by: Mark Wang <yichang.wang@nxp.com>
add libsbc to west.yml and add libsbc to MAINTAINERS.yml Signed-off-by: Mark Wang <yichang.wang@nxp.com>
4a7d78d
to
d79fa33
Compare