Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GRKaJ-00016b-4J for qemu-devel@nongnu.org; Sat, 23 Sep 2006 23:23:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GRKaI-00016L-BT for qemu-devel@nongnu.org; Sat, 23 Sep 2006 23:23:14 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GRKaI-00016I-5X for qemu-devel@nongnu.org; Sat, 23 Sep 2006 23:23:14 -0400 Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GRKeO-0005CS-Ab for qemu-devel@nongnu.org; Sat, 23 Sep 2006 23:27:28 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GRKa9-0004qZ-7O for qemu-devel@nongnu.org; Sun, 24 Sep 2006 05:23:05 +0200 Received: from n100h003.catv.ext.ru ([n100h003.catv.ext.ru]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Sep 2006 05:23:05 +0200 Received: from malc by n100h003.catv.ext.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Sep 2006 05:23:05 +0200 From: malc Date: Sun, 24 Sep 2006 03:22:49 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: news Subject: [Qemu-devel] Re: Audio output for CS4231, patch/RFC 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 Blue Swirl hotmail.com> writes: > > Hi, > > This patch hooks CS4231 to the audio subsystem. It's not ready for applying, > though I can already make some noise. Any comments? After having a cursory look at it only one thing really caught my attention: in the audio callback you set s->audio_free to the provided value, but then in you never use it. If i'm reading everything correctly this would lead to reading N bytes from DMA in write_audio, succeeding in writing only M bytes (where M < N) to the audio subsystem and loosing N-M bytes forever. Basically you should never attempt to do volatile reads of more than audio_free bytes. SB16 operates in similar fashion.