/*
AudioScience HPI driver
*/
/** \file hpi.h
AudioScience Hardware Programming Interface (HPI)
public API definition.
The HPI is a low-level hardware abstraction layer to all
AudioScience digital audio adapters
(C) Copyright AudioScience Inc. 1998-2010
*/
#ifndef _HPI_H_
#define _HPI_H_
#include <linux/types.h>
#define HPI_BUILD_KERNEL_MODE
/******************************************************************************/
/******** HPI API DEFINITIONS *****/
/******************************************************************************/
/*******************************************/
/** Audio format types
\ingroup stream
*/
enum HPI_FORMATS {
/** Used internally on adapter. */
HPI_FORMAT_MIXER_NATIVE = 0,
/** 8-bit unsigned PCM. Windows equivalent is WAVE_FORMAT_PCM. */
HPI_FORMAT_PCM8_UNSIGNED = 1,
/** 16-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM. */
HPI_FORMAT_PCM16_SIGNED = 2,
/** MPEG-1 Layer-1. */
HPI_FORMAT_MPEG_L1 = 3,
/** MPEG-1 Layer-2.
Windows equivalent is WAVE_FORMAT_MPEG.
The following table shows what combinations of mode and bitrate are possible:
<table border=1 cellspacing=0 cellpadding=5>
<tr>
<td><p><b>Bitrate (kbs)</b></p>
<td><p><b>Mono</b></p>
<td><p><b>Stereo,<br>Joint Stereo or<br>Dual Channel</b></p>
<tr><td>32<td>X<td>_
<tr><td>40<td>_<td>_
<tr><td>48<td>X<td>_
<tr><td>56<td>X<td>_
<tr><td>64<td>X<td>X
<tr><td>80<td>X<td>_
<tr><td>96<td>X<td>X
<tr><td>112<td>X<td>X
<tr><td>128<td>X<td>X
<tr><td>160<td>X<td>X
<tr><td>192<td>X<td>X
<tr><td>224<td>_<td>X
<tr><td>256<td>-<td>X
<tr><td>320<td>-<td>X
<tr><td>384<td>_<td>X
</table>
*/
HPI_FORMAT_MPEG_L2 = 4,
/** MPEG-1 Layer-3.
Windows equivalent is WAVE_FORMAT_MPEG.
The following table shows what combinations of mode and bitrate are possible:
<table border=1 cellspacing=0 cellpadding=5>
<tr>
<td><p><b>Bitrate (kbs)</b></p>
<td><p><b>Mono<br>Stereo @ 8,<br>11.025 and<br>12kHz*</b></p>
<td><p><b>Mono<br>Stereo @ 16,<br>22.050 and<br>24kHz*</b></p>
<td><p><b>Mono<br>Stereo @ 32,<br>44.1 and<br>48kHz</b></p>
<tr><td>16<td>X<td>X<td>_
<tr><td>24<td>X<td>X<td>_
<tr><td>32<td>X<td>X<td>X
<tr><td>40<td>X<td>X<td>X
<tr><td>48<td>X<td>X<td>X
<tr><td>56<td>X<td>X<td>X
<tr><td>64<td>X<td>X<td>X
<tr><td>80<td>_<td>X<td>X
<tr><td>96<td>_<td>X<td>X
<tr><td>112<td>_<td>X<td>X
<tr><td>128<td>_<td>X<td>X
<tr><td>144<td>_<td>X<td>_
<tr><td>160<td>_<td>X<td>X
<tr><td>192<td>_<td>_<td>X
<tr><td>224<td>_<td>_<td>X
<tr><td>256<td>-<td>_<td>X
<tr><td>320<td>-<td>_<td>X
</table>
\b * Available on the ASI6000 series only
*/
HPI_FORMAT_MPEG_L3 = 5,
/** Dolby AC-2. */
HPI_FORMAT_DOLBY_AC2 = 6,
/** Dolbt AC-3. */
HPI_FORMAT_DOLBY_AC3 = 7,
/** 16-bit PCM big-endian. */
HPI_FORMAT_PCM16_BIGENDIAN = 8,
/** TAGIT-1 algorithm - hits. */
HPI_FORMAT_AA_TAGIT1_HITS = 9,
/** TAGIT-1 algorithm - inserts. */
HPI_FORMAT_AA_TAGIT1_INSERTS = 10,
/** 32-bit signed PCM. Windows equivalent is WAVE_FORMAT_PCM.
Each sample is a 32bit word. The most significant 24 bits contain a 24-bit
sample and the least significant 8 bits are set to 0.
*/
HPI_FORMAT_PCM32_SIGNED = 11,
/** Raw bitstream - unknown format. */
HPI_FORMAT_RAW_BITSTREAM = 12,
/** TAGIT-1 algorithm hits - extended. */
HPI_FORMAT_AA_TAGIT1_HITS_EX1 = 13,
/** 32-bit PCM as an IEEE float. Windows equivalent is WAVE_FORMAT_IEEE_FLOAT.
Each sample is a 32bit word in IEEE754 floating point format.
The range is +1.0 to -1.0, which corresponds to digital fullscale.
*/
HPI_FORMAT_PCM32_FLOAT = 14,
/** 24-bit PCM signed. Windows equivalent is WAVE_FORMAT_PCM. */
HPI_FORMAT_PCM24_SIGNED = 15,
/** OEM format 1 - private. */
HPI_FORMAT_OEM1 = 16,
/** OEM format 2 - private. */
HPI_FORMAT_OEM2 = 17,
/** Undefined format. */
HPI_FORMAT_UNDEFINED = 0xffff
};
/*******************************************/
/** Stream States
\ingroup stream
*/
enum HPI_STREAM_STATES {
/** State stopped - stream is stopped. */
HPI_STATE_STOPPED = 1,
/** State playing - stream is playing audio. */
HPI_STATE_PLAYING = 2,
/** State recording - stream is recording. */
HPI_STATE_RECORDING = 3,
/** State drained - playing stream ran out of data to play. */
HPI_STATE_DRAINED = 4,
/** State generate sine - to be implemented. */
HPI_STATE_SINEGEN = 5,
/** State wait - used for inter-card sync to mean waiting for all
cards to be ready. */
HPI_STATE_WAIT = 6
};
/*******************************************/
/** Source node types
\ingroup mixer
*/
enum HPI_SOURCENODES {
/** This define can be used instead of 0 to indicate
that there is no valid source node. A control that
exists on a destination node can be searched for using a source
node value of either 0, or HPI_SOURCENODE_NONE */
HPI_SOURCENODE_NONE = 100,
/** Out Stream (Play) node. */
HPI_SOURCENODE_OSTREAM = 101,
/** Line in node - could be analog, AES/EBU or network. */
HPI_SOURCENODE_LINEIN = 102,
HPI_SOURCENODE_AESEBU_IN = 103, /**< AES/EBU input node. */
HPI_SOURCENODE_TUNER = 104, /**< tuner node. */
HPI_SOURCENODE_RF = 105, /**< RF input node. */
HPI_SOURCENODE_CLOCK_SOURCE = 106, /**< clock source node. */
HPI_SOURCENODE_RAW_BITSTREAM = 107, /**< raw bitstream node. */
HPI_SOURCENODE_MICROPHONE = 108, /**< microphone node. */
/** Cobranet input node -
Audio samples come from the Cobranet network and into the device. */
HPI_SOURCENODE_COBRANET = 109,
HPI_SOURCENODE_ANALOG = 110, /**< analog input node. */
HPI_SOURCENODE_ADAPTER = 111, /**< adapter node. */
/** RTP stream input node - This node is a destination for
packets of RTP audio samples from other devices. */
HPI_SOURCENODE_RTP_DESTINATION = 112,
HPI_SOURCENODE_INTERNAL = 113, /**< node internal to the device. */
/* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */
HPI_SOURCENODE_LAST_INDEX = 113 /**< largest ID */
/* AX6 max sourcenode types = 15 */
};
/*******************************************/
/** Destination node types
\ingroup mixer
*/
enum HPI_DESTNODES {
/** This define can be used instead of 0 to indicate
that there is no valid destination node. A control that
exists on a source node can be searched for using a destination
node value of either 0, or HPI_DESTNODE_NONE */
HPI_DESTNODE_NONE = 200,
/** In Stream (Record) node. */
HPI_DESTNODE_ISTREAM = 201,
HPI_DESTNODE_LINEOUT = 202, /**< line out node. */
HPI_DESTNODE_AESEBU_OUT = 203, /**< AES/EBU output node. */
HPI_DESTNODE_RF = 204, /**< RF output node. */
HPI_DESTNODE_SPEAKER = 205, /**< speaker output node. */
/** Cobranet output node -
Audio samples from the device are sent out on the Cobranet network.*/
HPI_DESTNODE_COBRANET = 206,
HPI_DESTNODE_ANALOG = 207, /**< analog output node. */
/** RTP stream output node - This node is a source for
packets of RTP audio samples that are sent to other devices. */
HPI_DESTNODE_RTP_SOURCE = 208,
/* !!!Update this AND hpidebug.h if you add a new destnode type!!! */
HPI_DESTNODE_LAST_INDEX = 208 /**< largest ID */
/* AX6 max destnode types = 15 */
};
/*******************************************/
/** Mixer control types
\ingroup mixer
*/
enum HPI_CONTROLS {
HPI_CONTROL_GENERIC = 0, /**< generic control. */
HPI_CONTROL_CONNECTION = 1, /**< A connection between nodes. */
HPI_CONTROL_VOLUME = 2, /**< volume control - works in dB_fs. */
HPI_CONTROL_METER = 3, /**< peak meter control. */
HPI_CONTROL_MUTE = 4, /*mute control - not used at present. */
HPI_CONTROL_MULTIPLEXER = 5, /**< multiplexer control. */
HPI_CONTROL_AESEBU_TRANSMITTER = 6, /**< AES/EBU transmitter control */
HPI_CONTROL_AESEBUTX = 6, /* HPI_CONTROL_AESEBU_TRANSMITTER */
HPI_CONTROL_AESEBU_RECEIVER = 7, /**< AES/EBU receiver control. */
HPI_CONTROL_AESEBURX = 7, /* HPI_CONTROL_AESEBU_RECEIVER */
HPI_CONTROL_LEVEL = 8, /**< level/trim control - works in d_bu. */
HPI_CONTROL_TUNER = 9, /**< tuner control. */
/* HPI_CONTROL_ONOFFSWITCH =