atom feed1 message in org.freebsd.freebsd-multimediaMaestro2E Problem [pcm bug?]
FromSent OnAttachments
Marat FayzullinSep 17, 2002 7:53 am 
Subject:Maestro2E Problem [pcm bug?]
From:Marat Fayzullin (fm@cs.umd.edu)
Date:Sep 17, 2002 7:53:44 am
List:org.freebsd.freebsd-multimedia

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