Page 1 of 1

Altered samples received in xCORE-200 Multichannel Audio platform

Posted: Mon Jan 25, 2021 11:30 am
by mastandres
Good morning everyone!

I am developing an audio application using the XCORE-200 Multichannel Audio Platform and currently I am targeting macOS as system and accessing the XCORE Audio Card using Apple's native API.
I have correctly set up the playback from my macOS App, setting the following Audio properties:
- 10 channels
- 44100Hz sample rate
- PCM, Signed Integer, 32 bytes per samples non interleaved
Whereas, the XMOS audio configuration is the following:
- 10 in/out USB channels
- MIDI, SPDIF disabled
In fact, I get no problems rendering audio via the 8-ch ADC on board.

What I am trying to do is to be able to detect arbitrary crafted audio samples from host application.
If I craft an audio packet containing a word like 0x11223344, on the XMOS firmware I receive 0x11223340. Or if I send 0xAABBCCFF, I receive on the XMOS 0xaabbcd00.
I don't actually understand why this happens and why I have this shift between sent and received value, I am sure I am missing something.
I ensured that the volume is at maximum level (I even set OUTPUT_VOLUME_CONTROL to 0), so shifts shall not be regarded to system volume and anyway the difference from sent and received samples is not constant.
The constant part seems to be the two most significant bytes of the word I send.

This is the code I am using to print sample value that I am using in xmos audio.xc source file:
```
int sampleRValue = (int)(samplesOut[frameCount+9]);
if (sampleRValue != 0)
printf("Sample is %x.\n", sampleRValue);
```
As you can see I am hooking up channel #9.

Can you please help me understanding what I am doing wrong or missing?
Thank you so much.

Re: Altered samples received in xCORE-200 Multichannel Audio platform

Posted: Mon Jan 25, 2021 8:51 pm
by akp
I wonder if Core Audio isn't bit perfect (will Steve Jobs strike me down if the blasphemy is spake thus?) If Core Audio's got a 32 bit floating point conversion in it somewhere along the line then you'd only get 24 bit/sample effective resolution.

Re: Altered samples received in xCORE-200 Multichannel Audio platform

Posted: Fri Jan 29, 2021 8:32 am
by fabriceo
agree, thats why players like Audivana use an "integer mode" somehow bypassing core audio at the latest stage

Re: Altered samples received in xCORE-200 Multichannel Audio platform

Posted: Sat Nov 26, 2022 6:20 pm
by Ross
Seems like you have some sample rate conversion occurring in the host.