Most code assumes the audio provider is providing int16 single channel audio data, without actually checking them. In this commit, we add a new function to provide the needed int16 mono data with checking.
Use std::chrono since it's a nicer API. Use a separate lock for playback
position so that the GUI thread isn't blocked for hundreds of ms while
snd_pcm_drain is waiting, and update the playback position after
decoding audio rather than before to avoid it being significantly wrong
when not using a cache.