www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/13/00:50:01

Xref: news2.mv.net comp.os.msdos.djgpp:4899
From: gaghon AT nevada DOT edu (GEORGE GAGHON)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: help on sb05_dj2 playing Mods.
Date: 12 Jun 1996 19:01:10 GMT
Organization: University of Nevada System Computing Services
Lines: 51
Message-ID: <4pn45m$d9k@news.nevada.edu>
References: <4ohbic$k8c AT news DOT nevada DOT edu> <4p9f0t$kh6 AT acebo DOT sdi DOT uam DOT es>
NNTP-Posting-Host: pioneer.nevada.edu
NNTP-Posting-User: unauthenticated_user
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019