linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: Introduce option to limit A2DP channels
  2024-01-29 20:41 [PATCH BlueZ v1 1/2] main.conf: Introduce option to limit A2DP channels Victor Pushkarev
@ 2024-01-29 22:18 ` bluez.test.bot
  0 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2024-01-29 22:18 UTC (permalink / raw)
  To: linux-bluetooth, VAnPushkarev

[-- Attachment #1: Type: text/plain, Size: 2901 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/project/bluetooth/list/?series=821056

---Test result---

Test Summary:
CheckPatch                    FAIL      1.20 seconds
GitLint                       PASS      0.64 seconds
BuildEll                      PASS      24.30 seconds
BluezMake                     PASS      744.06 seconds
MakeCheck                     PASS      11.58 seconds
MakeDistcheck                 PASS      164.00 seconds
CheckValgrind                 PASS      227.32 seconds
CheckSmatch                   PASS      333.77 seconds
bluezmakeextell               PASS      109.57 seconds
IncrementalBuild              PASS      1374.21 seconds
ScanBuild                     PASS      955.44 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,v1,1/2] main.conf: Introduce option to limit A2DP channels
WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const
#145: FILE: src/main.c:165:
+static const char *a2dp_options[] = {

/github/workspace/src/src/13536361.patch total: 0 errors, 1 warnings, 75 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13536361.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


[BlueZ,v1,2/2] a2dp: Reject connection when the channel limit is exceeded
WARNING:LONG_LINE: line length of 90 exceeds 80 columns
#118: FILE: profiles/audio/a2dp.c:2553:
+				queue_length(server->channels) > btd_opts.a2dp.channels) {

WARNING:LONG_LINE_STRING: line length of 81 exceeds 80 columns
#120: FILE: profiles/audio/a2dp.c:2555:
+		DBG("Reject current connection, A2DP channel limit exceeded: %d",

/github/workspace/src/src/13536360.patch total: 0 errors, 2 warnings, 14 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13536360.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH BlueZ 0/2] Introduce option to limit A2DP channels
@ 2024-11-07 22:01 Victor Pushkarev
  2024-11-07 22:01 ` [PATCH BlueZ 1/2] main.conf: " Victor Pushkarev
  2024-11-07 22:01 ` [PATCH BlueZ 2/2] a2dp: Reject incoming connection when channel limit is exceeded Victor Pushkarev
  0 siblings, 2 replies; 7+ messages in thread
From: Victor Pushkarev @ 2024-11-07 22:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: sdfw_system_team, corvinus.v, Victor Pushkarev

This patch adds feature to limit the number of active A2DP connections.

This may be necessary to prevent audio mixing problem when playing from
multiple sources using the A2DP profile.

Victor Pushkarev (2):
  main.conf: Introduce option to limit A2DP channels
  a2dp: Reject incoming connection when channel limit is exceeded

 profiles/audio/a2dp.c  |  9 +++++++++
 profiles/audio/media.c | 11 +++++++++++
 src/btd.h              |  6 ++++++
 src/main.c             | 15 +++++++++++++++
 src/main.conf          |  5 +++++
 5 files changed, 46 insertions(+)

-- 
2.39.3 (Apple Git-146)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH BlueZ 1/2] main.conf: Introduce option to limit A2DP channels
  2024-11-07 22:01 [PATCH BlueZ 0/2] Introduce option to limit A2DP channels Victor Pushkarev
@ 2024-11-07 22:01 ` Victor Pushkarev
  2024-11-08  0:09   ` bluez.test.bot
  2024-11-07 22:01 ` [PATCH BlueZ 2/2] a2dp: Reject incoming connection when channel limit is exceeded Victor Pushkarev
  1 sibling, 1 reply; 7+ messages in thread
From: Victor Pushkarev @ 2024-11-07 22:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: sdfw_system_team, corvinus.v, Victor Pushkarev

This introduces 'Channels' which can be used to
limit the number of A2DP channels.

For new option this also adds a new group A2DP to config.

---
 src/btd.h     |  6 ++++++
 src/main.c    | 15 +++++++++++++++
 src/main.conf |  5 +++++
 3 files changed, 26 insertions(+)

diff --git a/src/btd.h b/src/btd.h
index 07205aa69..c2b6a456e 100644
--- a/src/btd.h
+++ b/src/btd.h
@@ -109,6 +109,10 @@ struct btd_avrcp_opts {
 	bool		volume_category;
 };
 
+struct btd_a2dp_opts {
+	uint8_t  channels;
+};
+
 struct btd_advmon_opts {
 	uint8_t		rssi_sampling_period;
 };
@@ -152,6 +156,8 @@ struct btd_opts {
 	struct btd_avdtp_opts avdtp;
 	struct btd_avrcp_opts avrcp;
 
+	struct btd_a2dp_opts a2dp;
+
 	uint8_t		key_size;
 
 	enum jw_repairing_t jw_repairing;
diff --git a/src/main.c b/src/main.c
index 41c3271a7..2c583e611 100644
--- a/src/main.c
+++ b/src/main.c
@@ -168,6 +168,10 @@ static const char *avdtp_options[] = {
 static const char *avrcp_options[] = {
 	"VolumeWithoutTarget",
 	"VolumeCategory",
+};
+
+static const char *a2dp_options[] = {
+	"Channels",
 	NULL
 };
 
@@ -188,6 +192,7 @@ static const struct group_table {
 	{ "CSIS",	csip_options },
 	{ "AVDTP",	avdtp_options },
 	{ "AVRCP",	avrcp_options },
+	{ "A2DP",	a2dp_options },
 	{ "AdvMon",	advmon_options },
 	{ }
 };
@@ -1157,6 +1162,13 @@ static void parse_avrcp(GKeyFile *config)
 		&btd_opts.avrcp.volume_category);
 }
 
+static void parse_a2dp(GKeyFile *config)
+{
+	parse_config_u8(config, "A2DP", "Channels",
+				&btd_opts.a2dp.channels,
+				0, UINT8_MAX);
+}
+
 static void parse_advmon(GKeyFile *config)
 {
 	parse_config_u8(config, "AdvMon", "RSSISamplingPeriod",
@@ -1181,6 +1193,7 @@ static void parse_config(GKeyFile *config)
 	parse_csis(config);
 	parse_avdtp(config);
 	parse_avrcp(config);
+	parse_a2dp(config);
 	parse_advmon(config);
 }
 
@@ -1226,6 +1239,8 @@ static void init_defaults(void)
 	btd_opts.avrcp.volume_without_target = false;
 	btd_opts.avrcp.volume_category = true;
 
+	btd_opts.a2dp.channels = 0;
+
 	btd_opts.advmon.rssi_sampling_period = 0xFF;
 	btd_opts.csis.encrypt = true;
 }
diff --git a/src/main.conf b/src/main.conf
index fff13ed2f..323a2fbbe 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -316,6 +316,11 @@
 # notifications.
 #VolumeCategory = true
 
+[A2DP]
+# Maximum number of A2DP channels
+# Defaults to 0 (unlimited)
+#Channels = 0
+
 [Policy]
 #
 # The ReconnectUUIDs defines the set of remote services that should try
-- 
2.39.3 (Apple Git-146)


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH BlueZ 2/2] a2dp: Reject incoming connection when channel limit is exceeded
  2024-11-07 22:01 [PATCH BlueZ 0/2] Introduce option to limit A2DP channels Victor Pushkarev
  2024-11-07 22:01 ` [PATCH BlueZ 1/2] main.conf: " Victor Pushkarev
@ 2024-11-07 22:01 ` Victor Pushkarev
  2024-11-07 23:01   ` Luiz Augusto von Dentz
  1 sibling, 1 reply; 7+ messages in thread
From: Victor Pushkarev @ 2024-11-07 22:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: sdfw_system_team, corvinus.v, Victor Pushkarev

Add counting of active audio streams at MediaEndpoint level.

Reject incoming connection at the audio stream setting stage
when the configured A2DP channel limit is exceeded.

---
 profiles/audio/a2dp.c  |  9 +++++++++
 profiles/audio/media.c | 11 +++++++++++
 2 files changed, 20 insertions(+)

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index c97bd6e89..935873d07 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -716,6 +716,15 @@ static gboolean endpoint_setconf_ind(struct avdtp *session,
 			return TRUE;
 		}
 
+		if (ret == -1) {
+			/* Reject connection from SEP
+			* and clear configuration.
+			*/
+			DBG("Reject connection from %s", device_get_path(setup->chan->device));
+			a2dp_sep->endpoint->clear_configuration(a2dp_sep, a2dp_sep->user_data);
+			device_request_disconnect(setup->chan->device, NULL);
+		}
+
 		setup_error_init(setup, AVDTP_MEDIA_CODEC,
 					AVDTP_UNSUPPORTED_CONFIGURATION);
 		setup_unref(setup);
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 746e538fc..20b860f6a 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -33,6 +33,7 @@
 #include "src/dbus-common.h"
 #include "src/profile.h"
 #include "src/service.h"
+#include "src/btd.h"
 
 #include "src/uuid-helper.h"
 #include "src/log.h"
@@ -134,6 +135,7 @@ struct media_player {
 };
 
 static GSList *adapters = NULL;
+static unsigned int active_streams;
 
 static void endpoint_request_free(struct endpoint_request *request)
 {
@@ -302,6 +304,9 @@ done:
 
 static void clear_endpoint(struct media_endpoint *endpoint)
 {
+	if (active_streams > 0)
+		active_streams--;
+
 	media_endpoint_cancel_all(endpoint);
 
 	while (endpoint->transports != NULL)
@@ -659,6 +664,12 @@ static int set_config(struct a2dp_sep *sep, uint8_t *configuration,
 	struct media_endpoint *endpoint = user_data;
 	struct a2dp_config_data *data;
 
+	active_streams++;
+	if (active_streams > btd_opts.a2dp.channels) {
+		DBG("A2DP channel limit (%u) exceeded", btd_opts.a2dp.channels);
+		return -1;
+	}
+
 	data = g_new0(struct a2dp_config_data, 1);
 	data->setup = setup;
 	data->cb = cb;
-- 
2.39.3 (Apple Git-146)


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH BlueZ 2/2] a2dp: Reject incoming connection when channel limit is exceeded
  2024-11-07 22:01 ` [PATCH BlueZ 2/2] a2dp: Reject incoming connection when channel limit is exceeded Victor Pushkarev
@ 2024-11-07 23:01   ` Luiz Augusto von Dentz
  2024-12-05 10:51     ` Victor Pushkarev
  0 siblings, 1 reply; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2024-11-07 23:01 UTC (permalink / raw)
  To: Victor Pushkarev; +Cc: linux-bluetooth, sdfw_system_team, corvinus.v

Hi Victor,

On Thu, Nov 7, 2024 at 5:10 PM Victor Pushkarev
<VAnPushkarev@salutedevices.com> wrote:
>
> Add counting of active audio streams at MediaEndpoint level.
>
> Reject incoming connection at the audio stream setting stage
> when the configured A2DP channel limit is exceeded.
>
> ---
>  profiles/audio/a2dp.c  |  9 +++++++++
>  profiles/audio/media.c | 11 +++++++++++
>  2 files changed, 20 insertions(+)
>
> diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
> index c97bd6e89..935873d07 100644
> --- a/profiles/audio/a2dp.c
> +++ b/profiles/audio/a2dp.c
> @@ -716,6 +716,15 @@ static gboolean endpoint_setconf_ind(struct avdtp *session,
>                         return TRUE;
>                 }
>
> +               if (ret == -1) {
> +                       /* Reject connection from SEP
> +                       * and clear configuration.
> +                       */
> +                       DBG("Reject connection from %s", device_get_path(setup->chan->device));
> +                       a2dp_sep->endpoint->clear_configuration(a2dp_sep, a2dp_sep->user_data);
> +                       device_request_disconnect(setup->chan->device, NULL);
> +               }
> +
>                 setup_error_init(setup, AVDTP_MEDIA_CODEC,
>                                         AVDTP_UNSUPPORTED_CONFIGURATION);
>                 setup_unref(setup);
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index 746e538fc..20b860f6a 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -33,6 +33,7 @@
>  #include "src/dbus-common.h"
>  #include "src/profile.h"
>  #include "src/service.h"
> +#include "src/btd.h"
>
>  #include "src/uuid-helper.h"
>  #include "src/log.h"
> @@ -134,6 +135,7 @@ struct media_player {
>  };
>
>  static GSList *adapters = NULL;
> +static unsigned int active_streams;
>
>  static void endpoint_request_free(struct endpoint_request *request)
>  {
> @@ -302,6 +304,9 @@ done:
>
>  static void clear_endpoint(struct media_endpoint *endpoint)
>  {
> +       if (active_streams > 0)
> +               active_streams--;
> +
>         media_endpoint_cancel_all(endpoint);
>
>         while (endpoint->transports != NULL)
> @@ -659,6 +664,12 @@ static int set_config(struct a2dp_sep *sep, uint8_t *configuration,
>         struct media_endpoint *endpoint = user_data;
>         struct a2dp_config_data *data;
>
> +       active_streams++;
> +       if (active_streams > btd_opts.a2dp.channels) {
> +               DBG("A2DP channel limit (%u) exceeded", btd_opts.a2dp.channels);
> +               return -1;
> +       }

This is a global limit? Not really following the reasoning here, if
the platform don't want to connect to more devices just don't connect
them, or in case of incoming connection don't authorize the
connections, make the endpoints return an error to SetConfiguration,
suspend the streams, etc. There are so many ways to block this that I
don't really feel like introducing a new one will do us any good.

>         data = g_new0(struct a2dp_config_data, 1);
>         data->setup = setup;
>         data->cb = cb;
> --
> 2.39.3 (Apple Git-146)
>
>


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Introduce option to limit A2DP channels
  2024-11-07 22:01 ` [PATCH BlueZ 1/2] main.conf: " Victor Pushkarev
@ 2024-11-08  0:09   ` bluez.test.bot
  0 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2024-11-08  0:09 UTC (permalink / raw)
  To: linux-bluetooth, VAnPushkarev

[-- Attachment #1: Type: text/plain, Size: 3349 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/project/bluetooth/list/?series=907547

---Test result---

Test Summary:
CheckPatch                    FAIL      1.02 seconds
GitLint                       PASS      0.63 seconds
BuildEll                      PASS      25.51 seconds
BluezMake                     PASS      1739.17 seconds
MakeCheck                     PASS      12.98 seconds
MakeDistcheck                 PASS      178.52 seconds
CheckValgrind                 PASS      252.44 seconds
CheckSmatch                   PASS      356.62 seconds
bluezmakeextell               PASS      122.75 seconds
IncrementalBuild              PASS      3101.50 seconds
ScanBuild                     WARNING   1008.31 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,1/2] main.conf: Introduce option to limit A2DP channels
WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const
#140: FILE: src/main.c:173:
+static const char *a2dp_options[] = {

/github/workspace/src/src/13867230.patch total: 0 errors, 1 warnings, 74 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13867230.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


[BlueZ,2/2] a2dp: Reject incoming connection when channel limit is exceeded
WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line
#116: FILE: profiles/audio/a2dp.c:721:
+			/* Reject connection from SEP
+			* and clear configuration.

WARNING:LONG_LINE: line length of 95 exceeds 80 columns
#118: FILE: profiles/audio/a2dp.c:723:
+			DBG("Reject connection from %s", device_get_path(setup->chan->device));

WARNING:LONG_LINE: line length of 95 exceeds 80 columns
#119: FILE: profiles/audio/a2dp.c:724:
+			a2dp_sep->endpoint->clear_configuration(a2dp_sep, a2dp_sep->user_data);

/github/workspace/src/src/13867231.patch total: 0 errors, 3 warnings, 50 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13867231.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
profiles/audio/media.c:1059:7: warning: Use of memory after it is freed
                if (req->cb != pac_select_cb) {
                    ^~~~~~~
1 warning generated.



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH BlueZ 2/2] a2dp: Reject incoming connection when channel limit is exceeded
  2024-11-07 23:01   ` Luiz Augusto von Dentz
@ 2024-12-05 10:51     ` Victor Pushkarev
  0 siblings, 0 replies; 7+ messages in thread
From: Victor Pushkarev @ 2024-12-05 10:51 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth, corvinus.v

Hi, Luiz!

> This is a global limit?

Yes, the limit is global, to be able to disable/configure the behavior
via conf file.

> Not really following the reasoning here, if
> the platform don't want to connect to more devices just don't connect
> them

In this case, the patch solves the problem with audio mixing from
multiple sources via A2DP when the sink device is for example
a bluetooth speaker.

> make the endpoints return an error to SetConfiguration

Which I tried to do, but probably not too architecturally correct.
This patch works, but I would like to find the most correct
solution or implement it for everyone's benefit.

> There are so many ways to block this that I
> don't really feel like introducing a new one will do us any good.

In that case, could you please guide me - which option should I use
to limit the number of A2DP connections?
I haven't found a suitable setting or option that solves the problem
of multiple simultaneous A2DP connections..

Thank you in advance.

08.11.2024 02:01, Luiz Augusto von Dentz пишет:
> Hi Victor,
>
> On Thu, Nov 7, 2024 at 5:10 PM Victor Pushkarev
> <VAnPushkarev@salutedevices.com> wrote:
>> Add counting of active audio streams at MediaEndpoint level.
>>
>> Reject incoming connection at the audio stream setting stage
>> when the configured A2DP channel limit is exceeded.
>>
>> ---
>>   profiles/audio/a2dp.c  |  9 +++++++++
>>   profiles/audio/media.c | 11 +++++++++++
>>   2 files changed, 20 insertions(+)
>>
>> diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
>> index c97bd6e89..935873d07 100644
>> --- a/profiles/audio/a2dp.c
>> +++ b/profiles/audio/a2dp.c
>> @@ -716,6 +716,15 @@ static gboolean endpoint_setconf_ind(struct avdtp *session,
>>                          return TRUE;
>>                  }
>>
>> +               if (ret == -1) {
>> +                       /* Reject connection from SEP
>> +                       * and clear configuration.
>> +                       */
>> +                       DBG("Reject connection from %s", device_get_path(setup->chan->device));
>> +                       a2dp_sep->endpoint->clear_configuration(a2dp_sep, a2dp_sep->user_data);
>> +                       device_request_disconnect(setup->chan->device, NULL);
>> +               }
>> +
>>                  setup_error_init(setup, AVDTP_MEDIA_CODEC,
>>                                          AVDTP_UNSUPPORTED_CONFIGURATION);
>>                  setup_unref(setup);
>> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
>> index 746e538fc..20b860f6a 100644
>> --- a/profiles/audio/media.c
>> +++ b/profiles/audio/media.c
>> @@ -33,6 +33,7 @@
>>   #include "src/dbus-common.h"
>>   #include "src/profile.h"
>>   #include "src/service.h"
>> +#include "src/btd.h"
>>
>>   #include "src/uuid-helper.h"
>>   #include "src/log.h"
>> @@ -134,6 +135,7 @@ struct media_player {
>>   };
>>
>>   static GSList *adapters = NULL;
>> +static unsigned int active_streams;
>>
>>   static void endpoint_request_free(struct endpoint_request *request)
>>   {
>> @@ -302,6 +304,9 @@ done:
>>
>>   static void clear_endpoint(struct media_endpoint *endpoint)
>>   {
>> +       if (active_streams > 0)
>> +               active_streams--;
>> +
>>          media_endpoint_cancel_all(endpoint);
>>
>>          while (endpoint->transports != NULL)
>> @@ -659,6 +664,12 @@ static int set_config(struct a2dp_sep *sep, uint8_t *configuration,
>>          struct media_endpoint *endpoint = user_data;
>>          struct a2dp_config_data *data;
>>
>> +       active_streams++;
>> +       if (active_streams > btd_opts.a2dp.channels) {
>> +               DBG("A2DP channel limit (%u) exceeded", btd_opts.a2dp.channels);
>> +               return -1;
>> +       }
> This is a global limit? Not really following the reasoning here, if
> the platform don't want to connect to more devices just don't connect
> them, or in case of incoming connection don't authorize the
> connections, make the endpoints return an error to SetConfiguration,
> suspend the streams, etc. There are so many ways to block this that I
> don't really feel like introducing a new one will do us any good.
>
>>          data = g_new0(struct a2dp_config_data, 1);
>>          data->setup = setup;
>>          data->cb = cb;
>> --
>> 2.39.3 (Apple Git-146)
>>
>>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-12-05 11:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 22:01 [PATCH BlueZ 0/2] Introduce option to limit A2DP channels Victor Pushkarev
2024-11-07 22:01 ` [PATCH BlueZ 1/2] main.conf: " Victor Pushkarev
2024-11-08  0:09   ` bluez.test.bot
2024-11-07 22:01 ` [PATCH BlueZ 2/2] a2dp: Reject incoming connection when channel limit is exceeded Victor Pushkarev
2024-11-07 23:01   ` Luiz Augusto von Dentz
2024-12-05 10:51     ` Victor Pushkarev
  -- strict thread matches above, loose matches on Subject: below --
2024-01-29 20:41 [PATCH BlueZ v1 1/2] main.conf: Introduce option to limit A2DP channels Victor Pushkarev
2024-01-29 22:18 ` 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;
as well as URLs for NNTP newsgroup(s).