Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp48681pxk; Tue, 1 Sep 2020 15:53:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKdwMcu+k0/ZWP9gJD12IW/F1bjYfyYVd5uBzBD27ryJ6NNKdIQjc4l2qoO0fN+8WDVsTM X-Received: by 2002:aa7:cd5a:: with SMTP id v26mr3735725edw.38.1599000825688; Tue, 01 Sep 2020 15:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599000825; cv=none; d=google.com; s=arc-20160816; b=Bg0PiEzOGQfv9UnYlKtgAE4rvhicNmbyVD3BI5yMEAyrXadjSdzxtT2bH2GXjwRbTJ FpfZNdbE6HNFoFj+VHjns3Ftu3BpmLIVAUTkTBHoSsT+1kgsEsCvIKGdcGVOVYuj5Jy1 CGVy2GRySMxBKSxqU+w5b0fTYf23/tqCooFaUN/+naKQnFgZl+7FtzB9X9FpdqLWS5em LEZr1Z7AvhR8llijJbklXNtPXqqeMJ9iPtseD0rSIxuQyBv9ELZE1jPrrZKY8PeUnOPC wlucVuwRA+TeqwNH7UKJ+Idc55ZvT17WPU20zNWDuNYyjM5yKnbI31JkKUmeg1zGQzCc mfZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SiuTplZG9JZ32xrHtUa2/phQ6nHZeeGHunAtuf+rBYQ=; b=FPbNrCtki1bmuL/JKPsItaJuSa1XSTB5gR8bjHWMa+N14IE3bv+XNpwPnFetE5NpB+ x0gjB9UzMv+R7rcjOrh67A6uhKyx+4AdLkr56o4V1ttxNCdqjtcFAxhV4mCl632T9O+Z hMrDYjDMizWjAP4NteJM5U1UhqbJoPSUYBBX4K57cSTCVd4ijijO74UDZlrzxavvLvj3 eaOupbISOPjVjw/l8cauBjrfWVmG9q+R+zeOjlDCZQqOxrdxZkBslpskQzZf+0gFCFXx p8Wt/V8J8qXfEg3NPplAwf/u49K37U5STxf1Vu6PaxfwDHTWjPOjuxrCjD62pOy4jsYH OIaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qpSdIV4P; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk14si1397487edb.61.2020.09.01.15.53.04; Tue, 01 Sep 2020 15:53:45 -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=@gmail.com header.s=20161025 header.b=qpSdIV4P; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726936AbgIAWtm (ORCPT + 99 others); Tue, 1 Sep 2020 18:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgIAWtl (ORCPT ); Tue, 1 Sep 2020 18:49:41 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEE9CC061244 for ; Tue, 1 Sep 2020 15:49:40 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id 185so2632575oie.11 for ; Tue, 01 Sep 2020 15:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SiuTplZG9JZ32xrHtUa2/phQ6nHZeeGHunAtuf+rBYQ=; b=qpSdIV4PKLCmaNCTqn/4mVtzDZVTiexo3abFunLu0Ax2GI0sQoH8toX4HFCTY8pHnb +1/Kc0xQqmhB46iEKF/oI0eZP5oHCk5nHLbo2z4HWnOtkqy7AMObodhVnC1emn5aFCOA sbJQQ8CwDwMUB0wjPvtmZohuIcoFC73zwE4V7STPELuqE/4e4gqU4vdQJa0VCU/fkEoh 3SasO2Wwmb4HAlgOaXjMNS8f2fiJjLukrVzxGA6EBlQXKvaMS4C/8H4+pPxOZJTb4kIK k2W2ofHlHeQbcbzoxLWqgRWRukeJOK9GwuCeoGRjelTc+Ts+HS59bG/+NSRAPWX1tIHh UoNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SiuTplZG9JZ32xrHtUa2/phQ6nHZeeGHunAtuf+rBYQ=; b=p6zoPhXFQ8TZqw9jiltKG1M4xeqM+KbTr6EtSYqhxTgJEnrxieATwtfBplxlDJxk7I USRbQcprkMp4ErnGYyS0i2GAMFRBsQ9fOdfb2Pwgwtuwp5ZfXyfv6LG9uZsF4Ta38ri/ h99bFcqB2kEzcdmh2QJ4EzbPqPxd0gwiBh3da7lyHNwkeAZ1QH//lKZkSL3Ea33WwG0w yzSyBnRsqEb7qTVTCcknsPTSrOkKWkJK/+0x4+BNuFcFcQ/WqL1GEqpTIrV9+91ZV0Wi t3gYOJW/u5i+4s2kTIlLVTcKrtim0GJRScsrhL2lKxF/B+431LJT9YeJPt+qRDGGsJzH xlnQ== X-Gm-Message-State: AOAM532niVU118g3kFAiTLM3rcxf/tpjk9BQbLAbzfxU+w28VByrsRba Lx/zwJrqK8qlm/LfahkskXETvFiZrvYb6WlGb8U64WRQ X-Received: by 2002:a54:478f:: with SMTP id o15mr259948oic.137.1599000580096; Tue, 01 Sep 2020 15:49:40 -0700 (PDT) MIME-Version: 1.0 References: <20200817212554.3844965-1-yudiliu@google.com> <20200817142545.RFC.v2.1.Ibaa1dfd49179a141c19a651f3c2132a28b71b344@changeid> In-Reply-To: From: Luiz Augusto von Dentz Date: Tue, 1 Sep 2020 15:49:29 -0700 Message-ID: Subject: Re: [RFC PATCH v2 1/1] adapter - D-Bus API for querying the adapter's capabilities To: Alain Michaud Cc: Yu Liu , "linux-bluetooth@vger.kernel.org" , ChromeOS Bluetooth Upstreaming , Archie Pusaka , Sonny Sasaka , Marcel Holtmann Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alain, On Tue, Sep 1, 2020 at 1:55 PM Alain Michaud wrote: > > Hi Luiz, > > > On Tue, Sep 1, 2020 at 4:48 PM Luiz Augusto von Dentz > wrote: > > > > Hi Alain, > > > > On Tue, Sep 1, 2020 at 12:00 PM Alain Michaud wrote: > > > > > > Hi Luiz, > > > > > > > > > On Tue, Sep 1, 2020 at 1:47 PM Luiz Augusto von Dentz > > > wrote: > > > > > > > > Hi Alain, > > > > > > > > On Tue, Sep 1, 2020 at 8:43 AM Alain Michaud wrote: > > > > > > > > > > Hi Marcel/Luiz, > > > > > > > > > > I'd be particularly interested in seeing your opinion on whether this could be better described as some form of SCO socket property... even if this is indeed an adapter property. > > > > > > > > Yep, but wasn't that supposed to be what BT_PKT_STATUS is for? I mean > > > > one can just attempt to read it with getsockopt and in case of returns > > > > an error it means the controller does not support it, that said it > > > > doesn't look like we do check the adapter features when using > > > > BT_PKT_STATUS, should that be checking if HCI_WIDEBAND_SPEECH_ENABLED > > > > is set? > > > The problem here is that this will be after the connection is created > > > and a packet is exchanged. In this context, we'd like to know if the > > > controller supports it ahead of creating a sco connection so we can > > > choose to use the headset at all. For example, there are devices and > > > circumstances where using the device's built-in mic and A2DP will > > > yield a better experience for the user so the platform may choose that > > > as a default for the user rather than degrading down to narrow-band. > > > > You can use get/setsockopt after bind, so I wonder if that is really a > > problem here, in fact BT_VOICE wouldn't work if we couldn't use socket > > options before the connection is made see how it is used in ofono for > > instance: > > > > https://git.kernel.org/pub/scm/network/ofono/ofono.git/tree/src/handsfree-audio.c#n105 > > > > Also in order to use WBS one will need to use BT_VOICE anyway, > > actually that all you need for WBS with mSBC while BT_PKT_STATUS will > > indicate the possibility to do PLC, not sure why we are mixing these > > things together or does HFP mandates mSBC to implement PLC nowadays? > This is a design choice, one that must be done before a device > connected on our platform. Note ChromeOS doesn't use ofono. It's not > just about choosing to do mSBC, but rather about which mic the overall > platform will use (onboard or from the headset/speaker). Got it, I just don't like the naming because while it is perfectly fine for ChromeOS to choose to only do WBS when BT_PKT_STATUS is available, other platforms my not required that, specially since BlueZ may also be used in carkits/IVI systems which may have been built without PLC support. Regarding the use of oFono, I was using more as an example that you can set socket options before any connection is made, anyway the setting of the erroneous command seems to be done at startup regardless if the userspace will actually require BT_PKT_STATUS or not, so all I'm suggesting is to check if the command was actually used when using BT_PKT_STATUS. > > > > > > > > > > Also it doesn't seem we have updated userspace to support > > > > BT_PKT_STATUS, we should probably have something to test it via > > > > isotest and perhaps create a iso-tester.c to validate all the options. > > > > > > > > > Thanks, > > > > > Alain > > > > > > > > > > On Mon, Aug 31, 2020 at 5:44 PM Yu Liu wrote: > > > > >> > > > > >> +Alain Michaud > > > > >> > > > > >> Hi Marcel, > > > > >> > > > > >> Can you please comment on the cl as well as Luiz's suggestion? Thanks. > > > > >> > > > > >> On Thu, Aug 20, 2020 at 10:20 AM Yu Liu wrote: > > > > >> > > > > > >> > Friendly ping for comments from Marcel. Thanks. > > > > >> > > > > > >> > > > > > >> > On Mon, Aug 17, 2020 at 4:17 PM Luiz Augusto von Dentz > > > > >> > wrote: > > > > >> > > > > > > >> > > Hi Marcel, > > > > >> > > > > > > >> > > On Mon, Aug 17, 2020 at 4:07 PM Yu Liu wrote: > > > > >> > > > > > > > >> > > > From: Archie Pusaka > > > > >> > > > > > > > >> > > > Initially this is introduced to query whether WBS is supported by the adapter, > > > > >> > > > the API is generic enough to be extended to support querying others in > > > > >> > > > the future. > > > > >> > > > > > > > >> > > > Reviewed-by: sonnysasaka@chromium.org > > > > >> > > > > > > > >> > > > Signed-off-by: Yu Liu > > > > >> > > > --- > > > > >> > > > > > > > >> > > > Changes in v2: > > > > >> > > > - Return an array of strings instead of a dict > > > > >> > > > > > > > >> > > > Changes in v1: > > > > >> > > > - Initial change > > > > >> > > > > > > > >> > > > doc/adapter-api.txt | 12 ++++++++++++ > > > > >> > > > 1 file changed, 12 insertions(+) > > > > >> > > > > > > > >> > > > diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt > > > > >> > > > index 1a7255750..8fbcadb54 100644 > > > > >> > > > --- a/doc/adapter-api.txt > > > > >> > > > +++ b/doc/adapter-api.txt > > > > >> > > > @@ -204,6 +204,18 @@ Methods void StartDiscovery() > > > > >> > > > org.bluez.Error.NotReady > > > > >> > > > org.bluez.Error.Failed > > > > >> > > > > > > > >> > > > + array{string} GetCapabilities() > > > > >> > > > + > > > > >> > > > + This method returns a list of supported > > > > >> > > > + capabilities that is populated when the adapter > > > > >> > > > + initiated. > > > > >> > > > + > > > > >> > > > + Possible values: > > > > >> > > > + "wbs" - Wide band speech > > > > >> > > > > > > >> > > Btw, should we stick to use wbs terminology here, or we should > > > > >> > > actually use the HCI feature/command, because wbs has actually to be > > > > >> > > implemented by the HFP afaik this is only indicating that the > > > > >> > > controller is able to notify packets drops, etc, with use of erroneous > > > > >> > > command. Perhaps we should actually use the term PLC (Packet Loss > > > > >> > > Concealment) instead since that seems to be the real capability here, > > > > >> > > afaik WBS does not actually require PLC. > > > > >> > > > > > > >> > > > + > > > > >> > > > + Possible errors: org.bluez.Error.NotReady > > > > >> > > > + org.bluez.Error.Failed > > > > >> > > > + > > > > >> > > > Properties string Address [readonly] > > > > >> > > > > > > > >> > > > The Bluetooth device address. > > > > >> > > > -- > > > > >> > > > 2.28.0.220.ged08abb693-goog > > > > >> > > > > > > > >> > > > > > > >> > > > > > > >> > > -- > > > > >> > > Luiz Augusto von Dentz > > > > > > > > > > > > > > > > -- > > > > Luiz Augusto von Dentz > > > > > > > > -- > > Luiz Augusto von Dentz -- Luiz Augusto von Dentz