mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
bluez5: sco-io: start writing only after the packet size is known
The kernel-provided SCO write MTU is currently never the correct packet size for writing, so don't try to use it. Some adapter firmware (eg. BCM20702A0 0b05:17cb) appears in practice sensitive to the alignment of the msbc frames, and writes with wrong packet size break things but only on certain headsets. For other adapters, this doesn't appear to matter.
This commit is contained in:
parent
579481ab70
commit
0c9f0210ed
1 changed files with 6 additions and 2 deletions
|
|
@ -186,8 +186,12 @@ int spa_bt_sco_io_write(struct spa_bt_sco_io *io, uint8_t *buf, int size)
|
||||||
uint16_t packet_size;
|
uint16_t packet_size;
|
||||||
uint8_t *buf_start = buf;
|
uint8_t *buf_start = buf;
|
||||||
|
|
||||||
packet_size = (io->read_size > 0) ? SPA_MIN(io->write_mtu, io->read_size) : (io->write_mtu / 2) * 2;
|
if (io->read_size == 0) {
|
||||||
spa_assert(packet_size > 0);
|
/* The proper write packet size is not known yet */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
packet_size = SPA_MIN(io->write_mtu, io->read_size);
|
||||||
|
|
||||||
if (size < packet_size) {
|
if (size < packet_size) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue