Mail Archives: djgpp/1996/06/13/00:50:01
EINSTEIN6 (USUARIO AT CASIOPEA DOT ADI DOT UAM DOT ES) wrote:
: I've the same problem
I finally found out what is happening. with the Packard Bell.
Its skipping interrupts! When the HD is active it makes the sound card skip
interrputs once in a while. So, the DMA just plays buffers 1 and 2 over and
over, but the interrupt that fills the buffers with new sound data starts
to update the same buffer that the DMA is playing; and Static.
Make the following changes to SBDRIVER.C:
static void sb_interrupt_handler(void) {
int a, b, c ,d, e; /***** Add D and E ********/
DWORD addr;
asm("movl $96, %%ecx
movl $0x80, %%eax
movl %0, %%edi
cld
rep
stosl"
:
: "m" (sb_mixing_buffer)
: "%eax", "%ecx", "%edi");
/******** Add the following lines ************/
d = sb_info.DMA << 1;
outportb(0x0c, 0xff); /* get current posision and swap if interrupt is
skipped */
e = inportb(d);
e |= inportb(d) << 8;
if(sb_info.dspVersion>=0x0300)
d = sb_dmaBufferLinearAddress[1] & 0xffff;
else
d = sb_miniDMABufferAddress[1] & 0xffff;
if ( ((d>e) && (sb_currentBlock == 0)) || ((d<=e) &&
(sb_currentBlock != 0)) )
sb_currentBlock^=1;
==============================================================
Hope this helps you,
Vince
- Raw text -