]> git.tuebingen.mpg.de Git - paraslash.git/commit
alsa: Avoid busy loop with dmix.
authorAndre Noll <maan@systemlinux.org>
Sat, 8 Oct 2011 17:16:14 +0000 (19:16 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 18 Oct 2011 17:29:33 +0000 (19:29 +0200)
commit32309225ba462289fc6b51c22e6929d90f764dfa
treeffb4267056c22da3c57fbd983f633d2a2a981994
parent89f2de1016601e523fd456e0e2fa650fa695ecaa
alsa: Avoid busy loop with dmix.

When using alsa's direct mixing plugin, the alsa poll fd might be ready
for IO even though nothing can be written to the alsa handle. This
leads to a busy loop in para_audiod and para_write and makes these
applications eat up considerable amounts of CPU time during playback.

This patch fixes the problem by reading from the alsa fd after a
failed write. It also adjusts the test for when to return early from
alsa_post_select(). The old code was not wrong, however, since we
should never reach the test if poll_fd is negative.
alsa_write.c