- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,there!
I built a nios project with the audio IP from university program IPs(version 10.1),and program as follow: int main(void) { alt_up_audio_dev *audio_dev; unsigned int r_buf=1000; unsigned int l_buf=1000; unsigned int fifospace; audio_dev=alt_up_audio_open_dev("/dev/audio_controller"); if(audio_dev==NULL) printf("Error:could not open audio device\n"); else printf("Opened audio device\n"); while(1) { fifospace=alt_up_audio_write_fifo_space(audio_dev,ALT_UP_AUDIO_RIGHT); if(fifospace>2) { alt_up_audio_write_fifo(audio_dev, &(l_buf),2,ALT_UP_AUDIO_LEFT); alt_up_audio_write_fifo(audio_dev,&(r_buf),2,ALT_UP_AUDIO_RIGHT); } } return 0; } I ensured that hardware connection was right,and a 18.4MHz clock signal from pll connected to wm8731 MCLK port,but when run as hardware in nios ii ide,no sound come out from line out port. I'm strongly puzzled.After looking for useful info in handbook pdf for a long time,found no. Can you help me? I'll sincerely appreciate that.Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you see "Opened audio device" in the console?
I've ever used this component so I don't know if the code is right. I think you should use multiple word buffers instead of just unsigned ints. If your data size is 16 bits, what you are sending is a succession of 0 and 1000 values. This is a signal at a rather high frequency (half the sampling rate) and a rather low amplitude (about 1/32 of the maximum). So if it works it must be hard to hear. What word size and sampling frequency did you use?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for replying. I can see "Opened audio device" in the console window,and audio bit width is 16,and sampling rate is 48k sps.
Are you familiar with the university program IP?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No I'm not, but to output any audio you will have to use buffers instead of just ints, and fill them with a signal such as a sine wave.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page