Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 2000 16:02:35 +0100
From:      Orion Hodson <O.Hodson@cs.ucl.ac.uk>
To:        multimedia@freebsd.org
Cc:        rat-trap@cs.ucl.ac.uk
Subject:   Re: pcm & full-duplex
Message-ID:  <16633.969030155@cs.ucl.ac.uk>
In-Reply-To: Your message of "Fri, 15 Sep 2000 20:13:42 %2B0600." <39C22E96.C4469170@urc.ac.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
<39C22E96.C4469170@urc.ac.ru>Anton Voronin writes:
> Orion Hodson wrote:
> > <39C2165F.28CBAFBE@urc.ac.ru>Anton Voronin writes:
> >
> > I'm not sure if other applications open O_RDONLY and check for full
> > duplex with SNDCTL_DSP_GETCAPS, but AFAIK rat on FreeBSD never has in
> > the "full duplex only" versions (3.2 onwards).
> 
> At least 4.0.4 seems to do so:
> 
> int vox_audio_duplex(int audio_fd)
> {
> /* Find out if the device supports full-duplex operation. The device mu
> * be open to do this, so if we're passed -1 as a file-descriptor we op
> * the device, do the ioctl, and then close it again...
> */
> int options;
> if (audio_fd == -1) {
> audio_fd = vox_audio_open_rw(O_RDONLY);
> if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &options) == -1) {
> vox_audio_close(audio_fd);
> return FALSE;
> }
> vox_audio_close(audio_fd);
> return (options & DSP_CAP_DUPLEX);
> }
> /* Audio device already open */
> if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &options) == -1 ) {
> return FALSE;
> }
> return (options & DSP_CAP_DUPLEX);
> }

The code above is from the file for Voxware/OSS (confusingly called
auddev_freebsd.c - a throwback to when there was only one sound driver
interface).  With Voxware/OSS the correct way to detect full duplex is
to open the card half-duplex first and probe for full duplex.  The
device can then be made full duplex using ioctl SNDCTL_DSP_SETDUPLEX
or by re-opening it.

The file used on FreeBSD since rat-3.2 is auddev_luigi.c for
pcm/newpcm, and unless you hack the configure script you'll be using
this file.

cheers
- Orion.



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?16633.969030155>