From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmvMU-0005Sc-9A for qemu-devel@nongnu.org; Sun, 13 Sep 2009 16:07:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmvMP-0005SQ-RA for qemu-devel@nongnu.org; Sun, 13 Sep 2009 16:07:50 -0400 Received: from [199.232.76.173] (port=38014 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmvMP-0005SN-Oj for qemu-devel@nongnu.org; Sun, 13 Sep 2009 16:07:45 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:48745) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmvMP-0001wO-4L for qemu-devel@nongnu.org; Sun, 13 Sep 2009 16:07:45 -0400 Message-ID: <4AAD510A.90908@web.de> Date: Sun, 13 Sep 2009 22:07:38 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4AACD7DB.2080800@web.de> <4AAD4E9B.3010503@web.de> In-Reply-To: <4AAD4E9B.3010503@web.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig7284379B1BC8E9A5CF6D946A" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: Audio List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7284379B1BC8E9A5CF6D946A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Jan Kiszka wrote: > malc wrote: >> Does following help? >> >> diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c >> index 28c245d..9cc1372 100644 >> --- a/audio/alsaaudio.c >> +++ b/audio/alsaaudio.c >> @@ -37,6 +37,7 @@ struct pollhlp { >> snd_pcm_t *handle; >> struct pollfd *pfds; >> int count; >> + int mask; >> }; >> =20 >> typedef struct ALSAVoiceOut { >> @@ -178,7 +179,7 @@ static void alsa_poll_handler (void *opaque) >> return; >> } >> =20 >> - if (!(revents & POLLOUT)) { >> + if (!(revents & hlp->mask)) { >> if (conf.verbose) { >> dolog ("revents =3D %d\n", revents); >> } >> @@ -208,7 +209,7 @@ static void alsa_poll_handler (void *opaque) >> } >> } >> =20 >> -static int alsa_poll_helper (snd_pcm_t *handle, struct pollhlp *hlp) >> +static int alsa_poll_helper (snd_pcm_t *handle, struct pollhlp *hlp, = int mask) >> { >> int i, count, err; >> struct pollfd *pfds; >> @@ -265,6 +266,7 @@ static int alsa_poll_helper (snd_pcm_t *handle, st= ruct pollhlp *hlp) >> hlp->pfds =3D pfds; >> hlp->count =3D count; >> hlp->handle =3D handle; >> + hlp->mask =3D mask; >> return 0; >> } >> =20 >> @@ -272,14 +274,14 @@ static int alsa_poll_out (HWVoiceOut *hw) >> { >> ALSAVoiceOut *alsa =3D (ALSAVoiceOut *) hw; >> =20 >> - return alsa_poll_helper (alsa->handle, &alsa->pollhlp); >> + return alsa_poll_helper (alsa->handle, &alsa->pollhlp, POLLOUT); >> } >> =20 >> static int alsa_poll_in (HWVoiceIn *hw) >> { >> ALSAVoiceIn *alsa =3D (ALSAVoiceIn *) hw; >> =20 >> - return alsa_poll_helper (alsa->handle, &alsa->pollhlp); >> + return alsa_poll_helper (alsa->handle, &alsa->pollhlp, POLLIN); >> } >> =20 >> static int alsa_write (SWVoiceOut *sw, void *buf, int len) >> >> >=20 > Nope, still full CPU load. Forgot to mention: I also tried OSS before, but it suffered the same way, and polling had to be disabled. Jan --------------enig7284379B1BC8E9A5CF6D946A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkqtUQ4ACgkQniDOoMHTA+kcQQCcD+M37thrHRgOUuRsPOE424Uv SN4An0+FCOYqk6n7cK+v3pTUOTWjftvo =GgD5 -----END PGP SIGNATURE----- --------------enig7284379B1BC8E9A5CF6D946A--