• Andre Eisenbach's avatar
    Remove overflow rate limiting when reading A2DP frames · c5916e97
    Andre Eisenbach authored
    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 4aebca46 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: 18326405
    Change-I...
    c5916e97
btif_media_task.c 94.2 KB