AVB loopback using i2s master

If you have a simple question and just want an answer.
Posts: 13
Joined: Mon Jan 30, 2017 11:09 am

AVB loopback using i2s master

Postby tonetechnician » Fri Jan 26, 2018 3:34 pm

Hello everyone,

I'm hoping someone has tried something similar, or has any tips for me on how to accomplish this.

I'm currently working on a project that uses a custom board with XMOS xcore-200 and a SHARC DSP processor. They pass audio to one another via the i2s pins. I need to implement TDM master in order to multiplex multiple channels onto the 2 i2s pins so to pass 32 channels to the SHARC.

Currently, I've implemented the TDM master but am unsure whether it's working properly. I want to perform a loopback from Apple Mac AVB talker back to the Mac AVB listener in order to check the driver is working. I've decided to simplify the process by first getting it to work with the i2s master since I know it is working currently because I can hear the audio.

The loopback will go as follows: Mac AVB talker stream -> XMOS -> i2s pins out -> i2s pin in -> XMOS -> Mac AVB listener stream.

I'm unsure as to where the audio buffer manager will encapsulate new samples to pass back to the AVB talker via the audio input sample buffer and it's respective interfaces.

I see that samples are pulled from the fifo using the audio_output_fifo_pull_sample function from audio_output_fifo.c within the lib_tsn but I'm unsure as to how the audio double buffer will be filled before being sent to the AVB talker.

I've tried a variety of things based off the i2s loopback examples here (https://github.com/xmos/lib_i2s/tree/ma ... pback_demo), as well as some of my own ideas of switching pins around but to no avail.
In particular, within the buffer_manager_to_i2s function in main.xc, this doesn't work.

Code: Select all

    case i2s.receive(size_t index, int32_t sample):
      unsafe {
        p_in_frame->samples[index] = sample;

    case i2s.send(size_t index) -> int32_t sample:
      unsafe {
        sample = p_in_frame->samples[index]

Would I be able to fill the double buffer in the audio buffering task, or would this need to happen elsewhere? And how do the talker streams get filled normally. I can't see exactly where that happens.

If anyone has ideas they're willing to share, I would greatly appreciate it! doesn't seem to me like it should be too hard a task.

Who is online

Users browsing this forum: No registered users and 42 guests