I am getting a problem with lib_tsn AN00203 where I occasionally get scrambled data -- actually it appears to be out-of-order -- primarily on streams 3 and 4 in the 32in/32out build. Here are the steps I used to generate the problem:
1. I started with lib_tsn-8.0.0rc1 retrieved from https://github.com/xmos/lib_tsn/tree/v8.0.0rc1
2. I changed the synthesized sine wave from channels 1&2 to synth on channel 24 (last channel of stream 3) and channel 25 (first channel of stream 4) with the following code at line 454 of main.xc of AN00203 (this is the only code change from the example):
Code: Select all
on tile[0]: [[distribute]] buffer_manager_to_tdm(i_tdm, c_audio, i_i2c[I2S_TO_I2C], c_sound_activity, 0x01800000,
i_gpio[0], i_gpio[1], i_gpio[2], i_gpio[3]);
4. Flash xCORE-200 MC Audio Board with binary
5. Connect MC audio board to MacBook running MacOS El-Capitan (10.11.6 at present). I kept the media clock at Mac System Clock (INPUT_STREAM_DERIVED) but I think the problem may show up more frequently using MC audio board LOCAL_CLOCK. The MacBook Ethernet port is set to DHCP and connects 1000baseT.
6. Start recording with Audacity. I used 25 ch recording and used display Spectrogram to easily see the spurs caused by the scrambling. If ch 24 and 25 are both clean, Cmd-Q quit audacity, cycle power on MC Audio board, and repeat test.
On my 7th attempt I got the attached result, scrambling on ch 25. If you look at the attached screen shots (one showing complete periods of the sine tone, the other zoomed in to show detail), you can see the bad samples come in every 6th sample. What it looks like to me is that the samples are actually coming in out of order (e.g. samples 6,1,2,3,4,5 rather than 1,2,3,4,5,6). That would make sense since the AVB packet rate is 8kHz so there would be 6 samples in every AVB packet.
My other tests I have done show that all channels in a stream are scrambled the same (i.e. chs 25-32 would all be scrambled identically, but not necessarily scrambled the same as the channels in the other streams).
Has anyone else experienced this problem and is there a solution for it?