qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: Audio


From: Jan Kiszka
Subject: [Qemu-devel] Re: Audio
Date: Sun, 13 Sep 2009 21:57:15 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

malc wrote:
> 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.

Sorry, the patch was so trivial that I became sloppy.

> 
> 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.

Unless the bounce said "mailbox full": Just forward me a recent bounce
message privately (replace web.de with siemens.com). Typically I get
wrong black-listings resolved with web.de within a day or less.

> 
> 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

Hmm, this setup works for me (current master). Maybe you can catch what
strace reports or which backtrace gdb generates. Does disabling polling
or reverting before your changes make it boot again?

> 
> Is disabling of both DAC/ADC poll mode needed in your case or?

Yes.

> 
> 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)
> 
> 

Nope, still full CPU load.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]