From owner-freebsd-multimedia Wed Aug 15 21:44:15 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from finch-post-11.mail.demon.net (finch-post-11.mail.demon.net [194.217.242.39]) by hub.freebsd.org (Postfix) with ESMTP id B7AB037B401 for ; Wed, 15 Aug 2001 21:44:11 -0700 (PDT) (envelope-from gandalf@vilnya.demon.co.uk) Received: from vilnya.demon.co.uk ([158.152.19.238]) by finch-post-11.mail.demon.net with esmtp (Exim 2.12 #1) id 15XF0g-0009Yl-0B; Thu, 16 Aug 2001 04:44:06 +0000 Received: from haveblue (haveblue.rings [10.2.4.5]) by vilnya.demon.co.uk (Postfix) with SMTP id 3F39C32603; Thu, 16 Aug 2001 05:42:57 +0100 (BST) Message-ID: <004f01c1260d$ef694b10$0504020a@haveblue> From: "Cameron Grant" To: "The Anarcat" Cc: References: <3ADB420A.B1B696A4@lmc.ericsson.se> <005901c0c6aa$4ec49560$0504020a@haveblue> <3ADB4835.E34532A5@lmc.ericsson.se> <007301c0c6af$4d399650$0504020a@haveblue> <20010815171514.B471@shall.anarcat.dyndns.org> Subject: Re: Test record program triggers pcm problems on -stable (was: Re: kern/21438: Sox recording in 16 bits creates a panic: no feed) Date: Thu, 16 Aug 2001 05:43:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2530.0001 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2530.0001 Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 3- ioctls does not seem to work properly. At some point in the code, I call the ioctls: > if (ioctl(fd, SOUND_PCM_READ_CHANNELS, ¶ms->r_channels)) > err(1, "ioctl for read channels failed"); > if (ioctl(fd, SOUND_PCM_WRITE_CHANNELS, ¶ms->w_channels)) > err(1, "ioctl for write channels failed"); > >(for example). Now the value of params->*_channels is 2 in both cases. >The output of the program, however, is: > > read write units >DSP device : /dev/dspW /dev/dspW >Rate : 8000 44100 Hz >Channels : 1 2 >Size : 16 16 bits > >ie, params->r_channels is *changed* from 2 to 1. Same goes for r_rate. I >do not understand that behavior. the SNDCTL_READ_*/SNDCTL_WRITE* ioctls do not do what you think they do. the oss api does not support asymmetric settings for record and play. SNDCTL_READ_* return the current settings; SNDCTL_WRITE* change the settings. these ioctls are deprecated. the Right way to use the oss api is documented in http://www.opensound.com/pguide/oss.pdf -cg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message