Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4819880pxu; Tue, 22 Dec 2020 01:23:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ3XvElMGKg7SRaoP3pqdSAA6euauCHQRSWxUSQiVQJVvTNckNjlUGo84FZzrFPzy4hUx2 X-Received: by 2002:a17:906:94ca:: with SMTP id d10mr18195540ejy.62.1608629022647; Tue, 22 Dec 2020 01:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608629022; cv=none; d=google.com; s=arc-20160816; b=ub03Dy1DGhisu4juoHZbGS/1z9h/hRp7BhJ/cTcXrUja5kpJZ9+vb0bMZkJQHWd1yQ XFEIhhnAKatH1xwpYgm7JgY2d7ier9spMiYDs0GLEKguomVO3TVwuqC/7rh7a+Ga7VFx /s7K2n4NumO+5y9SVKNf7PjHLa0ZzI7p/nZ8Hd3YbR+kR+VzQ1DtGO3FNmmzFGlP1Z3m 9uf0Uk8uLWzpaRHYg01Q7khWAnsqEpZTwesK1MOsNtnzn5dzZoJ7gXeOQTseAuDpsoH5 IRNVXu8X6MAiXTBWMQ1XsWQgj9yC3FIk8mZJiCpO4ToN9N9bFo4XilIDi/iKePI35Uft /6gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=72UkIrM/0wklmy1WGE6BzZhepnxmxGF9KD+xNrQchGE=; b=IYCoPcuDCT/Gwo2s65rYYHQN0UfSK9M06xB9/fU/vIIPHSxIqXAOlFGC/8kRBvaF7N RMt1L8zTMsNXUPcLtkcMq0q8PxbYnLyi5hlqkKgaX5iW0l+bvtEBUJI2g7FmM+aaBb2B EKNbs5iWHbFXFS43UlqfnQWhBlVMEza543Czd8SzUP4lonq+AqnF6G1kBUaAjRL+kcCf Cdm2n5HORAITT28gphg4SQxv/yQK0mxatqtGABb0MogyjejDlKrJXpqu9iV4ylT6jQaQ uK7ZHfDOk+MFAwPcVAoPrIy0qce+4595mJpHXq99eEwAWL3/srB685AiJNSFZNxBa83w nNIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WceDHc8o; 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 w3si793630ejo.101.2020.12.22.01.23.01; Tue, 22 Dec 2020 01:23:42 -0800 (PST) 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=k20201202 header.b=WceDHc8o; 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 S1725807AbgLVJVp (ORCPT + 99 others); Tue, 22 Dec 2020 04:21:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:52082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbgLVJVo (ORCPT ); Tue, 22 Dec 2020 04:21:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A07422B2B; Tue, 22 Dec 2020 09:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608628863; bh=yMJEj3ZhsaLj8upgAVhZt+H13wDW0F9GcOh7VvZZ1Xs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WceDHc8ow/FXk4vIovz2muh4bJ7S0oHUkBdJFGHzgU46dtEZkyPEV8S/p/yg0cdqs TJqwgwa5wQyc2AAR7UMQNe+jl6mOYJMtcJT1huhSIgj3nCyXdsT7N4XSzZl/eBz+1x b7rvzoNhXTHKASLAt5nw1R3gIbp30GXR1oaDB8uwJYAktOQdUDkXx/ESrpQ8LLlUqS u/PO7kdfWZQSICs3spTitEoeRnkFv/qSDgKkIc//bquBnY7T7VUgYfHaBSqeEw0vOM 90P6W20DCvuV2zEN+oDXOj0q6+mmAey3E7EZGv6OqSe+VdEPPdK+hieF/l4Th++LU1 BKMZ/Wplf5UBQ== Received: by pali.im (Postfix) id 06CFC848; Tue, 22 Dec 2020 10:21:00 +0100 (CET) Date: Tue, 22 Dec 2020 10:21:00 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Luiz Augusto von Dentz Cc: Joakim Tjernlund , "linux-bluetooth@vger.kernel.org" Subject: Re: Default to HW mSBC on capable controllers ? Message-ID: <20201222092100.ru5inf45v55qoa4m@pali> References: <20201221211437.4s27cl6t4v27sugh@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hello! On Monday 21 December 2020 17:54:56 Luiz Augusto von Dentz wrote: > Hi Pali, > > On Mon, Dec 21, 2020 at 1:14 PM Pali Rohár wrote: > > > > On Friday 18 December 2020 11:43:32 Luiz Augusto von Dentz wrote: > > > Hi Joakim, > > > > > > On Fri, Dec 18, 2020 at 10:48 AM Joakim Tjernlund > > > wrote: > > > > > > > > There seems to be quite a few USB controllers gaining the BTUSB_WIDEBAND_SPEECH which I guess means HW mSBC but currently there is no way to select this mode. > > > > Any idea if one could patch the kernel to default to HW mSBC and user apps like bluealsa/pulseaudio would just use it automatically? > > > > > > It is in our plan to support HW offloading, but that doesn't mean all > > > platforms will be supported since that depends on the PCM lines being > > > connected to BT controller in the first place. > > > > Dedicated PCM lines are used in embedded world and maybe also still in > > some mobile segment. I remember that e.g. Nokia N900 had this setup. And > > it was quite crazy how it was finally configured... but it worked! > > > > But this is nothing for classic x86 laptops with USB bluetooth > > controllers on classic intel bluetooth+wifi mPCIe cards where SCO > > traffic is routed via HCI (over USB). And not via dedicated PCM pins. > > Moreover I think there are not any mainstream laptop which have PCM pins > > on mPCIe slots usable for such bluetooth mPCIe cards. > > > > For classic desktop / laptop it is needed to deal with fact that SCO > > audio is routed via HCI (like A2DP) and therefore support for Enhanced > > Setup Synchronous Connection HCI command. > > > > AFAIK even for routing SCO over PCM when mSBC hw encoder is used, > > Enhanced Setup Synchronous Connection HCI command is required. > > So you are saying that we should do PCM over HCI and that would > actually work (meaning we have enough bandwidth)? This is something which needs to be tested. And without full implementation (with control of all parameters) we cannot say YES or NO. And if you are aware of bandwidth, Enhanced Setup Synchronous Connection HCI command allows you to use also software based CVSD codec. Meaning that CVSD encoding/decoding can be done by application and therefore decreasing amount of data to transfer to bluetooth adapter. As I said this command is needed also if you want to use mSBC hw encoder over PCM, so I think usage of Enhanced Setup Synchronous Connection HCI command always have benefits to implement it (I have unfinished and untested implementation). > From power point of > view this makes very little sense imo, since all the cycle we save on > no encoding we probably lose with more data to transmit, so are we > looking into use HW encoder just to fix the quality of codec? That is a good question if power consumption would be increased or decreased. Anyway, hw encoding may be able to achieve lower latency. So I rather do not drop it prematurely without any tests. And another important thing, not all bluetooth adapters are USB based, there are adapters connected over UART and SDIO. And every bus can behave differently. USB is domain of laptops, UART can be found on raspberry pi which is also heavily used. SDIO bluetooth is less used but I have there at least device on which is running mainline kernel (5.10) and has SDIO bluetooth.