Exemplo n.º 1
0
// This function handles the rate change request from the driver.
// If the rate mode has changed it will create a new DAL.
static HRESULT myAppChangeSR(DICE_DRIVER_CB_DATA * pData)
{
	HRESULT hResult = NO_ERROR;
	uint32 notify = 0;
	DAL_RATE_MODE_ENUM driverRateMode;

	driverRateMode = dalRateByID(pData->rate)->rateMode;
	if (driverRateMode != lastDriverRatemode)
	{
		//Driver asked for a change of rate mode
		lastDriverRatemode = driverRateMode;
	    myAppCreateDAL(driverRateMode);
	    // Send the RX and TX Configuration Notification as this might
	    // have resulted in a change of the Rx and Tx streams going
	    // to the computer. This will for example happen if the device
	    // has ADAT, when going from 48k to 96k ADAT will be reduced
	    // to 4 channels (SMUXII)
		notify |= DD_NOTIFY_RX_CFG_CHG_BIT  | DD_NOTIFY_TX_CFG_CHG_BIT;
	}

	//Change the Clock as instructed by driver, this could be a change
	//in clock source, nominal rate or both.
	dalSetClockSource (eDAL_INTERFACE_1, pData->source, pData->rate);
	
	//Send the Clock Setting Accept Notification, this should always be send
	notify |= DD_NOTIFY_CLOCK_ACP;
	diceDriverNotifyHost(notify);
	return hResult;
}
Exemplo n.º 2
0
static HRESULT myAppChangeSR(DICE_DRIVER_CB_DATA * pData)
{
	HRESULT hResult = NO_ERROR;
	uint32 notify = 0;

	if (dalRateByID (pData->rate)->rateMode != lastDriverRateMode)
	{
		lastDriverRateMode = dalRateByID (pData->rate)->rateMode;
		
		dalCreateInterface(eDAL_INTERFACE_1, lastDriverRateMode, INPUT_DEVICES,OUTPUT_DEVICES);
		eapDriverChangeRateMode (lastDriverRateMode);
	    dalStartInterface(eDAL_INTERFACE_1);
		//Send the RX and TX Configuration Notification
		notify |= DD_NOTIFY_RX_CFG_CHG_BIT  | DD_NOTIFY_TX_CFG_CHG_BIT;
	}
	//Change the Clock Now
	dalSetClockSource (eDAL_INTERFACE_1, pData->source, pData->rate);
	//Send the Clock Setting Accept Notification
	notify |= DD_NOTIFY_CLOCK_ACP;
	diceDriverNotifyHost(notify);
	return hResult;
}
Exemplo n.º 3
0
void StandAloneInitialize (void)
{
	//we need to figure out what dal to create
	EAP_STND_ALONE_CFG const * pStdaCfg;
	DAL_RATE_MODE_ENUM rate_mode = eDAL_RATE_MODE_LOW_MID;
	DAL_NOMINAL_RATE_ENUM rate = eDAL_NOMINAL_RATE_ANY;
	DAL_CLOCK_SOURCE_ENUM clksrc;
	
	pStdaCfg = eapGetStandaloneCfg();
	clksrc = CLOCK_SOURCE[pStdaCfg->clkSrc];
	if (clksrc == eDAL_CLK_SRC_AESRX0)
	{
		rate_mode = eDAL_RATE_MODE_ALL; //auto lock to 32k-192k
	}
	else if (clksrc == eDAL_CLK_SRC_ADATRX)
	{
		if (pStdaCfg->extADAT == 0) //Normal
			rate_mode = eDAL_RATE_MODE_LOW;
		else if (pStdaCfg->extADAT == 1) //SMUX II
			rate_mode = eDAL_RATE_MODE_MID;
		else if (pStdaCfg->extADAT == 2) //SMUX IV
			rate_mode = eDAL_RATE_MODE_HIGH;
		else //Auto
			rate_mode = eDAL_RATE_MODE_LOW_MID;
	}
	else if (clksrc == eDAL_CLK_SRC_INTERNAL)
	{
		rate_mode = dalRateByID (pStdaCfg->extInt)->rateMode;
		rate = pStdaCfg->extInt;
	}
	else
	{
		//illegal, do something
		rate = eDAL_NOMINAL_RATE_48;
	}
	dalCreateInterface(eDAL_INTERFACE_1, rate_mode, STDA_INPUT_DEVICES,STDA_OUTPUT_DEVICES);
	dalSetClockSource (eDAL_INTERFACE_1, clksrc, rate);
	dalStartInterface(eDAL_INTERFACE_1);
	//update the routing now according to the currently locked rate mode, in auto modes this might change
	//so in that case this function must be called.
	//updateStdaRouting(); Happens later
}