Post Go back to editing

BF548 Audio signal processing (AD1980 Callback)


I'm currently trying to extract audio input data, perform some signal processing, and output something at the end. (Much like the talkthrough on the 533 boards).

I have been using the audio loopback project to attempt this, and for starters, I've tried something very simple: Set all left audio out to zero. (Just to make sure I am actually able to manipulate the data somehow).

In regards to the code, this is what I've done:

            /* copy the source (ADC) data to DAC channels */
            for (i = 0;i < (BUFFER_SIZE_PER_CHANNEL * NUM_ADC_CHANNELS); i++)
                /* copy ADC left channel data to PCM out Left */
                *(pDest+(NUM_DAC_CHANNELS*i))    = 0;
                /* copy ADC right channel data to PCM out right */
                *(pDest+1+(NUM_DAC_CHANNELS*i)) = *(pSrc+1+(NUM_ADC_CHANNELS*i));

However, this does not silence the left output at all.  I am very confused, am I doing something wrong? Or have I modified the whole thing incorrectly?

I've also noticed that after I press PB4 (to terminate the program), it says "Done!", but audio is still coming in and going out.

Other than what I've written above, I have not changed the program.

I realise it is only a basic operation I am trying to achieve at the moment, but I want to take it one step at a time.  It will get much more difficult in the future (planning to write functions which will process a 2 second audio input, and analyse the data, to detect speech), so if you guys could help me get over this hurdle, that'd be great.



Additional information: Using VisualDSP+++ V5 (with update 6 applied).

File edited is Audio_Loopback.c

Codec: ad1980

  • Where we are at with 548

    We have also been playing around with the BF548 processing -- we have a 2 buffer version going using a co-operative scheduler so that we can launch other tasks in syncronism with the audio interrupts.

    The co-operative scheduler has two processes being launched and these transmit the Blackfin signal -- over an FPGA board to a TigerSHARC for high speed processing using an ultra-fast s-transform.

    Re -- still hearing the signal

    I have destroyed a number of audio chips associated with the blackfin ez-lite kits -- not the BF548 yet  :-)

    One property of those destroyed chips is that you can still hear the audio -- some sort of break-through.

    Suggested approach

    Assuming that is not the problem -- I would suggest that you leave the output buffers alone -- and set the input bffers to 0. What I suspect is happening is that you are changing the output buffers to 0, but before they are getting played, they are being rewritten by the unmodified code.

    Changing the input to 0 may fix this.  Except then you might change the input buffers to 0 "after" the values have been moved to the output  :-)

  • My graduate student developed the co-operatives scheduler using the BF548 audio.

    She suggests looking at the multi-audio channel (pseudo and virtual etc) setting to see if you are unintentionally picking up the signals from there. She can provide more information if you ned to follow up that route.

  • Thanks for your replies Mike.

    I don't think it would be the pseudo/multi channel outputs, because I've deleted those completely from the code (only leaving left/right output).

    I've also tried setting the input to zero (pSrc = &InboundData0[0];), I've included, after that line, InboundData0[0] = 0;

    I've put a breakpoint in the code to make sure the program actually reaches that stage, but even though it breaks at that point, audio still plays.

    I hope it's not a broken chip.  If you can think of anything else that may be an issue, let me know.

    It's frustrating to think that I can't even null an output, let alone process signals yet.

  • Oh, I've reloaded the original code a few times.

    It has exactly the same result.  I have two boards (one at home, and one at university), and both continue to play audio despite having terminated the program.  Also, both boards are unresponsive to changing output/input values to zero.

    I've done a printf of the values (just to see if they are zero), and the indeed are (printf("value of inbounddata0 is %u",InboundData0[0]);).

    Have you managed to extract audio data and perform some form of signal processing on it yet?

    I'm trying to find a simple program like the talkthrough of the bf533 boards, but there doesn't appear to be one for the 548.

  • Sounds like you have not got TOO far into the recoding. In this

    situation, I normally reckon that I have, somehow, made a change in the

    code that I had not intended. I then employ the rm . approach --

    meaning download the BF548 code again and hope that this time, when I

    modify the code, I don't make the same mistake again.

  • I've sent you a PM Mike, thanks for the offer to help, really appreciate it.

    As to commenting out all the left channel code: I've removed all code relating to left AND right buffers (in all combinations), and the audio output is still playing.

    I've completely deleted the part of the code which states:

                /* copy the source (ADC) data to DAC channels */
                for (i = 0;i < (BUFFER_SIZE_PER_CHANNEL * NUM_ADC_CHANNELS); i++)
                    /* copy ADC left channel data to PCM out Left */
                    *(pDest+(NUM_DAC_CHANNELS*i))    = *(pSrc+(NUM_ADC_CHANNELS*i));
                    /* copy ADC right channel data to PCM out right */
                    *(pDest+1+(NUM_DAC_CHANNELS*i)) = *(pSrc+1+(NUM_ADC_CHANNELS*i));

    And the output is still there.

    Those are the only instances where I can find Left or Right channel data.

    Anyway, I hope to hear from you soon re: co-operative scheduler code.


  • The co-operative scheduler capable of processing audio code on BF533 and

    BF548 I have developed is to be placed in the public domain as part of

    the support I get from Analog Devices for my Analog Devices University


    Contact me via the Forum using a private message. I can upload an

    executable where we have set one channel to be zero so you can test your

    board, or let you have a current version of the co-operative scheduler code.

    Watch out for this  -- I have two BF548 boards and they seem to behave

    differently. I thought it was a version number issue (looking at the

    board markings) but I put a breakpoint in the middle of the version

    related code and both boards went down the same path.

    Sorry to state the probably impossible -- have you done something to

    your code so that it caused the flashed in "self-power test" code to

    reload. I can't see how -- but you could flash a "blink" program to the

    board to over ride the self test code

  • Another suggestion -- Use VDSP to find all code references (not

    declarations) to the left channel and comment them all out rather than

    setting them to zero

  • One explanation is that some how you are not executing the code you think you are executing. Have done that before -- used ^L and downloaded unchanged code from the debug directory when I was currently working with a release project.

    If just compiling and run -- then I can't see how as VDSP automatically loads the file after a build -- unless you are liike my graduate student who does not like that option and have that option turned off

    Rather than removing audio code -- can you add a piece of code that turns the LEDs on and off in response to the buttons being pushed at the location of your code. This is really no different than setting a breakpoint which you have already done but some how feels better.

    Note -- There is a VDSP setting where the code will continue to execute after you have exitted from VDSP rather than stopping -- however that should still play the "expected code" with one dead channel.

    Message was edited by: Mike Smith

  • You are not going to believe this -- I can't get the audio to stop either

    We were testing our code with dummy tones -- pick up a sine wave -- and that was working

    We now set up code to read the switches and display the switch press on the LEDs

    Switching the channels to 0 on the key press

    We are listening on the sound surround output in stereo mode

    Will get back to you after we go back to doing the sine wave test