Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4462430pxu; Mon, 21 Dec 2020 13:09:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhfwSY0QdwVFfnqLySTIVqvRzhzO1LUObsJtaF1ZNr3iOjO4we8x2hBe8bIzesE87F95ah X-Received: by 2002:a17:907:20cc:: with SMTP id qq12mr17734027ejb.316.1608584992102; Mon, 21 Dec 2020 13:09:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608584992; cv=none; d=google.com; s=arc-20160816; b=jtGVWXinu4BCf/Jy97E3mktgT/rf76xROBSKrekpQT3lPaVYfnW0lC1GBmHPbKdJ/f 58Erl2JBtL/qogWmhQJhA7q6J0k9eHHjXs4IOdj9wrX8NMmPGIK7AphQNdfQZqfvBSsu ywZsanAceJPTv9szngB3ftvxWIDkbu+kmkKxiIsyYVkGyLWcbKKkFugitGbyfXehY483 fQbounBsL4+BgJOLc+doGXfs90CtedzcW9p2s8cNMExyNbE1HsSLPvIF2xkNFAAI4jCM R69k+FnQgiI1Teke3ByHY0mWeidvijH9k+FPKRSu8KBhFx8Q7cly4PLKO80ymGrMnA1h x19g== 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-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:date; bh=VGVjJLnIQtya25e51U0P98ztkv+rFnGb0587112Q01M=; b=dgnYJqrh5/yE4VvO1eNokZqWBcGx077RLk4yxMSmgXL6Yi5rHZanPUyp9lMfMWuGao zxOMAHbmWYpEMf9hvsMSXF526Ihn/51EgqR4cU04BxL9oyEEP2mPrMlEN/TNJLZTLpM0 iKrRiwdC2V8YIcv+hphp7yA9l/BiNueb4czOoHFDbqEucEIZSE9h+Hsi0MIGe/MXEq+n O3rzkTS1VeqJlAoLWrB/vUTvPorVkEhjVv5xVxwnWQe4EOnIoi01/hTDlaJFIUpo6ROa AWlMPPrOIE6Q8dVrbIPqRLpL5uwTe/GeFJmLrTCQg2DcjMgHIKPd2JdEtX8QTujlB1M1 YcMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XCq6643I; 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 u7si11414713edb.213.2020.12.21.13.09.13; Mon, 21 Dec 2020 13:09:52 -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=XCq6643I; 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 S1725908AbgLUVHv (ORCPT + 99 others); Mon, 21 Dec 2020 16:07:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:48004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbgLUVHv (ORCPT ); Mon, 21 Dec 2020 16:07:51 -0500 Date: Mon, 21 Dec 2020 22:07:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608584830; bh=VGVjJLnIQtya25e51U0P98ztkv+rFnGb0587112Q01M=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=XCq6643IenNQ2fr25XgwGFu+K4u61/dhgCvkAFOeG/CPaUKrXEwrxkS2/2cG1vD8L 8WiAieUORyQSHVyVS5dQ7DXjPx6zc+3poUf2DOj5AEOXlw5c815ywUOwjI4wzOJiuo +ywuZYjFLSfCJcyIZU3Hv7UFzxJ0cD7XGw1CXb3EMyYngngqJmnkoJh2ivC7kWInlZ Cw/UjoALKg6KgLJXNPPhAo+JHDpaCJKougGpPKZUh0qTjwKp1bUVT+YP7P0JCsvX9I rM3bEQXAgXlUyzFoFs1ReOsI3T46+sPqnXISdoJ7odQ6Ttdsrt0TMP3t28R0mEh2S7 /2lFYgONK9c7w== From: Pali =?utf-8?B?Um9ow6Fy?= To: Joakim Tjernlund Cc: "linux-bluetooth@vger.kernel.org" Subject: Re: Default to HW mSBC on capable controllers ? Message-ID: <20201221210707.evrdeyiki45pivux@pali> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Friday 18 December 2020 13:32:29 Joakim Tjernlund wrote: > There seems to be quite a few USB controllers gaining the BTUSB_WIDEBAND_SPEECH which I guess means HW mSBC No, it does not mean mSBC. If you want to query if your bluetooth adapter supports hw mSBC then you need to check OCF_READ_LOCAL_CODECS command. You can look into script sco_features.pl for details. Note that currently it is not possible to send OCF_READ_LOCAL_CODECS command from non-root user as kernel currently does not allow it. > but currently there is no way to select this mode. Yes. "/bin/hciconfig voice" allows to set only voice settings for old Add Synchronous Connection HCI command which does not support hw mSCB. > Any idea if one could patch the kernel to default to HW mSBC and user apps like bluealsa/pulseaudio would just use it automatically? For usage mSBC hw encoder you need to use Enhanced Setup Synchronous Connection HCI command for establishing SCO connection. For using HW encoder you need to stop feeding socket with mSBC encoded data and instead put into this socket RAW pcm samples. Also you need somehow inform kernel about this change. For both things I designed new setsockopt() API which I described in: https://lore.kernel.org/linux-bluetooth/20200419234937.4zozkqgpt557m3o6@pali/