2021-04-08 16:59:13

by K, Kiran

[permalink] [raw]
Subject: [PATCH v1] Bluetooth: Fix alt settings for incoming SCO with transparent coding format

For incoming SCO connection with transparent coding format, alt setting
of CVSD is getting applied instead of Transparent.

Before fix:
< HCI Command: Accept Synchron.. (0x01|0x0029) plen 21 #2196 [hci0] 321.342548
Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
Transmit bandwidth: 8000
Receive bandwidth: 8000
Max latency: 13
Setting: 0x0003
Input Coding: Linear
Input Data Format: 1's complement
Input Sample Size: 8-bit
# of bits padding at MSB: 0
Air Coding Format: Transparent Data
Retransmission effort: Optimize for link quality (0x02)
Packet type: 0x003f
HV1 may be used
HV2 may be used
HV3 may be used
EV3 may be used
EV4 may be used
EV5 may be used
> HCI Event: Command Status (0x0f) plen 4 #2197 [hci0] 321.343585
Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
Status: Success (0x00)
> HCI Event: Synchronous Connect Comp.. (0x2c) plen 17 #2198 [hci0] 321.351666
Status: Success (0x00)
Handle: 257
Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
Link type: eSCO (0x02)
Transmission interval: 0x0c
Retransmission window: 0x04
RX packet length: 60
TX packet length: 60
Air mode: Transparent (0x03)
........
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2336 [hci0] 321.383655
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #2337 [hci0] 321.389558
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2338 [hci0] 321.393615
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2339 [hci0] 321.393618
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2340 [hci0] 321.393618
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #2341 [hci0] 321.397070
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2342 [hci0] 321.403622
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2343 [hci0] 321.403625
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2344 [hci0] 321.403625
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2345 [hci0] 321.403625
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #2346 [hci0] 321.404569
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #2347 [hci0] 321.412091
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2348 [hci0] 321.413626
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2349 [hci0] 321.413630
> SCO Data RX: Handle 257 flags 0x00 dlen 48 #2350 [hci0] 321.413630
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #2351 [hci0] 321.419674

After fix:

< HCI Command: Accept Synchronou.. (0x01|0x0029) plen 21 #309 [hci0] 49.439693
Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
Transmit bandwidth: 8000
Receive bandwidth: 8000
Max latency: 13
Setting: 0x0003
Input Coding: Linear
Input Data Format: 1's complement
Input Sample Size: 8-bit
# of bits padding at MSB: 0
Air Coding Format: Transparent Data
Retransmission effort: Optimize for link quality (0x02)
Packet type: 0x003f
HV1 may be used
HV2 may be used
HV3 may be used
EV3 may be used
EV4 may be used
EV5 may be used
> HCI Event: Command Status (0x0f) plen 4 #310 [hci0] 49.440308
Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
Status: Success (0x00)
> HCI Event: Synchronous Connect Complete (0x2c) plen 17 #311 [hci0] 49.449308
Status: Success (0x00)
Handle: 257
Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
Link type: eSCO (0x02)
Transmission interval: 0x0c
Retransmission window: 0x04
RX packet length: 60
TX packet length: 60
Air mode: Transparent (0x03)
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #312 [hci0] 49.450421
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #313 [hci0] 49.457927
> HCI Event: Max Slots Change (0x1b) plen 3 #314 [hci0] 49.460345
Handle: 256
Max slots: 5
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #315 [hci0] 49.465453
> SCO Data RX: Handle 257 flags 0x00 dlen 60 #316 [hci0] 49.470502
> SCO Data RX: Handle 257 flags 0x00 dlen 60 #317 [hci0] 49.470519
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #318 [hci0] 49.472996
> SCO Data RX: Handle 257 flags 0x00 dlen 60 #319 [hci0] 49.480412
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #320 [hci0] 49.480492
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #321 [hci0] 49.487989
> SCO Data RX: Handle 257 flags 0x00 dlen 60 #322 [hci0] 49.490303
< SCO Data TX: Handle 257 flags 0x00 dlen 60 #323 [hci0] 49.495496
> SCO Data RX: Handle 257 flags 0x00 dlen 60 #324 [hci0] 49.500304
> SCO Data RX: Handle 257 flags 0x00 dlen 60 #325 [hci0] 49.500311

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Lokendra Singh <[email protected]>
---
net/bluetooth/hci_event.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 016b2999f219..47166cea68bb 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4404,12 +4404,12 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev,

bt_dev_dbg(hdev, "SCO connected with air mode: %02x", ev->air_mode);

- switch (conn->setting & SCO_AIRMODE_MASK) {
- case SCO_AIRMODE_CVSD:
+ switch (ev->air_mode) {
+ case 0x02:
if (hdev->notify)
hdev->notify(hdev, HCI_NOTIFY_ENABLE_SCO_CVSD);
break;
- case SCO_AIRMODE_TRANSP:
+ case 0x03:
if (hdev->notify)
hdev->notify(hdev, HCI_NOTIFY_ENABLE_SCO_TRANSP);
break;
--
2.17.1


2021-04-08 17:55:31

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v1] Bluetooth: Fix alt settings for incoming SCO with transparent coding format

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=463595

---Test result---

##############################
Test: CheckPatch - FAIL
Bluetooth: Fix alt settings for incoming SCO with transparent coding format
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#11:
< HCI Command: Accept Synchron.. (0x01|0x0029) plen 21 #2196 [hci0] 321.342548

total: 0 errors, 1 warnings, 0 checks, 15 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.

"[PATCH] Bluetooth: Fix alt settings for incoming SCO with transparent" has style problems, please review.

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


##############################
Test: CheckGitLint - FAIL
Bluetooth: Fix alt settings for incoming SCO with transparent coding format
1: T1 Title exceeds max length (75>72): "Bluetooth: Fix alt settings for incoming SCO with transparent coding format"


##############################
Test: CheckBuildK - PASS


##############################
Test: CheckTestRunner: Setup - PASS


##############################
Test: CheckTestRunner: l2cap-tester - PASS
Total: 40, Passed: 34 (85.0%), Failed: 0, Not Run: 6

##############################
Test: CheckTestRunner: bnep-tester - PASS
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: mgmt-tester - FAIL
Total: 416, Passed: 394 (94.7%), Failed: 6, Not Run: 16

Failed Test Cases
Set connectable off (LE) - Success 2 Failed 0.028 seconds
Set connectable off (LE) - Success 3 Failed 0.032 seconds
Set connectable off (LE) - Success 4 Failed 0.028 seconds
Add Advertising - Success 13 (ADV_SCAN_IND) Failed 0.028 seconds
Add Advertising - Success 14 (ADV_NONCONN_IND) Failed 0.024 seconds
Add Advertising - Success 17 (Connectable -> off) Failed 0.024 seconds

##############################
Test: CheckTestRunner: rfcomm-tester - PASS
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: sco-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: smp-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: userchan-tester - PASS
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth


Attachments:
l2cap-tester.log (42.32 kB)
bnep-tester.log (3.45 kB)
mgmt-tester.log (534.29 kB)
rfcomm-tester.log (11.38 kB)
sco-tester.log (9.66 kB)
smp-tester.log (11.52 kB)
userchan-tester.log (5.30 kB)
Download all attachments

2021-04-14 19:21:31

by K, Kiran

[permalink] [raw]
Subject: RE: [PATCH v1] Bluetooth: Fix alt settings for incoming SCO with transparent coding format

Hi Marcel,

Gentle reminder.

Thanks,
Kiran


> -----Original Message-----
> From: Kiran K <[email protected]>
> Sent: Thursday, April 8, 2021 10:32 PM
> To: [email protected]
> Cc: Srivatsa, Ravishankar <[email protected]>; Tumkur
> Narayan, Chethan <[email protected]>; K, Kiran
> <[email protected]>; Singh, Lokendra <[email protected]>
> Subject: [PATCH v1] Bluetooth: Fix alt settings for incoming SCO with
> transparent coding format
>
> For incoming SCO connection with transparent coding format, alt setting of
> CVSD is getting applied instead of Transparent.
>
> Before fix:
> < HCI Command: Accept Synchron.. (0x01|0x0029) plen 21 #2196 [hci0]
> 321.342548
> Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
> Transmit bandwidth: 8000
> Receive bandwidth: 8000
> Max latency: 13
> Setting: 0x0003
> Input Coding: Linear
> Input Data Format: 1's complement
> Input Sample Size: 8-bit
> # of bits padding at MSB: 0
> Air Coding Format: Transparent Data
> Retransmission effort: Optimize for link quality (0x02)
> Packet type: 0x003f
> HV1 may be used
> HV2 may be used
> HV3 may be used
> EV3 may be used
> EV4 may be used
> EV5 may be used
> > HCI Event: Command Status (0x0f) plen 4 #2197 [hci0] 321.343585
> Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
> Status: Success (0x00)
> > HCI Event: Synchronous Connect Comp.. (0x2c) plen 17 #2198 [hci0]
> > 321.351666
> Status: Success (0x00)
> Handle: 257
> Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
> Link type: eSCO (0x02)
> Transmission interval: 0x0c
> Retransmission window: 0x04
> RX packet length: 60
> TX packet length: 60
> Air mode: Transparent (0x03)
> ........
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2336 [hci0] 321.383655
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2337 [hci0] 321.389558
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2338 [hci0] 321.393615
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2339 [hci0] 321.393618
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2340 [hci0] 321.393618
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2341 [hci0] 321.397070
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2342 [hci0] 321.403622
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2343 [hci0] 321.403625
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2344 [hci0] 321.403625
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2345 [hci0] 321.403625
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2346 [hci0] 321.404569
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2347 [hci0] 321.412091
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2348 [hci0] 321.413626
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2349 [hci0] 321.413630
> > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2350 [hci0] 321.413630
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2351 [hci0] 321.419674
>
> After fix:
>
> < HCI Command: Accept Synchronou.. (0x01|0x0029) plen 21 #309 [hci0]
> 49.439693
> Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
> Transmit bandwidth: 8000
> Receive bandwidth: 8000
> Max latency: 13
> Setting: 0x0003
> Input Coding: Linear
> Input Data Format: 1's complement
> Input Sample Size: 8-bit
> # of bits padding at MSB: 0
> Air Coding Format: Transparent Data
> Retransmission effort: Optimize for link quality (0x02)
> Packet type: 0x003f
> HV1 may be used
> HV2 may be used
> HV3 may be used
> EV3 may be used
> EV4 may be used
> EV5 may be used
> > HCI Event: Command Status (0x0f) plen 4 #310 [hci0] 49.440308
> Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
> Status: Success (0x00)
> > HCI Event: Synchronous Connect Complete (0x2c) plen 17 #311 [hci0]
> > 49.449308
> Status: Success (0x00)
> Handle: 257
> Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
> Link type: eSCO (0x02)
> Transmission interval: 0x0c
> Retransmission window: 0x04
> RX packet length: 60
> TX packet length: 60
> Air mode: Transparent (0x03)
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #312 [hci0] 49.450421
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #313 [hci0] 49.457927
> > HCI Event: Max Slots Change (0x1b) plen 3 #314 [hci0] 49.460345
> Handle: 256
> Max slots: 5
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #315 [hci0] 49.465453
> > SCO Data RX: Handle 257 flags 0x00 dlen 60 #316 [hci0] 49.470502
> > SCO Data RX: Handle 257 flags 0x00 dlen 60 #317 [hci0] 49.470519
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #318 [hci0] 49.472996
> > SCO Data RX: Handle 257 flags 0x00 dlen 60 #319 [hci0] 49.480412
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #320 [hci0] 49.480492
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #321 [hci0] 49.487989
> > SCO Data RX: Handle 257 flags 0x00 dlen 60 #322 [hci0] 49.490303
> < SCO Data TX: Handle 257 flags 0x00 dlen 60 #323 [hci0] 49.495496
> > SCO Data RX: Handle 257 flags 0x00 dlen 60 #324 [hci0] 49.500304
> > SCO Data RX: Handle 257 flags 0x00 dlen 60 #325 [hci0] 49.500311
>
> Signed-off-by: Kiran K <[email protected]>
> Signed-off-by: Lokendra Singh <[email protected]>
> ---
> net/bluetooth/hci_event.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index
> 016b2999f219..47166cea68bb 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -4404,12 +4404,12 @@ static void hci_sync_conn_complete_evt(struct
> hci_dev *hdev,
>
> bt_dev_dbg(hdev, "SCO connected with air mode: %02x", ev-
> >air_mode);
>
> - switch (conn->setting & SCO_AIRMODE_MASK) {
> - case SCO_AIRMODE_CVSD:
> + switch (ev->air_mode) {
> + case 0x02:
> if (hdev->notify)
> hdev->notify(hdev,
> HCI_NOTIFY_ENABLE_SCO_CVSD);
> break;
> - case SCO_AIRMODE_TRANSP:
> + case 0x03:
> if (hdev->notify)
> hdev->notify(hdev,
> HCI_NOTIFY_ENABLE_SCO_TRANSP);
> break;
> --
> 2.17.1