Anyone using chinese xmos under linux

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
One whole weekend and I guess my linux knowledge has improved a little but I still can not get my weiliang 10pin xmos daughterboard to work under linux. It is the new U8 version of the board.

it is recoqnised as a USB device and now aplay will list it as a sound device but it still will not play. I'm using alsa 1.0.27 and am wandering if I need a newer version of alsa?

Its a longshot but I hoped someone on my favourite forum may shine some light on it.

It cause alsamixer to crash with an unknown protocol error and the device is listed as 201b:000a - I know that 201b is the the Xmos manufacturer number but 000a may be the issue?

Stu
 
First I would try the latest official alsa version - in the brand new 4.1 kernel.

What is the error message exactly?

Please post lsusb -v of your usb device (the -v param gives important details).

Most likely we will end up posting a questing to alsa-devel mailing list where alsa developers communicate Mailing-lists - AlsaProject

Perhaps you may want to register to the mailing list and post your question directly. Please include the outputs of lsusb -v as well as output of script alsa-info.sh https://wiki.ubuntu.com/Audio/AlsaInfo .
 
Thanks for the reply phofman, am out of my depth here!

usb - v

Bus 003 Device 006: ID 20b1:000a XMOS Ltd
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x20b1 XMOS Ltd
idProduct 0x000a
bcdDevice 6.40
iManufacturer 1
iProduct 3
iSerial 0
bNumConfigurations 2
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 231
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 0mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 0
bFunctionProtocol 32
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 32
iInterface 3
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 2.00
bCategory 8
wTotalLength 72
bmControl 0x00
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 10 (CLOCK_SOURCE)
bClockID 41
bmAttributes 0x03 Internal programmable Clock
bmControls 0x07
Clock Frequency Control (read/write)
Clock Validity Control (read-only)
bAssocTerminal 0
iClockSource 14
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 11 (CLOCK_SELECTOR)
bUnitID 40
bNrInPins 1
baCSourceID( 0) 41
bmControls 0x03
Clock Selector Control (read/write)
iClockSelector 13
AudioControl Interface Descriptor:
bLength 17
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 2
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bCSourceID 40
bNrChannels 2
bmChannelConfig 0x00000000
bmControls 0x0000
iChannelNames 16
iTerminal 6
AudioControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 10
bSourceID 2
bmaControls( 0) 0x0000000f
Mute Control (read/write)
Volume Control (read/write)
bmaControls( 1) 0x0000000f
Mute Control (read/write)
Volume Control (read/write)
bmaControls( 2) 0x0000000f
Mute Control (read/write)
Volume Control (read/write)
iFeature 0
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 20
wTerminalType 0x0301 Speaker
bAssocTerminal 0
bSourceID 10
bCSourceID 40
bmControls 0x0000
iTerminal 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 4
AudioStreaming Interface Descriptor:
bLength 16
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 2
bmControls 0x00
bFormatType 1
bmFormats 0x00000001
PCM
bNrChannels 2
bmChannelConfig 0x00000000
iChannelNames 16
AudioStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bSubslotSize 4
bBitResolution 24
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0188 1x 392 bytes
bInterval 1
AudioControl Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bmControls 0x00
bLockDelayUnits 2 Decoded PCM samples
wLockDelay 8
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 17
Transfer Type Isochronous
Synch Type None
Usage Type Feedback
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 4
AudioStreaming Interface Descriptor:
bLength 16
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 2
bmControls 0x00
bFormatType 1
bmFormats 0x80000000
bNrChannels 2
bmChannelConfig 0x00000000
iChannelNames 16
AudioStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bSubslotSize 4
bBitResolution 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0188 1x 392 bytes
bInterval 1
AudioControl Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bmControls 0x00
bLockDelayUnits 2 Decoded PCM samples
wLockDelay 8
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 17
Transfer Type Isochronous
Synch Type None
Usage Type Feedback
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 254 Application Specific Interface
bInterfaceSubClass 1 Device Firmware Update
bInterfaceProtocol 1
iInterface 15
Device Firmware Upgrade Interface Descriptor:
bLength 9
bDescriptorType 33
bmAttributes 7
Will Not Detach
Manifestation Tolerant
Upload Supported
Download Supported
wDetachTimeout 250 milliseconds
wTransferSize 64 bytes
bcdDFUVersion 1.10
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 231
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 0mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 0
bFunctionProtocol 32
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 32
iInterface 3
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 2.00
bCategory 8
wTotalLength 72
bmControl 0x00
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 10 (CLOCK_SOURCE)
bClockID 41
bmAttributes 0x03 Internal programmable Clock
bmControls 0x07
Clock Frequency Control (read/write)
Clock Validity Control (read-only)
bAssocTerminal 0
iClockSource 14
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 11 (CLOCK_SELECTOR)
bUnitID 40
bNrInPins 1
baCSourceID( 0) 41
bmControls 0x03
Clock Selector Control (read/write)
iClockSelector 13
AudioControl Interface Descriptor:
bLength 17
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 2
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bCSourceID 40
bNrChannels 2
bmChannelConfig 0x00000000
bmControls 0x0000
iChannelNames 16
iTerminal 6
AudioControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 10
bSourceID 2
bmaControls( 0) 0x0000000f
Mute Control (read/write)
Volume Control (read/write)
bmaControls( 1) 0x0000000f
Mute Control (read/write)
Volume Control (read/write)
bmaControls( 2) 0x0000000f
Mute Control (read/write)
Volume Control (read/write)
iFeature 0
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 20
wTerminalType 0x0301 Speaker
bAssocTerminal 0
bSourceID 10
bCSourceID 40
bmControls 0x0000
iTerminal 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 4
AudioStreaming Interface Descriptor:
bLength 16
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 2
bmControls 0x00
bFormatType 1
bmFormats 0x00000001
PCM
bNrChannels 2
bmChannelConfig 0x00000000
iChannelNames 16
AudioStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bSubslotSize 4
bBitResolution 24
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0188 1x 392 bytes
bInterval 1
AudioControl Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bmControls 0x00
bLockDelayUnits 2 Decoded PCM samples
wLockDelay 8
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 17
Transfer Type Isochronous
Synch Type None
Usage Type Feedback
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 4
AudioStreaming Interface Descriptor:
bLength 16
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 2
bmControls 0x00
bFormatType 1
bmFormats 0x80000000
bNrChannels 2
bmChannelConfig 0x00000000
iChannelNames 16
AudioStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bSubslotSize 4
bBitResolution 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0188 1x 392 bytes
bInterval 1
AudioControl Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bmControls 0x00
bLockDelayUnits 2 Decoded PCM samples
wLockDelay 8
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 17
Transfer Type Isochronous
Synch Type None
Usage Type Feedback
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 254 Application Specific Interface
bInterfaceSubClass 1 Device Firmware Update
bInterfaceProtocol 1
iInterface 15
Device Firmware Upgrade Interface Descriptor:
bLength 9
bDescriptorType 33
bmAttributes 7
Will Not Detach
Manifestation Tolerant
Upload Supported
Download Supported
wDetachTimeout 250 milliseconds
wTransferSize 64 bytes
bcdDFUVersion 1.10

........................................................................................................

And my Alsa script info:

http://www.alsa-project.org/db/?f=435d397f03c247d58c71cf2fd56953dd293d87e2

stu
 
and the error msg:

stu@Server:~$ sudo aplay -D plughw:0,0 /media/Disk2/Rehab.wav
[sudo] password for stu:
Playing WAVE '/media/Disk2/Rehab.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
aplay: set_params:1297: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: 125000
PERIOD_SIZE: 6000
PERIOD_BYTES: 24000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 24000
BUFFER_BYTES: 96000
TICK_TIME: 0
 
Thanks again phofman, I've subscribed to the mailing list at alsa as you suggested. I may try to update Kernel when I get home tonight so when I email alsa I have the latest kernel.

Still unsure about the update process, I currently run ubuntu server 14.04.2 I will google it tonight.

Also, if all else fails I may buy a better USB I2s. The chinese supplier never said this new xmos board was UAC compliant. It works with Windows Theyscon drivers and other users have reported it working under Mac which is why I bought it.

Stu
 
Hi Phofman,

Better and worse - feeling pleased that I'm learning and I'm now running 4.1 kernel

But now if I run alsa force-reload it says there is no program called alsa

This is annoying because I was able to use this command to load my xmos card into snd-usb-audio

Now aplay -l does not list the xmos card which is a slight step back

I have a feeling that the new kernal coupled with alsa 1.0.29 knows that the xmos card is unsupported and will not attempt to load it as part of the module?

I only installed alsa-lib 1,0,29 and alsa-utils 1.0.29

Do i need any of the other alsa packages?

stu
 
Update: the card is listed under aplay -L again but I'm getting the same error msgs as before. I have posted my lsusb - v and alsainfo script result to the mailing list that phofman pointed me to.

Althought they have sent me an email saying that my message was too big and is now awaiting approval by a moderator,

thanks for your help, I guess I will wait to see what they say.If the card will not work then that is fine, at least I will know and will start looking at alternative ways to get i2s to my ak4399 dac 9

n.b. i broke the spdif caox input but the xmos card works in windows so I'm guessing this will not have an effect on whether this card works under linux

stu
 
I do not see how a kernel upgrade could change your user-space utils (/sbin/alsa). Perhaps you upgraded the alsa-xxx packages too. But anyways, it does not matter.

Your USB Dac should be loaded automatically when hooked to USB port - the xmos support (usb audio v. 2) is part of the snd-usb-audio module.

IMO the usb audio protocol implemented in your xmos slightly deviates from the stock implementation and the linux driver does not like it. Perhaps unlike the windows driver.

I am sure the guys at alsa-devel mailing list will help you.

If the message is too large, just upload the txt dumps to any public sharing website.
 
Thanks Phofman, I received a response from the mailing list:

it looks like Alsa is having trouble retrieving mixer control information from the device,
or a quirk is missing, or something like that.


Recent kernels have a new usb_audio_dbg() feature that dynamically enable printing of debug information for usb audio.
If you kernel was compiled with DEBUG, this information should be logged in messages or kern.log

Otherwise you need to recompile with this option or with DYNAMIC_DEBUG option,
and then activate debug traces for the mixer using the command:
echo "file mixer.c" > /sys/kernel/debug/dynamic_debug/control

Activating traces for any file located under "sound/usb/" could also be useful.


Then, plug your card, try to aplay and amixer, and let us know what comes out.




I've never read a log file but I will be trying this evening, should I simply type:

sudo tail /var/log/messages

after plugging in my usb card?

not sure about the kern.log

this is a steep learning curve for me, any pointers as to how I should reply to above msg would be great,

Stu
 
Member
Joined 2011
Paid Member
I really respect your willingness to pursue the problem and I have 100% confidence in phofman's ability to provide direction.

If you do decide to opt for another USB-to-I2S solution (as you mentioned in post #6 as an option) I can recommend the CM6631A-based cards commonly available, such as the one from LJM CM6631A 24bit 192kHz USB TO Coaxial AND Optical Fiber Spdif AND I2S BY LJM NEW | eBay

It works with no issue in Linux, supports up to 24/192, and the I2S header works by default.
 
I received a response from the mailing list...

Prefect, you are doing a great job. I read your response with the kern.log output. Perhaps this info will suffice for the troubleshooting.

If not, you will have to rebuild the latest kernel (4.1) with the debug enabled.

I would suggest to follow this tutorial Virtual World: How to customize and build Ubuntu server 12.04 LTS kernel . It is not complicated, just takes a bit of time and space on disc.

In the "make menuconfig" step, check the dynamic debug option. It should be in the Kernel hacking section.

We will see how the discussion in alsa-user mailing list develops. I would suggest using the alsa-devel list, but perhaps the less development-oriented alsa-user one will suffice.
 
Thanks for all the advice, and sorry to let you down but I've given up. Have bought an amanero USB to i2s now. The xmos card is for sale. I have a little girl and another on the way, a hectic job and this consumed too much of my time last weekend and late nights this week. The Alsa guys were very helpful but without the device for them to try I would have had to delve into driver code in windows and linux to compare the two. This may have taken me weeks!

Stu
 
To continue this thread, I have the same problem (more or less).

I have a Xmos U8-ak4490 DAC and I can't make it work in Mageia 5 Linux - Kernel 3.19.3.(I don't have a /proc/bus/usb directory and consequently no USBFS support? see here http://www.xcore.com/questions/1973/how-enable-usb-drivers-linux-development-tools). In WINXP it works fine.

I am not in front of the pc right now, but i will also try to see what several logs say (like above).

Ps. Xmos sent me the Linux FTDI Library (a dll win file), but there is no advise how to use it, only this:

> Thank you for contacting XMOS support.
>
> Please find attached the patched binary for allowing FTDI devices to work with linux kernel versions 2.6.32 and onwards.
>
> To install, copy the attached binary "xftd2xx.dll" into the lib directory of the tools installation.
>
> For instructions on how to setup permissions correctly for the device please see http://www.xcore.com/questions/1973/how-enable-usb-drivers-linux-development-tools
>
> Please contact us if you have any further issues.
 
Last edited:
I followed these steps:

1.Create a file /etc/udev/rules.d/99-xmos.rules with the following contents:

SUBSYSTEM!="usb|usb_device", GOTO="xmos_rules_end"
ACTION!="add", GOTO="xmos_rules_end"

# 20b1:f7d1 for xmos xtag2
ATTRS{idVendor}=="20b1", ATTRS{idProduct}=="f7d1", MODE="0666", SYMLINK+="xtag2-%n"

# 0403:6010 for XC-1 with FTDI dual-uart chip
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666", SYMLINK+="xc1-%n"

LABEL="xmos_rules_end"

2. service udev reload (doesn't work. Got into MCC and restart all services named *udev*)
3. Unplug and re-plug the USB cable (or restart, I don't remember).
And
4. In MCC untick pulse audio in sound configuration, in order to use alsa.
5. Open gnome-alsamixer and increase the volume on usb audio.
6. Opened my music file with Deadbeef (or whatever you like) and route the sound through alsa and Xmos device.

Instead of 2&3 steps, you can restart the system. This maybe needed several times, without the xmos device connected, but after stopping pulse audio.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.