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 22:07:38 +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

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

Forgot to mention: I also tried OSS before, but it suffered the same
way, and polling had to be disabled.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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