Re: [linux-audio-dev] Another Annoying "How Do I Get Started" Question

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Another Annoying "How Do I Get Started" Question
From: Andre Majorel (amajorel_AT_teaser.fr)
Date: Sun Jul 08 2001 - 13:07:24 EEST


On 2001-07-07 18:53 -0400, Greg Berchin wrote:

> I notice that you simply "open" /dev/dsp as write-only.
> Farther down I see that you used "ioctl" -- I've never seen that function
> before. What does it do?

ioctl() is a multi-purpose system call that acts on a file
descriptor. It's used to perform operations that don't fit in
the open-read-write-lseek-close Unix model.

The first argument is a file descriptor, the second argument is
an operation. After the second argument, there are sometimes
more arguments, depending on the operation.

Most operations are specific to a particular type of device. For
a file descriptor pointing to an OSS /dev/dsp device, you could
use the following operations :

  SNDCTL_DSP_SETFMT
  SNDCTL_DSP_STEREO
  SNDCTL_DSP_SPEED
  SNDCTL_DSP_SETFRAGMENT
  SNDCTL_DSP_GETBLKSIZE
  SNDCTL_DSP_GETOSPACE

and more. They're explained in detail in the doc at

  http://www.opensound.com/pguide/

If you want a paper book, you might want to take a look at
"Linux multimedia guide" by Jeff Tranter at O'Reilly. Perhaps
it talks about those ioctl()s.

-- 
André Majorel <amajorel_AT_teaser.fr>
http://www.teaser.fr/~amajorel/


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sun Jul 08 2001 - 07:02:13 EEST