Maestro2E Problem [pcm bug?]

Marat Fayzullin <[email protected]>
Newsgroups gmane.os.freebsd.devel.multimedia,gmane.os.freebsd.devel.mobile
Message-ID <[email protected]>
Hello!

I have just found that Maestro2E refuses to produce sound if the total
buffer size is <16kB. For example, look at the following program:

int main(int argc,char *argv)
{
  int I,J,K,SoundFD;
  char Buf[256];

  SoundFD=open("/dev/dsp",O_WRONLY);
  if(SoundFD<0) return(1);

  J=AFMT_U8;
  ioctl(SoundFD,SNDCTL_DSP_SETFMT,&J);
  J=0;
  ioctl(SoundFD,SNDCTL_DSP_STEREO,&J);
  J=44100;
  ioctl(SoundFD,SNDCTL_DSP_SPEED,&J);
  J=11|(8<<16);                               // <------- 8x2048 buffers
  ioctl(SoundFD,SNDCTL_DSP_SETFRAGMENT,&J);

  for(J=0;J<256;J++)   Buf[J]=J&1? 0:127;
  for(J=0;J<10000;J++) write(SoundFD,Buf,256);

  close(SoundFD);
  return(0);
}

When I set the fragmentation to 64x256 or 8x2048 or some other similar
value, I get the sound. Otherwise, the driver reports "channel dead"
and there is silence. My suspicion is that the DMA buffer has to be
allocated at a 16kB segment boundary, which does not always happen when
its size is <16kB. Unfortunately, I do not know FreeBSD kernel well enough
to verify and fix this problem.

Could somebody with enough expertise please look at it and try fixing
the problem? Because of this, I can't test several programs planned for
release.

System specifications:

SYSTEM:		FreeBSD 4.6.2-RELEASE
MACHINE:	Toshiba Portege 3380
SOUND:		ESS Maestro2E



To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-multimedia" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.