Page 1 of 2

USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Thu Apr 19, 2012 4:59 pm
by pdeoliveira
Hello,
I've a problem trying to run an USB Audio 2.0 MC Reference Design with Linux (Ubuntu 11.10).
When I connected it to the computer I've got the following error in dmesg :

[ 112.313730] usbaudio: unit 51: unexpected type 0x09
[ 112.313775] snd-usb-audio: probe of 1-5:1.0 failed with error -5
[ 112.314472] usbcore: registered new interface driver snd-usb-audio

The device is seen in lsusb :
Bus 001 Device 011: ID 20b1:f7d1 XMOS Ltd XTAG2 - JTAG Adapter
Bus 001 Device 012: ID 20b1:0004 XMOS Ltd

but I can't get it working with alsa tools (aplay, etc).

I've tried to look into the "USB-Audio-2.0-XS1-L2-Software-Release(5.3)[11.2.0]" code but it's rather complex !!!!
Is there someone to have some experience of this hardware with Linux ?
Thanks in advance,

Pascal

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Fri Apr 20, 2012 11:37 am
by Ross
Im wondering if the driver is having issues enumerating the rather complex descriptor set.

I would try setting MAX_MIX_COUNT to 0. From memory this should remove the mixer descriptors.

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Fri Apr 20, 2012 5:08 pm
by pdeoliveira
Thank you for your help, Ross.
I've tried your fix but I still get the error.
So I put back the old value ("8").
Looking into the code, I've found the subtype 9 (extension unit) is used for the mixer. So I "undef" MIXER in customdefines.h and now, it works (still get some warnings in dmesg (ie: "cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4") but they seem to be harmless).
I think the ALSA driver is not able to handle the EXTENSION_UNIT subtype.

I'll continue my investigations, but any help is welcome ;-)

Pascal

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Mon Apr 23, 2012 3:07 pm
by spaceharfang
We pretty much came to the same conclusion.

Once the hardware mixer is disabled, the alsa driver works just fine.
We have seen no adverse effects on Mac and Windows as well.

I did some digging and it seems that particular extension is not supported at this point.

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Tue Apr 24, 2012 11:20 am
by Ross
Thanks, this is good to know.

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Sun Apr 29, 2012 10:38 am
by pdeoliveira
Some news ...
I confirm that the current version of the ALSA driver doesn't support the UAC2_EXTENSION_UNIT_V2 value for interface descriptor.
What I've done : 1/ I use the standard XMOS firmware 2/. I updated the alsa source (simple modification of mixer.c) and recompiled it. Now, I get some warnings when I plug the xmos device (ie: "ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4") but it works !

Next: understand what the extension unit is used for and how to update ALSA driver to make it compatible.

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Wed Aug 29, 2012 11:11 pm
by langalang
Hi Pascal,

Are you able to provide the changes you made to mixer.c to get the development board running with the alsa drivers?

Thanks,

Michael

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Sat Oct 13, 2012 10:21 pm
by feniksa
A few notes:
1. Alsa driver fail to init, because XMOS board doesn't support "resume from suspend" device. I commented a few init steps in alsa driver
2. In XMOS board names of mixer are absolutly wrong and alsa will not init mixer names -> pulseaudio unable to init board.
3. Alsa doesn't support "min/max ranges" for ctl... I don't know how to fix it yet :-(

I am still working with xmos and alsa to provide fully supported xmos audio board under linux :-) If someone interesting i will provide modified source :)

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Sun Jan 06, 2013 4:34 pm
by faxtrode
Hello! Can you help me? I have got the sound device that uses on the board Xmos chip. The device is connected to the pc that running Linux. I use ALSA as the sound subsystem in my OS. The device is detected and subscribed in the OS, but i can`t admine it in either alsamixer or any other sound apllication. When I try to choose it[sound card] in alsa mixer I get the error: "Protocol error". Sometimes I get kernel panic.(kernel 3.6.10/3.7.1) It seems there is no support for this sound chip in the ALSA system, can you help me how can I enable it, may be someone who did it before can share the modificated source code with me?(I use ALSA 1.0.25 from the source)

Re: USB Audio 2.0 MC Reference Design and Linux (Ubuntu)

Posted: Wed Oct 23, 2013 8:11 am
by feniksa
faxtrode wrote:Hello! Can you help me? I have got the sound device that uses on the board Xmos chip. The device is connected to the pc that running Linux. I use ALSA as the sound subsystem in my OS. The device is detected and subscribed in the OS, but i can`t admine it in either alsamixer or any other sound apllication. When I try to choose it[sound card] in alsa mixer I get the error: "Protocol error". Sometimes I get kernel panic.(kernel 3.6.10/3.7.1) It seems there is no support for this sound chip in the ALSA system, can you help me how can I enable it, may be someone who did it before can share the modificated source code with me?(I use ALSA 1.0.25 from the source)
Hehe, welcome to linux. But unfortunately you will not get working this board under linux.
Linux driver snd_usb_audio not fully implemented Usb Audio 2.0 specification (still, kernel 3.11.2-gentoo):
1. Linux doesn't implemented RANGE mixer values
2. Some problem with mixer names.

And other stuff. Only 2 solution:
1. Ignore USB audio 2.0 specification and write your own Linux driver + modification for XMOS firmware
2. Finish implementation of usb audio 2.0 specification for linux driver

I moved in 2 way, but i haven't enough time to finish this work.