wavrec(1) cannot record from the second time on half-duplex mode

Ariff Abdullah skywizard at MyBSD.org.my
Sat Dec 10 09:20:50 PST 2005


On Sat, 10 Dec 2005 17:40:43 +0900
Watanabe Kazuhiro <CQG00620 at nifty.ne.jp> 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)


More information about the freebsd-multimedia mailing list