Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4876236pxu; Tue, 22 Dec 2020 03:07:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHTMnRSn0zMnZG6DFPWbIjaLLXt00BOIn8tMU232Wip8JYfmnnfld3n5l5XgstnI7OI/8T X-Received: by 2002:a17:906:ae14:: with SMTP id le20mr19680758ejb.451.1608635231585; Tue, 22 Dec 2020 03:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608635231; cv=none; d=google.com; s=arc-20160816; b=JXEXJ8BU9hynGuj42GZEpIEGMW21wc72RQ2TEU4Q/7XTW38WOKYUM0kBMQRQXSpaxC URnoSaTx0dJ+2Sm2gHWELqf82ak/W/t9c7s2dkGLbzGw0Uqag7u25bwCLfoTgpcszwVc skKGswMe3pLYK/PgkF3cdZeax4zX0FWVbQ7ywqQaWHZZaT8NtXVb5q/PFOhPD4+aI44h MfB/5bKfoRsMHF0SawOOZdpt0ZTy1w2LjSXNxh9027z6ETFfE37WYECm4B/ZApzpBeo5 AK8jgT/45hW8QXCk8LgpHXFTHK0O7gJuElHGYxws7biYCeUgvC1nzSzvMk3TSlNSj6D2 J1Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=C0fpgjg1CT6v4F3dHpM5jCXj3aWz6mWJHDHsyIo41iw=; b=ZFAPxVMOlJGxx21cx68JzA8Kl038fcx0KQqMxDaGUfXqviT5J4ezmINfPX338erIyk mvTXKk4m3WuuNr+cYlnVBESCpqIM6lf5LW4whKqqO/fcbb1N25JHn+XvpZh4m4uT/umS AIOvS+uym4+ZzWL/f/KFYBAVKu4kchHZUtM+iDGcTwMyoZQkbURS3NlKnBYE/WiuI6gA +Lfegdku6ItXG/LcHU1nmVtAiIjmcmPtAIUbBhKx4Dnd6VOtGSFayWPVs2x4c+p3RNMS ABeffpnu42zr6S5Fyw+v1BjIkGkIuEpiQ9TNidRZqzoC4HAF7vM6yvNVqvqYiw2H5cbh +CjQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si10218957ejh.264.2020.12.22.03.06.36; Tue, 22 Dec 2020 03:07:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbgLVLFf convert rfc822-to-8bit (ORCPT + 99 others); Tue, 22 Dec 2020 06:05:35 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:40286 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726108AbgLVLFf (ORCPT ); Tue, 22 Dec 2020 06:05:35 -0500 Received: from mac-pro.holtmann.net (p4ff9fbc9.dip0.t-ipconnect.de [79.249.251.201]) by mail.holtmann.org (Postfix) with ESMTPSA id 722A1CED1D; Tue, 22 Dec 2020 12:12:10 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: Default to HW mSBC on capable controllers ? From: Marcel Holtmann In-Reply-To: <20201222101930.awcxtsgltrrde2d3@pali> Date: Tue, 22 Dec 2020 12:04:52 +0100 Cc: Luiz Augusto von Dentz , Joakim Tjernlund , "linux-bluetooth@vger.kernel.org" Content-Transfer-Encoding: 8BIT Message-Id: References: <20201221211437.4s27cl6t4v27sugh@pali> <20201222092100.ru5inf45v55qoa4m@pali> <20201222101930.awcxtsgltrrde2d3@pali> To: =?utf-8?Q?Pali_Roh=C3=A1r?= X-Mailer: Apple Mail (2.3654.40.0.2.32) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Pali, >>>>>>> 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). >> >> CVSD is an air codec only. Controller<->Host is PCM in that case. > > Hello! > > This is not fully truth. You can use also use CVSD between Controller > and Host. Enhanced Setup Synchronous Connection HCI allows you to do it. so the spec is unclear in case of HCI transport. It could be stipulated that CVSD is also possible. However it is not practical since the controller would have to re-encode in case a different air codec is used. The reality is that all “legacy” devices decided for CVSD air codec and PCM host codec. Going into this direction of allowing CVSD as host codec is just a waste of time. >> Only with mSBC you have both air codec and Controller<->Host running with mSBC. > > No, you can use it also with other codecs. With all transparent codecs > and CVSD, alaw and ulaw based on capabilities of your bluetooth > adapters. The case when it is not CVSD, alaw and ulaw is pretty clear written in the spec. Both have to be transparent. I think that the spec and the assigned numbers document is not really clear in specifying which of the Coding_Format fields apply when HCI transport is used vs external channel. I would really assume that when the host is running the codec, then it is transparent. When the codec is offload to the controller, then the host transport is Linear PCM. So you I would plan for CVSD<->CVSD<->PCM, Transparent<->{mSBC,LC3}<->PCM, Transparent<->Transparent<->{mSBC,LC3} for the SCO/eSCO cases. Regards Marcel