From owner-freebsd-multimedia@FreeBSD.ORG Tue Nov 13 07:08:20 2012 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E09958FA for ; Tue, 13 Nov 2012 07:08:20 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 690FE8FC0C for ; Tue, 13 Nov 2012 07:08:19 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 342720716; Tue, 13 Nov 2012 08:08:12 +0100 From: Hans Petter Selasky To: freebsd-multimedia@freebsd.org Subject: Re: [SoX-devel] Bug in sox-14.3.2/src/oss.c Date: Tue, 13 Nov 2012 08:09:55 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201210281324.36923.hselasky@c2i.net> <20121031090350.GA8165@dcvr.yhbt.net> <201210311037.46581.hselasky@c2i.net> In-Reply-To: <201210311037.46581.hselasky@c2i.net> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201211130809.55220.hselasky@c2i.net> Cc: Eric Wong , sox-devel@lists.sourceforge.net X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 07:08:20 -0000 On Wednesday 31 October 2012 10:37:46 Hans Petter Selasky wrote: > On Wednesday 31 October 2012 10:03:50 Eric Wong wrote: > > Hans Petter Selasky wrote: > > > Hi, > > > > > > Line buffering should be off, but this statement leads to SOX reading 1 > > > and > > > > > > one byte from the recording DSP device under FreeBSD: > > > /* Change to non-buffered I/O */ > > > setvbuf(ft->fp, NULL, _IONBF, sizeof(char) * file->size); > > > return(SOX_SUCCESS); > > > > > > I think this flag should be used instead: > > > _IOFBF fully buffered > > > > > > I've tested this change and it works like expected. > > > > > > Any comments? > > > > The code you're changing in src/oss.c no long applies to SoX 14.4.0, > > how does 14.4.0 work out-of-the-box for you? > > Hi, > > First observation: > > oss.c: In function 'ossinit': > oss.c:116: warning: dereferencing 'void *' pointer > oss.c:116: error: request for member '_file' in something not a structure > or union > oss.c:124: warning: dereferencing 'void *' pointer > oss.c:124: error: request for member '_file' in something not a structure > or union > oss.c:163: warning: dereferencing 'void *' pointer > oss.c:163: error: request for member '_file' in something not a structure > or union > oss.c:176: warning: dereferencing 'void *' pointer > oss.c:176: error: request for member '_file' in something not a structure > or union > oss.c:186: warning: dereferencing 'void *' pointer > oss.c:186: error: request for member '_file' in something not a structure > or union > oss.c:205: warning: dereferencing 'void *' pointer > oss.c:205: error: request for member '_file' in something not a structure > or union > oss.c:214: warning: dereferencing 'void *' pointer > oss.c:214: error: request for member '_file' in something not a structure > or union > > Fixed by renaming fileno( into sox_fileno( and defining this: > > #define sox_fileno(x) fileno((FILE *)(x)) > > Second observation: > > Default audio driver is not OSS. > > env AUDIODEVICE=/dev/dsp AUDIODRIVER=oss rec test.wav > > Third observation: > > GIO syscalls are still used, and the length is 1 byte. > > 15260 sox RET read 1 > 15260 sox CALL read(0x3,0x807b2de37,0x1) > 15260 sox GIO fd 3 read 1 byte > 0x0000 ff > > Patch needed: > > /* Change to non-buffered I/O */ > setvbuf(ft->fp, NULL, _IONBF, sizeof(char) * file->size); > return(SOX_SUCCESS); > } > > Change to: > > /* Change to non-buffered I/O */ > setvbuf(ft->fp, NULL, _IOFBF, sizeof(char) * file->size); > return(SOX_SUCCESS); > } > Hi, Will someone handle this or do I have to file a bug-report? --HPS