#include <string.h>
|
#include <alg.h>
|
#include <math.h>
|
#include "drv/global.h"
|
#include "f2f.h"
|
#include "jitter.h"
|
#include "protocol.h"
|
|
#define MAX_LOGIC_CHANNEL 36
|
|
extern int dual_dsp;
|
extern int dsp_index;
|
extern int hardware_ver;
|
|
static float rx_channel[MAX_LOGIC_CHANNEL][NUM_SAMPLES];
|
static float tx_channel[MAX_LOGIC_CHANNEL][NUM_SAMPLES];
|
|
static float dante_rx_channel[16][NUM_SAMPLES];
|
static float dante_tx_channel[16][NUM_SAMPLES];
|
|
extern int sport0a_buf[2][NUM_SAMPLES*SLOTS];
|
extern int sport0b_buf[2][NUM_SAMPLES*SLOTS];
|
|
extern int sport1a_buf[2][NUM_SAMPLES*SLOTS];
|
extern int sport1b_buf[2][NUM_SAMPLES*SLOTS];
|
|
extern int sport2a_buf[2][NUM_SAMPLES*SLOTS];
|
extern int sport2b_buf[2][NUM_SAMPLES*SLOTS];
|
|
extern int sport3a_buf[2][NUM_SAMPLES*SLOTS];
|
extern int sport3b_buf[2][NUM_SAMPLES*SLOTS];
|
|
//usb
|
extern int sport4a_buf[2][NUM_SAMPLES*2];
|
extern int sport5a_buf[2][NUM_SAMPLES*2];
|
|
extern int sport6a_buf[2][NUM_SAMPLES*SLOTS];
|
extern int sport7a_buf[2][NUM_SAMPLES*SLOTS];
|
|
|
extern int local_input_channels_num ;
|
extern int local_output_channels_num ;
|
extern int dante_input_channels_num ;
|
extern int dante_output_channels_num ;
|
|
extern jitter_mem* pusb_input_jitter;
|
extern jitter_mem* pusb_output_jitter;
|
extern void* usbExpander;
|
float usb_input[NUM_SAMPLES],usb_output[NUM_SAMPLES];
|
|
float* rx_channel_ptr[]={
|
rx_channel[0],rx_channel[1],rx_channel[2],rx_channel[3]
|
,rx_channel[4],rx_channel[5],rx_channel[6],rx_channel[7]
|
,rx_channel[8],rx_channel[9],rx_channel[10] , rx_channel[11]
|
,rx_channel[12],rx_channel[13], rx_channel[14] ,rx_channel[15]
|
,rx_channel[16] ,rx_channel[17], rx_channel[18], rx_channel[19]
|
,rx_channel[20] ,rx_channel[21] ,rx_channel[22] ,rx_channel[23]
|
,rx_channel[24] ,rx_channel[25] ,rx_channel[26] ,rx_channel[27]
|
,rx_channel[28] ,rx_channel[29] ,rx_channel[30] ,rx_channel[31]
|
,rx_channel[32] ,rx_channel[33], rx_channel[34] ,rx_channel[35]
|
};
|
|
float* tx_channel_ptr[]={
|
tx_channel[0] ,tx_channel[1] ,tx_channel[2] ,tx_channel[3]
|
,tx_channel[4] ,tx_channel[5] ,tx_channel[6] ,tx_channel[7]
|
,tx_channel[8] ,tx_channel[9] ,tx_channel[10] ,tx_channel[11]
|
,tx_channel[12] ,tx_channel[13] ,tx_channel[14] ,tx_channel[15]
|
,tx_channel[16] ,tx_channel[17], tx_channel[18] ,tx_channel[19]
|
,tx_channel[20] ,tx_channel[21] ,tx_channel[22] ,tx_channel[23]
|
,tx_channel[24] ,tx_channel[25] ,tx_channel[26] ,tx_channel[27]
|
,tx_channel[28] ,tx_channel[29] ,tx_channel[30] ,tx_channel[31]
|
,tx_channel[32] ,tx_channel[33], tx_channel[34] ,tx_channel[35]
|
};
|
|
// Structures to hold floating point data for each AD1939
|
//ad1939_float_data fBlockA;
|
|
inline void floatData(float *output, const int *input, unsigned int instep, unsigned int length)
|
{
|
int i;
|
|
|
for(i = 0; i < length; i++)
|
{
|
output[i] = __builtin_conv_RtoF(input[instep*i]);
|
}
|
}
|
|
#define NORMALIZE(X) (((X)&0x8000)?(-((~(X))&0xffff)-1):(X)) //»¹Ô·ûºÅλ
|
|
inline void floatData16(float *output, const int *input, unsigned int instep, unsigned int length)
|
{
|
int i;
|
int temp;
|
|
for(i = 0; i < length; i++)
|
{
|
temp = input[instep*i]&0xffff;
|
|
output[i] = NORMALIZE(temp)*(1.f/0x7fff);
|
}
|
}
|
|
// Unoptimized function to convert the outgoing floating-point data to 1.31 fixed-point format.
|
inline void fixData(int *output, const float *input, unsigned int outstep, unsigned int length)
|
{
|
int i;
|
|
for(i = 0; i < length; i++)
|
{
|
output[outstep*i] = __builtin_conv_FtoR(input[i]);
|
}
|
}
|
|
extern int fflush_lock;
|
|
void input_fflush(int sid, const unsigned int blockIndex)
|
{
|
int i;
|
int channel_index = 8;
|
#if 1
|
if(sid == SIG_SP1){
|
floatData( get_rx_channel(0), sport1a_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(1), sport1a_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(2), sport1a_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(3), sport1a_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
|
floatData( get_rx_channel(4), sport1a_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(5), sport1a_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(6), sport1a_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(7), sport1a_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
|
|
if(local_input_channels_num >8 ){
|
floatData( get_rx_channel(channel_index++), sport1b_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport1b_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport1b_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport1b_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
}
|
|
if(local_input_channels_num>12){
|
floatData( get_rx_channel(channel_index++), sport1b_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport1b_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport1b_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport1b_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}
|
|
if(hardware_ver == HARDWARE_NX){
|
//if(fflush_lock == 0){
|
for(i = 0; i < dante_input_channels_num; i++){
|
memcpy(get_rx_channel(channel_index++),dante_rx_channel[i], NUM_SAMPLES);
|
}
|
//}
|
//channel_index += dante_input_channels_num;
|
}
|
else{
|
if(dante_input_channels_num>0){ //dante
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}
|
|
if(dante_input_channels_num>8){
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
}
|
|
if(dante_input_channels_num>12){
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}
|
}
|
|
if(dual_dsp && dsp_index == 1){
|
floatData( get_rx_channel(channel_index++), sport7a_buf[blockIndex]+0,SLOTS, NUM_SAMPLES); //am
|
floatData( get_rx_channel(channel_index++), sport7a_buf[blockIndex]+1,SLOTS, NUM_SAMPLES); //usb
|
floatData( get_rx_channel(channel_index++), sport7a_buf[blockIndex]+2,SLOTS, NUM_SAMPLES); //aec
|
floatData( get_rx_channel(channel_index++), sport7a_buf[blockIndex]+3,SLOTS, NUM_SAMPLES); //ans
|
}
|
else{
|
//jitter_read(pusb_input_jitter, get_rx_channel(channel_index+1), NUM_SAMPLES);
|
//floatData( get_rx_channel(channel_index+1), sport5a_buf[blockIndex]+0,2, NUM_SAMPLES);//L
|
memcpy(get_rx_channel(channel_index+1), usb_input, NUM_SAMPLES);
|
}
|
}
|
else{
|
channel_index = 0;
|
}
|
#if 0
|
if(sid == SIG_SP3){
|
if(dante_input_channels_num>0){ //dante
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}
|
|
if(dante_input_channels_num>8){
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
}
|
|
if(dante_input_channels_num>12){
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}
|
}
|
#endif
|
#endif
|
}
|
|
void dante_input_fflush(const unsigned int blockIndex)
|
{
|
int channel_index = 0;//local_input_channels_num;
|
|
if(dante_input_channels_num>0){ //dante
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3a_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}
|
|
if(dante_input_channels_num>8){
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
}
|
|
if(dante_input_channels_num>12){
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( dante_rx_channel[channel_index++], sport3b_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}
|
/*if(dante_input_channels_num>0){ //dante
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3a_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}
|
|
if(dante_input_channels_num>8){
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+0,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+1,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+2,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+3,SLOTS, NUM_SAMPLES);
|
}
|
|
if(dante_input_channels_num>12){
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+4,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+5,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+6,SLOTS, NUM_SAMPLES);
|
floatData( get_rx_channel(channel_index++), sport3b_buf[blockIndex]+7,SLOTS, NUM_SAMPLES);
|
}*/
|
}
|
|
|
void usb_input_fflush(const unsigned int blockIndex)
|
{
|
//float L[NUM_SAMPLES];
|
//float R[NUM_SAMPLES];
|
int i=0;
|
float diff =0;
|
float f =0;
|
|
floatData( usb_input, sport5a_buf[blockIndex]+0,2, NUM_SAMPLES);//L
|
//jitter_write(pusb_input_jitter, L, NUM_SAMPLES);
|
for(i=1;i<NUM_SAMPLES;i++) {
|
f = fabs(usb_input[i] - usb_input[i-1]);
|
if(f > diff){
|
diff = f;
|
}
|
}
|
|
if(diff <= 0.00001){
|
memset(usb_input, 0, NUM_SAMPLES);
|
}
|
|
//if(usbExpander) {
|
// alg_expander_process(usbExpander,usb_input,usb_input);
|
//}
|
}
|
|
|
void usb_output_fflush(const unsigned int blockIndex)
|
{
|
//float L[NUM_SAMPLES];
|
|
//jitter_read(pusb_output_jitter, L, NUM_SAMPLES);
|
|
fixData(sport4a_buf[blockIndex]+0, usb_output, 2, NUM_SAMPLES);
|
fixData(sport4a_buf[blockIndex]+1, usb_output, 2, NUM_SAMPLES);
|
}
|
|
void output_empty(void)
|
{
|
//memset(sport0a_buf[0],0,NUM_SAMPLES*SLOTS*2);
|
//memset(sport0b_buf[0],0,NUM_SAMPLES*SLOTS*2);
|
//memset(sport2a_buf[0],0,NUM_SAMPLES*SLOTS*2);
|
//memset(sport2b_buf[0],0,NUM_SAMPLES*SLOTS*2);
|
|
//memset(sport4a_buf[0],0,NUM_SAMPLES*2*2);
|
|
//memset(sport6a_buf[0],0,NUM_SAMPLES*SLOTS*2);
|
|
int i;
|
|
for(i=0;i<MAX_LOGIC_CHANNEL;i++){
|
memset(get_rx_channel(i),0,NUM_SAMPLES);
|
}
|
}
|
|
void dante_output_empty(void)
|
{
|
int i;
|
|
for(i = 0; i < 16; i++){
|
memset(dante_rx_channel[i], 0, NUM_SAMPLES);
|
memset(dante_tx_channel[i], 0, NUM_SAMPLES);
|
}
|
}
|
|
void output_fflush(int sid, const unsigned int blockIndex)
|
{
|
int i;
|
int channel_index = 4;
|
extern int input_num_channels;
|
#if 0
|
float pcm[NUM_SAMPLES];
|
|
//int i;
|
static int t=0;
|
|
for(i=0;i<NUM_SAMPLES;i++){
|
pcm[i] = 0.5*sinf(2*3.1415926*1000*t/48000);
|
t++;
|
}
|
if(t>=48000){
|
t =0;
|
}
|
#endif
|
if(sid == SIG_SP1){
|
fixData(sport0a_buf[blockIndex]+0, get_rx_channel(0), SLOTS, NUM_SAMPLES);
|
fixData(sport0a_buf[blockIndex]+1, get_rx_channel(1), SLOTS, NUM_SAMPLES);
|
|
fixData(sport0a_buf[blockIndex]+2, get_rx_channel(2), SLOTS, NUM_SAMPLES);
|
fixData(sport0a_buf[blockIndex]+3, get_rx_channel(3), SLOTS, NUM_SAMPLES);
|
|
if(local_output_channels_num>4){
|
fixData(sport0a_buf[blockIndex]+4, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0a_buf[blockIndex]+5, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0a_buf[blockIndex]+6, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0a_buf[blockIndex]+7, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}
|
|
if(local_output_channels_num>8){
|
fixData(sport0b_buf[blockIndex]+0, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0b_buf[blockIndex]+1, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0b_buf[blockIndex]+2, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0b_buf[blockIndex]+3, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}
|
|
if(local_output_channels_num>12){
|
fixData(sport0b_buf[blockIndex]+4, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0b_buf[blockIndex]+5, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0b_buf[blockIndex]+6, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport0b_buf[blockIndex]+7, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}
|
|
if(hardware_ver == HARDWARE_NX){
|
//if(fflush_lock == 0){
|
for(i = 0; i < dante_output_channels_num; i++){
|
memcpy(dante_tx_channel[i],get_rx_channel(channel_index++) ,NUM_SAMPLES);
|
}
|
//}
|
//channel_index += dante_output_channels_num;
|
}
|
else{
|
if(dante_output_channels_num>0){
|
fixData(sport2a_buf[blockIndex]+0, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+1, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+2, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+3, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+4, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+5, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+6, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+7, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}
|
if(dante_output_channels_num>8){
|
fixData(sport2b_buf[blockIndex]+0, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+1, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+2, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+3, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}
|
|
|
if(dante_output_channels_num>12){
|
fixData(sport2b_buf[blockIndex]+4, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+5, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+6, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+7, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}
|
}
|
|
memcpy(usb_output,get_rx_channel(channel_index) ,NUM_SAMPLES);
|
|
if(dsp_index == 0){
|
if(dual_dsp == 1){
|
fixData(sport6a_buf[blockIndex]+0, get_rx_channel(channel_index), SLOTS, NUM_SAMPLES);
|
fixData(sport6a_buf[blockIndex]+1, get_rx_channel(channel_index+1), SLOTS, NUM_SAMPLES);
|
fixData(sport6a_buf[blockIndex]+2, get_rx_channel(channel_index+2), SLOTS, NUM_SAMPLES);
|
fixData(sport6a_buf[blockIndex]+3, get_rx_channel(channel_index+3), SLOTS, NUM_SAMPLES);
|
}
|
memset(get_rx_channel(channel_index), 0 ,NUM_SAMPLES);// ²»Çå³ýUSB
|
memset(get_rx_channel(channel_index+1),0 ,NUM_SAMPLES);
|
memset(get_rx_channel(channel_index+2),0 ,NUM_SAMPLES);
|
memset(get_rx_channel(channel_index+3),0 ,NUM_SAMPLES);
|
}
|
}
|
else{
|
channel_index = 0;
|
}
|
#if 0
|
if(sid == SIG_SP3){
|
if(dante_output_channels_num>0){
|
fixData(sport2a_buf[blockIndex]+0, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+1, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+2, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+3, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+4, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+5, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+6, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+7, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
}
|
if(dante_output_channels_num>8){
|
fixData(sport2b_buf[blockIndex]+0, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+1, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+2, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+3, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
}
|
|
|
if(dante_output_channels_num>12){
|
fixData(sport2b_buf[blockIndex]+4, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+5, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+6, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+7, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
}
|
}
|
#endif
|
}
|
|
void dante_output_fflush(const unsigned int blockIndex)
|
{
|
int channel_index = 0;//local_output_channels_num;
|
|
if(dante_output_channels_num>0){
|
fixData(sport2a_buf[blockIndex]+0, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+1, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+2, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+3, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+4, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+5, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+6, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+7, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
}
|
if(dante_output_channels_num>8){
|
fixData(sport2b_buf[blockIndex]+0, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+1, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+2, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+3, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
}
|
|
|
if(dante_output_channels_num>12){
|
fixData(sport2b_buf[blockIndex]+4, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+5, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+6, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+7, dante_tx_channel[channel_index++], SLOTS, NUM_SAMPLES);
|
}
|
/*if(dante_output_channels_num>0){
|
fixData(sport2a_buf[blockIndex]+0, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+1, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+2, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+3, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+4, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+5, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+6, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2a_buf[blockIndex]+7, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}
|
if(dante_output_channels_num>8){
|
fixData(sport2b_buf[blockIndex]+0, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+1, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+2, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+3, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}
|
|
|
if(dante_output_channels_num>12){
|
fixData(sport2b_buf[blockIndex]+4, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+5, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+6, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
fixData(sport2b_buf[blockIndex]+7, get_rx_channel(channel_index++), SLOTS, NUM_SAMPLES);
|
}*/
|
}
|