-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Bluetooth: audio: Handle lack of channel allocation structure #50249
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
Bluetooth: audio: Handle lack of channel allocation structure #50249
Conversation
|
@MariuszSkamra FYI |
MariuszSkamra
left a comment
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.
I have 2 minor comments, otherwise LGTM
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.
I guess this comment describes BT_AUDIO_LOCATION_UNSPECIFIED, not enum bt_audio_location, so you could put it right before BT_AUDIO_LOCATION_UNSPECIFIED
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.
Done
subsys/bluetooth/audio/codec.c
Outdated
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.
I would put here sentence taken from the spec:
BAP v1.0.1 4.3.2 Codec_Specific_Configuration LTV requirements
The absence of the Audio_Channel_Allocation LTV structure
shall be interpreted as a single channel with no specified Audio Location.
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.
Done
This commits fixes the handling of codec configuration in case there is no channel allocation field present. Signed-off-by: Szymon Czapracki <[email protected]>
fcf77dd to
1ba829a
Compare
| * The absence of the Audio_Channel_Allocation LTV structure | ||
| * shall be interpreted as a single channel with no specified Audio Location. | ||
| */ | ||
| return BT_AUDIO_LOCATION_UNSPECIFIED; |
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.
What is the reasoning here to return 0 (BT_AUDIO_LOCATION_UNSPECIFIED, which is btw also an bt_audio_location and not an int) here, instead of an error code?
Seems odd to return error code in all other instances, except this one (and even more weirdly to return 0, i.e. success, in that case).
If we just want to return 0/sucess, instead of an error, I suggest that we just return 0 directly, instead of putting BT_AUDIO_LOCATION_UNSPECIFIED into bt_audio_location and use that here.
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
@szymon-czapracki Are you going to reopen this? |
This commits fixes the handling of codec configuration in case there is no channel allocation field present.