FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP

audio core

Altera_Forum
Honored Contributor II
1,000 Views

I am using audio core to generate digital audio filters . I want to pass digital signal from ADC to DAC , but it can't operate . Who can help me this problem . Thank you very much !!!

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
249 Views

here is my code by C 

while(1) 

//wait for interrupt signal 

ctrl_reg = IORD_ALT_UP_AUDIO_CONTROL(ALT_UP_AUDIO_BASE); 

ctrl_reg &= ALT_UP_AUDIO_CONTROL_RI_MSK; 

if(ctrl_reg == 0) continue; //if there isn't read interrupt signal , continue wait 

ctrl_reg = IORD_ALT_UP_AUDIO_CONTROL(ALT_UP_AUDIO_BASE); 

//clear interrupt flag 

ctrl_reg &= ~ALT_UP_AUDIO_CONTROL_RI_MSK; 

IOWR_ALT_UP_AUDIO_CONTROL(ALT_UP_AUDIO_BASE, ctrl_reg); 

//read left channel 

alt_up_audio_read_left_channel(&left_reg,read_length); 

//read right channel 

alt_up_audio_read_right_channel(&right_reg,read_length); 

// write left channel  

alt_up_audio_write_left_channel(&left_reg,write_length); 

// write right channel 

alt_up_audio_write_right_channel(&right_reg,write_length); 

}
0 Kudos
Altera_Forum
Honored Contributor II
249 Views

Try this example, let me know if it works. 

# include "alt_up_audio.h" 

 

// assumes input only from right channel 

int main() 

unsigned sample_count; 

long audiobuf[128]; 

 

alt_up_audio_reset_audio_core(); //get the audio started 

while (1) 

sample_count = alt_up_audio_read_right_channel(audiobuf,128); 

if(sample_count) 

{ //must write both output channels 

alt_up_audio_write_left_channel(audiobuf,sample_count); 

alt_up_audio_write_right_channel(audiobuf,sample_count); 

}
0 Kudos
Altera_Forum
Honored Contributor II
249 Views

Hello, i am having the same problem , so is there any workaround for this?  

 

Thanks!
0 Kudos
Reply