29 Mar
2018
29 Mar
'18
8:39 a.m.
For the non-blocking mode, it's not supposed that drain() is called multiple times. Instead, it should do the loop of snd_pcm_wait(), and status check, as ioplug_drain_vai_poll() actually does.
I fear the repeat call to snd_pcm_wait() when draining is active would end up in 100% CPU load as long as draining is not done because snd_pcm_wait() would immediate return due to the fact that avail > min_avail at the end of draining.
I have not tested it but I could also not find a line which would ignore the avail > min_avail short circuit of snd_pcm_wait().
Best regards
Timo