From owner-freebsd-multimedia Tue Sep 17 7:54:21 2002 Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D63E537B401; Tue, 17 Sep 2002 07:54:19 -0700 (PDT) Received: from ringding.cs.umd.edu (ringding.cs.umd.edu [128.8.129.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 550F143E77; Tue, 17 Sep 2002 07:54:17 -0700 (PDT) (envelope-from fms@cs.umd.edu) Received: from snickers.cs.umd.edu (snickers.cs.umd.edu [128.8.129.109]) by ringding.cs.umd.edu (8.12.5/8.12.5) with ESMTP id g8HEs8A8008990; Tue, 17 Sep 2002 10:54:08 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by snickers.cs.umd.edu (8.12.5/8.12.5) with ESMTP id g8HEs7rA028673; Tue, 17 Sep 2002 10:54:07 -0400 (EDT) Date: Tue, 17 Sep 2002 10:54:06 -0400 (EDT) From: Marat Fayzullin To: Cc: Subject: Maestro2E Problem [pcm bug?] Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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