Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6770196ybi; Mon, 8 Jul 2019 08:22:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqysnLmNQOLEa9wvpqUOVnYgjnjW3T/2bxmiQFb2GncH3tlqO+PThYlrKmRa2+gtyS6H03tA X-Received: by 2002:a17:902:8c83:: with SMTP id t3mr25402262plo.93.1562599370623; Mon, 08 Jul 2019 08:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562599370; cv=none; d=google.com; s=arc-20160816; b=tXKOlaIdIPaURj1Mcc+iUSlo9ZjSB8nLd9EUxV75zV9eNV1q3vaThmlO7EL73/GTud cpoA9s1ero4L0vQm7/sLeGxqxSmcL9k6XdzRCPxWWWlwDPOWCX4CxB/dYglEimqksNQP asngAfbrXrgvXccRTJwGjrYPnYy2atIQQcNhN/Vq2GTmPhAeS5vQTTNPr1DZzhdxq/3A nV4T+uAKmhpNY4W0088Cxp/OVA5GksmgWTh+wBAaGS6tZfzXPEFqZsVRk4HQ+g1/F04Y HaX2sweDe8Qr6xajV/9c2WDYTRXGPkQFcmSH9dio3Tcd9hNTTxZmgh/NwA/1m5ZzqzZI Vtzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=E2/EqvmpQ4MDPooKv8iHteDFUrhYEdhBqjSgTLWnjNo=; b=UQqwYKe+FcRK8ybsDkpLNjx8A55qWjXl2/feGubHiNl/3InGInHdbdyKRlrUJlEN1Y eRGI9FKqCaln1mGdiHMguqx0g1Osi0ZtTtMuPSNQWFHa3jNbNiVY5YQiCWwBf0Ghh0/p vRRZ1qSS3SwoY8u69OMXIae4+cwNih45PFFPGsV1hMjRBxkn/r6oXyt9rUtNgHIT/4mt h5vsPMYWX5vUza0afq9cy560dBIzsysmLVb0iGfSXdw1mmBa23RcbMFkz6a+f89FVL0Y DZYpvKwI5mPG5bVw5+lH4KEGY8yiS3Ky6YdeQKuj86hTZpv0aydqR3eWjCD1eeWbXWoH SrSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si8328631pgb.245.2019.07.08.08.22.35; Mon, 08 Jul 2019 08:22:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729770AbfGHNXI convert rfc822-to-8bit (ORCPT + 99 others); Mon, 8 Jul 2019 09:23:08 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:40357 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729736AbfGHNXI (ORCPT ); Mon, 8 Jul 2019 09:23:08 -0400 Received: from [192.168.1.184] (apn-37-247-209-172.dynamic.gprs.plus.pl [37.247.209.172]) by mail.holtmann.org (Postfix) with ESMTPSA id 44083CF18A; Mon, 8 Jul 2019 15:31:39 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: HCI Set custom bandwidth for AuriStream SCO codec From: Marcel Holtmann In-Reply-To: <20190708122512.qqfvtm455ltxxg3h@pali> Date: Mon, 8 Jul 2019 15:23:06 +0200 Cc: Pavel Machek , Luiz Augusto von Dentz , "linux-bluetooth@vger.kernel.org" , Johan Hedberg Content-Transfer-Encoding: 8BIT Message-Id: References: <20190504171550.llqfv5674gxd3bnn@pali> <20190506151651.pu2us2fgsf7w2vos@pali> <20190516183429.ql3hxtnmiabcq7tj@pali> <20190519082305.q7y4gpmdhvx3vzvo@pali> <20190519212157.GB31403@amd> <20190607130245.mv4ch6dxnuptzdki@pali> <20190708122512.qqfvtm455ltxxg3h@pali> To: =?utf-8?Q?Pali_Roh=C3=A1r?= X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Pali, >>>>>>> to be honest, I would rather see WBS implementation finally >>>>>>> reach PA before we start digging into this. >>>>>> >>>>>> First I want to finish improving A2DP codec support in pulseaudio. Later >>>>>> I can look at HSP/HFP profiles. Ideally it should have modular/plugin >>>>>> extensible design. So the aim is that adding new codec would be very >>>>>> simple, without need to hack something related to mSBC/WBC, AuriStream >>>>>> or any other codec. >>>>> >>>>> Well HSP don't have support for codec negotiation, but yes a modular >>>>> design is probably recommended. >>>>> >>>>>> But for AuriStream I need to set custom SCO parameters as described >>>>>> below and currently kernel does not support it. This is why I'm asking >>>>>> how kernel can export for userspace configuration of SCO parameters... >>>>> >>>>> We can always come up with socket options but we got to see the value >>>>> it would bring since AuriStream don't look that popular among >>>>> headsets, at least Ive never seem any device advertising it like >>>>> apt-X, etc. >>>> >>>> Pali clearly has such device and he is willing to work on it. Surely >>>> that means it is popular enough to be supported...? >>> >>> Just put AT+CSRSF=0,0,0,0,0,7 to google search and you would see that >>> not only I have such device... >>> >>> So I would really would like to see that kernel finally stops blocking >>> usage of this AuriStream codec. >> >> we need to figure out on how we do the kernel API to allow you this specific setting. > > Hi Marcel! Kernel API for userspace should be simple. Just add two > ioctls for retrieving and setting structure with custom parameters: > > syncPktTypes = 0x003F > bandwidth = 4000 > max_latency = 16 > voice_settings = 0x63 > retx_effort = 2 > > Or add more ioctls, one ioctl per parameter. There is already only ioctl > for voice settings and moreover it is whitelisted only for two values. it is not that simple actually. Most profiles define a certain set of parameters and then they try to configure better settings and only fallback to a specification defined default as last resort. >> We have kept is really simple since there was only CVSD and mSBC as of now. > > Seems that custom codecs are already widely used, so it would be great > it Linux kernel allows to use also other codecs in future without need > to explicitly whitelist them. This is an overstatement. I see only one custom codec being used. Unless you have heard from others. However as stated above, I think we need to provide an array of settings that are similar defined to what the HFP spec does. Then we just load the whole set into the kernel. >> I am also curious on what the assumptions are for the USB driver alternate settings are when using a different codec. > > I did all above tests and kernel changes with USB bluetooth chip which > is integrated in notebook's combo bt+wifi intel minipci-e card. Good to know. Since for mSBC in theory they need a new alternate settings that wasn’t really available. Regards Marcel