Is there a possibility to be notified by ALSA (through a callback or similar) when an underrun occurs during playback?
I would be using the snd_async_handler_t but unfortunately snd_async_add_pcm_handler() fails, telling me that this function is not implemented.
ALSA will not notice than an underrun has occured until it reads the current position, which happens
So, in practice, a separate notification would not make sense.
Usually, you just check the return value of snd_pcm_write*(), or call snd_pcm_status() explicitly.