- Dual Basic Rate ISDN and audio Interface
The dbri device uses the T5900FC Dual Basic Rate ISDN Interface (DBRI) and Multimedia Codec chips to implement the audio device interface. This interface is described fully in the audio(7I) manual page.
Applications that open /dev/audio may use the AUDIO_GETDEV ioctl to determine which audio device is being used. The dbri driver will return the string "SUNW,dbri" in the name field of the audio_device structure. The Version field will contain "e" and the Config field will contain one of the following values: "isdn_b" on an ISDN B channel stream, "speakerbox" on a /dev/audio stream associated with a SpeakerBox, and lastly "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 a multiple of 16 bytes, up to a maximum of 8176 bytes.
The SpeakerBox audio peripheral is available for connection to the SpeakerBox Interface (SBI) port of most dbri equipped systems and provides an integral monaural speaker as well as stereo line out, stereo line in, stereo headphone, and monaural microphone connections. The headset output level is adequate to power most headphones, but may be too low for some external speakers. Powered speakers or an external amplifier may be used with both the headphone and line out ports.
The Sun Microphone is recommended for normal desktop audio recording. When the Sun Microphone is used in conjunction with the SpeakerBox, the microphone battery is bypassed. Other audio sources may be recorded by connecting their line output to the SpeakerBox line input (audio sources may also be connected from their headphone output if the volume is adjusted properly).
The DBRI controller offers two Basic Rate ISDN (BRI) interfaces. One is a BRI Terminal Equipment (TE) interface and the other is a BRI Network Termination (NT) interface.
The NT connector is switched by a relay so that when system power is not available or when software is not accessing the NT port, the TE and NT connectors are electrically connected and devices plugged into the NT port will be on the same BRI passive bus.
The dbri 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.
ISDN channels implement a subset of audio semantics. The preferred ioctls for querying or setting the format of a BRI channel are ISDN_GET_FORMAT, ISDN_SET_FORMAT, and ISDN_SET_CHANNEL. In particular, there is no audio format described in audio(7I) that covers HDLC or transparent data. The dbri driver maps HDLC and transparent data to AUDIO_ENCODING_NONE. ISDN D-channels are always configured for HDLC encoding of data. The programmer should interpret an encoding value of AUDIO_ENCODING_NONE as an indication that the fd is not being used to transfer audio data.
B-channels can be configured for mu-law (as in the Greek letter mu), A-law, or HDLC encoding of data. The mu-law and A-law formats are always at 8000 Hz, 8-bit, mono. Although a BRI H-channel is actually 16 bits wide at the physical layer and the 16-bit sample occurs at 8 kHz, the HDLC encoding always presents the data in 8-bit quantities. Therefore, 56 bit-per-second (bps), 64 bps, and 128 bps formats are all presented to the programmer as 8-bit wide, mono, AUDIO_ENCODING_NONE format streams at different sample rates. A line rate of 56kbps results in a 8-bit sample rate of 7000 Hz. If the bit stuffing and un-stuffing of HDLC were taken into account, the data rate would be slightly less.
For the sake of compatibility, AUDIO_GETINFO will return one of the following on a ISDN channel:
ISDN_GET_FORMAT will return one of the following for an ISDN channel:
In the previous table:
HDLC = ISDN_MODE_HDLC TRANS = ISDN_MODE_TRANSPARENT
Audio ports are not relevant to ISDN D or B channels.
The record.avail_ports and play.avail_ports fields of the audio_info structure report the available input and output ports. The dbri device supports two input ports, selected by setting the record.port field to either AUDIO_MICROPHONE or AUDIO_LINE_IN. 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.
Since the dbri 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.
As described in audio(7I), it is possible to request asynchronous notification of changes in the state of an audio device. The DBRI driver extends this to the ISDN B channels by sending the signal up the data channel instead of the control channel. Asynchronous notification of events on a B-channel only occurs when the channel is in a transparent data mode. When the channel is in HDLC mode, no such notification will take place.
In addition to the errors described in audio(7I), an open() will fail if:
The driver is unable to communicate with the SpeakerBox, possibly because it is currently not plugged in.
The physical device names are very system dependent and are rarely used by programmers. For example:
The programmer should instead use the generic device names listed below:
symlink to the system's primary audio device, not necessarily a dbri based audio device
control device for the above audio device
represents the first audio device on the system and is not necessarily based on dbri or SpeakerBox
first audio device in the system
audio control for above device
represents the first ISDN device on the system and any associated interfaces. This device is not necessarily based on dbri.
TE management device
TE D channel
TE B1 channel
TE B2 channel
NT management device
NT D channel
NT B1 channel
NT B2 channel
SpeakerBox or onboard Multimedia Codec
Control device for SpeakerBox or onboard Multimedia Codec
See attributes(5) for descriptions of the following attributes:
AT&T Microelectronics data sheet for the T5900FC Sun Dual Basic Rate ISDN Interface.
Crystal Semiconductor, Inc., data sheet for the CS4215 16-Bit, 48 kHz, Multimedia Audio Codec Publication number DS76PP5.
Due to hardware restrictions, it is impossible to reduce the record gain to 0. A valid input signal is still received at the lowest gain setting the Multimedia Codec allows. For security reasons, the dbri driver disallows a record gain value of 0. This is to provide feedback to the user that such a setting is not possible and that a valid input signal is still being received. An attempt to set the record gain to 0 will result in the lowest possible non-zero gain. The audio_info structure will be updated with this value when the AUDIO_SETINFO ioctl returns.
When a DBRI channel associated with the SpeakerBox Interface underruns, DBRI may not always repeat the last sample but instead could repeat more than one sample. This behavior can result in a tone being generated by an audio device connected to the SBI port.
Monitor STREAMs connected to a B1 channel on either the TE or NT interface do not work because of a DBRI hardware problem. The device driver disallows the creation of such monitors.