From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmuBD-0003RW-0m for qemu-devel@nongnu.org; Sun, 13 Sep 2009 14:52:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmuBB-0003RK-4r for qemu-devel@nongnu.org; Sun, 13 Sep 2009 14:52:06 -0400 Received: from [199.232.76.173] (port=42768 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmuBB-0003RH-0L for qemu-devel@nongnu.org; Sun, 13 Sep 2009 14:52:05 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:59349 helo=akado.ru) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmuBA-0000lz-Er for qemu-devel@nongnu.org; Sun, 13 Sep 2009 14:52:04 -0400 Received: from [10.0.66.9] ([10.0.66.9] verified) by fe01-cgp.akado.ru (CommuniGate Pro SMTP 5.2.13) with ESMTP id 108512890 for qemu-devel@nongnu.org; Sun, 13 Sep 2009 22:52:00 +0400 Date: Sun, 13 Sep 2009 22:52:01 +0400 (MSD) From: malc In-Reply-To: <4AACD7DB.2080800@web.de> Message-ID: References: <4AACD7DB.2080800@web.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [Qemu-devel] Re: Audio List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel On Sun, 13 Sep 2009, Jan Kiszka wrote: > malc wrote: > > The code was just commited that enables "polling" audio mode (oss and > > alsa), it's also unconditionally enabled now to obtain some testing > > coverage, so please give it a whirl, feedback is welcome. > > CPU load goes to 100% when starting my Musicpal image. Applying the fix > below and disabling polling again cures this effect here. Few things: Thanks for the patch, but i was at a loss how to properly apply it with git and retain all the relevant information (Subject/Authorhsip etc), so for the time being it was applied manually. In the past your mail server was bouncing my replies to threads where you paticipated, and since this new CC-ing madness is in place i'm not sure whether the list reply was delivered to you either, hence i emptied CC header and replying to the list alone. The Musicpal image i have here is getting stuck somewhere along the way to the point of monitor not being responsive, so i can not test anything myself. FWIW the command line is this: [...]/arm-softmmu/qemu-system-arm \ -M musicpal \ -pflash flash.image \ -kernel u-boot.bin \ -monitor stdio \ -m 128 \ -redir tcp:8080::80 -redir tcp:2323::23 Is disabling of both DAC/ADC poll mode needed in your case or? 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; }; typedef struct ALSAVoiceOut { @@ -178,7 +179,7 @@ static void alsa_poll_handler (void *opaque) return; } - if (!(revents & POLLOUT)) { + if (!(revents & hlp->mask)) { if (conf.verbose) { dolog ("revents = %d\n", revents); } @@ -208,7 +209,7 @@ static void alsa_poll_handler (void *opaque) } } -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, struct pollhlp *hlp) hlp->pfds = pfds; hlp->count = count; hlp->handle = handle; + hlp->mask = mask; return 0; } @@ -272,14 +274,14 @@ static int alsa_poll_out (HWVoiceOut *hw) { ALSAVoiceOut *alsa = (ALSAVoiceOut *) hw; - return alsa_poll_helper (alsa->handle, &alsa->pollhlp); + return alsa_poll_helper (alsa->handle, &alsa->pollhlp, POLLOUT); } static int alsa_poll_in (HWVoiceIn *hw) { ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw; - return alsa_poll_helper (alsa->handle, &alsa->pollhlp); + return alsa_poll_helper (alsa->handle, &alsa->pollhlp, POLLIN); } static int alsa_write (SWVoiceOut *sw, void *buf, int len) [..snip..] -- mailto:av1474@comtv.ru