OSDN Git Service

DO NOT MERGE Remove overflow rate limiting when reading A2DP frames
authorAndre Eisenbach <eisenbach@google.com>
Fri, 7 Nov 2014 23:46:04 +0000 (15:46 -0800)
committerSean Wan <swan@google.com>
Tue, 18 Nov 2014 00:11:33 +0000 (00:11 +0000)
commita59f47f27b2962828afd8d90d1a1d21206e32324
tree9344d889f52b9c579bdfa39bd5dea71a202f24e5
parentb407515ffa145b1a2cab01467da03c92aeb0e8eb
DO NOT MERGE Remove overflow rate limiting when reading A2DP frames

A2DP now supports adjusting the number of A2DP frames sent per timer
tick to adjust for timer drift and missed media task ticks. When the
signal to the headset/speakers becomes interrupted, the number of
packets to be read can queue up and rate limiting will not allow for the
queue to be cleared.

The overflow mechanism introduced in commit 4aebca4 will cause the media
task to stop sending packets completely, which can underflow the jutter
buffer on the remote device and lead to audio drop-outs.

This patch removes the overflow mechanism and also adds code do discard
audio frames that could not be sent to the remote device (weak signal
etc) to allow the device to stay in sync and not build up audio delays.

Also added additional debug logging and changed the UIPC flush mechanism
to address an issue where reading byte by byte causes an endless flush
loop if remote UIPC producer writes data faster than the flush loop
consumes it.

Bug: 18244205
Change-Id: I9a424984806bb2a464877399804b3355b2c439c3
(cherry picked from commit c5916e97384f07ec5a2e061e6af24f70107c74a2)
btif/src/btif_media_task.c
udrv/ulinux/uipc.c