Date: Thu, 16 Aug 2001 05:43:03 +0100 From: "Cameron Grant" <gandalf@vilnya.demon.co.uk> To: "The Anarcat" <anarcat@anarcat.dyndns.org> Cc: <freebsd-multimedia@freebsd.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) Message-ID: <004f01c1260d$ef694b10$0504020a@haveblue> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?004f01c1260d$ef694b10$0504020a>