[alsa-devel] busy loop in snd_pcm_plugin_status()
Hi,
I'm seeing a strange issue when using linphone (3.4.3) with alsa-lib (1.0.24.1) on an Atom-based platform. I was able to trace the problem down to the snd_pcm_plugin_status() function. The problem is that the call to the snd_atomic_read_ok() function fails because snd_pcm_plugin_avail_update() has already called snd_atomic_write_{begin,end}() in the meantime. The result is that I'm seeing calls to snd_pcm_plugin_status() where the code jumps back to the _again between 200 and 1800 times before succeeding. This in turn leads to delays in the linphone of 20 to 180 milliseconds, which results in rather absurdly high CPU usage (usually 100%) and correspondingly bad audio playback and side-effects (choppiness, linphone no longer terminates calls properly, ...).
I'm using the attached patch as a workaround, but I'm pretty sure it's not a proper fix. The strange thing is that I see that behaviour only on the Atom platform (Intel HDA, Sigmatel 92HD83 codec). Another ARM-based platform does not exhibit the same issue.
Can anybody shed some light on the situation?
Cheers, Thierry
participants (1)
-
Thierry Reding