Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit caa0e32e authored by En-Shuo Hsu's avatar En-Shuo Hsu
Browse files

floss: Move the read buffer out of btm_route_sco_data

We change the behavior to not drop PCM data we read when its length is
less than BTM_MSBC_CODE_SIZE bytes by moving the buffer out of the
function.

The new behaviors after this CL will be:
1. We don't drop PCM now if audio server send PCM less for one mSBC
   packet
2. Do not send zero frame to SCO if not enough

(1) is what we want to improve in this CL and we should have extra
attention for (2). (2) means that we intentionally let SCO Rx/Tx offset
by 1 frame when audio server underrun.
Since we choose to not add any mechanism to catch up. It now fully
relies on the controller to handle potential underrun in SCO.

With these new behaviors, we'd like to make the audio frames eventually
played continually without pop noises that was caused by the added zero
frames.

This also means that we now leave the underrun handling fully to the
audio stack. You may think this complicates audio server's
implementation. However, it actually simplifies audio server's
coordination with the Bluetooth stack as there is no longer implicit
data changes introduced by the Bluetooth stack from audio server's point
of view.

Also, this CL helps to simplify the code structure for future commits to
land.

Bug: 235901463
Tag: #floss
Test: gd/cert/run & Build and verify HFP works & cras_test_client \
--block_size 512 --playback_file 400.wav

Change-Id: I8323fdd7eb3af899722fd1aa3b6643d3f9a64bb6
parent f1347793
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment