From owner-freebsd-multimedia Sat Jul 26 12:45:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA16170 for multimedia-outgoing; Sat, 26 Jul 1997 12:45:09 -0700 (PDT) Received: from whizzo.TransSys.COM (whizzo.TransSys.COM [144.202.42.10]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA16161 for ; Sat, 26 Jul 1997 12:45:05 -0700 (PDT) Received: from localhost.transsys.com (localhost.transsys.com [127.0.0.1]) by whizzo.TransSys.COM (8.8.6/8.7.3) with SMTP id PAA00779; Sat, 26 Jul 1997 15:44:56 -0400 (EDT) Message-Id: <199707261944.PAA00779@whizzo.TransSys.COM> X-Mailer: exmh version 2.0delta 6/3/97 To: Amancio Hasty cc: multimedia@FreeBSD.ORG From: "Louis A. Mamakos" Subject: Re: ftp://rah.star-gate.com/pub/guspnp12.tar.gz References: <199707240240.TAA08628@rah.star-gate.com> In-reply-to: Your message of "Wed, 23 Jul 1997 19:40:57 PDT." <199707240240.TAA08628@rah.star-gate.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 26 Jul 1997 15:44:55 -0400 Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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 bytes */ #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, mult. 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