All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] tools/avtest: Add AAC configuration
@ 2025-02-20  7:22 Frédéric Danis
  2025-02-20  8:30 ` [BlueZ] " bluez.test.bot
  2025-02-21 16:50 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Frédéric Danis @ 2025-02-20  7:22 UTC (permalink / raw)
  To: linux-bluetooth

The tests A2DP/SNK/AVP/BI-01-C, A2DP/SNK/AVP/BI-02-C,
A2DP/SNK/AVP/BI-05-C and  A2DP/SNK/AVP/BI-07-C expect the IUT to
provide an AAC configuration.

This can be used by adding '--aac' to the avtest command, e.g. for
A2DP/SNK/AVP/BI-01-C test:
 tools/avtest --aac --reject setconf --reject-code 214
---
 tools/avtest.c | 49 +++++++++++++++++++++++++++++++++++++------------
 1 file changed, 37 insertions(+), 12 deletions(-)

diff --git a/tools/avtest.c b/tools/avtest.c
index 5ac3418aa..a52662d80 100644
--- a/tools/avtest.c
+++ b/tools/avtest.c
@@ -151,7 +151,7 @@ struct avctp_header {
 
 #define AVCTP_PACKET_SINGLE	0
 
-static const unsigned char media_transport[] = {
+static const unsigned char media_transport_sbc[] = {
 		0x01,	/* Media transport category */
 		0x00,
 		0x07,	/* Media codec category */
@@ -164,6 +164,24 @@ static const unsigned char media_transport[] = {
 		0x33,
 };
 
+static const unsigned char media_transport_aac[] = {
+		0x01,	/* Media transport category */
+		0x00,
+		0x07,	/* Media codec category */
+		0x08,
+		0x00,	/* Media type audio */
+		0x02,	/* Codec MPEG2,4 AAC */
+		0x80,	/* Codec MPEG-2 AAC LC */
+		0x01,	/* 44100 */
+		0x8C,	/* 48000, 1 and 2 channels */
+		0x84,	/* VBR supported, Max peak rate 320000 */
+		0xE2,
+		0x00
+};
+
+static const unsigned char *media_transport = media_transport_sbc;
+static size_t media_transport_size = sizeof(media_transport_sbc);
+
 static int media_sock = -1;
 
 static void dump_avctp_header(struct avctp_header *hdr)
@@ -254,30 +272,30 @@ static void process_avdtp(int srv_sk, int sk, unsigned char reject,
 				start->signal_id = AVDTP_GET_CAPABILITIES;
 				start->no_of_packets = 3;
 				memcpy(&buf[3], media_transport,
-						sizeof(media_transport));
+						media_transport_size);
 				len = write(sk, buf,
 						3 + sizeof(media_transport));
 
 				/* Continue packet */
 				hdr->packet_type = AVDTP_PKT_TYPE_CONTINUE;
 				memcpy(&buf[1], media_transport,
-						sizeof(media_transport));
+						media_transport_size);
 				len = write(sk, buf,
-						1 + sizeof(media_transport));
+						1 + media_transport_size);
 
 				/* End packet */
 				hdr->packet_type = AVDTP_PKT_TYPE_END;
 				memcpy(&buf[1], media_transport,
-						sizeof(media_transport));
+						media_transport_size);
 				len = write(sk, buf,
-						1 + sizeof(media_transport));
+						1 + media_transport_size);
 			} else {
 				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
 				memcpy(&buf[2], media_transport,
-						sizeof(media_transport));
+						media_transport_size);
 				printf("Accepting get capabilities command\n");
 				len = write(sk, buf,
-						2 + sizeof(media_transport));
+						2 + media_transport_size);
 			}
 			break;
 
@@ -578,10 +596,10 @@ static void do_avdtp_send(int sk, const bdaddr_t *src, const bdaddr_t *dst,
 		hdr->signal_id = AVDTP_SET_CONFIGURATION;
 		buf[2] = 1 << 2; /* ACP SEID */
 		buf[3] = 1 << 2; /* INT SEID */
-		memcpy(&buf[4], media_transport, sizeof(media_transport));
+		memcpy(&buf[4], media_transport, media_transport_size);
 		if (invalid)
 			buf[5] = 0x01; /* LOSC != 0 */
-		len = write(sk, buf, 4 + sizeof(media_transport));
+		len = write(sk, buf, 4 + media_transport_size);
 		break;
 
 	case AVDTP_GET_CONFIGURATION:
@@ -717,7 +735,8 @@ static void usage(void)
 		"\t--preconf            Configure stream before actual command\n"
 		"\t--wait <N>           Wait N seconds before exiting\n"
 		"\t--fragment           Use minimum MTU and fragmented messages\n"
-		"\t--invalid <command>  Send invalid command\n");
+		"\t--invalid <command>  Send invalid command\n"
+		"\t--aac                MPEG2,4 AAC LC\n");
 }
 
 static struct option main_options[] = {
@@ -731,6 +750,7 @@ static struct option main_options[] = {
 	{ "fragment",   0, 0, 'F' },
 	{ "avctp",	0, 0, 'C' },
 	{ "wait",	1, 0, 'w' },
+	{ "aac",	0, 0, 'a' },
 	{ 0, 0, 0, 0 }
 };
 
@@ -774,7 +794,7 @@ int main(int argc, char *argv[])
 	bacpy(&src, BDADDR_ANY);
 	bacpy(&dst, BDADDR_ANY);
 
-	while ((opt = getopt_long(argc, argv, "+i:r:s:f:hcFCw:R:",
+	while ((opt = getopt_long(argc, argv, "+i:r:s:f:hcFCw:R:a",
 						main_options, NULL)) != EOF) {
 		switch (opt) {
 		case 'i':
@@ -818,6 +838,11 @@ int main(int argc, char *argv[])
 			reject_code = atoi(optarg);
 			break;
 
+		case 'a':
+			media_transport = media_transport_aac;
+			media_transport_size = sizeof(media_transport_aac);
+			break;
+
 		case 'h':
 		default:
 			usage();
-- 
2.43.0


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

* RE: [BlueZ] tools/avtest: Add AAC configuration
  2025-02-20  7:22 [PATCH BlueZ] tools/avtest: Add AAC configuration Frédéric Danis
@ 2025-02-20  8:30 ` bluez.test.bot
  2025-02-21 16:50 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-02-20  8:30 UTC (permalink / raw)
  To: linux-bluetooth, frederic.danis

[-- Attachment #1: Type: text/plain, Size: 1260 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=935871

---Test result---

Test Summary:
CheckPatch                    PENDING   0.36 seconds
GitLint                       PENDING   0.32 seconds
BuildEll                      PASS      20.55 seconds
BluezMake                     PASS      1544.66 seconds
MakeCheck                     PASS      12.93 seconds
MakeDistcheck                 PASS      158.77 seconds
CheckValgrind                 PASS      213.74 seconds
CheckSmatch                   PASS      287.60 seconds
bluezmakeextell               PASS      98.18 seconds
IncrementalBuild              PENDING   0.39 seconds
ScanBuild                     PASS      870.44 seconds

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

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

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] tools/avtest: Add AAC configuration
  2025-02-20  7:22 [PATCH BlueZ] tools/avtest: Add AAC configuration Frédéric Danis
  2025-02-20  8:30 ` [BlueZ] " bluez.test.bot
@ 2025-02-21 16:50 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-02-21 16:50 UTC (permalink / raw)
  To: =?utf-8?b?RnLDqWTDqXJpYyBEYW5pcyA8ZnJlZGVyaWMuZGFuaXNAY29sbGFib3JhLmNvbT4=?=
  Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 20 Feb 2025 08:22:35 +0100 you wrote:
> The tests A2DP/SNK/AVP/BI-01-C, A2DP/SNK/AVP/BI-02-C,
> A2DP/SNK/AVP/BI-05-C and  A2DP/SNK/AVP/BI-07-C expect the IUT to
> provide an AAC configuration.
> 
> This can be used by adding '--aac' to the avtest command, e.g. for
> A2DP/SNK/AVP/BI-01-C test:
>  tools/avtest --aac --reject setconf --reject-code 214
> 
> [...]

Here is the summary with links:
  - [BlueZ] tools/avtest: Add AAC configuration
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=fc7be1e86771

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-02-21 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20  7:22 [PATCH BlueZ] tools/avtest: Add AAC configuration Frédéric Danis
2025-02-20  8:30 ` [BlueZ] " bluez.test.bot
2025-02-21 16:50 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.