* [PATCH BlueZ 0/1] policy: fix HSP/HFP reconnection
@ 2025-04-01 2:02 Yao Wei (魏銘廷)
2025-04-01 2:02 ` [PATCH BlueZ 1/1] " Yao Wei (魏銘廷)
2025-04-09 14:40 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
0 siblings, 2 replies; 4+ messages in thread
From: Yao Wei (魏銘廷) @ 2025-04-01 2:02 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Yao Wei (魏銘廷)
This patch was regarding to https://github.com/bluez/bluez/issues/1069.
The previous patch did not fix the issue, as I was testing it with Apple
AirPods Pro 2 and it automatically reconnects HSP/HFP after A2DP is
connected for about 25 seconds, and I assume the patch worked for me.
Some other devices I tested did not exhibit such behavior (Jabra Speak2
55 UC). This patch was tested against both these devices, and both
cases with NVIDIA GPU enabled and disabled.
By removing the code checking whether A2DP service is initiator for
directly starting HSP/HFP service, it will now only check whether
HSP/HFP is connected, and start the service if not.
The previous patch also has an oversight of not falling back to get HSP
service if HFP is not available. This patch fixed the issue.
Yao Wei (魏銘廷) (1):
policy: fix HSP/HFP reconnection
plugins/policy.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
--
2.49.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH BlueZ 1/1] policy: fix HSP/HFP reconnection
2025-04-01 2:02 [PATCH BlueZ 0/1] policy: fix HSP/HFP reconnection Yao Wei (魏銘廷)
@ 2025-04-01 2:02 ` Yao Wei (魏銘廷)
2025-04-01 3:55 ` bluez.test.bot
2025-04-09 14:40 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
1 sibling, 1 reply; 4+ messages in thread
From: Yao Wei (魏銘廷) @ 2025-04-01 2:02 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Yao Wei (魏銘廷)
This patch removes checking whether A2DP service initiates the
connection starting HSP/HFP connection, instead just start timer
when HSP/HFP is not connected, also move order so that setting
HSP/HFP connection timer is not blocked by AVRCP connection.
The previous patch also did not get HSP service if HFP is not
available. This patch adds it in.
---
plugins/policy.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/plugins/policy.c b/plugins/policy.c
index 360d1359f..0e533ba1f 100644
--- a/plugins/policy.c
+++ b/plugins/policy.c
@@ -312,6 +312,14 @@ static void sink_cb(struct btd_service *service, btd_service_state_t old_state,
data->sink_timer = 0;
}
+ /* Try connecting HSP/HFP if it is not connected */
+ hs = btd_device_get_service(dev, HFP_HS_UUID);
+ if (hs == NULL)
+ hs = btd_device_get_service(data->dev, HSP_HS_UUID);
+ if (hs && btd_service_get_state(hs) !=
+ BTD_SERVICE_STATE_CONNECTED)
+ policy_set_hs_timer(data);
+
/* Check if service initiate the connection then proceed
* immediatelly otherwise set timer
*/
@@ -321,16 +329,6 @@ static void sink_cb(struct btd_service *service, btd_service_state_t old_state,
BTD_SERVICE_STATE_CONNECTED)
policy_set_ct_timer(data, CONTROL_CONNECT_TIMEOUT);
- /* Also try connecting HSP/HFP if it is not connected */
- hs = btd_device_get_service(dev, HFP_HS_UUID);
- if (hs) {
- if (btd_service_is_initiator(service))
- policy_connect(data, hs);
- else if (btd_service_get_state(hs) !=
- BTD_SERVICE_STATE_CONNECTED)
- policy_set_hs_timer(data);
- }
-
break;
case BTD_SERVICE_STATE_DISCONNECTING:
break;
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* RE: policy: fix HSP/HFP reconnection
2025-04-01 2:02 ` [PATCH BlueZ 1/1] " Yao Wei (魏銘廷)
@ 2025-04-01 3:55 ` bluez.test.bot
0 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2025-04-01 3:55 UTC (permalink / raw)
To: linux-bluetooth, yao.wei
[-- Attachment #1: Type: text/plain, Size: 1261 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=948733
---Test result---
Test Summary:
CheckPatch PENDING 0.33 seconds
GitLint PENDING 0.40 seconds
BuildEll PASS 20.84 seconds
BluezMake PASS 1562.68 seconds
MakeCheck PASS 12.91 seconds
MakeDistcheck PASS 161.21 seconds
CheckValgrind PASS 217.39 seconds
CheckSmatch PASS 289.96 seconds
bluezmakeextell PASS 100.81 seconds
IncrementalBuild PENDING 0.36 seconds
ScanBuild PASS 893.38 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] 4+ messages in thread
* Re: [PATCH BlueZ 0/1] policy: fix HSP/HFP reconnection
2025-04-01 2:02 [PATCH BlueZ 0/1] policy: fix HSP/HFP reconnection Yao Wei (魏銘廷)
2025-04-01 2:02 ` [PATCH BlueZ 1/1] " Yao Wei (魏銘廷)
@ 2025-04-09 14:40 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2025-04-09 14:40 UTC (permalink / raw)
To: =?utf-8?b?WWFvIFdlaSAo6a2P6YqY5bu3KSA8eWFvLndlaUBjYW5vbmljYWwuY29tPg==?=
Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Tue, 1 Apr 2025 10:02:20 +0800 you wrote:
> This patch was regarding to https://github.com/bluez/bluez/issues/1069.
>
> The previous patch did not fix the issue, as I was testing it with Apple
> AirPods Pro 2 and it automatically reconnects HSP/HFP after A2DP is
> connected for about 25 seconds, and I assume the patch worked for me.
> Some other devices I tested did not exhibit such behavior (Jabra Speak2
> 55 UC). This patch was tested against both these devices, and both
> cases with NVIDIA GPU enabled and disabled.
>
> [...]
Here is the summary with links:
- [BlueZ,1/1] policy: fix HSP/HFP reconnection
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0b3d49f4e030
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] 4+ messages in thread
end of thread, other threads:[~2025-04-09 14:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01 2:02 [PATCH BlueZ 0/1] policy: fix HSP/HFP reconnection Yao Wei (魏銘廷)
2025-04-01 2:02 ` [PATCH BlueZ 1/1] " Yao Wei (魏銘廷)
2025-04-01 3:55 ` bluez.test.bot
2025-04-09 14:40 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox