man Pages(7): Device Network Interfaces
  Search only this book
Download this book in PDF

NAME

audiocs - Crystal Semiconductor 4231 audio Interface

DESCRIPTION

Audiocs is an audio interface that provides line in and line out ports for audio devices. It can be either an integrated device or an add-in option card.

SPARC

SPARCstation 5 systems have the Multimedia Codec integrated onto the CPU board of the machine. In the "onboard" Codec, there are microphone, line in, headphone, and line out ports located on the system back panel. In addition, the headphone and microphone ports do not have the input detection circuitry to determine whether or not there is currently headphones or a microphone plugged in. There is no interface on the SPARCstation 5 for the speakerbox to connect to.
SPARCstation 4 systems have ports for microphone, line in, headphone, and line out, as well as a port for an internal CD-ROM.
For all SPARCstations, the new Sun Microphone II is recommended for normal desktop audio recording. Other audio sources may be recorded by connecting their line output to the line input (audio sources may also be connected from their headphone output if the volume is adjusted properly).

Ultra

Ultra systems have ports for microphone, line in, headphone and line out.

x86

The Multimedia Codec may be found as either an integrated motherboard device, or as an add-in option card. An internal CD-ROM is also a common input option.

APPLICATION PROGRAM

Applications that open /dev/audio may use the AUDIO_GETDEV ioctl to determine which audio device is being used. The audiocs driver will return the string "SUNW,CS4231" in the name field of the audio_device structure. The version field will contain one of the following values, depending upon the platform:

INTERFACE

Platform Type
Version
SPARCstation 4/5
a
Ultra
b
reserved
c
The config field will contain the following value: "onboard1" on a /dev/audio stream associated with the onboard Multimedia Codec.
The AUDIO_SETINFO ioctl controls device configuration parameters. When an application modifies the record.buffer_size field using the AUDIO_SETINFO ioctl, the driver will constrain it to be non-zero and up to a maximum of 8180 bytes.

Audio Data Formats

The Multimedia 4231 Codec audiocs device supports the audio formats listed in the following table. When the device is open for simultaneous play and record, the input and output data formats must match.
Supported Audio Data Formats
Sample Rate     Encoding      Precision  Channels
 8000 Hz     .-law or A-law      8          1
 9600 Hz     .-law or A-law      8          1
 11025 Hz    .-law or A-law      8          1
 16000 Hz    .-law or A-law      8          1
 18900 Hz    .-law or A-law      8          1
 22050 Hz    .-law or A-law      8          1
 32000 Hz    .-law or A-law      8          1
 37800 Hz    .-law or A-law      8          1
 44100 Hz    .-law or A-law      8          1
 48000 Hz    .-law or A-law      8          1
 8000 Hz         linear         16        1 or 2
 9600 Hz         linear         16        1 or 2
 11025 Hz        linear          16       1 or 2
 16000 Hz        linear          16       1 or 2
 18900 Hz        linear          16       1 or 2
 22050 Hz        linear          16       1 or 2
 32000 Hz        linear          16       1 or 2
 37800 Hz        linear          16       1 or 2
 44100 Hz        linear          16       1 or 2
 48000 Hz        linear          16       1 or 2

Audio Ports

The record.avail_ports and play.avail_ports fields of the audio_info structure report the available input and output ports. In most environments, the audiocs device supports three input ports, except the Ultra product family which supports only two. These input ports are selected by setting the record.port field to either AUDIO_MICROPHONE , AUDIO_LINE_IN ,or AUDIO_INTERNAL_CD_IN . (Ultra systems do not support AUDIO_INTERNAL_CD_IN .) If you select the AUDIO_INTERNAL_CD_IN this will select input from the internal CD drive, if present. This will allow you to gather data from the CD without having to hook up a connecting line from the headphone jack to the line input jack. The play.port field may be set to any combination of AUDIO_SPEAKER , AUDIO_HEADPHONE ,and AUDIO_LINE_OUT by OR'ing the desired port names together. (Note: On some systems, the headphone and line out ports internally share the same circuitry; in these cases, it is not possible to enable either output exclusively.)

Sample Granularity

Since the audiocs device manipulates buffers of audio data, at any given time the reported input and output sample counts will vary from the actual sample count by no more than the size of the buffers it is transferring. Programs should, in general, not rely on absolute accuracy of the play.samples and record.samples fields of the audio_info structure.

Audio Status Change Notification

As described in audio(7I), it is possible to request asynchronous notification of changes in the state of an audio device.

ERRORS

audiocs errors are defined in the audio(7I), man pages.

FILES

The physical device names are very system dependent and are rarely used by programmers.

SPARC Only

/devices/iommu@f,e0000000/sbus@f,e0001000/SUNW,CS4231@2,c00000:sound,audio

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPEATTRIBUTE VALUE
ArchitectureSPARCstation 4/5, x86

SEE ALSO

ioctl(2), attributes(5), audio(7I), streamio(7I)
Crystal Semiconductor, Inc., data sheet for the CS4231 16-Bit, 48 kHz, Multimedia Audio Codec Publication number DS111PP2.

NOTES:

The AUDIO_INTERNAL_CD_IN is another new functionality addition. Because of this, audiotool will now have a new button appear in the record popup box that will allow the user of audiotool to switch to the internal CD (if present).