* [PATCH BlueZ] avdtp: Fix rejected Close dropping A2DP
@ 2026-12-04 8:00 Jakob Stender Guldberg
2026-12-04 17:22 ` [BlueZ] " bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Jakob Stender Guldberg @ 2026-12-04 8:00 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jakob Stender Guldberg
A Close Reject carries only the Error Code, but avdtp_parse_rej() parsed
it with stream_rej_to_err(), which wants an ACP SEID before it. The
1 byte reject failed the size check and session_cb() dropped the whole
session.
OnePlus Buds Pro 4 often reject Close with BAD_ACP_SEID, so changing the
codec left the headset without A2DP:
< 80 08 08
> 83 08 12
stream_rej_to_err() Too small packet for stream_rej
session_cb() Unable to parse reject response
Parse the Error Code alone and release the stream as if the Close had
been accepted.
Fixes: 6763ebb3c231 ("Integrate A2DP work from Johan's and Luiz's GIT trees")
Assisted-by: Claude:claude-opus-5-5
---
Tests:
- A test program runs a2dp.c and avdtp.c against simulated buds that
reject Close. The codec change fails on master and works with this
patch. The test program is not in the tree.
- On real OnePlus Buds Pro 4 with BlueZ 5.87, the codec changed from AAC
to SBC and back. The buds rejected both Close commands. That build also
contained a change to a2dp.c that is not in this patch.
- make check gives the same result with and without this patch.
The BlueZ tree has no test for this case. The functional tests have no
remote device that rejects Close.
profiles/audio/avdtp.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index c49ac9c0e..191ae12b5 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -3192,15 +3192,12 @@ static gboolean avdtp_parse_rej(struct avdtp *session,
sep->user_data);
return TRUE;
case AVDTP_CLOSE:
- if (!stream_rej_to_err(buf, size, &err, &acp_seid))
+ if (!seid_rej_to_err(buf, size, &err))
return FALSE;
error("CLOSE request rejected: %s (%d)",
avdtp_strerror(&err), err.err.error_code);
- if (sep && sep->cfm && sep->cfm->close) {
- sep->cfm->close(session, sep, stream, &err,
- sep->user_data);
- stream->close_int = FALSE;
- }
+ if (stream)
+ return avdtp_close_resp(session, stream, buf, size);
return TRUE;
case AVDTP_ABORT:
if (!stream_rej_to_err(buf, size, &err, &acp_seid))
base-commit: 71f224fd62317779ec6de23098b4dd96ea83ae5e
--
2.56.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [BlueZ] avdtp: Fix rejected Close dropping A2DP
2026-12-04 8:00 [PATCH BlueZ] avdtp: Fix rejected Close dropping A2DP Jakob Stender Guldberg
@ 2026-12-04 17:22 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-12-04 17:22 UTC (permalink / raw)
To: linux-bluetooth, jakob1379
[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1231686/
---Test result---
Test Summary:
CheckPatch PASS 0.49 seconds
GitLint PASS 0.33 seconds
BuildEll PASS 20.37 seconds
BluezMake PASS 310.60 seconds
MakeCheck PASS 3.61 seconds
MakeDistcheck PASS 148.57 seconds
CheckValgrind PASS 161.04 seconds
CheckSmatch PASS 320.76 seconds
bluezmakeextell PASS 107.67 seconds
TestFunctional PASS 1271.55 seconds
IncrementalBuild PASS 318.99 seconds
ScanBuild PASS 1220.03 seconds
https://github.com/bluez/bluez/pull/2979
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 17:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 8:00 [PATCH BlueZ] avdtp: Fix rejected Close dropping A2DP Jakob Stender Guldberg
2026-12-04 17:22 ` [BlueZ] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox