Slice Kit Beginners Problems

If you have a simple question and just want an answer.
asdf234
New User
Posts: 3
Joined: Wed Nov 04, 2015 4:40 pm

Slice Kit Beginners Problems

Post by asdf234 »

Hello,

I use a sliceKIT Starter Kit with the Audio Slice Card (XA-SK-AUDIO). I use the "I2S Master sliceKIT Loopback Demo" to read Audio in by an mp3 player and to give it back out as well. This is working fine. What I want to do now is to use that ADC values and send them to another task to be able to work with them.

the task "i2s_loopback.xc" gets the values over a channel streaming from the function "i2s_master". Here is a short look at the loopback function that gets the ADC values over the channel.

________________________________________________________________

while(1)
    {
        /* Receive ADC samples from audio thread */
#pragma loop unroll
        for (int i = 0; i < I2S_MASTER_NUM_CHANS_ADC; i++)
        {
            c :> sampsAdc;
        }}

________________________________________________________________

First off a problem that I don't understand so far. The array sampsAdc[] is defined like this:

________________________________________________________________

unsigned sampsAdc[I2S_MASTER_NUM_CHANS_ADC];

________________________________________________________________

and the array size is a define like this:

________________________________________________________________

#define I2S_MASTER_NUM_CHANS_ADC 2

________________________________________________________________

This would mean to me I have an array of the size 2 with 2 values, but when I look at it in the debugger it has 4 values. When i force it to a size of 2 it is then really 2 values big but the sound input/output stops working. Ok but now to the main part.

 

I tryed to give that "loopback" function a second streaming channel were it just sends the data to another task. Something like this:

________________________________________________________________

loopback(c_data, c_con);

________________________________________________________________

But whenever I tryed to send the data to another task the sound output stoped working. I figured the problem is the connection from multiple channels and tasks, so they have to wait and block each other some time.

Ok, so if someone could give me an idea how to get that ADC values from my sound files out of that task so I can use it in another task would be nice.

 

 

 

 

 

User avatar
Ross
Verified
XCore Legend
Posts: 1185
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

I tryed to give that "loopback" function a second streaming channel were it just sends the data to another task. Something like this:

________________________________________________________________

loopback(c_data, c_con);

________________________________________________________________

But whenever I tryed to send the data to another task the sound output stoped working. I figured the problem is the connection from multiple channels and tasks, so they have to wait and block each other some time.

Ok, so if someone could give me an idea how to get that ADC values from my sound files out of that task so I can use it in another task would be nice.
Can you attach your full code listing please?