From owner-freebsd-multimedia Sat Jul 26 12:50:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA16587 for multimedia-outgoing; Sat, 26 Jul 1997 12:50:07 -0700 (PDT) Received: from rah.star-gate.com (rah.star-gate.com [204.188.121.18]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA16582 for ; Sat, 26 Jul 1997 12:50:05 -0700 (PDT) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.8.5/8.8.5) with ESMTP id MAA10679; Sat, 26 Jul 1997 12:49:49 -0700 (PDT) Message-Id: <199707261949.MAA10679@rah.star-gate.com> X-Mailer: exmh version 2.0gamma 1/27/96 To: "Louis A. Mamakos" cc: multimedia@FreeBSD.ORG Subject: [snddrv] Re: ftp://rah.star-gate.com/pub/guspnp12.tar.gz In-reply-to: Your message of "Sat, 26 Jul 1997 15:44:55 EDT." <199707261944.PAA00779@whizzo.TransSys.COM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 26 Jul 1997 12:49:49 -0700 From: Amancio Hasty Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk "Sounds" mighty good to me !! Currently, I trying to figured out why the SB16 is generating a click at the start and stop of a sound stream with the guspnp12 driver. It is a weird problem :( Tnks! Amancio >From The Desk Of "Louis A. Mamakos" : > > I think that I may be on to why the 'mixer' command has stopped working. > > When installing the new sound drivers, I've been replacing the soundcard.h > file with the on included in the sound driver distribution. What I noticed > is that programs which worked before I recompiled them would stop working > after they were built. Firing up gdb on old and new binaries, I see > that the ioctl() system call is being passed different commands. Looking > at header files, I see: > > #define IOCPARM_MASK 0x7f /* parameters must be < 128 byt es */ > #define IOC_VOID 0x00000000 /* no parameters */ > #define IOC_OUT 0x20000000 /* copy out parameters */ > #define IOC_IN 0x40000000 /* copy in parameters */ > #define IOC_INOUT (IOC_IN|IOC_OUT) > /* the 0x20000000 is so we can distinguish new ioctl's from old */ > #define _IO(x,y) ((int)(IOC_VOID|(x<<8)|y)) > #define _IOR(x,y,t) ((int)(IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|( x<<8)|y)) > #define _IOW(x,y,t) ((int)(IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|(x <<8)|y)) > /* this should be _IORW, but stdio got there first */ > #define _IOWR(x,y,t) ((int)(IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16) |(x<<8)|y)) > > in the soundcard.h file, but looking at /usr/include/sys/ioccom.h: > > > #define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */ > #define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) > #define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16)) > #define IOCGROUP(x) (((x) >> 8) & 0xff) > > #define IOCPARM_MAX PAGE_SIZE /* max size of ioctl, m ult. of PAGE_SIZE */ > #define IOC_VOID 0x20000000 /* no parameters */ > #define IOC_OUT 0x40000000 /* copy out parameters */ > #define IOC_IN 0x80000000 /* copy in parameters */ > #define IOC_INOUT (IOC_IN|IOC_OUT) > #define IOC_DIRMASK 0xe0000000 /* mask for IN/OUT/VOID */ > > #define _IOC(inout,group,num,len) \ > (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)) > #define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) > #define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) > #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) > /* this should be _IORW, but stdio got there first */ > #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) > > Notice how IOC_OUT, IOC_IN, IOC_VOID are different between the two. > > I think that soundcard.h should just #include if _IOR > isn't defined, rather than doing its own thing like this. I'm going > to try rebuilding stuff with this change and see what happens. > > louie > > >