bluez5: use initial SCO RX wait workaround only for USB controllers

Kernel-provided MTU does not work for USB controllers and the correct
packet size to send can be known currently only from RX. So we are
waiting for RX to get it.

The known problem is USB-specific, we shouldn't need the workaround for
other transport types.

Don't wait for POLLIN for non-USB controllers on connect, but ready
things on POLLOUT as usual.

For non-USB controllers, pick some sensible packet sizes to use
initially, before we switch to same size as for RX.
This commit is contained in:
Pauli Virtanen 2024-05-12 12:41:36 +03:00
parent b3bd026699
commit b94d6e53a1
4 changed files with 54 additions and 20 deletions

View file

@ -3219,10 +3219,7 @@ static int spa_bt_transport_stop_volume_timer(struct spa_bt_transport *transport
int spa_bt_transport_ensure_sco_io(struct spa_bt_transport *t, struct spa_loop *data_loop)
{
if (t->sco_io == NULL) {
t->sco_io = spa_bt_sco_io_create(data_loop,
t->fd,
t->read_mtu,
t->write_mtu);
t->sco_io = spa_bt_sco_io_create(t, data_loop, t->monitor->log);
if (t->sco_io == NULL)
return -ENOMEM;
}