loopback: Implement underrun protection
authorGeorg Chini <georg@chini.tk>
Fri, 14 Apr 2017 13:02:36 +0000 (15:02 +0200)
committerGeorg Chini <georg@chini.tk>
Fri, 14 Apr 2017 13:02:36 +0000 (15:02 +0200)
commitf3265f944ae89c2b38c9dac6e5383f21d238d296
tree3eb9bab60bc38c4311043545012101a829d7cbf4
parentcaabff2728d9d588664f8a0ea2f8441804c8b91a
loopback: Implement underrun protection

The latency controller will try to adjust to the configured latency regardless
of underruns. If the configured latency is set too small, it will lead to
periodically occuring underruns. Therefore an underrun protection is implemented
which will increase the target latency if too many underruns are detected.
Underruns are tracked and if more than 3 underruns occur, the target latency
is increased in increments of 5 ms. One underrun per hour is accepted.
The protection ensures, that independent from the configured latency the
module will converge to a stable latency if the configured latency is too
small.

The print_msg argument to update_minimum_latency() had to be re-introduced,
because there is one place where the message should not be logged.
src/modules/module-loopback.c