Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp63466pxy; Sat, 14 Aug 2021 00:11:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw74aLZsrrHyVRZMllSNN7y9Az4+MKxNc/BkLx3ZmCnn4eSX3Z8PLEPUleoKhW4p+YEMM7a X-Received: by 2002:aa7:dbc8:: with SMTP id v8mr7513407edt.242.1628925098700; Sat, 14 Aug 2021 00:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628925098; cv=none; d=google.com; s=arc-20160816; b=CD5VxCrAaF5wxYqoICl58PBA3VNc2jyLV8zkcyIh4/gQHSgK6a5RUROr4qIDUt/oYu m3JMmXH6H9DUEBn9dvX4SH58dUC458QgAZv2vt+nFZkkhb23S2pPnZIJ3xzvglkPwLM7 gZtDuh6WFrLMnPy9t1CRgJ68nBVi1vcPKZLH9iTDEHYreZveUWkpD/e1/g2s08GpejRS ALwaFAp4s595Yr/5Hs2dN7jAZ+PpuGdg16lNt0jlF9/k3lmJ76F/zMg2DDvHwQ1IToTg ZFA2JMoWiOiwBd9Jon6IBMauI2X/qr9Fry6sO0bBuMKJOFwQfALruUz2FO0PaXTqVw3j B4ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=z7pkFAI9aHs1wZC/RanppuJG6BLvSfn98JNatH3XzcI=; b=WVqFUATl1TXRMxwC8vPMjiY8Ad5Uz/h8R+KBhTEdbg+/6Tk+zYHpMJ81+FwwzBbMJ8 NXKjUiYhtJeZLyMwSmEex5SePxDwwFHQkLjUWRGLnKILE5zuaqqXhdHgq6rHfgZrwBlf He1UgNLWsJ2wkCPR2dCxHdfCADGSVU3HsKCec1O1N5Zb38dH2b5laKXYkMrwt9RKUi18 HZZOSub5M86a7eDLj+teYAGCMO6lIJt46R472Nfkw1GGso+tG3txFfJdtXyDZToACB9A S5Da8Qbbr86SIi179T5wnKoCdvLFJHgmqkgs1cMZ0x+k6y3Dsm/OETS9DYOjYGkqzamc 07WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=liMRPvEj; 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 e20si4060399eds.158.2021.08.14.00.10.57; Sat, 14 Aug 2021 00:11:38 -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=liMRPvEj; 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 S236542AbhHNHJ4 (ORCPT + 99 others); Sat, 14 Aug 2021 03:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236519AbhHNHJz (ORCPT ); Sat, 14 Aug 2021 03:09:55 -0400 Received: from mail-vk1-xa33.google.com (mail-vk1-xa33.google.com [IPv6:2607:f8b0:4864:20::a33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB05C06175F for ; Sat, 14 Aug 2021 00:09:27 -0700 (PDT) Received: by mail-vk1-xa33.google.com with SMTP id 1so1173104vkk.1 for ; Sat, 14 Aug 2021 00:09:27 -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=z7pkFAI9aHs1wZC/RanppuJG6BLvSfn98JNatH3XzcI=; b=liMRPvEjXS6ePuxRiJgWdXiq2nx1sGEboy3pkTfefNfT348sfd+9Lrmn8ap3O0SaY9 dT4moQTEaGJ1oQOgqsZEQkN4SUsfve3WmnxGRorApytVpchHnTnfuinDA3dNyN1SjC4b Uh/s9SRFWg2bIuVHb8i8Aj/WvRik9n8fFFZNeR/jL1VcuyTeijWnlI2wfFVHlAjbPC7y d76mrljXTfc3okPnqC1J82IyGrfPe83HWT1+0Ghlmsf8EZkcCpHElYBTJdDXid4o4kmR iuxGAZ5ogAjHDIZXCyZeQXkSVMIQWay9d+VCGHYhQOIQUstOGdRr+nOoEiBGdwKtPhNx +/Zw== 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=z7pkFAI9aHs1wZC/RanppuJG6BLvSfn98JNatH3XzcI=; b=tEVQU5082S00+H2vRvC83OWdMpbqtmsnSFkGxflAUvqM+2AaoVmCjdiXWgVsBxEsIE gOWxI4kBjMhvQ3+A3kMqcWREDjhmiczlv1+AZQdM8XvlSqOf5kpgnI281p/klPFefARz 1T8rfWm7P6Tv00+kYXa6bpVNpsR+Bi4WDDx8d7grBPGD9aQCDA7P9PZpubM4Q9to3pCJ QkC+fIpoqBBYhR4uJqF1OK7Z6tv8cIvVWMiv9tTHqUxQ0tKJ41Tt+TaE2btUhaLpfz4k ibongxfu2bzJ1wIylQD0+4KLQdn1Mu3uA9FJhLoCCh9npllf6BfNYzbKluYANUb4O6Ve o+3g== X-Gm-Message-State: AOAM5319SicJRsinW9B6oGH/VJhGqlHlOLI1IgfLdp5cnIWdAnilh2/w Xnf7w+QQVi028U5KeEDg4HG1DHxhVHePfjnA3kY= X-Received: by 2002:a05:6122:91:: with SMTP id r17mr4369848vka.15.1628924966940; Sat, 14 Aug 2021 00:09:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Igor Kovalenko Date: Sat, 14 Aug 2021 10:09:15 +0300 Message-ID: Subject: Re: Query on the patch series "define HCI packet size of USB Alts" To: Sanchayan Cc: linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Fri, Feb 5, 2021 at 6:52 PM Sanchayan wrote: > > Hello, > > We currently have an opened merge request on adding mSBC support to PulseAudio. > https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/254 > > There currently seems to be an issue in getting the correct MTU. In the test > setup it works with the ofono backend, except for the assumed MTU. For getting > it to work, we had to use a MTU of 24. 48 does not work and renders silence. > getsockopt(card->fd, SOL_SCO, SCO_OPTIONS ... returns 64 which is too large. > > The missing bits on the kernel side seems to be the below patch. > https://lore.kernel.org/patchwork/patch/1303411/ > > Second patch in the above series seem to have been applied but not the first. > > The first patch in the series above, when applied seems to fix getsockopt > returning 24 bytes for the MTU. An additional correction on top of that > below > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index fd0dcfa9a390..35f9c0743014 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -1669,6 +1669,8 @@ static int btusb_switch_alt_setting(struct hci_dev *hdev, int new_alts) > err = __set_isoc_interface(hdev, new_alts); > if (err < 0) > return err; > + > + hdev->sco_mtu = hci_packet_size_usb_alt[new_alts]; > } > > if (!test_and_set_bit(BTUSB_ISOC_RUNNING, &data->flags)) { > > > seems to make it work for all bluetooth usb devices. > > Has there been any further development or way to push this forward? > > - Sanchayan. Gentle reminder, anything can be done to push this forward? I believe we all use the same workaround discussed in patchwork thread https://lore.kernel.org/patchwork/patch/1303411/ but first SCO socket write either has to be delayed until first read succeeds, or first SCO socket write size may be incorrect since payload size of HCI packet is not propagated to socket MTU value. With https://lore.kernel.org/patchwork/patch/1303411/ and the change above to btusb_switch_alt_setting() first SCO socket write can be done with correct size right away. -- Kind regards, Igor V. Kovalenko