mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
bluetooth: Amend writeout to send more initial frames
When bluetooth transport has both both sink and source, pulseaudio would synchronize writing out frames with reading frames from peer to make fair schedule of reads and writes. Pulseaudio allows two blocks of data to be sent to peer before synchronizing writes with reads just in case that peer implements similar write schedule. It could happen that first blocks are still missed by peer, which would cause pulseaudio writes to stall waiting for first frames from peer. Fix this by allowing more data frames out until data from peer is actually received. Closes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1424 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/777>
This commit is contained in:
parent
86c5fbab57
commit
3e5db72ab7
1 changed files with 8 additions and 2 deletions
|
|
@ -1549,8 +1549,8 @@ static void thread_func(void *userdata) {
|
|||
writable = true;
|
||||
|
||||
/* If we have a source, we let the source determine the timing
|
||||
* for the sink */
|
||||
if (have_source) {
|
||||
* for the sink unless peer has not sent any data yet */
|
||||
if (have_source && u->read_index > 0) {
|
||||
|
||||
/* If the stream is writable, send some data if necessary */
|
||||
if (writable) {
|
||||
|
|
@ -1663,6 +1663,12 @@ static void thread_func(void *userdata) {
|
|||
goto fail;
|
||||
|
||||
if (result) {
|
||||
if (have_source && u->read_index <= 0) {
|
||||
/* We have a source but peer has not sent any data yet, log this */
|
||||
if (pa_log_ratelimit(PA_LOG_DEBUG))
|
||||
pa_log_debug("Still no data received from source, sent one more block to sink");
|
||||
}
|
||||
|
||||
writable = false;
|
||||
have_written = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue