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

Skip to content
Commit dc71a44c authored by Prashant Malani's avatar Prashant Malani
Browse files

audio: hal: Fix CTS test failure with no hardware output

last_write_time_us is an approximation of when the (simulated) alsa
buffer is believed completely full. The usleep above waits for more space
in the buffer, but by the end of the sleep the buffer is considered
topped-off.

On the subsequent out_write(), we measure the elapsed time spent in
the mixer. This is subtracted from the sleep estimate based on frames,
thereby accounting for drain in the alsa buffer during mixing.
This is a crude approximation; we don't handle underruns precisely.

Note that this is copied from the stub hal.

Bug: 33764682
Change-Id: I3f3b825ede8f98b92b09ac76be3835c54bd7188f
parent 75b99736
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment