Re: Test record program triggers pcm problems on -stable (was: Re: kern/21438: Sox recording in 16 bits creates a panic: no feed)

[ Available lists | Index of freebsd-multimedia | Month of Aug 2001 | Week of 15 Aug 2001 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Cameron Grant <gandalf@vilnya.demon.co.uk>
Date
15 Aug 2001 21:44:15
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 to
Replies
Referenced by

[ Hide this part ]
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, &params->r_channels))
> err(1, "ioctl for read channels failed");
> if (ioctl(fd, SOUND_PCM_WRITE_CHANNELS, &params->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



Elapsed time: 0.197 seconds