From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ew3oh-0006lI-2v for qemu-devel@nongnu.org; Mon, 09 Jan 2006 15:40:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ew3oe-0006kF-BY for qemu-devel@nongnu.org; Mon, 09 Jan 2006 15:40:34 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ew3oe-0006k7-4a for qemu-devel@nongnu.org; Mon, 09 Jan 2006 15:40:32 -0500 Received: from [84.96.92.55] (helo=smtP.neuf.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ew3qy-0002dk-8c for qemu-devel@nongnu.org; Mon, 09 Jan 2006 15:42:56 -0500 Received: from [84.102.211.235] by sp604004mt.gpm.neuf.ld (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0ISU000FKEO174L1@sp604004mt.gpm.neuf.ld> for qemu-devel@nongnu.org; Mon, 09 Jan 2006 21:38:25 +0100 (CET) Date: Mon, 09 Jan 2006 21:40:36 +0100 From: Fabrice Bellard Subject: Re: [Qemu-devel] [patch] minimal PC speaker output In-reply-to: Message-id: <43C2CA44.9080504@bellard.org> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT References: 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 Hi, I think it would not be difficult to add a real speaker emulation with the audio API written by malc, at least to simulate tone generation using the PIT. Regards, Fabrice. Joachim Henke wrote: > Ok, although this ugly hack has nothing to do with real PC speaker emulation, > it's probably the most portable way to have some noise anyway. I just post > this for people (like me) who are missing their guest operating system beeps. > For this case the patch below is "better than nothing" (c: > > Greets > Jo. > > --- pc.c > +++ pc.c > @@ -276,6 +276,11 @@ > static void speaker_ioport_write(void *opaque, uint32_t addr, uint32_t val) > { > + int spk_off = speaker_data_on ^ 1; > + > speaker_data_on = (val >> 1) & 1; > pit_set_gate(pit, 2, val & 1); > + /* ring terminal bell, if speaker is switched on */ > + if (spk_off & speaker_data_on) > + puts("*beep*\a"); > } > >