This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SIO_issue/SIO_reclaim buffer confusion with audio output on OMAP-L137 EVM

Other Parts Discussed in Thread: OMAP-L137

4478.audio_test.zip


I am having some difficulty outputting an audio signal on the OMAP-L137 EVM. While the audio output example works ok, when I adapt the program to output data that I have generated it does not appear at the output in the order in which the data was sent with SIO_issue.

Initially I noticed some discontinuities in the data that I was outputting, so I wrote a test program to try to investigate what was happening and got some very strange results. I have attached the code for the program to this post.

The idea of the test program is to output a sequence of (currently 5) square waves with increasing amplitude on one of the audio output channels (zeros are output to the other). If I make the size of the buffers passed to SIO_issue such that they contain the full pattern (ie define BUFLEN as PATTERN_LEN * 2, with the two accounting for the stereo output), this will make every buffer passed to SIO_issue contain the same data and I see the full pattern as expected at the output (well almost, it gets inverted somewhere along the line, but that is not a problem).

The problem is if I make the buffers such a size that they contain only one of the square waves (in which case each buffer passed to SIO_issue should contain different data). Now the output does not appear as expected and appears to indicate that the order of the data is mixed up and that in some cases it does not reach the output at all. In the current configuration of the attached example, the entire sequence is output in reverse order with each wave (which should appear only once per cycle) being repeated twice. Similar results occur with different configurations.

Please note that the attached example has been adapted from the audio sample application which copies audio input to audio output (and seems to work well). Some significant changes made to the program include:

  1. Removal of the entire RX side of the application.
  2. The number of buffers for the output is two instead of four. From the SIO_reclaim/SIO_issue documentation, it seems that only two should be necessary, however I have tried with four and still do not get the expected output.
  3. Smaller buffers. This makes the problem easier to catch on an oscilloscope, however the size of the buffer does not appear to matter.

Note also that I have looked at the sine wave example for the McASP driver. Each output buffer here contains a full sine wave period, so if there is any mix up there will be no difference in the output. Also this example uses DIT while the audio example is TDM and it is not clear if using the McAsp in DIT mode is even compatible with the audio driver. Also, since the audio example works, it seems logical that the buffers are confused in a predictable way that also applies to the input, and that it effectively cancels itself out in the example.

Is there some way to configure the program so that it works as expected, or at least a suitable workaround so that data can be output in the desired order?


Edit: I forgot to mention that I have also made an attempt with the standard streaming model (ie SIO_put), I will post another question with the problems that I had there. Also the following software versions were used:

DSP/BIOS 5.41.03.17

PSP drivers 01.30.01

  • Hi,

    Thanks for your post.

    I presume that SIO_reclaim is called from SWI and Is SIO_reclaim( ) returns any error when there is no buffer availability? There are also many constraints need to be met when the stream compliant to attrs.model set to SIO_ISSUERECLAIM and for more info. on this, it would be more appropriate to walk through the below E2E post which would provide you more clarity:

    http://e2e.ti.com/support/embedded/tirtos/f/355/t/270678.aspx

    Also, note that, the SIO_reclaim() function should always be called first in the tasks priority, followed by a SIO_issue() call since both input and output streams were prioritized before task execution, Kindly ensure calls to SIO issue/reclaim should be balanced and SIO_reclaim() call scheduled with high priority task being held up waiting for an SIO_issue() call in a lower priority task.

    You could also check the below E2E posts which i hope, it would be helpful in evaluating the data discontinuity issue:

    http://e2e.ti.com/support/embedded/tirtos/f/355/p/155286/605874.aspx#605874

    http://e2e.ti.com/support/embedded/tirtos/f/355/t/143549.aspx

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------