Separate 4 channels one by one issue

New to XMOS and XCore? Get started here.
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

should I use 13 to work latest packages?
Yes - 6.3.0 is only tested under 13 and as you have seen, may not even build..
usb_device module source code has something wrong. As I know xc does not support pointers. But here is something ::::
Pointers are now supported! However, due to have concurrent tasks sharing the same physical memory space, there are some restrictions to enforce safety. There are extension to handle these cases (such as moving pointers between cores, which is handy for buffers) and you can even go fully unchecked using unsafe pointers (but beware if you do!).

More on that here - search for pointers https://www.xmos.com/download/public/XM ... on)(B).pdf


Bayanaa
Active Member
Posts: 33
Joined: Fri Feb 07, 2014 3:03 pm

Post by Bayanaa »

Now I am using : xtimecomposer 13.
tsusbaudio driver 2.3
ref design v6.5.0
and wanted to apply dsp that you uploaded previous discussion.
However You said that you tested it on MFA.
In my case I am using DJ Kit. Still cannot record. IF you mind please test it on dj kit and give a feedback.
in xp_skc_su1.xn why the end of the line is changed? for specific reason?

<Device NodeId="0" Core="0" Class="SPIFlash" Name="bootFlash" Type="M25P40">
in previous version it was M25P10

Thank you.
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

Hi, tried it on the DJ kit (using ref design version 6.6.0 and tools 13.1) and it works!

I notice that the Makefile wasn't right - it was setup for output but no input. So I changed it to this:

# Audio Class 2, Input, Output, No MIDI, No SPDIF
XCC_FLAGS_2ioxx = $(BUILD_FLAGS) -DSPDIF=0 -DNUM_USB_CHAN_OUT=2 -DI2S_CHANS_DAC=2 -DNUM_USB_CHAN_IN=2 -DI2S_CHANS_ADC=2


The change in XN file was to put the correct FLASH in - looks like 25P10 was wrong before..This won't affect building and running code, only DFU.
Bayanaa
Active Member
Posts: 33
Joined: Fri Feb 07, 2014 3:03 pm

Post by Bayanaa »

# Audio Class 2, Input, Output, No MIDI, No SPDIF
XCC_FLAGS_2ioxx = $(BUILD_FLAGS) -DSPDIF=0 -DNUM_USB_CHAN_OUT=2 -DI2S_CHANS_DAC=2 -DNUM_USB_CHAN_IN=2 -DI2S_CHANS_ADC=2

above definitions are different from where you defined in customdefines.h?

#ifndef NUM_USB_CHAN_IN
#define NUM_USB_CHAN_IN (4) /* Device to Host */
#endif
#ifndef NUM_USB_CHAN_OUT
#define NUM_USB_CHAN_OUT (4) /* Host to Device */
#endif

...
I followed your instructions.
But still cannot return audio signals. How did you check the output with dsp?
I used matlab to record from dj kit.


another question:
In dsp.xc Line 131 and 132 outuint(c_dsp2audio, inuint(c_host)); is twice. Is it right or any other reason?
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

above definitions are different from where you defined in customdefines.h?
>> Yes - I used stereo in/out. The other difference is I passed the defines in from teh makefile rather than from the include file using -Dxxx. Don't forget you need to set the number of DAC channels as well as channels out. Same for ADC channels vs channels in. I didn't try it with 4ch in/out. The timing of my test code may not work for that case because you are doing double the DSP and more channel comms. So you would need to check that.


But still cannot return audio signals. How did you check the output with dsp?
>>>Audacity

I used matlab to record from dj kit.


In dsp.xc Line 131 and 132 outuint(c_dsp2audio, inuint(c_host)); is twice. Is it right or any other reason?
>>>It is correct. That part of the protocol passes through two ints to audio
Bayanaa
Active Member
Posts: 33
Joined: Fri Feb 07, 2014 3:03 pm

Post by Bayanaa »

Audacity records only two channel I as know. Last time I used it.


# Audio Class 2, Input, Output, No MIDI, No SPDIF
XCC_FLAGS_2ioxx = $(BUILD_FLAGS) -DSPDIF=0 -DNUM_USB_CHAN_IN=4 -DNUM_USB_CHAN_OUT=4 -DI2S_CHANS_ADC=4 -DI2S_CHANS_DAC=4
INCLUDE_ONLY_IN_2ioxx =

is defined in Makefile for my project.
But does not record!
even I used like so: (But you tested with 2 channels and said worked!) and does not make sense.
XCC_FLAGS_2ioxx = $(BUILD_FLAGS) -DSPDIF=0 -DMIDI=0 -DNUM_USB_CHAN_IN=2 -DNUM_USB_CHAN_OUT=2 -DI2S_CHANS_ADC=2 -DI2S_CHANS_DAC=2

Did you change other things?

Should I enable (#define SU1_ADC_ENABLE 1) ?

What do you mean >>The timing of my test code may not work for that case?
Can you upload the source code that worked for you?
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

Audacity records only two channel I as know. Last time I used it.
>>>I have managed to record/playback 8 channels OK using audacity. I use OSX maveriks, not sure it that makes any difference.

# Audio Class 2, Input, Output, No MIDI, No SPDIF
XCC_FLAGS_2ioxx = $(BUILD_FLAGS) -DSPDIF=0 -DNUM_USB_CHAN_IN=4 -DNUM_USB_CHAN_OUT=4 -DI2S_CHANS_ADC=4 -DI2S_CHANS_DAC=4
INCLUDE_ONLY_IN_2ioxx =

is defined in Makefile for my project.
But does not record!
>>>But does it playback? Does it enumerate even? It would help to know if it is completely broken or whether just input is not working.

even I used like so: (But you tested with 2 channels and said worked!) and does not make sense.
XCC_FLAGS_2ioxx = $(BUILD_FLAGS) -DSPDIF=0 -DMIDI=0 -DNUM_USB_CHAN_IN=2 -DNUM_USB_CHAN_OUT=2 -DI2S_CHANS_ADC=2 -DI2S_CHANS_DAC=2

Did you change other things?
>>>Nope - the rest is stock 6.6.0 ref design.

Should I enable (#define SU1_ADC_ENABLE 1) ?
>>> Only if you want to enable the 12b integrated ADC inside the U8A. It has nothing to do with the audio path

What do you mean >>The timing of my test code may not work for that case?
>>>If you increase channel count, you increase the amount of channel communications and DSP workload per sample (comms overhead), so you need to calculate how much time you have in between samples and make sure your code fits within that time period. That's true for any realtime DSP though..

Can you upload the source code that worked for you?
>>>I can't publicly because our source is licensed to specific users. If you like you can send me a pm and I will send you a link to a dropbox. It'll be a zipped up 6.6.0 ref design release with the changes applied that I mentioned in this thread. Like I said, it all seems to work fine so probably a simple mistake somewhere along the way!
Bayanaa
Active Member
Posts: 33
Joined: Fri Feb 07, 2014 3:03 pm

Post by Bayanaa »

I built the probject. archive.zip
Recording setup is on figure below. It is signal playing on windows, I record it by dj kit.
p1.png
p1.png (22.82 KiB) Viewed 6675 times
p1.png
p1.png (22.82 KiB) Viewed 6675 times
If I dont use dsp it records OK. See below.
p2.png
p2.png (10.98 KiB) Viewed 6672 times
p2.png
p2.png (10.98 KiB) Viewed 6672 times
However, after adding dsp it does not record and playback, See below
p3.png
p3.png (9.92 KiB) Viewed 6671 times
p3.png
p3.png (9.92 KiB) Viewed 6671 times
It is the problem...
Post Reply