AVB: AN00111 won't stream by default

If you have a simple question and just want an answer.
cgunther
New User
Posts: 3
Joined: Fri Aug 14, 2015 3:28 am

AVB: AN00111 won't stream by default

Post by cgunther »

Application Note 00111 "Optimizing start-up time in AVB endpoints" contains a set of files you install over the top of the AVB Endpoint Software, version 6.1.1.

Here's the problem I am encountering: when I build the version 6.1.1 software and install it on my XK-AVB-LC-SYS kit I am able to stream audio as well as the three additional sine waves. After applying AN00111 the Listener no longer plays audio.

First, here are a couple of bugs I found in the AN00111 source code:
  1. avb_1722_1.xc, line 128 uses "#ifdef DISABLE_MAP", which should be "#if DISABLE_MAP" because DISABLE_MAP can be set to 0 or 1. This one is not a big deal, but it is inconsistent.
  2. main.xc, line 326 used "#ifdef STATIC_STREAM_CONFIG" instead of "#if STATIC_STREAM_CONFIG". This one causes a compile error if STATIC_STREAM_CONFIG is set to 0.
Now, onto the software behavior. Note that I have LC_BOARD_0_MAC_ADDR_LAST_OCTET set to my gPTP slave board. When I look at wireshark traces I see the gPTP master sending syncs, followups, and pdelays; the slave only sends pdelays; which is all as expected.
 
There are two ways I can get audio streaming again (after fixing the above #ifdef's):
  1. set FAST_STARTUP to 0, which basically turns AN00111 off,
  2. set FAST_STARTUP to 1; then set STATIC_STREAM_CONFIG and STATIC_PTP_ROLES to 0. Setting either of these STATIC_* to 1 stops the audio from playing (although Wireshark shows the talker is still streaming).
Anyone using AN00111 and have audio streaming? Any hints to get this going?

 
User avatar
Thomas
Experienced Member
Posts: 66
Joined: Fri Feb 05, 2010 12:34 pm

Post by Thomas »

 

I debugged this and found a genuine problem with the source-code.
The PTP Master Address and Stream IDs have to be static to save time.
The problem is that the static settings were not made configurable to match the MAC address of other Boards.

The following files have to be updated to fix the issue:
- startup_timme_customisations.h

add these #defines and change them to match the mac addresses of your boards!
#define LC_BOARD_0_MAC_ADDR_OCTET_4 0x5
// last two octets of Mac address of the other board
#define LC_BOARD_1_MAC_ADDR_LAST_OCTET 0xa
#define LC_BOARD_1_MAC_ADDR_OCTET_4 0x5

- gptp.xc  
change
master_port_id.data[7] = 0xEB;
to
master_port_id.data[7] = LC_BOARD_1_MAC_ADDR_OCTET_5;

- main.xc:
change two occurences of 0x04EA0000 to
(LC_BOARD_0_MAC_ADDR_OCTET_4 << 24) | (LC_BOARD_0_MAC_ADDR_LAST_OCTET << 16) | 0x0000;

change two occurences of 0x04EB0000 to
(LC_BOARD_1_MAC_ADDR_OCTET_4 << 24) | (LC_BOARD_1_MAC_ADDR_LAST_OCTET << 16) | 0x0000


Note: This will only work if the first 4 octets (0..3) of the Mac addresses are the same 
The message trace from the endpoints will print the Mac Addresses.
In my case: 
[118263] Endpoint mac_addr: 0:22:97:4:5:9
and
[119223] Endpoint mac_addr: 0:22:97:4:5:A

For more information on activating the realtime message trace, See Chapter 6.1.5 Using the Command Line Tools in the "AVB Endpoint Design Guide"

I also implemented in SW the disabling of the PHY auto negotiation.
That saves the HW mods on the MODE signals of the PHY. The additional time this takes should be insignificant.
To disable the PHY auto negotiation in SW, make this change in avb_ethernet.xc
add: 
#include "startup_time_customisations.h"

change
eth_phy_config(1, ports.smi);
to:
#if FAST_STARTUP
eth_phy_config_noauto(1, ports.smi);
#else
eth_phy_config(1, ports.smi);
#endif

But there is another HW Mod which is important:
Reduce delay between 3v3 and 1v0 and Reset Delay
Procedure: Remove caps C73 and C74 to change default delay to the minimum 20ms. Saving: Around 600ms

Best Regards, /T