Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2002 10:54:06 -0400 (EDT)
From:      Marat Fayzullin <fms@cs.umd.edu>
To:        <freebsd-mobile@freebsd.org>
Cc:        <freebsd-multimedia@freebsd.org>
Subject:   Maestro2E Problem [pcm bug?]
Message-ID:  <Pine.SOL.4.33.0209171047350.28624-100000@snickers.cs.umd.edu>

next in thread | raw e-mail | index | archive | help

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 majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.33.0209171047350.28624-100000>