Combining two AVB/TSN boards in Mac OS

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
mx12
Member++
Posts: 19
Joined: Thu Aug 18, 2016 3:22 pm

Combining two AVB/TSN boards in Mac OS

Postby mx12 » Mon Aug 14, 2017 1:56 pm

We have followed the AN00202 (Gigabit Ethernet AVB endpoint example using I2S master) to implement a 8 channels talker AVB card. Its works fine when connected to a Mac computer.

Now, we would like to connect two devices and use them together. On Mac OS, you can aggregate audio devices. The problem: I never managed to make it work. What I get is either 8 channels ok, 8 channels muted, or 16 channels muted. No error message, nothing preventing me that something goes wrong.

Does anyone already tried that? Can anyone give me some help?
Thanks!
Vincent
User avatar
akp
XCore Addict
Posts: 203
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Thu Jan 11, 2018 3:05 pm

Hi Vincent

I have only used one board but I wonder -- did you get the AN00202 working with 96kHz sampling? Mine works at 48kHz but not at 96kHz or 192kHz whether I pull in lib_tsn 7.0.3 or 8.0.0rc1 or the github master. I believe the i2s.receive callback is not firing for 96kHz (but the i2s.send callback is) whereas at 192kHz the i2s.send callback doesn't seem to fire.

Cheers
Adam
mx12
Member++
Posts: 19
Joined: Thu Aug 18, 2016 3:22 pm

Postby mx12 » Thu Jan 11, 2018 3:15 pm

Hey Adam,
My design works with 48, 96 & 192kHz. Don't know why your code doesn't, I can imagine that your AVB_MAX_AUDIO_SAMPLE_RATE is set to 192000? How do you change the sampling frequency?
Don't know how I can help you, don't expect anything from XMOS, I never get any help from them for my problem.
User avatar
akp
XCore Addict
Posts: 203
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Thu Jan 11, 2018 3:29 pm

The AVB_MAX_AUDIO_SAMPLE_RATE is set to 192000. I change the sampling frequency by choosing the format in Audio MIDI Setup. The rate change shows up in the xscope output .. e.g. it says "SET SAMPLING RATE TO 96000" or "SET SAMPLING RATE TO 192000" or "SET SAMPLING RATE TO 48000"

I am glad yours is working as talker; that gives me hope. Can you tell me what version of the various modules you used as a baseline? At least for lib_tsn and lib_i2s. I have tried lib_i2s 2.3.0 and the github master.

I have tried both 1Gbps and 100Mbps Ethernet links with the same result. I can get audio input at 48kHz but not higher.
User avatar
akp
XCore Addict
Posts: 203
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Thu Jan 11, 2018 3:36 pm

Also if you can tell me what version of xTIME composer you are using. I suspect you didn't have to change any Makefile settings, optimizations, etc?
mx12
Member++
Posts: 19
Joined: Thu Aug 18, 2016 3:22 pm

Postby mx12 » Thu Jan 11, 2018 3:41 pm

I use lib_i2s 2.3.4 and tried lib_tsn 7.0.3 as well as 8.0.0. Can you try your code with the Multichannel Audio Platform evaluation board?
Here is my avb_conf.h file:

Code: Select all

// Copyright (c) 2016, XMOS Ltd, All rights reserved
#ifndef __avb_conf_h__
#define __avb_conf_h__

#define AVB_1722_1_ADP_VENDOR_ID 0x000B2FFFu

/******** 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 8
/** 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 8
/** Enable the 1722.1 Listener functionality */
#define AVB_1722_1_LISTENER_ENABLED 0
//#define AVB_1722_1_LISTENER_ENABLED 1


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

/** Use 61883-6 audio format for 1722 streams */
#define AVB_1722_FORMAT_61883_6 1

/** The number of components in the endpoint that will register and initialize media FIFOs
    (typically an audio interface component such as I2S). */
#define AVB_NUM_MEDIA_UNITS 1

/** The number of media clocks in the endpoint. Typically the number of clock domains, each with a
  * separate PLL and master clock. */
#define AVB_NUM_MEDIA_CLOCKS 1

/** The maximum sample rate in Hz of audio that is to be input or output */
#define AVB_MAX_AUDIO_SAMPLE_RATE 192000

/** Enable 1722 MAAP on the device, required for Talkers */
#define AVB_ENABLE_1722_MAAP 1

/******** 1722.1 parameters *****************************************************************/

/** Enable 1722.1 AVDECC on the entity */
#define AVB_ENABLE_1722_1 1
/** The entity capability flags as reported by 1722.1 ADP */
#define AVB_1722_1_ADP_ENTITY_CAPABILITIES (AVB_1722_1_ADP_ENTITY_CAPABILITIES_AEM_SUPPORTED| \
                                          AVB_1722_1_ADP_ENTITY_CAPABILITIES_CLASS_A_SUPPORTED| \
                                          AVB_1722_1_ADP_ENTITY_CAPABILITIES_GPTP_SUPPORTED| \
                                          AVB_1722_1_ADP_ENTITY_CAPABILITIES_EFU_MODE| \
                                          AVB_1722_1_ADP_ENTITY_CAPABILITIES_ADDRESS_ACCESS_SUPPORTED| \
                                          AVB_1722_1_ADP_ENTITY_CAPABILITIES_AEM_IDENTIFY_CONTROL_INDEX_VALID)

/** The model ID of the device as reported by 1722.1 ADP and AEM */
//#define AVB_1722_1_ADP_MODEL_ID 0x1234
#define AVB_1722_1_ADP_MODEL_ID 0x12FF

/** The list of AEM control descriptor IDs */
enum aem_control_indices {
    DESCRIPTOR_INDEX_CONTROL_IDENTIFY = 0,
};
/** Enable 1722.1 Entity Firmware Update functionality on the entity. */
//#define AVB_1722_1_FIRMWARE_UPGRADE_ENABLED 1
#define AVB_1722_1_FIRMWARE_UPGRADE_ENABLED 0
/** Enable 1722.1 ACMP fast connect functionality on the entity. */
#define AVB_1722_1_FAST_CONNECT_ENABLED 0
/** Enable 1722.1 Controller functionality on the entity. */
#define AVB_1722_1_CONTROLLER_ENABLED 0

/******** Flash parameters *****************************************************************/

/** The maximum size in bytes of an XCore program image */
#define FLASH_MAX_UPGRADE_IMAGE_SIZE (128 * 1024)
/** The page size of the flash used */
#define FLASH_PAGE_SIZE (256)


#endif
mx12
Member++
Posts: 19
Joined: Thu Aug 18, 2016 3:22 pm

Postby mx12 » Thu Jan 11, 2018 3:43 pm

XTIME compozer: I use versions 14.2.1 & 14.3.0. Had some crashed with compilation when modifying the code, I didn't go further and freezed the product. Can't work with all these problems.
User avatar
akp
XCore Addict
Posts: 203
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Thu Jan 11, 2018 4:20 pm

I understand. On the 8.0.0rc1 it outputs a synthesized sine tone on ch 3 & 4. I can see that in Audacity when I use Audio MIDI setup to select 48kHz, but not when I use it to select 96kHz or 192kHz. Just checking you can see it OK in that situation. I know you have it frozen so I can't expect you to help me much, as this isn't even your problem you want to solve.

If all you need is 16 (or even 32) ch at 48kHz I would use the TDM demo if you can, then you don't need to aggregate the channels. But maybe the analog ins are too far apart to do that.

Edit: I am using the multichannel audio platform xCORE-200 MC AUDIO 2V0
Last edited by akp on Thu Jan 11, 2018 4:35 pm, edited 1 time in total.
User avatar
akp
XCore Addict
Posts: 203
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Thu Jan 11, 2018 4:25 pm

Oh, and what version of macOS are you using?
mx12
Member++
Posts: 19
Joined: Thu Aug 18, 2016 3:22 pm

Postby mx12 » Thu Jan 11, 2018 4:35 pm

I removed the code that generates a sone tone. Aggregate devices in Mac OS is mandatory for me, as we are manufacturing mic preamps, so the idea is to provide a way to stack multiple products to increase channel count. I've tested about recent all Mac OS versions, without any success. Sorry, I don't have time to give you a full answer right now, I'm working on another project.

Who is online

Users browsing this forum: No registered users and 3 guests