xcore / sw_avb

AVB Software stack

Home Page:http://github.xcore.com/sw_avb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xmos Daisy Chain topology

baynaa7 opened this issue · comments

I am connecting two daisy chain board each other without avb switch. One board is connected to linux machine (in which openavb is running).
I have two audio slice each connected to DC boards.
I want to record from 8 audio channels in which 4 channels per daisy chain board.
I want the setup like:
two DC as talkers and PC as listener.
But recorded signal does no look right form. I recorded simple 1khz sine wave.
I modified:
line 39: #define AVB_NUM_SOURCES 2
line 61: #define AVB_NUM_SINKS 2
in xmos source code.

xmos console output is as following:
PTP Port 0 Role: Master
PTP Port 1 Role: Master
Setting clock source: INPUT_STREAM_DERIVED
MAAP reserved Talker stream #0 address: 91:E0:F0:0:A0:56
MAAP reserved Talker stream #1 address: 91:E0:F0:0:A0:57
CONNECTING Talker stream #0 (229700617C0000) -> Listener 0:22:97:FF:FE:0:61:BC
MSRP: Register stream request 229700:617C0000
Added stream:
ID: 229700617C0000
DA:91:E0:F0:0:A0:56:
max size: 128
interval: 1
Talker stream #0 ready
Added stream:
ID: 22970061BC0000
DA:91:E0:F0:0:5F:CA:
max size: 128
interval: 1
CONNECTING Listener sink #0 -> Talker stream 22970061BC0000, DA: 91:E0:F0:0:5F:CA
Listener sink #0 chan map:
0 -> 0
1 -> 1
1722 router: Enabled map for stream 22970061BC0000 (link_num:0, hash:0)
MSRP: Register attach request 229700:61BC0000
Media output 0 locked: 166 samples shorter
Media output 1 locked: 166 samples shorter
PTP Port 1 Role: Slave
PTP Port 0 Role: Master
Media output 0 lost lock
Media output 1 lost lock
Media output 0 locked: 123 samples shorter
Media output 1 locked: 122 samples shorter
PTP sync locked
CONNECTING Talker stream #0 (229700617C0000) -> Listener A0:36:9F:FF:FE:4A:52:20
Added stream:
ID: 229700617C0000
Increasing port 1 shaper bandwidth to 10880000
Setting stream 0 1722 TX port to 1
Talker stream #0 on
Decreasing port 1 shaper bandwidth to 0
Talker stream #0 off
AP: MSRP_LISTENER 617C0000:1:0:0 MRP_EVENT_RECEIVE_LEAVE_ALL: MRP_LO -> MRP_UNUSED

in
1722 router: Enabled map for stream 22970061BC0000 (link_num:0, hash:0)
MSRP: Register attach request 229700:61BC0000
Media output 0 locked: 166 samples shorter
Media output 1 locked: 166 samples shorter
PTP Port 1 Role: Slave
PTP Port 0 Role: Master
Media output 0 lost lock
Media output 1 lost lock

I traced those messages and it is in media_clock_server.xc. There is some macros including stable threshold.
What is that threshold for? and min and max range?

What is the problem?

Thank you.

As I recall your network setup is as follows:

DC#1(talker 1) <-> DC#2 (talker 2) <-> PC (listener)

and you want 1 stream from talker 1 with 4 channels to go to the PC, and you want 1 stream from talker 2 with 4 channels to go to the PC also.

At the PC you are hoping for 8 channels of audio to show up, but this is problem number 1. Each stream is separate and in separate media clock domains, so you can have eight channels at the PC, but the setup would have to look like this without some sophisticated software:

DC#1(talker 1) <-> DC#2 (talker 2) <-> PC (listener #1(stream1) & listener #2(stream2))

The above should work fine with the DC firmware, but the setup for each DC should be as below.
You do not have to receive 4 channels on DC#2 and then send them out as a source again though. The firmware already knows that the stream from DC#1 should just be passed on.

Does this make sense?

-Chris

/******** Endpoint audio and clocking parameters ************************************************/

/* Talker configuration */

/** The total number of AVB sources (streams that are to be transmitted). /
#define AVB_NUM_SOURCES 1
/
* The total number or Talker components (typically the number of

  • tasks running the avb_1722_talker function). /
    #define AVB_NUM_TALKER_UNITS 1
    /
    * The total number of media inputs (typically number of I2S input channels). /
    #define AVB_NUM_MEDIA_INPUTS 4
    /
    * Enable the 1722.1 Talker functionality */
    #define AVB_1722_1_TALKER_ENABLED 1

/* Listener configuration */

/** The total number of AVB sinks (incoming streams that can be listened to) /
#define AVB_NUM_SINKS 1
/
* The total number or listener components

  • (typically the number of tasks running the avb_1722_listener function) /
    #define AVB_NUM_LISTENER_UNITS 1
    /
    * The total number of media outputs (typically the number of I2S output channels). /
    #define AVB_NUM_MEDIA_OUTPUTS 4
    /
    * Enable the 1722.1 Listener functionality */
    #define AVB_1722_1_LISTENER_ENABLED 1

/** The maximum number of channels permitted per 1722 Talker stream /
#define AVB_MAX_CHANNELS_PER_TALKER_STREAM 4
/
* The maximum number of channels permitted per 1722 Listener stream */
#define AVB_MAX_CHANNELS_PER_LISTENER_STREAM 4

Thank you Chris.
I implemented the setup that you mentioned. But now openavb does not support (Avnu/OpenAvnu#264) that functionality, Then I implemented it too.
I have another question.
Is there any delays (time) between media clocks of different streams?

They are different streams, so they will not necessarily be any synchronization between the two talker streams.

I suspect that you need the two talkers to be synchronized.

If the stream should be synchronized, you need to take the audio from each listener (remember there are two listeners) and combine them in time. I am not really on an expert on what will be involved there, but all of the timing information should be available at the listeners to do that.

-Chris

From: pcub <notifications@github.commailto:notifications@github.com>
Reply-To: xcore/sw_avb <reply@reply.github.commailto:reply@reply.github.com>
Date: Sunday, August 16, 2015 at 9:11 PM
To: xcore/sw_avb <sw_avb@noreply.github.commailto:sw_avb@noreply.github.com>
Cc: Chris Alger <chris@xmos.commailto:chris@xmos.com>
Subject: Re: [sw_avb] Xmos Daisy Chain topology (#31)

Thank you Chris.
I implemented the setup that you mentioned. But now openavb does not support that functionality, Then I implemented it too.
I have another question.
Is there any delays (time) between media clocks of different streams?


Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-131657933.

@pcub does it make sense about synchronizing the audio data from two talkers? The listener will still have to combine them. The media clocks driving the ADCs on the XMOS DC can be synchronized to an incoming clock. I am not sure if every AVB endpoint can synchronize media clocks like this. AVB provides the capabilities with gPTP, but that does not mean that every entity will provide this capability. This is how I understand that topic.

So on a XMOS DC, to synchronize a media clock the device needs to be a listener as well as a talker. Then a device needs to be set up to provide a stream with the master clock. This can be the PC or one of the DCs. Having the PC be the media clock master makes the most sense to me, so it also needs to be send a stream to the DCs. This is not trivial and requires a separate controller to set up the streams.

I hope this makes sense. I don't believe there are any issues with the XMOS DC software to do any of this work. I am going to close this issue.

-Chris