AudioScience HPI Version_4.24.1
Enumerations | Functions

SampleClock control

Controls

The SampleClock control is used to control the clock source for the adapter. More...

Enumerations

enum  HPI_SAMPLECLOCK_SOURCES {
  HPI_SAMPLECLOCK_SOURCE_LOCAL = 1, HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2, HPI_SAMPLECLOCK_SOURCE_WORD = 3, HPI_SAMPLECLOCK_SOURCE_WORD_HEADER = 4,
  HPI_SAMPLECLOCK_SOURCE_SMPTE = 5, HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6, HPI_SAMPLECLOCK_SOURCE_NETWORK = 8, HPI_SAMPLECLOCK_SOURCE_PREV_MODULE = 10,
  HPI_SAMPLECLOCK_SOURCE_BLULINK = 11, HPI_SAMPLECLOCK_SOURCE_LAST = 11
}
 

SampleClock source values.

More...

Functions

hpi_err_t HPI_SampleClock_QuerySource (const hpi_hsubsys_t *phSubSys, const hpi_handle_t hClock, const uint32_t dwIndex, uint16_t *pwSource)
 Query valid SampleClock sources Iterate dwIndex until an error is returned to get allowed values for SampleClock source in *pwFormat.
hpi_err_t HPI_SampleClock_SetSource (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint16_t wSource)
 Sets the clock source for the sample clock.
hpi_err_t HPI_SampleClock_GetSource (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint16_t *pwSource)
 Gets the current sample clock source.
hpi_err_t HPI_SampleClock_QuerySourceIndex (const hpi_hsubsys_t *phSubSys, const hpi_handle_t hClock, const uint32_t dwIndex, const uint32_t dwSource, uint16_t *pwSourceIndex)
 Query the available source indices.
hpi_err_t HPI_SampleClock_SetSourceIndex (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint16_t wSourceIndex)
 Sets the index for the currently selected source.
hpi_err_t HPI_SampleClock_GetSourceIndex (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint16_t *pwSourceIndex)
 Gets the AES/EBU input used to source the adapter clock.
hpi_err_t HPI_SampleClock_QueryLocalRate (const hpi_hsubsys_t *phSubSys, const hpi_handle_t hClock, const uint32_t dwIndex, uint32_t *pdwRate)
 Query samplerates supported by the local PLL of this sampleclock Iterate dwIndex until an error is returned to get the list of valid PLL samplerates.
hpi_err_t HPI_SampleClock_SetLocalRate (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t dwSampleRate)
 Set the samplerate of the sample clock's local PLL This samplerate becomes the sampleclock output rate when the HPI_SAMPLECLOCK_SOURCE_LOCAL source is selected.
hpi_err_t HPI_SampleClock_SetLocalRateEx (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t dwSampleRateHz, uint32_t dwSampleRatePPB)
 Set the samplerate of the sample clock's local PLL in Hz and parts per billion.
hpi_err_t HPI_SampleClock_GetLocalRate (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t *pdwSampleRate)
 Get the samplerate of the sample clock's local PLL.
hpi_err_t HPI_SampleClock_GetSampleRate (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t *pdwSampleRate)
 Gets the current adapter samplerate.
hpi_err_t HPI_SampleClock_SetAuto (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t dwEnable)
 Enable/disable clock autoswitching.
hpi_err_t HPI_SampleClock_GetAuto (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t *pdwEnable)
hpi_err_t HPI_SampleClock_SetLocalRateLock (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t dwLock)
 Enable/disable local rate changing.
hpi_err_t HPI_SampleClock_GetLocalRateLock (const hpi_hsubsys_t *phSubSys, hpi_handle_t hControl, uint32_t *pdwLock)

Detailed Description

The SampleClock control is used to control the clock source for the adapter.


Enumeration Type Documentation

SampleClock source values.

Enumerator:
HPI_SAMPLECLOCK_SOURCE_LOCAL 

The sampleclock output is derived from its local samplerate generator.

The local samplerate may be set using HPI_SampleClock_SetLocalRate().

HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC 

The adapter is clocked from a dedicated AES/EBU SampleClock input.

HPI_SAMPLECLOCK_SOURCE_WORD 

From external wordclock connector.

HPI_SAMPLECLOCK_SOURCE_WORD_HEADER 

Board-to-board header.

HPI_SAMPLECLOCK_SOURCE_SMPTE 

FUTURE - SMPTE clock.

HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT 

One of the aesebu inputs.

HPI_SAMPLECLOCK_SOURCE_NETWORK 

From a network interface e.g.

Cobranet or Livewire at either 48 or 96kHz

HPI_SAMPLECLOCK_SOURCE_PREV_MODULE 

From previous adjacent module (ASI2416 only)

HPI_SAMPLECLOCK_SOURCE_BLULINK 

Blu link sample clock.

HPI_SAMPLECLOCK_SOURCE_LAST 

Update this if you add a new clock source.


Function Documentation

hpi_err_t HPI_SampleClock_QuerySource ( const hpi_hsubsys_t *  phSubSys,
const hpi_handle_t  hClock,
const uint32_t  dwIndex,
uint16_t *  pwSource 
)

Query valid SampleClock sources Iterate dwIndex until an error is returned to get allowed values for SampleClock source in *pwFormat.

Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hClockControl to query
dwIndexIndex for possible attribute values
pwSourcesource

References HPI_ControlQuery().

hpi_err_t HPI_SampleClock_SetSource ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint16_t  wSource 
)

Sets the clock source for the sample clock.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
wSourceSample clock source - one of HPI_SAMPLECLOCK_SOURCES.
hpi_err_t HPI_SampleClock_GetSource ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint16_t *  pwSource 
)

Gets the current sample clock source.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
pwSourceSample clock source - one of HPI_SAMPLECLOCK_SOURCES.
hpi_err_t HPI_SampleClock_QuerySourceIndex ( const hpi_hsubsys_t *  phSubSys,
const hpi_handle_t  hClock,
const uint32_t  dwIndex,
const uint32_t  dwSource,
uint16_t *  pwSourceIndex 
)

Query the available source indices.

Currently the only source with indices is HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT. Iterate dwIndex until an error is returned to get allowed values for SampleClock source index in *pwSourceIndex.

Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hClockControl to query
dwIndexIndex for possible attribute values
dwSourceSource type
pwSourceIndexsource index

References HPI_ControlQuery().

hpi_err_t HPI_SampleClock_SetSourceIndex ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint16_t  wSourceIndex 
)

Sets the index for the currently selected source.

Note, to use this function the source must already be set to a source that supports indices (Currently only HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT). The source retains its index setting if a different source is selected.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
wSourceIndexIndex of the source to use
hpi_err_t HPI_SampleClock_GetSourceIndex ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint16_t *  pwSourceIndex 
)

Gets the AES/EBU input used to source the adapter clock.

Note, to use this function the source must already be set to a source that supports indices (Currently only HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT) On error, *pwSource index is NOT updated.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
pwSourceIndexIndex of the current source
hpi_err_t HPI_SampleClock_QueryLocalRate ( const hpi_hsubsys_t *  phSubSys,
const hpi_handle_t  hClock,
const uint32_t  dwIndex,
uint32_t *  pdwRate 
)

Query samplerates supported by the local PLL of this sampleclock Iterate dwIndex until an error is returned to get the list of valid PLL samplerates.

Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hClockControl to query
dwIndexIndex for possible attribute values
pdwRaterate

References HPI_ControlQuery().

hpi_err_t HPI_SampleClock_SetLocalRate ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t  dwSampleRate 
)

Set the samplerate of the sample clock's local PLL This samplerate becomes the sampleclock output rate when the HPI_SAMPLECLOCK_SOURCE_LOCAL source is selected.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Return values:
HPI_ERROR_INVALID_CONTROL_ATTRIBUTEif the adapter has no local PLL
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlControl to set
dwSampleRateSample rate in Hz
hpi_err_t HPI_SampleClock_SetLocalRateEx ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t  dwSampleRateHz,
uint32_t  dwSampleRatePPB 
)

Set the samplerate of the sample clock's local PLL in Hz and parts per billion.

This samplerate becomes the sampleclock output rate when the HPI_SAMPLECLOCK_SOURCE_LOCAL source is selected. Note that not all adapters support this call.

Note:
To set the sample rate to 48000.010 Hz the dwSampleRateHz would be set to 48000 and the dwSampleRatePPB to 10000000 (i.e. 0.010 * 1000000000).
Returns:
0 on success, or one of the HPI_ERROR_CODES.
Return values:
HPI_ERROR_INVALID_CONTROL_ATTRIBUTEif the adapter has no local PLL
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlControl to set
dwSampleRateHzSample rate in Hz
dwSampleRatePPBFractional Hz in parts per billion
hpi_err_t HPI_SampleClock_GetLocalRate ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t *  pdwSampleRate 
)

Get the samplerate of the sample clock's local PLL.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Return values:
HPI_ERROR_INVALID_CONTROL_ATTRIBUTEif the adapter has no local PLL
hpi_err_t HPI_SampleClock_GetSampleRate ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t *  pdwSampleRate 
)

Gets the current adapter samplerate.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
pdwSampleRateCurrent sample rate
hpi_err_t HPI_SampleClock_SetAuto ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t  dwEnable 
)

Enable/disable clock autoswitching.

When enabled, the adapter clock will be derived from the first valid AESEBU input, or from the local PLL if no inputs are valid.

Adapters supporting auto switch are ASI5111, and ASI50xx family members with AESEBU inputs.

Returns:
hpierr
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
dwEnableAuto enable. Either HPI_SWITCH_OFF, or HPI_SWITCH_ON
hpi_err_t HPI_SampleClock_GetAuto ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t *  pdwEnable 
)
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
pdwEnableCurrent auto enable state. Either HPI_SWITCH_OFF, or HPI_SWITCH_ON
hpi_err_t HPI_SampleClock_SetLocalRateLock ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t  dwLock 
)

Enable/disable local rate changing.

Adapters supporting local clock locking are in the ASI50xx (PCM), ASI54xx (CobraNet), ASI63xx (CobraNet) and ASI64xx (CobraNet) families.

For the ASI50xx family, when enabled (locked), the local clock will be locked to the last rate set by a call to HPI_SampleClock_SetLocalRate().

For the ASI53xx, ASI54xx, ASI63xx and ASI64xx families the meaning is a little different. The lock operation disables the software sample rate converters, thereby locking the sample rate of all play and record device to the network clock rate of 48 kHz.

When a ASI53xx or ASI63xx is in low latency mode, locked always returns true and is readonly. An attempt to set the lock will return HPI_ERROR_CONTROL_DISABLED.

Returns:
hpierr
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
dwLockLocked state. Either HPI_SWITCH_OFF, or HPI_SWITCH_ON
hpi_err_t HPI_SampleClock_GetLocalRateLock ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hControl,
uint32_t *  pdwLock 
)
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hControlHandle to control of type HPI_CONTROL_SAMPLECLOCK
pdwLockLocked state. Either HPI_SWITCH_OFF, or HPI_SWITCH_ON