[Top][All Lists]

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

Re: [Qemu-devel] [patch] minimal PC speaker output

From: Fabrice Bellard
Subject: Re: [Qemu-devel] [patch] minimal PC speaker output
Date: Mon, 09 Jan 2006 21:40:36 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913


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.



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:


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

reply via email to

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