* [Qemu-devel] Patch for disabling audio
@ 2004-04-24 0:43 Keith Grandin
2004-04-26 20:09 ` Fabrice Bellard
0 siblings, 1 reply; 2+ messages in thread
From: Keith Grandin @ 2004-04-24 0:43 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 164 bytes --]
Here is a simple patch that allows you to have the --disable-audio
option on the command line. This is handy for running windows inside
the emulation.
--Keith
[-- Attachment #2: disable.audio.diff --]
[-- Type: text/plain, Size: 3855 bytes --]
Index: vl.c
===================================================================
RCS file: /cvsroot/qemu/qemu/vl.c,v
retrieving revision 1.61
diff -u -r1.61 vl.c
--- vl.c 22 Apr 2004 00:35:09 -0000 1.61
+++ vl.c 23 Apr 2004 23:01:17 -0000
@@ -111,6 +111,7 @@
SerialState *serial_console;
QEMUTimer *gui_timer;
int vm_running;
+static int audio_enabled = 1;
/***********************************************************/
/* x86 io ports */
@@ -1731,8 +1732,11 @@
qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL],
qemu_get_clock(vm_clock));
- /* XXX: add explicit timer */
- SB16_run();
+ if (audio_enabled)
+ {
+ /* XXX: add explicit timer */
+ SB16_run();
+ }
/* run dma transfers, if any */
DMA_run();
@@ -1781,6 +1785,7 @@
"Debug/Expert options:\n"
"-s wait gdb connection to port %d\n"
"-p port change gdb connection port\n"
+ "-disable-audio disable sound blaster emulation (x86 emulation only)\n"
"-d item1,... output log to %s (use -d ? for a list of log items)\n"
"-hdachs c,h,s force hard disk 0 geometry (usually qemu can guess it)\n"
"-L path set the directory for the BIOS and VGA BIOS\n"
@@ -1829,6 +1834,7 @@
{ "macaddr", 1, NULL, 0 },
{ "user-net", 0, NULL, 0 },
{ "dummy-net", 0, NULL, 0 },
+ { "disable-audio", 0, NULL, 0 },
{ NULL, 0, NULL, 0 },
};
@@ -2020,6 +2026,10 @@
case 19:
net_if_type = NET_IF_DUMMY;
break;
+ case 20:
+ audio_enabled = 0;
+ fprintf(stderr, "Disabling audio\n");
+ break;
}
break;
case 'h':
@@ -2301,7 +2311,8 @@
#if defined(TARGET_I386)
pc_init(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
- kernel_filename, kernel_cmdline, initrd_filename);
+ kernel_filename, kernel_cmdline, initrd_filename,
+ audio_enabled);
#elif defined(TARGET_PPC)
ppc_init(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
Index: vl.h
===================================================================
RCS file: /cvsroot/qemu/qemu/vl.h,v
retrieving revision 1.20
diff -u -r1.20 vl.h
--- vl.h 21 Apr 2004 23:27:19 -0000 1.20
+++ vl.h 23 Apr 2004 23:01:17 -0000
@@ -458,7 +458,7 @@
void pc_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename);
+ const char *initrd_filename, int audio_enabled);
/* monitor.c */
void monitor_init(void);
Index: hw/pc.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/pc.c,v
retrieving revision 1.9
diff -u -r1.9 pc.c
--- hw/pc.c 7 Apr 2004 21:30:08 -0000 1.9
+++ hw/pc.c 23 Apr 2004 23:01:17 -0000
@@ -282,7 +282,7 @@
void pc_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+ const char *initrd_filename, int audio_enabled)
{
char buf[1024];
int ret, linux_boot, initrd_size, i, nb_nics1, fd;
@@ -402,8 +402,11 @@
#ifndef _WIN32
/* no audio supported yet for win32 */
- AUD_init();
- SB16_init();
+ if (audio_enabled)
+ {
+ AUD_init();
+ SB16_init();
+ }
#endif
floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] Patch for disabling audio
2004-04-24 0:43 [Qemu-devel] Patch for disabling audio Keith Grandin
@ 2004-04-26 20:09 ` Fabrice Bellard
0 siblings, 0 replies; 2+ messages in thread
From: Fabrice Bellard @ 2004-04-26 20:09 UTC (permalink / raw)
To: qemu-devel
Can someone confirm that Windows (2000? XP?) refuses to boot or install
with the SB16 emulation enabled with the current CVS ? If it is the
case, I will disable SB16 by default in the release.
Fabrice.
Keith Grandin wrote:
> Here is a simple patch that allows you to have the --disable-audio
> option on the command line. This is handy for running windows inside
> the emulation.
>
> --Keith
>
>
>
>
> ------------------------------------------------------------------------
>
> Index: vl.c
> ===================================================================
> RCS file: /cvsroot/qemu/qemu/vl.c,v
> retrieving revision 1.61
> diff -u -r1.61 vl.c
> --- vl.c 22 Apr 2004 00:35:09 -0000 1.61
> +++ vl.c 23 Apr 2004 23:01:17 -0000
> @@ -111,6 +111,7 @@
> SerialState *serial_console;
> QEMUTimer *gui_timer;
> int vm_running;
> +static int audio_enabled = 1;
>
> /***********************************************************/
> /* x86 io ports */
> @@ -1731,8 +1732,11 @@
> qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL],
> qemu_get_clock(vm_clock));
>
> - /* XXX: add explicit timer */
> - SB16_run();
> + if (audio_enabled)
> + {
> + /* XXX: add explicit timer */
> + SB16_run();
> + }
>
> /* run dma transfers, if any */
> DMA_run();
> @@ -1781,6 +1785,7 @@
> "Debug/Expert options:\n"
> "-s wait gdb connection to port %d\n"
> "-p port change gdb connection port\n"
> + "-disable-audio disable sound blaster emulation (x86 emulation only)\n"
> "-d item1,... output log to %s (use -d ? for a list of log items)\n"
> "-hdachs c,h,s force hard disk 0 geometry (usually qemu can guess it)\n"
> "-L path set the directory for the BIOS and VGA BIOS\n"
> @@ -1829,6 +1834,7 @@
> { "macaddr", 1, NULL, 0 },
> { "user-net", 0, NULL, 0 },
> { "dummy-net", 0, NULL, 0 },
> + { "disable-audio", 0, NULL, 0 },
> { NULL, 0, NULL, 0 },
> };
>
> @@ -2020,6 +2026,10 @@
> case 19:
> net_if_type = NET_IF_DUMMY;
> break;
> + case 20:
> + audio_enabled = 0;
> + fprintf(stderr, "Disabling audio\n");
> + break;
> }
> break;
> case 'h':
> @@ -2301,7 +2311,8 @@
> #if defined(TARGET_I386)
> pc_init(ram_size, vga_ram_size, boot_device,
> ds, fd_filename, snapshot,
> - kernel_filename, kernel_cmdline, initrd_filename);
> + kernel_filename, kernel_cmdline, initrd_filename,
> + audio_enabled);
> #elif defined(TARGET_PPC)
> ppc_init(ram_size, vga_ram_size, boot_device,
> ds, fd_filename, snapshot,
> Index: vl.h
> ===================================================================
> RCS file: /cvsroot/qemu/qemu/vl.h,v
> retrieving revision 1.20
> diff -u -r1.20 vl.h
> --- vl.h 21 Apr 2004 23:27:19 -0000 1.20
> +++ vl.h 23 Apr 2004 23:01:17 -0000
> @@ -458,7 +458,7 @@
> void pc_init(int ram_size, int vga_ram_size, int boot_device,
> DisplayState *ds, const char **fd_filename, int snapshot,
> const char *kernel_filename, const char *kernel_cmdline,
> - const char *initrd_filename);
> + const char *initrd_filename, int audio_enabled);
>
> /* monitor.c */
> void monitor_init(void);
> Index: hw/pc.c
> ===================================================================
> RCS file: /cvsroot/qemu/qemu/hw/pc.c,v
> retrieving revision 1.9
> diff -u -r1.9 pc.c
> --- hw/pc.c 7 Apr 2004 21:30:08 -0000 1.9
> +++ hw/pc.c 23 Apr 2004 23:01:17 -0000
> @@ -282,7 +282,7 @@
> void pc_init(int ram_size, int vga_ram_size, int boot_device,
> DisplayState *ds, const char **fd_filename, int snapshot,
> const char *kernel_filename, const char *kernel_cmdline,
> - const char *initrd_filename)
> + const char *initrd_filename, int audio_enabled)
> {
> char buf[1024];
> int ret, linux_boot, initrd_size, i, nb_nics1, fd;
> @@ -402,8 +402,11 @@
>
> #ifndef _WIN32
> /* no audio supported yet for win32 */
> - AUD_init();
> - SB16_init();
> + if (audio_enabled)
> + {
> + AUD_init();
> + SB16_init();
> + }
> #endif
>
> floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table);
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://mail.nongnu.org/mailman/listinfo/qemu-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-26 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-24 0:43 [Qemu-devel] Patch for disabling audio Keith Grandin
2004-04-26 20:09 ` Fabrice Bellard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).