From owner-freebsd-multimedia@FreeBSD.ORG Sat Dec 10 17:20:50 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org 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 A27CA16A41F for ; Sat, 10 Dec 2005 17:20:50 +0000 (GMT) (envelope-from skywizard@MyBSD.org.my) Received: from tomoyo.MyBSD.org.my (tomoyo.mybsd.org.my [202.157.186.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 621C943D64 for ; Sat, 10 Dec 2005 17:20:47 +0000 (GMT) (envelope-from skywizard@MyBSD.org.my) Received: from localhost (localhost [127.0.0.1]) by tomoyo.MyBSD.org.my (Postfix) with ESMTP id 391AE6CC3B; Sun, 11 Dec 2005 01:25:26 +0800 (MYT) Received: from tomoyo.MyBSD.org.my ([127.0.0.1]) by localhost (TOMOYO.MYBSD.ORG.MY [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30174-05; Sun, 11 Dec 2005 01:25:24 +0800 (MYT) Received: from misaki (unknown [IPv6:2001:328:2002:aa2:214:a5ff:fe25:e1c7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tomoyo.MyBSD.org.my (Postfix) with ESMTP id 5827C6CC2B; Sun, 11 Dec 2005 01:25:24 +0800 (MYT) Date: Sun, 11 Dec 2005 01:20:42 +0800 From: Ariff Abdullah To: Watanabe Kazuhiro Message-Id: <20051211012042.060bf511.skywizard@MyBSD.org.my> In-Reply-To: <20051210083826.B72C61B626@mail.asahi-net.or.jp> References: <20051210083826.B72C61B626@mail.asahi-net.or.jp> Organization: MyBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by Amavisd AntiVirus & AntiSpam Scanner running on FreeBSD mailserver at TOMOYO.MYBSD.ORG.MY Cc: freebsd-multimedia@freebsd.org Subject: Re: wavrec(1) cannot record from the second time on half-duplex mode X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2005 17:20:50 -0000 On Sat, 10 Dec 2005 17:40:43 +0900 Watanabe Kazuhiro wrote: > > lock order reversal: > 1st 0xc22e8640 pcm1 (sound cdev) @ > /FreeBSD/FreeBSD-current/src/sys/modules/sound/sound/../../../dev/ > sound/pcm/dsp.c:277 2nd 0xc22e85e0 pcm1:record:0 (pcm record > channel) @ > /FreeBSD/FreeBSD-current/src/sys/modules/sound/sound/../../../dev/ > sound/pcm/dsp.c:290 > KDB: stack backtrace: > kdb_backtrace(0,ffffffff,c0954ff0,c0954f78,c08e27a4) at > kdb_backtrace+0x29 witness_checkorder(c22e85e0,9,c0ac7b63,122) at > witness_checkorder+0x580 _mtx_lock_flags(c22e85e0,0,c0ac7b63,122,1) > at _mtx_lock_flags+0x5b dsp_open(c22f8800,3,2000,c25ffd80,c094614c) > at dsp_open+0x2fd giant_open(c22f8800,3,2000,c25ffd80,c22f8800) at > giant_open+0x30 devfs_open(d1398a08) at devfs_open+0x223 > VOP_OPEN_APV(c08db0c0,d1398a08) at VOP_OPEN_APV+0x7e > vn_open_cred(d1398b70,d1398c70,0,c260b100,4) at vn_open_cred+0x3fe > vn_open(d1398b70,d1398c70,0,4,6b2) at vn_open+0x1e > kern_open(c25ffd80,bfbfed76,0,3,0) at kern_open+0xb6 > open(c25ffd80,d1398d04,c,c25ffd80,d1398d30) at open+0x1a > syscall(3b,3b,3b,805204c,8051000) at syscall+0x27e > Xint0x80_syscall() at Xint0x80_syscall+0x1f > --- syscall (5, FreeBSD ELF32, open), eip = 0x2811fb5f, esp = > 0xbfbfeadc, ebp = 0xbfbfeb08 --- > This is considered harmless, just ignore it for now. The fix will come later hopefully before new year. > > Wavrec open a sound device (default: /dev/audio) with O_RDWR flag. > Probably it's wrong. Because wavrec doesn't support full-duplex > operation. For a simple tool, it is wrong, indeed. > > It is documented in "Open Sound System(TM) Programmer's Guide" pp29: > | It is recommended that the device file is opened in read only > | (O_RDONLY) or write only (O_WRONLY) mode. Read write mode > | (O_RDWR) should be used only when it is necessary to record and > | play back at the same time (full duplex mode). > ("Selecting and Opening the Sound Device" > http://www.opensound.com/pguide/oss.pdf) > > Actually, this problem can be fixed by the patch: > --- recplay.c.configured Fri Dec 9 21:47:01 2005 > +++ recplay.c Fri Dec 9 21:50:53 2005 > @@ -190,7 +190,7 @@ > wfile = svr.wfile; /* And the file is > already opened */ > } > > - if ( (dfile = OpenDSP(wfile,O_RDWR,v_erf)) == NULL ) > + if ( (dfile = OpenDSP(wfile,O_RDONLY,v_erf)) == NULL ) > goto errxit; > > if ( RecordDSP(dfile,wfile,samples,svr_work_proc,v_erf) ) > > > Is it an only wavrec's bug? If so, I will send-pr. > Yeah, please file the PR and point to the maintainer. > If it's a newpcm's bug, please somebody fix the problem... How about a diff / patch ? > In FreeBSD/pc98, most of PC-98 have an on-board MSS chip (CS4231A). > These are only works on half-duplex mode (single DRQ). And > SoundBlaster16 for PC-98 is also worked on half-duplex too. -- Ariff Abdullah MyBSD http://www.MyBSD.org.my (IPv6/IPv4) http://staff.MyBSD.org.my (IPv6/IPv4) http://tomoyo.MyBSD.org.my (IPv6/IPv4)