Hello,
I'm doing some modifications to the Audio DMA Project, i'm using the Zybo Z7-20 with the Vitis and Vivado 2023.2 version. This project storage the audio data received by the codec at 96khz during a period of time with a microphone in the memory using AXI DMA, also you can reproduce the file using some headphones.
The point is that i want to read the data that it's storaged, for this purpose i have made the next code:
INTPTR adr = (u32) MEM_BASE_ADDR; //Starting address of the data, i get this looking in the function used in the project
u32 len = (3 * NR_AUDIO_SAMPLES); //(Time of sec * freq), multiply by 3 because, the data lenght is 24 bits, so it fills 3 memory address (each 1 byte)
const u32 cacheline = 3U; //Aumenting the memory address in 3 to match the size of the data get by the audio codec
u32 tempadr = adr; //Starting Memory Address
u32 tempend = adr + len; //Final Memory Address
while (tempadr < tempend){ //Loop in the interval and auments by 3 each iteration
int* i = (int*) tempadr;
u32 data = *(volatile u32*) i; //Get back the data in the actual memory address using pointer
xil_printf("%u\r\n", data); //Write the data in the serial terminal
tempadr += cacheline;
}
I printf the data in the serial terminal and save the data using external applications, i get the correct number of data, but the problem is that the data looks nonsense is oscillates between the min and max value of 24bits. The procedure was to knock the table and recording the sound in the memory of the Zybo Z7 and then storage the data (Look the data graph).
In theory, the data should look like a straight graph and a peak corresponding to the knock on the table. And i don't know if the problem is that i'm reading the data wrong or the direction is not correct.
Thanks for your responding.🙃