Index: qemu/audio/alsaaudio.c =================================================================== RCS file: /home/malc/cvsroot/bellard/qemu/audio/alsaaudio.c,v retrieving revision 1.1.1.4 retrieving revision 1.1.1.1.2.8 diff -u -r1.1.1.4 -r1.1.1.1.2.8 --- audio/alsaaudio.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 +++ audio/alsaaudio.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.8 @@ -61,8 +61,8 @@ .size_in_usec_in = 1, .size_in_usec_out = 1, #endif - .pcm_name_out = "hw:0,0", - .pcm_name_in = "hw:0,0", + .pcm_name_out = "default", + .pcm_name_in = "default", #ifdef HIGH_LATENCY .buffer_size_in = 400000, .period_size_in = 400000 / 4, Index: qemu/audio/audio.h =================================================================== RCS file: /home/malc/cvsroot/bellard/qemu/audio/audio.h,v retrieving revision 1.1.1.3 retrieving revision 1.1.1.1.2.5 diff -u -r1.1.1.3 -r1.1.1.1.2.5 --- audio/audio.h 21 Nov 2005 12:47:06 -0000 1.1.1.3 +++ audio/audio.h 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.5 @@ -111,7 +111,7 @@ } uint32_t popcount (uint32_t u); -inline uint32_t lsbindex (uint32_t u); +uint32_t lsbindex (uint32_t u); #ifdef __GNUC__ #define audio_MIN(a, b) ( __extension__ ({ \ Index: qemu/audio/dsound_template.h =================================================================== RCS file: /home/malc/cvsroot/bellard/qemu/audio/dsound_template.h,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.2 -r1.1.1.1.2.2 --- audio/dsound_template.h 5 Nov 2005 20:42:14 -0000 1.1.1.2 +++ audio/dsound_template.h 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.2 @@ -70,7 +70,13 @@ int i; LPVOID p1 = NULL, p2 = NULL; DWORD blen1 = 0, blen2 = 0; + DWORD flag; +#ifdef DSBTYPE_IN + flag = entire ? DSCBLOCK_ENTIREBUFFER : 0; +#else + flag = entire ? DSBLOCK_ENTIREBUFFER : 0; +#endif for (i = 0; i < conf.lock_retries; ++i) { hr = glue (IFACE, _Lock) ( buf, @@ -80,13 +86,7 @@ &blen1, &p2, &blen2, - (entire -#ifdef DSBTYPE_IN - ? DSCBLOCK_ENTIREBUFFER -#else - ? DSBLOCK_ENTIREBUFFER -#endif - : 0) + flag ); if (FAILED (hr)) { Index: qemu/audio/dsoundaudio.c =================================================================== RCS file: /home/malc/cvsroot/bellard/qemu/audio/dsoundaudio.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.2 -r1.1.1.1.2.2 --- audio/dsoundaudio.c 5 Nov 2005 20:42:14 -0000 1.1.1.2 +++ audio/dsoundaudio.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.2 @@ -987,6 +987,12 @@ hr = IDirectSound_Initialize (s->dsound, NULL); if (FAILED (hr)) { dsound_logerr (hr, "Could not initialize DirectSound\n"); + + hr = IDirectSound_Release (s->dsound); + if (FAILED (hr)) { + dsound_logerr (hr, "Could not release DirectSound\n"); + } + s->dsound = NULL; return NULL; } Index: qemu/audio/ossaudio.c =================================================================== RCS file: /home/malc/cvsroot/bellard/qemu/audio/ossaudio.c,v retrieving revision 1.1.1.4 retrieving revision 1.1.1.1.2.5 diff -u -r1.1.1.4 -r1.1.1.1.2.5 --- audio/ossaudio.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 +++ audio/ossaudio.c 7 Apr 2006 22:23:42 -0000 1.1.1.1.2.5 @@ -324,9 +324,18 @@ return 0; } - if (abinfo.bytes < 0 || abinfo.bytes > bufsize) { - ldebug ("warning: Invalid available size, size=%d bufsize=%d\n", - abinfo.bytes, bufsize); + if (abinfo.bytes > bufsize) { +#ifndef __FreeBSD__ + dolog ("warning: Invalid available size, size=%d bufsize=%d\n" + "please report your OS/audio hw to malc@pulsesoft.com\n", + abinfo.bytes, bufsize); +#endif + abinfo.bytes = bufsize; + } + + if (abinfo.bytes < 0) { + dolog ("warning: Invalid available size, size=%d bufsize=%d\n", + abinfo.bytes, bufsize); return 0; } Index: qemu/hw/es1370.c =================================================================== RCS file: /home/malc/cvsroot/bellard/qemu/hw/es1370.c,v retrieving revision 1.1.1.4 retrieving revision 1.1.1.1.2.7 diff -u -r1.1.1.4 -r1.1.1.1.2.7 --- hw/es1370.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 +++ hw/es1370.c 7 Apr 2006 22:05:21 -0000 1.1.1.1.2.7 @@ -479,9 +479,10 @@ IO_WRITE_PROTO (es1370_writeb) { ES1370State *s = opaque; - addr = es1370_fixup (s, addr); uint32_t shift, mask; + addr = es1370_fixup (s, addr); + switch (addr) { case ES1370_REG_CONTROL: case ES1370_REG_CONTROL + 1: Index: qemu/hw/sb16.c =================================================================== RCS file: /home/malc/cvsroot/bellard/qemu/hw/sb16.c,v retrieving revision 1.1.1.4 retrieving revision 1.1.1.1.2.6 diff -u -r1.1.1.4 -r1.1.1.1.2.6 --- hw/sb16.c 21 Nov 2005 12:47:06 -0000 1.1.1.4 +++ hw/sb16.c 7 Apr 2006 22:23:59 -0000 1.1.1.1.2.6 @@ -193,6 +193,31 @@ #define DMA8_AUTO 1 #define DMA8_HIGH 2 +static void continue_dma8 (SB16State *s) +{ + if (s->freq > 0) { + audsettings_t as; + + s->audio_free = 0; + + as.freq = s->freq; + as.nchannels = 1 << s->fmt_stereo; + as.fmt = s->fmt; + + s->voice = AUD_open_out ( + &s->card, + s->voice, + "sb16", + s, + SB_audio_callback, + &as, + 0 /* little endian */ + ); + } + + control (s, 1); +} + static void dma_cmd8 (SB16State *s, int mask, int dma_len) { s->fmt = AUD_FMT_U8; @@ -201,7 +226,8 @@ s->fmt_signed = 0; s->fmt_stereo = (s->mixer_regs[0x0e] & 2) != 0; if (-1 == s->time_const) { - s->freq = 11025; + if (s->freq <= 0) + s->freq = 11025; } else { int tmp = (256 - s->time_const); @@ -239,27 +265,7 @@ s->freq, s->fmt_stereo, s->fmt_signed, s->fmt_bits, s->block_size, s->dma_auto, s->fifo, s->highspeed); - if (s->freq) { - audsettings_t as; - - s->audio_free = 0; - - as.freq = s->freq; - as.nchannels = 1 << s->fmt_stereo; - as.fmt = s->fmt; - - s->voice = AUD_open_out ( - &s->card, - s->voice, - "sb16", - s, - SB_audio_callback, - &as, - 0 /* little endian */ - ); - } - - control (s, 1); + continue_dma8 (s); speaker (s, 1); } @@ -437,7 +443,7 @@ break; case 0x1c: /* Auto-Initialize DMA DAC, 8-bit */ - control (s, 1); + dma_cmd8 (s, DMA8_AUTO, -1); break; case 0x20: /* Direct ADC, Juice/PL */ @@ -531,7 +537,9 @@ break; case 0xd4: /* continue DMA operation. 8bit */ - control (s, 1); + /* KQ6 (or maybe Sierras audblst.drv in general) resets + the frequency between halt/continue */ + continue_dma8 (s); break; case 0xd5: /* halt DMA operation. 16bit */