Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2194445ybt; Fri, 3 Jul 2020 03:16:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxahgehwxXYS6nh4GsoaR+pPV5hWzTuVdylQ3weI+JizMTkBoZFHHHZN9abtEJM4Y6Ccf28 X-Received: by 2002:a50:d513:: with SMTP id u19mr38430292edi.241.1593771393257; Fri, 03 Jul 2020 03:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593771393; cv=none; d=google.com; s=arc-20160816; b=v4bufV9FIJvOU8REr8Rtz8h0oxNNGWTBzgQPYW5Ye7bMdiAzSWT7qKf0mnzlN7IWns Vq2Y+Yo89jHtG8gD4nsKyddcNxhZhSI72GohK4Wacc6M8LT0xibV5Vn+iSNByadL9cNG Wj4wuLpYlR9j09xnz1x5G3pi8dburpbi5aPbO2aB5livsXOv/LY66UvigwzkiGClZgYj BRP25ci4wGf/4zZ4/2DR3LacCUGDGaqtDEZgOnSnb+fcU2yq1GOMlAoGokOiodffTYOP fmAHb9JT/63VtShkzjEFnRY/eQTA+B4iJsGOQ9Jf4Avx8uaPt4pjft0NTobebJEGBWK2 AhDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ifMggHqAR/q/6FWhu479I99L9b05/DsQO/pcz4kG+SI=; b=omQf6dr2h6sGulG4H7xfLihgxMLNT2eDSVxJslqGZeZi/ieBCezOLhFSVJN/wM0lN8 dy8R2LxYaU1qmFoHhqlPENez67B1LMpUfXvGgn6LVvf3XVqxKGUAY3LPaj0HrGgL/8Rf AeHppvyuUIf7mgQ49QESZY13gkgaiyxjVV9sTrZxgjs2+9uILEHkkES8x2ilASs53L/E R6kXDnUYVbmdRtS0X8t7VdZK9jQ4eXl7QR3TRfLsmBxT4VD9VexTrVKxywMo+Mv3BfGr xtVKbr8ufh4vk8+ZrbcmFOQsrVD4DrafUSzGydc4mFlRYZF7MXnWcbFD+FCnkM+7cqhe W6fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KfL3eZUx; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si7741574ejp.333.2020.07.03.03.15.52; Fri, 03 Jul 2020 03:16:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KfL3eZUx; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725915AbgGCKPr (ORCPT + 99 others); Fri, 3 Jul 2020 06:15:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:55978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgGCKPr (ORCPT ); Fri, 3 Jul 2020 06:15:47 -0400 Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 857E520720; Fri, 3 Jul 2020 10:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593771346; bh=riTgBkhb10cSb888g5PwM76KzzVM7R+64oGXCOixw6M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KfL3eZUxINTpmtT3zphPdyUVMVi1XnvrNzMIUouBAR8he83qRRAVSnwb+RXRVvlgn +QhbN32fW/dTYYc80UFnQfmyKTB0baxXmNA/miQQJUnT4oPmwG41HPgpmzKJTu91qD QwYZO7CW+++4iFtZcL8Mf/0xTCISMXP0tLtoZnf0= Received: by pali.im (Postfix) id 18D20121B; Fri, 3 Jul 2020 12:15:44 +0200 (CEST) Date: Fri, 3 Jul 2020 12:15:43 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Yu Liu Cc: linux-bluetooth@vger.kernel.org, Hsin-Yu Chao , Sonny Sasaka Subject: Re: [Bluez PATCH v1] device - If HFP is supported, ignore HSP Message-ID: <20200703101543.nrkpczji7zasqueg@pali> References: <20200630154855.Bluez.v1.1.I63c3ddd54189c2ad9ca9aba2c08e0925d7f0aee3@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200630154855.Bluez.v1.1.I63c3ddd54189c2ad9ca9aba2c08e0925d7f0aee3@changeid> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Tuesday 30 June 2020 15:49:34 Yu Liu wrote: > From: Hsin-Yu Chao > > For a BT headset that supports both HSP and HFP, BlueZ creates > service instances for these two profiles and connects them. > It's uncertain that which of HSP and HFP eventually get connected > and being used for SCO audio. And we start observing some problem > because of this uncertainty: > > - For headset that supports WBS, we need HFP connect for codec > negotiation. If HSP connects but not HFP, WBS cannot be used. > - For WH-1000XM3, if BlueZ ever initiated HFP connection but failed, > headset won't have working SCO audio even HSP is connected. > > Fix this at when device probes services, if HFP is in the uuid list, > don't bother create one for HSP. > > Reviewed-by: Sonny Sasaka > --- > > Changes in v1: > - Initial change > > src/device.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/src/device.c b/src/device.c > index 7b0eb256e..4036bfd81 100644 > --- a/src/device.c > +++ b/src/device.c > @@ -4370,6 +4370,11 @@ static struct btd_service *probe_service(struct btd_device *device, > if (!device_match_profile(device, profile, uuids)) > return NULL; > > + /* If device supports HFP, don't bother create service for HSP. */ > + if (g_slist_find_custom(uuids, HFP_HS_UUID, bt_uuid_strcmp) && > + bt_uuid_strcmp(profile->remote_uuid, HSP_HS_UUID) == 0) > + return NULL; > + This patch would completely break devices with buggy HFP profile support. Also this patch disallow usage of HSP when both HSP and HFP are supported. I'm against this change as it disallow to use HSP and HFP simultaneously with hsphpfd daemon. With hsphfpd daemon it is working with non-buggy headsets. Also in pulseaudio we have more bug reports that HFP is does not work (even when advertised), but HSP is working fine. If you have a broken headset as you described in commit message, then please add some quirk for it. But do not disallow usage of HSP / HFP for all devices including non-broken ones, just because you have one broken device. > l = find_service_with_profile(device->services, profile); > if (l) > return l->data; > -- > 2.27.0.212.ge8ba1cc988-goog >