Errors compiling DJ Kit USB Audio 2.0 code

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
millenliam
Member++
Posts: 23
Joined: Fri Feb 14, 2014 2:51 pm

Errors compiling DJ Kit USB Audio 2.0 code

Post by millenliam »

Hey

I'm trying to implement the mixer into the USB Audio 2.0 firmware v6.5 on the DJ Kit by defining MIXER in customdefines.h, however I'm getting the following compilation errors:

Code: Select all

/XMOS_DJ_Kit_Demo/module_usb_audio/endpoint0/audiorequests.xc:609: error: too few arguments to function `XUD_GetBuffer'
/XMOS_DJ_Kit_Demo/module_usb_audio/endpoint0/audiorequests.xc:647: error: too few arguments to function `XUD_GetBuffer'
/XMOS_DJ_Kit_Demo/module_usb_audio/endpoint0/audiorequests.xc:681: error: `USB_BM_REQTYPE_DIRECTION_OUT' undeclared (first use in this function)
/XMOS_DJ_Kit_Demo/module_usb_audio/endpoint0/audiorequests.xc:681: error: (Each undeclared identifier is reported only once
/XMOS_DJ_Kit_Demo/module_usb_audio/endpoint0/audiorequests.xc:681: error: for each function it appears in.)
/XMOS_DJ_Kit_Demo/module_usb_audio/endpoint0/audiorequests.xc:684: error: too few arguments to function `XUD_GetBuffer'
/XMOS_DJ_Kit_Demo/module_usb_audio/endpoint0/audiorequests.xc:743: error: too few arguments to function `XUD_GetBuffer'
/XMOS_DJ_Kit_Demo/module_usb_audio/endpoint0/audiorequests.xc:910: error: `USB_BM_REQTYPE_DIRECTION_IN' undeclared (first use in this function)
I'm using xtimecomposer 13.0.2. Everything is fine without the mixer, and I've successfully managed to compile v6.1 with the mixer using xtimecomposer 12.2.0 in the past.

A couple of general questions about the mixer:
1. Does the mixer just allow you to adjust the overall volume of all audio channels?
2. Where is the mixer in the audio chain? On the input before going to USB or afterwards on the output?

Thanks,
Liam.


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

Post by infiniteimprobability »

Where is the mixer in the audio chain? On the input before going to USB or afterwards on the output?
Mixer sits in between audio (I2S + SPDIF output) and decouple (handles one side of the audio buffer and control path). It emulates the interfaces (API) of audio/decouple so just slots in to the channel path if enabled.
Does the mixer just allow you to adjust the overall volume of all audio channels?
It does, if enabled (otherwise volume is done in decouple - look for the XXX_MIXER_XX #define guards) however mixer allows you to do a lot more than that. It's very powerful and flexible, so is reasonably complex as a result. Check section 3.9 of the design guide for the full low down. https://www.xmos.com/download/public/US ... 99D%29.pdf

BTW, I had a very quick look at this and got similar build errors. Enabling mixer is perfectly reasonable thing to do (as long as MIDI & SPDIF are disabled, otherwise you run out of cores).
My first thought is that there might be a bug since some of the XUD APIs look different.. Did you try any other versions? Which versions worked OK?
User avatar
Ross
XCore Expert
Posts: 966
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Define MAX_MIX_COUNT to 0.

The full mixer code is not supported the recent releases.
User avatar
millenliam
Member++
Posts: 23
Joined: Fri Feb 14, 2014 2:51 pm

Post by millenliam »

Thanks for the info.

Ross - what does MAX_MIX_COUNT do? What functionality of the mixer isn't supported within v6.5.0?
User avatar
Ross
XCore Expert
Posts: 966
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

We've just done quite a big update to the "USB Audio Design Guide" (PDF from here: https://www.xmos.com/support/xkits?comp ... 2&secure=1)

You should find what you need in there, if not let us know and we'll get it added ASAP :)
Unchyu2
Member++
Posts: 29
Joined: Tue Jun 17, 2014 11:40 am

Post by Unchyu2 »

Hey,
I am also getting the same errors.
What is the current status of the mixer module and what can we do to make it work (a workaround).

I am using the xCORE-USB sliceKIT with a single slot audio slice (XA-Sk-AUDIO 1V1) and v6.6.0 of the USB-Audio-2.0-Device-Reference-Design-Software
pasau
Experienced Member
Posts: 77
Joined: Fri Dec 06, 2013 7:05 pm

Post by pasau »

To me from the errors you got it looks like the mixer code is making API calls to a different version of the XMOS XUD library. This happens to me a few times when i compile a project that uses an older XUD. I think the best thing to do is correcting the errors in API calls yourself, e.g. check the function XUD_getbuffer, make some changes to the mixer code to work with the API you have.
User avatar
Ross
XCore Expert
Posts: 966
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

passau is correct, maintaining support for the mixer has dropped off recently in favour of other features. Hope to get this rectified soon..
sflower
Member
Posts: 10
Joined: Thu Feb 16, 2012 6:27 pm

Post by sflower »

Yeah, I've been through and updated the XUD calls for the lastest version - it's not too tricky. Just replace:

Code: Select all

loop = XUD_GetBuffer(ep0_out, buffer);
with:

Code: Select all

loop = XUD_GetBuffer(ep0_out, buffer, bytesWritten);
[hr]

Code: Select all

if(sp.bmRequestType.Direction == USB_BM_REQTYPE_DIRECTION_OUT)
with

Code: Select all

if(sp.bmRequestType.Direction == USB_BM_REQTYPE_DIRECTION_H2D)
[hr]

Code: Select all

if(sp.bmRequestType.Direction == USB_BM_REQTYPE_DIRECTION_IN)
with

Code: Select all

if(sp.bmRequestType.Direction == USB_BM_REQTYPE_DIRECTION_D2H)
User avatar
Ross
XCore Expert
Posts: 966
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Did you guys get his going in the end? I've made my own changes now - quite a few were required due to changes to 13 tools.