From owner-freebsd-stable Sat Feb 19 6:56:34 2000 Delivered-To: freebsd-stable@freebsd.org Received: from typhoon.mail.pipex.net (typhoon.mail.pipex.net [158.43.128.27]) by hub.freebsd.org (Postfix) with SMTP id 281A737BC84 for ; Sat, 19 Feb 2000 06:56:23 -0800 (PST) (envelope-from mark@dogma.freebsd-uk.eu.org) Received: (qmail 5188 invoked from network); 19 Feb 2000 14:55:55 -0000 Received: from userac41.uk.uudial.com (HELO marder-1.) (62.188.130.239) by smtp.dial.pipex.com with SMTP; 19 Feb 2000 14:55:55 -0000 Received: (from mark@localhost) by marder-1. (8.9.3/8.9.3) id OAA61989 for stable@freebsd.org; Sat, 19 Feb 2000 14:55:18 GMT (envelope-from mark) Date: Sat, 19 Feb 2000 14:55:18 +0000 From: Mark Ovens To: stable@freebsd.org Subject: Help needed with ioctl() calls Message-ID: <20000219145518.C328@marder-1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i Organization: Total lack of Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG # uname -a FreeBSD marder-1 3.4-STABLE FreeBSD 3.4-STABLE #0: Fri Feb 18 18:14:43 GMT 2000 root@marder-1:/usr/src/sys/compile/MARDER-1 i386 I'm trying to debug a problem in the xmms port whereby the volume doesn't get set correctly. It goes wrong after the ioctl() call to set the volume in /dev/mixer. From /usr/include/machine/soundcard.h: #define SOUND_MIXER_PCM 4 #define MIXER_WRITE(dev) _IOWR('M', dev, int) #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) and the code in question is int fd, v, l, r; fd = open(devname, O_RDONLY); l = 90; r = 90; v = (r << 8) | l; /* v == 23130 */ ioctl(fd, SOUND_MIXER_WRITE_PCM, &v); /* now v == 23387, which is (91 << 8) | 91 */ Before the ioctl() call the output from mixer(8) was: Mixer pcm is currently set to 88:88 and after: Mixer pcm is currently set to 91:91 when it should be 90:90 The appears to be a bug in ioctl(), but is it? /dev/mixer is being opened read-only but we appear to be writing to it OK, albeit the wrong values. I'm getting a bit out of my depth here so a bit of help would be appreciated. Is this a bug in ioctl()? If not, any suggestions as to what I should do now to find the cause of the problem? Thanks. -- Microsoft: Where do you want to go today? Linux: Where do you want to go tomorrow? BSD: Are you guys coming, or what? -Poster at LinuxWorld 2000 ________________________________________________________________ FreeBSD - The Power To Serve http://www.freebsd.org My Webpage http://ukug.uk.freebsd.org/~mark/ mailto:mark@ukug.uk.freebsd.org http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message