mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: output silence if no data for some ISO sinks
When a sink contributing to an ISO CIG does not have data, output silence for it, as long as at least one sink in the CIG is running. Only if writes to sockets fail, pause all streams to reset synchronization. This way we write exactly the same number of packets for each CIS at the same time, which probably is the best tested configuration in BT adapters and devices. We also don't then have to pause output if some sinks are not running or miss their timing, as we generate silence on the fly. When using iso-io, have it initialize the codec instance, and have media-sink uses that instance, so that silence and actual audio are encoded with the same codec.
This commit is contained in:
parent
2d1b02b5a2
commit
9d7d3599db
4 changed files with 179 additions and 59 deletions
|
|
@ -3282,7 +3282,6 @@ static int transport_create_iso_io(struct spa_bt_transport *transport)
|
|||
{
|
||||
struct spa_bt_monitor *monitor = transport->monitor;
|
||||
struct spa_bt_transport *t;
|
||||
bool sink = (transport->profile & SPA_BT_PROFILE_BAP_SINK) != 0;
|
||||
|
||||
if (!(transport->profile & (SPA_BT_PROFILE_BAP_SINK | SPA_BT_PROFILE_BAP_SOURCE)))
|
||||
return 0;
|
||||
|
|
@ -3306,7 +3305,7 @@ static int transport_create_iso_io(struct spa_bt_transport *transport)
|
|||
if (t->iso_io) {
|
||||
spa_log_debug(monitor->log, "transport %p: attach ISO IO to %p",
|
||||
transport, t);
|
||||
transport->iso_io = spa_bt_iso_io_attach(t->iso_io, transport->fd, sink);
|
||||
transport->iso_io = spa_bt_iso_io_attach(t->iso_io, transport);
|
||||
if (transport->iso_io == NULL)
|
||||
return -errno;
|
||||
return 0;
|
||||
|
|
@ -3314,9 +3313,7 @@ static int transport_create_iso_io(struct spa_bt_transport *transport)
|
|||
}
|
||||
|
||||
spa_log_debug(monitor->log, "transport %p: new ISO IO", transport);
|
||||
transport->iso_io = spa_bt_iso_io_create(transport->fd, sink,
|
||||
transport->bap_cig, transport->bap_interval,
|
||||
monitor->log, monitor->data_loop, monitor->data_system);
|
||||
transport->iso_io = spa_bt_iso_io_create(transport, monitor->log, monitor->data_loop, monitor->data_system);
|
||||
if (transport->iso_io == NULL)
|
||||
return -errno;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue