From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JpBj6-0003Fy-LX for qemu-devel@nongnu.org; Thu, 24 Apr 2008 20:23:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JpBj2-00035g-Fp for qemu-devel@nongnu.org; Thu, 24 Apr 2008 20:23:43 -0400 Received: from [199.232.76.173] (port=53478 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JpBj2-00035K-A4 for qemu-devel@nongnu.org; Thu, 24 Apr 2008 20:23:40 -0400 Received: from ug-out-1314.google.com ([66.249.92.173]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JpBj1-0001kU-Rl for qemu-devel@nongnu.org; Thu, 24 Apr 2008 20:23:40 -0400 Received: by ug-out-1314.google.com with SMTP id m2so904770uge.4 for ; Thu, 24 Apr 2008 17:23:36 -0700 (PDT) Message-ID: Date: Fri, 25 Apr 2008 02:23:36 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [4249] Improve audio api use in WM8750. In-Reply-To: <4811213C.7020507@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4810FBF9.1040308@web.de> <48111E61.9050002@web.de> <4811213C.7020507@web.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 25/04/2008, Jan Kiszka wrote: > Jan Kiszka wrote: > > Nothing is crawling here, just use a reasonable threshold for flushing > > _after_ the callback. Need to check, but maybe we can even wait the a > > full buffer. > > > Of course not the full buffer, but its half is fine as it generally > leaves enough time to the guest to refill the other half: > > Index: hw/wm8750.c > =================================================================== > --- hw/wm8750.c (Revision 4250) > +++ hw/wm8750.c (Arbeitskopie) > @@ -73,14 +73,10 @@ static void wm8750_audio_out_cb(void *op > > { > struct wm8750_s *s = (struct wm8750_s *) opaque; > > > - if (s->idx_out >= free_b) { > - s->idx_out = free_b; > - s->req_out = 0; > > + s->req_out = free_b; > + s->data_req(s->opaque, free_b >> 2, s->req_in >> 2); > > + if (s->idx_out >= sizeof(s->data_out)/2) The checking of whether the guest filled enough data happens in wm8750_dac_dat(), I don't see why do it second time here. The only place we need an additional check is before s->dat_req call, which you remove. Regards -- Please do not print this email unless absolutely necessary. Spread environmental awareness.