diff mbox series

[BlueZ,bluez,v2] bap: fixed issue of muting music silent after pause and resume.

Message ID 20250208-ascs_bug-v2-1-b7e062d6604d@amlogic.com (mailing list archive)
State Superseded
Headers show
Series [BlueZ,bluez,v2] bap: fixed issue of muting music silent after pause and resume. | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake fail BluezMake FAIL: src/shared/bap.c: In function ‘stream_notify_ase_state’: src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types] 941 | gatt_db_attribute_notify(ep->attr, &status, sizeof(status), | ^~~~~~~ | | | struct bt_ascs_ase_status * In file included from src/shared/bap.c:27: ./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’ 296 | const uint8_t *value, size_t len, | ~~~~~~~~~~~~~~~^~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:8631: src/shared/libshared_mainloop_la-bap.lo] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:4682: all] Error 2
tedd_an/MakeCheck fail BlueZ Make Check FAIL:
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind fail Check Valgrind FAIL: src/shared/bap.c: In function ‘stream_notify_ase_state’: src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types] 941 | gatt_db_attribute_notify(ep->attr, &status, sizeof(status), | ^~~~~~~ | | | struct bt_ascs_ase_status * In file included from src/shared/bap.c:27: ./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’ 296 | const uint8_t *value, size_t len, | ~~~~~~~~~~~~~~~^~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:8631: src/shared/libshared_mainloop_la-bap.lo] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:12320: check] Error 2
tedd_an/CheckSmatch fail CheckSparse: FAIL: src/shared/crypto.c:271:21: warning: Variable length array is used. src/shared/crypto.c:272:23: warning: Variable length array is used. src/shared/gatt-helpers.c:768:31: warning: Variable length array is used. src/shared/gatt-helpers.c:830:31: warning: Variable length array is used. src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used. src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used. src/shared/gatt-server.c:278:25: warning: Variable length array is used. src/shared/gatt-server.c:618:25: warning: Variable length array is used. src/shared/gatt-server.c:716:25: warning: Variable length array is used. src/shared/bap.c:296:25: warning: array of flexible structures src/shared/bap.c: note: in included file: ./src/shared/ascs.h:88:25: warning: array of flexible structures src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h): /usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function' /usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction' /usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction' /usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction' src/shared/bap.c: In function ‘stream_notify_ase_state’: src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types] 941 | gatt_db_attribute_notify(ep->attr, &status, sizeof(status), | ^~~~~~~ | | | struct bt_ascs_ase_status * In file included from src/shared/bap.c:27: ./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’ 296 | const uint8_t *value, size_t len, | ~~~~~~~~~~~~~~~^~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:8631: src/shared/libshared_mainloop_la-bap.lo] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:4682: all] Error 2
tedd_an/bluezmakeextell fail Make External ELL FAIL: src/shared/bap.c: In function ‘stream_notify_ase_state’: src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types] 941 | gatt_db_attribute_notify(ep->attr, &status, sizeof(status), | ^~~~~~~ | | | struct bt_ascs_ase_status * In file included from src/shared/bap.c:27: ./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’ 296 | const uint8_t *value, size_t len, | ~~~~~~~~~~~~~~~^~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:8631: src/shared/libshared_mainloop_la-bap.lo] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:4682: all] Error 2
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Yang Li via B4 Relay Feb. 8, 2025, 3:05 a.m. UTC
From: Yang Li <yang.li@amlogic.com>

After the ASE state changes (streaming->releasing->idle),
the Client needs to be notified. The process as follows:

...(Sink ASE: ID=1, State=Streaming)
ATT Write Command Packet (ASE Control Point: Op=Release)
ATT Notification Packet (Sink ASE: ID=1, State=Releasing)
ATT Notification Packet (Sink ASE: ID=1, State=Idle)

Signed-off-by: Yang Li <yang.li@amlogic.com>
---
 src/shared/bap.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)


---
base-commit: 2ee08ffd4d469781dc627fa50b4a015d9ad68007
change-id: 20250208-ascs_bug-e7c5715d3d8c

Best regards,

Comments

bluez.test.bot@gmail.com Feb. 8, 2025, 3:42 a.m. UTC | #1
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/project/bluetooth/list/?series=931834

---Test result---

Test Summary:
CheckPatch                    PENDING   0.23 seconds
GitLint                       PENDING   0.19 seconds
BuildEll                      PASS      21.02 seconds
BluezMake                     FAIL      19.86 seconds
MakeCheck                     FAIL      33.93 seconds
MakeDistcheck                 PASS      164.31 seconds
CheckValgrind                 FAIL      16.21 seconds
CheckSmatch                   FAIL      23.49 seconds
bluezmakeextell               FAIL      13.96 seconds
IncrementalBuild              PENDING   0.23 seconds
ScanBuild                     PASS      904.77 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: BluezMake - FAIL
Desc: Build BlueZ
Output:

src/shared/bap.c: In function ‘stream_notify_ase_state’:
src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  941 |  gatt_db_attribute_notify(ep->attr, &status, sizeof(status),
      |                                     ^~~~~~~
      |                                     |
      |                                     struct bt_ascs_ase_status *
In file included from src/shared/bap.c:27:
./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’
  296 |      const uint8_t *value, size_t len,
      |      ~~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:8631: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4682: all] Error 2
##############################
Test: MakeCheck - FAIL
Desc: Run Bluez Make Check
Output:

src/shared/bap.c: In function ‘stream_notify_ase_state’:
src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  941 |  gatt_db_attribute_notify(ep->attr, &status, sizeof(status),
      |                                     ^~~~~~~
      |                                     |
      |                                     struct bt_ascs_ase_status *
In file included from src/shared/bap.c:27:
./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’
  296 |      const uint8_t *value, size_t len,
      |      ~~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:8386: src/shared/libshared_glib_la-bap.lo] Error 1
make: *** [Makefile:12320: check] Error 2
##############################
Test: CheckValgrind - FAIL
Desc: Run Bluez Make Check with Valgrind
Output:

src/shared/bap.c: In function ‘stream_notify_ase_state’:
src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  941 |  gatt_db_attribute_notify(ep->attr, &status, sizeof(status),
      |                                     ^~~~~~~
      |                                     |
      |                                     struct bt_ascs_ase_status *
In file included from src/shared/bap.c:27:
./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’
  296 |      const uint8_t *value, size_t len,
      |      ~~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:8631: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:12320: check] Error 2
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:

src/shared/crypto.c:271:21: warning: Variable length array is used.
src/shared/crypto.c:272:23: warning: Variable length array is used.
src/shared/gatt-helpers.c:768:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:830:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used.
src/shared/gatt-server.c:278:25: warning: Variable length array is used.
src/shared/gatt-server.c:618:25: warning: Variable length array is used.
src/shared/gatt-server.c:716:25: warning: Variable length array is used.
src/shared/bap.c:296:25: warning: array of flexible structures
src/shared/bap.c: note: in included file:
./src/shared/ascs.h:88:25: warning: array of flexible structures
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function'
/usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction'
/usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction'
/usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction'
src/shared/bap.c: In function ‘stream_notify_ase_state’:
src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  941 |  gatt_db_attribute_notify(ep->attr, &status, sizeof(status),
      |                                     ^~~~~~~
      |                                     |
      |                                     struct bt_ascs_ase_status *
In file included from src/shared/bap.c:27:
./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’
  296 |      const uint8_t *value, size_t len,
      |      ~~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:8631: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4682: all] Error 2
##############################
Test: bluezmakeextell - FAIL
Desc: Build Bluez with External ELL
Output:

src/shared/bap.c: In function ‘stream_notify_ase_state’:
src/shared/bap.c:941:37: error: passing argument 2 of ‘gatt_db_attribute_notify’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  941 |  gatt_db_attribute_notify(ep->attr, &status, sizeof(status),
      |                                     ^~~~~~~
      |                                     |
      |                                     struct bt_ascs_ase_status *
In file included from src/shared/bap.c:27:
./src/shared/gatt-db.h:296:21: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘struct bt_ascs_ase_status *’
  296 |      const uint8_t *value, size_t len,
      |      ~~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:8631: src/shared/libshared_mainloop_la-bap.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4682: all] Error 2
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 167501282..1cadb682d 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -930,6 +930,18 @@  static void ascs_ase_rsp_success(struct iovec *iov, uint8_t id)
 					BT_ASCS_REASON_NONE);
 }
 
+static void stream_notify_ase_state(struct bt_bap_stream *stream)
+{
+	struct bt_bap_endpoint *ep = stream->ep;
+	struct bt_ascs_ase_status status;
+
+	status.id = ep->id;
+	status.state = ep->state;
+
+	gatt_db_attribute_notify(ep->attr, &status, sizeof(status),
+					bt_bap_get_att(stream->bap));
+}
+
 static void stream_notify_config(struct bt_bap_stream *stream)
 {
 	struct bt_bap_endpoint *ep = stream->ep;
@@ -1634,7 +1646,9 @@  static bool stream_notify_state(void *data)
 	struct bt_bap_stream *stream = data;
 	struct bt_bap_endpoint *ep = stream->ep;
 
-	DBG(stream->bap, "stream %p", stream);
+	DBG(stream->bap, "stream %p state %s",
+			stream,
+			bt_bap_stream_statestr(ep->state));
 
 	if (stream->state_id) {
 		timeout_remove(stream->state_id);
@@ -1643,6 +1657,7 @@  static bool stream_notify_state(void *data)
 
 	switch (ep->state) {
 	case BT_ASCS_ASE_STATE_IDLE:
+		stream_notify_ase_state(stream);
 		break;
 	case BT_ASCS_ASE_STATE_CONFIG:
 		stream_notify_config(stream);
@@ -1655,6 +1670,9 @@  static bool stream_notify_state(void *data)
 	case BT_ASCS_ASE_STATE_DISABLING:
 		stream_notify_metadata(stream);
 		break;
+	case BT_ASCS_ASE_STATE_RELEASING:
+		stream_notify_ase_state(stream);
+		break;
 	}
 
 	return false;
@@ -2068,17 +2086,11 @@  static unsigned int bap_ucast_metadata(struct bt_bap_stream *stream,
 
 static uint8_t stream_release(struct bt_bap_stream *stream, struct iovec *rsp)
 {
-	struct bt_bap_pac *pac;
-
 	DBG(stream->bap, "stream %p", stream);
 
 	ascs_ase_rsp_success(rsp, stream->ep->id);
 
-	pac = stream->lpac;
-	if (pac->ops && pac->ops->clear)
-		pac->ops->clear(stream, pac->user_data);
-
-	stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE);
+	stream_set_state(stream, BT_BAP_STREAM_STATE_RELEASING);
 
 	return 0;
 }
@@ -6172,7 +6184,8 @@  static bool stream_io_disconnected(struct io *io, void *user_data)
 
 	DBG(stream->bap, "stream %p io disconnected", stream);
 
-	bt_bap_stream_set_io(stream, -1);
+	if (stream->ep->state == BT_BAP_STREAM_STATE_RELEASING)
+		stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE);
 
 	return false;
 }