+22
−6
+2
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
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