All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hilda Wu <hildawu@realtek.com>
To: Pauli Virtanen <pav@iki.fi>, Joseph Hwang <josephsih@google.com>
Cc: linux-bluetooth <linux-bluetooth@vger.kernel.org>,
	Max Chou <max.chou@realtek.com>,
	"alex_lu@realsil.com.cn" <alex_lu@realsil.com.cn>
Subject: RE: [PATCH] Bluetooth: btusb: check SCO MTU before enabling USB ALT 3 for WBS
Date: Thu, 22 Jul 2021 10:28:31 +0000	[thread overview]
Message-ID: <3b249bde3ccf4fa7b53a53f2033e93b2@realtek.com> (raw)
In-Reply-To: <f0a3fae602bb54313d078563d971827c88315b43.camel@iki.fi>

Hi,

Thanks for your supplement.
Add the sco_mtu condition is better.

When USB BT adapters support the alternate 3, it will announce alternate 3.
However, USB Alt 3 supported also need HFP support transparent MTU in 72 Bytes.
Add this sco_mtu condition could avoid HFP profile transparent MTU not match or not suitable ALT 3.

Regards,
Hilda

-----Original Message-----
From: Pauli Virtanen <pav@iki.fi> 
Sent: Wednesday, July 21, 2021 11:40 PM
To: Joseph Hwang <josephsih@google.com>
Cc: linux-bluetooth <linux-bluetooth@vger.kernel.org>; Hilda Wu <hildawu@realtek.com>
Subject: Re: [PATCH] Bluetooth: btusb: check SCO MTU before enabling USB ALT 3 for WBS

Hi,

la, 2021-07-17 kello 21:34 +0800, Joseph Hwang kirjoitti:
> It looks reasonable to check sco_mtu. My suggestion is to use 
> hci_packet_size_usb_alt[3] instead of the magic number 72.

Thanks for looking at it. IIUC, hci_packet_size_usb_alt only appears in previous discussions on this list, which did not seem to reach a conclusion if this should be computed from wMaxPacketSize. I can do less magical v2 and add the table.

Different solution would be to make the altsetting choice manufacturer/device specific flag, as I'm not sure on what hardware e848dbd364ac was tested on, so maybe it is intended Realtek specific.

Best,
Pauli


> On Sat, Jul 17, 2021 at 1:58 AM Pauli Virtanen <pav@iki.fi> wrote:
> > 
> > Some USB BT adapters don't satisfy the MTU requirement mentioned in 
> > commit e848dbd364ac ("Bluetooth: btusb: Add support USB ALT 3 for 
> > WBS") and have ALT 3 setting that produces no/garbled audio. Check 
> > that the MTU condition is satisfied, and fall back to ALT 1 if not.
> > 
> > Tested with USB adapters (mtu<72, produce sound only with ALT1)
> > BCM20702A1 0b05:17cb, CSR8510A10 0a12:0001, and (mtu>=72, ALT3) 
> > RTL8761BU 0bda:8771, Intel AX200 8087:0029 (after disabling ALT6).
> > 
> > Signed-off-by: Pauli Virtanen <pav@iki.fi>
> > ---
> >  drivers/bluetooth/btusb.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c 
> > index a9855a2dd561..3ee66e415c4d 100644
> > --- a/drivers/bluetooth/btusb.c
> > +++ b/drivers/bluetooth/btusb.c
> > @@ -1763,9 +1763,11 @@ static void btusb_work(struct work_struct *work)
> >                         /* Because mSBC frames do not need to be aligned to the
> >                          * SCO packet boundary. If support the Alt 3, use the
> >                          * Alt 3 for HCI payload >= 60 Bytes let air packet
> > -                        * data satisfy 60 bytes.
> > +                        * data satisfy 60 bytes. USB Alt 3 support also needs
> > +                        * HFP transparent MTU >= 72 Bytes.
> >                          */
> > -                       if (new_alts == 1 && btusb_find_altsetting(data, 3))
> > +                       if (new_alts == 1 && hdev->sco_mtu >= 72 &&
> > +                           btusb_find_altsetting(data, 3))
> >                                 new_alts = 3;
> >                 }
> > 
> > --
> > 2.31.1
> > 
> > 
> 
> 


------Please consider the environment before printing this e-mail.

  reply	other threads:[~2021-07-22 10:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 17:58 [PATCH] Bluetooth: btusb: check SCO MTU before enabling USB ALT 3 for WBS Pauli Virtanen
2021-07-16 19:16 ` bluez.test.bot
2021-07-17 13:34 ` [PATCH] " Joseph Hwang
2021-07-21 15:40   ` Pauli Virtanen
2021-07-22 10:28     ` Hilda Wu [this message]
2021-07-20  9:15 ` Pasi Kärkkäinen
2021-07-22 13:29 ` Michał Kępień
2021-07-22 14:26   ` Pauli Virtanen
2021-07-22 14:42     ` Michał Kępień
2021-07-23 10:07 ` [PATCH v2] Bluetooth: btusb: check conditions " Pauli Virtanen
2021-07-23 12:19   ` Marcel Holtmann
2021-07-25  5:47     ` Michał Kępień
2021-08-10 16:48     ` Pasi Kärkkäinen
2021-08-10 18:37       ` Luiz Augusto von Dentz
2021-07-26 18:02 ` [PATCH v3] " Pauli Virtanen
2021-07-27  2:11   ` [v3] " bluez.test.bot
2021-07-30 12:35   ` [PATCH v3] " Pasi Kärkkäinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b249bde3ccf4fa7b53a53f2033e93b2@realtek.com \
    --to=hildawu@realtek.com \
    --cc=alex_lu@realsil.com.cn \
    --cc=josephsih@google.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=max.chou@realtek.com \
    --cc=pav@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.