All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice
@ 2024-12-16 18:46 Frédéric Danis
  2024-12-16 18:46 ` [PATCH BlueZ v2 1/2] lib: Add constant for 16 bits transparent voice setting Frédéric Danis
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Frédéric Danis @ 2024-12-16 18:46 UTC (permalink / raw)
  To: linux-bluetooth

Add 16 bits, 2s complement, transparent air coding format for mSBC.
Corresponding commit implements functionality on kernel side.

The voice setting is used by sco_connect() or sco_conn_defer_accept()
after being set by sco_sock_setsockopt().

The PCM part of the voice setting is used for offload mode through PCM
chipset port.
This commits add support for mSBC 16 bits offloading, i.e. audio data
not transported over HCI.

The BCM4349B1 supports 16 bits transparent data on its I2S port.
If BT_VOICE_TRANSPARENT is used when accepting a SCO connection, this
gives only garbage audio while using BT_VOICE_TRANSPARENT_16BIT gives
correct audio.
This has been tested with connection to iPhone 14 and Samsung S24.

This also adds a test to checks that BT_VOICE_TRANSPARENT_16BIT voice
settings can be set and get using [set|get]sockopt().

v1 -> v2: Add test to tools/sco-tester

Frédéric Danis (2):
  lib: Add constant for 16 bits transparent voice setting
  sco-tester: Add test for BT_VOICE_TRANSPARENT_16BIT constant

 lib/bluetooth.h    |  1 +
 tools/sco-tester.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

-- 
2.34.1


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

* [PATCH BlueZ v2 1/2] lib: Add constant for 16 bits transparent voice setting
  2024-12-16 18:46 [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice Frédéric Danis
@ 2024-12-16 18:46 ` Frédéric Danis
  2024-12-16 20:07   ` Add constant for 16 bits transparent voice bluez.test.bot
  2024-12-16 18:46 ` [PATCH BlueZ v2 2/2] sco-tester: Add test for BT_VOICE_TRANSPARENT_16BIT constant Frédéric Danis
  2024-12-16 21:50 ` [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice patchwork-bot+bluetooth
  2 siblings, 1 reply; 5+ messages in thread
From: Frédéric Danis @ 2024-12-16 18:46 UTC (permalink / raw)
  To: linux-bluetooth

Add 16 bits, 2s complement, transparent air coding format for mSBC.
Corresponding commit implements functionality on kernel side.

The voice setting is used by sco_connect() or sco_conn_defer_accept()
after being set by sco_sock_setsockopt().

The PCM part of the voice setting is used for offload mode through PCM
chipset port.
This commits add support for mSBC 16 bits offloading, i.e. audio data
not transported over HCI.

The BCM4349B1 supports 16 bits transparent data on its I2S port.
If BT_VOICE_TRANSPARENT is used when accepting a SCO connection, this
gives only garbage audio while using BT_VOICE_TRANSPARENT_16BIT gives
correct audio.
This has been tested with connection to iPhone 14 and Samsung S24.
---
 lib/bluetooth.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index 073ed875d..32e58678b 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -111,6 +111,7 @@ struct bt_voice {
 
 #define BT_VOICE_TRANSPARENT			0x0003
 #define BT_VOICE_CVSD_16BIT			0x0060
+#define BT_VOICE_TRANSPARENT_16BIT		0x0063
 
 #define BT_PHY			14
 
-- 
2.34.1


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

* [PATCH BlueZ v2 2/2] sco-tester: Add test for BT_VOICE_TRANSPARENT_16BIT constant
  2024-12-16 18:46 [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice Frédéric Danis
  2024-12-16 18:46 ` [PATCH BlueZ v2 1/2] lib: Add constant for 16 bits transparent voice setting Frédéric Danis
@ 2024-12-16 18:46 ` Frédéric Danis
  2024-12-16 21:50 ` [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice patchwork-bot+bluetooth
  2 siblings, 0 replies; 5+ messages in thread
From: Frédéric Danis @ 2024-12-16 18:46 UTC (permalink / raw)
  To: linux-bluetooth

This test checks that BT_VOICE_TRANSPARENT_16BIT voice settings can
be set and get using [set|get]sockopt().
---
 tools/sco-tester.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tools/sco-tester.c b/tools/sco-tester.c
index a56cb9153..6fc26b7af 100644
--- a/tools/sco-tester.c
+++ b/tools/sco-tester.c
@@ -527,6 +527,34 @@ static void test_setsockopt(const void *test_data)
 		goto end;
 	}
 
+	memset(&voice, 0, sizeof(voice));
+	voice.setting = BT_VOICE_TRANSPARENT_16BIT;
+
+	err = setsockopt(sk, SOL_BLUETOOTH, BT_VOICE, &voice, sizeof(voice));
+	if (err < 0) {
+		tester_warn("Can't set socket option : %s (%d)",
+							strerror(errno), errno);
+		tester_test_failed();
+		goto end;
+	}
+
+	len = sizeof(voice);
+	memset(&voice, 0, len);
+
+	err = getsockopt(sk, SOL_BLUETOOTH, BT_VOICE, &voice, &len);
+	if (err < 0) {
+		tester_warn("Can't get socket option : %s (%d)",
+							strerror(errno), errno);
+		tester_test_failed();
+		goto end;
+	}
+
+	if (voice.setting != BT_VOICE_TRANSPARENT_16BIT) {
+		tester_warn("Invalid voice setting");
+		tester_test_failed();
+		goto end;
+	}
+
 	memset(&voice, 0, sizeof(voice));
 	voice.setting = BT_VOICE_TRANSPARENT;
 
-- 
2.34.1


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

* RE: Add constant for 16 bits transparent voice
  2024-12-16 18:46 ` [PATCH BlueZ v2 1/2] lib: Add constant for 16 bits transparent voice setting Frédéric Danis
@ 2024-12-16 20:07   ` bluez.test.bot
  0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2024-12-16 20:07 UTC (permalink / raw)
  To: linux-bluetooth, frederic.danis

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

---Test result---

Test Summary:
CheckPatch                    PENDING   0.52 seconds
GitLint                       PENDING   0.39 seconds
BuildEll                      PASS      20.42 seconds
BluezMake                     PASS      1509.10 seconds
MakeCheck                     PASS      13.29 seconds
MakeDistcheck                 PASS      158.50 seconds
CheckValgrind                 PASS      215.34 seconds
CheckSmatch                   WARNING   272.81 seconds
bluezmakeextell               PASS      98.70 seconds
IncrementalBuild              PENDING   0.35 seconds
ScanBuild                     PASS      841.58 seconds

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

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

##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
tools/sco-tester.c: note: in included file:./lib/bluetooth.h:220:15: warning: array of flexible structures./lib/bluetooth.h:225:31: warning: array of flexible structures
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice
  2024-12-16 18:46 [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice Frédéric Danis
  2024-12-16 18:46 ` [PATCH BlueZ v2 1/2] lib: Add constant for 16 bits transparent voice setting Frédéric Danis
  2024-12-16 18:46 ` [PATCH BlueZ v2 2/2] sco-tester: Add test for BT_VOICE_TRANSPARENT_16BIT constant Frédéric Danis
@ 2024-12-16 21:50 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2024-12-16 21:50 UTC (permalink / raw)
  To: =?utf-8?b?RnLDqWTDqXJpYyBEYW5pcyA8ZnJlZGVyaWMuZGFuaXNAY29sbGFib3JhLmNvbT4=?=
  Cc: linux-bluetooth

Hello:

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

On Mon, 16 Dec 2024 19:46:11 +0100 you wrote:
> Add 16 bits, 2s complement, transparent air coding format for mSBC.
> Corresponding commit implements functionality on kernel side.
> 
> The voice setting is used by sco_connect() or sco_conn_defer_accept()
> after being set by sco_sock_setsockopt().
> 
> The PCM part of the voice setting is used for offload mode through PCM
> chipset port.
> This commits add support for mSBC 16 bits offloading, i.e. audio data
> not transported over HCI.
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2,1/2] lib: Add constant for 16 bits transparent voice setting
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9b631e09e943
  - [BlueZ,v2,2/2] sco-tester: Add test for BT_VOICE_TRANSPARENT_16BIT constant
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ff07f10ee4da

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] 5+ messages in thread

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-16 18:46 [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice Frédéric Danis
2024-12-16 18:46 ` [PATCH BlueZ v2 1/2] lib: Add constant for 16 bits transparent voice setting Frédéric Danis
2024-12-16 20:07   ` Add constant for 16 bits transparent voice bluez.test.bot
2024-12-16 18:46 ` [PATCH BlueZ v2 2/2] sco-tester: Add test for BT_VOICE_TRANSPARENT_16BIT constant Frédéric Danis
2024-12-16 21:50 ` [PATCH BlueZ v2 0/2] Add constant for 16 bits transparent voice 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.