• 0
n3wbie

Zynq book - tutorial 5 Zybo Z7

Question

Hi,

I have been following tutorials from Zynq book for Zybo Z7 board.

In tutorial 5, where the zybo_audio_ctrl IP core is used, I can not get any audio data through my board. 

The tutorials are made for Zybo board, and I followed migration guide (to Zybo Z7), but still no success.

 

 

Any help would be appreciated.

Thanks

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 1

Hi @n3wbie,

Th working project is attached. what you have to take in to account when using this audio codecs with Digilent products is that you need to configure the codec (using I2C) as well as receive the samples using I2S IP core. Basically one is for the control of the codec and the other one is to receive the samples. I have written a small driver for both the I2S core and the I2C SSM2603 which is in the source files of the SDK project (in the sdk folder) which configures the registers for the codec and I2S IP core; the documentation for the codec can be found here. The IP core has not yet been documented which is the main reason we have not added it to the Digilent vivado-ip library, but it needs a 100MHz input for it to be able to synthesize the 12.228 MHz MCLK and the subsequent clocks for the I2S protocol.

The demo project reads the buttons and based on the ones you press it will:

BTN0 - Record 1s

BTN1 - Set Mic input

BTN2 - Set Line In input

BTN3 - Playback 1s

The project is not really optimized so it uses a variable "RecSamples", allocated to the stack memory which holds the recorded samples(48000 samples representing 1s at a 48KHz sampling rate) and it is also used fro play back, so don't press play back before record. The rest should be easily traceable from the comments in the driver and the main source code.

If you have any other questions feel fr to ask.

Ciprian

ZyboZ7Audio.zip

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron,

In the attachement is my block design. I just want to stream audio data. Also, I have attached my code and here is SDK log.

21:21:55 INFO    : Registering command handlers for SDK TCF services
21:21:55 INFO    : Launching XSCT server: xsct.bat -interactive C:\Users\melis\Downloads\exercise5.xpr\exercise5\exercise5.sdk\temp_xsdb_launch_script.tcl
21:22:00 INFO    : XSCT server has started successfully.
21:22:00 INFO    : Successfully done setting XSCT server connection channel  
21:22:11 INFO    : Successfully done setting SDK workspace  
21:22:11 INFO    : Processing command line option -hwspec C:/Users/user/Downloads/exercise5.xpr/exercise5/exercise5.sdk/design_1_wrapper.hdf.

 

 

I dont have any critical warnings in Vivado. There are warnings like this:

image.png.398cf28484eb9f55ae5f2c5c01490567.png

 

Hope you can help me. 

Thanks,

Regards

blockdiagram.jpg

audio.c

audio.h

ip_functions.c

adventures_with_ip.c

adventures_with_ip.h

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron,

Here it is.

Thanks.

adventures_with_ip.xdc

 

edit: I have noticed the following - I program the board and Run As -> Launch on Hardware(System Debugger) and nothings happen. Then, I turn on and off board, and run program again without programming the board and I can hear sound. Also, if the board is turned off, some strange noise can be heared.

If someone can help me, I would appreciate that.

Regards

Edited by n3wbie

Share this post


Link to post
Share on other sites
  • 0

Hi @n3wbie,

I do not see anything wrong with your xdc. When i have a moment in the next few days i'll try to go through the tutorial any see if i can get it to work and or duplicate your issue.  Also if your concern is trying to use the audio codec then the Zybo Z7 DMA Audio Demo linked above uses the audio codec on the Zybo-Z7.

thank you,

Jon

 

 

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron,

Hope you will find time soon to help me with this.

Regarding DMA Audio Demo, I find it a bit hard and complicated for taking and processing audio data. I have already tried with it, but this Zynq book tutorial is more simpler and easier for beginners. Hope we will find solution to it :)

 

Regards,

Share this post


Link to post
Share on other sites
  • 0

Hi @n3wbie,

I spent some time looking at the tutorial 5b. It appears that these tutorials are built on each other. I tried using your project with the zybo and zybo z7-20. I was not able to get audio streaming with either board. I would still suggest using the Digilent Audio DMA Demo.  I found a zybo instructable here and a forum thread here that might be helpful as well.

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron,

I tried to follow your advice using IP core from that demo. I couldn't find any documentation, but from the demo I tried to figure out how to configure it.
This is my block design (basically I just replaced zybo_audio IP core from the book with the one from demo):
d_axi_i2s.thumb.png.5fc7527a4781d165a2332377a326194f.png

When I export my hardware, I first ran helloworld and it worked.
However, when I try to run it with configuration I did for streaming the data, it hangs (it does nothing, program does not start at all). Can you help me with this?

Regards,

Share this post


Link to post
Share on other sites
  • 0

Hi @n3wbie,

I tried to rebuild you project but there are some errors from downloading the project from Drive, for future reference when uploading a project make sure you archive it first. Regardless, I started to build a simple demo that does exactly what you want to do, it will not be fully documented but it will be documented enough so that you can understand how the IP works and how to use it in future project.

This will probably take a bit of time, so I will have the demo ready for you by the beginning of next week, and I will post project and the description as a reply to this post.

Regards,

Ciprian

Share this post


Link to post
Share on other sites
  • 0

Hi @Ciprian,

Thank you very much for your time and help. :)

I tested it and it is working properly. So, I don't want to make anything more that putting my code for FFT and calculate FFT on that array.

I have one following question -  when I enter debugging mode, program stops at init_platform(); I left out the buttons part. Also, I am thinking if I put sine wave, and then take results of array - I can plot them using MATLAB/Octave so I can check if my data is correctly sampled.

Is this right approach and did you face any problems with debugging mode?

 

Thank you again for everything,

Regards,

 

Share this post


Link to post
Share on other sites
  • 0

Hi @n3wbie,

I had a similar problem, for me it was the fact that I did not have enough space allocated to the stack in the linker script, if you changed the dimension of the RecSamples variable then that might be the issue.

Regarding the sin wave, I'm not sure what you want to do but if you want to generate a sin wave from within the and then play it back to the Head Phones then you can simply use the sin function in C (you need to add the math.h library and make sure you activate the library in the project settings, described here). Otherwise you can set Mic or Line in, connect the jack to you PC and play a Sin video from youtube then you can look at the recorded samples. I'm guessing you are more familiar with MATLAB, you can try that to; the idea is that as long as you are feeding it the right samples either way works.

Hope this helps,

Ciprian

Share this post


Link to post
Share on other sites
  • 0

Hi @Ciprian,

Yes, I tried to change dimension of the RecSamples, that is why I had the same problems as you. Thank you :)

Yes, my idea is to put Sine Wave through PC via Line in, and then record it. I have been playing around with it and have more questions if you can help me.

I wasn't able to find a way to store or see all 48000 samples, I have tried to save that variable into binary file, and I have also tried to put it as output in XSCT Console (reference: https://forums.xilinx.com/t5/Xcell-Daily-Blog-Archived/Adam-Taylor-s-MicroZed-Chronicles-Part-233-Zynq-SoC-XADC/ba-p/824170), but both ways are not working. When I try to store it as a binary file, command is executed, but I can not find file. Other way, as a output in XSCT console, I can see the data but I can not copy it from there. Sorry if this is some beginner mistake.

 

Anyway, thank you very much for all the help provided. :)

Regards,

 

Edited by n3wbie

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now