From owner-freebsd-multimedia Wed May 24 1:18: 4 2000 Delivered-To: freebsd-multimedia@freebsd.org Received: from blizzard.sabbo.net (blizzard.sabbo.net [193.193.218.18]) by hub.freebsd.org (Postfix) with ESMTP id CB2A237B733; Wed, 24 May 2000 01:17:56 -0700 (PDT) (envelope-from SoboMax@FreeBSD.org) Received: from vega.vega.com (vic.sabbo.net [193.193.218.106]) by blizzard.sabbo.net (8.9.1/8.9.3) with ESMTP id LAA07172; Wed, 24 May 2000 11:17:01 +0300 (EEST) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.9.3/8.9.3) with ESMTP id LAA82248; Wed, 24 May 2000 11:17:26 +0300 (EEST) (envelope-from SoboMax@FreeBSD.org) Message-ID: <392B9011.368FEC6B@FreeBSD.org> Date: Wed, 24 May 2000 11:17:21 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.73 [en] (WinNT; I) X-Accept-Language: uk,ru,en MIME-Version: 1.0 To: daeron@wit401305.student.utwente.nl Cc: cg@FreeBSD.org, multimedia@FreeBSD.org Subject: Re: cvs commit: ports/audio/wsoundserver Makefile ports/audio/wsoundserver/files md5 ports/audio/wsoundserver/patches patch-aa patch-ab patch-ac patch-ad ports/audio/wsoundserver/pkg DESCR PLIST References: <200005230633.XAA68264@freefall.freebsd.org> <20000524021016.A24438@shadowmere.student.utwente.nl> <392B7DEB.9344C331@FreeBSD.org> <20000524095458.C71443@shadowmere.student.utwente.nl> Content-Type: multipart/mixed; boundary="------------F189634FBF935B75CB181369" Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. --------------F189634FBF935B75CB181369 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Pascal Hofstee wrote: > On Wed, May 24, 2000 at 09:59:55AM +0300, Maxim Sobolev wrote: > > Pascal Hofstee wrote: > > Yes, it is already in my TODO list ;). > > > > BTW, there is some problem with playing short sounds, at least on my -current > > with OPL3-SA soundcard. It seems that if length of sound is less that default > > buffer used to write sounds (8k for 8 bit and 4k for 16 bit) then it simple > > doesn't produce any sound. Reducing length of the buffer helps, but it might be > > not the ideal solution. Now I'm looking into the problem and probably will came > > with the workaround soon. > > This problem is something that i noticed quite a while back around the > first time the emu10k-support was introduced into CURRENT .... from that > moment on Any wav file that i try to play basically just "skips" the first > x couple of frames ... i am still convinced this si a bug in the current > pcm-code Yes, it is definitely a bug in the pcm driver. It seems that driver needs at least two write() operations for sound to be actually played. With this message I'm attaching small workarround which seems fix this problem in wsoundserver, at least for my OPL3-SA card. Probably we should contact Cameron (he is the current maintainer of the pcm stuff), for proper kernel fix. -Maxim --------------F189634FBF935B75CB181369 Content-Type: text/plain; charset=koi8-r; name="wsound.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="wsound.patch" --- wslib/audio_voxware.c.orig Fri Mar 31 23:14:40 2000 +++ wslib/audio_voxware.c Wed May 24 11:08:24 2000 @@ -403,6 +403,7 @@ long blkFrames; /* number of frames in current audio block */ int blockSize = 8192; /* Size of an audio block buffer in frames */ int i; + u_int8_t fakebuffer[2] = {0, 0}; #ifdef DEBUG fprintf(stderr, " >> writing data\n"); @@ -413,7 +414,11 @@ SErrorCode = SERR_NOMEMORY; return -1; } - + + /* Following line is a simple workarround for buggy pcm driver, which seens need at least to write() + calls for sound to be actually played */ + write(audiofd, fakebuffer, 2); + curFrame = 0; while (curFrame < afInfo->FrameCount) { if ((blkFrames = (afInfo->FrameCount - curFrame)) > blockSize) { @@ -503,6 +508,7 @@ long blkFrames; /* number of frames in current audio block */ int blockSize = 4096; /* Size of an audio block buffer in frames */ int i; + u_int16_t fakebuffer[2] = {0, 0}; #ifdef DEBUG fprintf(stderr, " >> writing data\n"); @@ -513,7 +519,11 @@ SErrorCode = SERR_NOMEMORY; return -1; } - + + /* Following line is a simple workarround for buggy pcm driver, which seens need at least to write() + calls for sound to be actually played */ + write(audiofd, fakebuffer, 4); + curFrame = 0; while (curFrame < afInfo->FrameCount) { if ((blkFrames = (afInfo->FrameCount - curFrame)) > blockSize) { --------------F189634FBF935B75CB181369-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message