xCore200 UAC2 Demo record only silence under Linux
Posted: Mon Nov 07, 2016 7:37 pm
Hi all,
I'm developing an USB audio interface for an embedded linux system based on quad-core Freescale cortex A9 running custom linux distribution based on Yocto with kernel 3.10.
I know that the support for UAC2 in linux has some problem as documented in this post
https://www.xcore.com/forum/viewtopic.php?f=8&t=1719
but what I see sems different.
I use a xCore200 MC Audio version2 running the supplied UAC2 project with no code modification. I customized only the makefile building the test application with the following options (I don't need any mixer or volume control and I want to avoid risk that linux don't understand mixer descriptor or badly initialize volume so I disable it at all):
-DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=8
-DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=8
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0
-DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 -DMAX_FREQ=96000
-DOUTPUT_VOLUME_CONTROL=0 -DINPUT_VOLUME_CONTROL=0 -DMIXER=0
-DHID_CONTROLS=0
I tested my system under OSX and perfectly record audio signals from 8 input channels. In the osx control panel no volume or mute control is accessible as expected.
Then I tested my system connected to my embedded linux system.
Linux correctly enumerate USB device and also ALSA seen it without any kernel suspect error or warning message.
alsamixer correctly see the device without any accessible control as expected.
arecord also see the device, so I can try to record with the following command:
arecord -D hw:CARD=x20 -f S32_LE -r 48000 -c 8 testrec.wav
!The recorded has the expected format and length but is completely filled of 0!
First though was that my linux system don't correctly handle this kind of device, so I tested a commercial product I have that is based on XMOS L2 processor and (probably) contain nothing more than the example code I'm using:
https://www.minidsp.com/products/usb-au ... sbstreamer
The surprise is that this system perfectly work!!
So I can't understand where the problem can be.
Further test done using a PC with Linux Ubuntu 14.04 and different kernel version show the same problem (interface recognized but recorded file filled with 0).
Only upgrading to the very last kernel 4.4.0-47 the system start record correctly.
I can't figure why the MiniDSP interface work on my linux box and not the xCore MC Audio v2 board (that perfectly work under OSX)!
Can some update to the USB library occurred on porting to xC200 have determined this issue compatibility with linux driver?
Many thanks, Lorenzo
I'm developing an USB audio interface for an embedded linux system based on quad-core Freescale cortex A9 running custom linux distribution based on Yocto with kernel 3.10.
I know that the support for UAC2 in linux has some problem as documented in this post
https://www.xcore.com/forum/viewtopic.php?f=8&t=1719
but what I see sems different.
I use a xCore200 MC Audio version2 running the supplied UAC2 project with no code modification. I customized only the makefile building the test application with the following options (I don't need any mixer or volume control and I want to avoid risk that linux don't understand mixer descriptor or badly initialize volume so I disable it at all):
-DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=8
-DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=8
-DMIDI=0 -DSPDIF_TX=0 -DSPDIF_RX=0
-DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 -DMAX_FREQ=96000
-DOUTPUT_VOLUME_CONTROL=0 -DINPUT_VOLUME_CONTROL=0 -DMIXER=0
-DHID_CONTROLS=0
I tested my system under OSX and perfectly record audio signals from 8 input channels. In the osx control panel no volume or mute control is accessible as expected.
Then I tested my system connected to my embedded linux system.
Linux correctly enumerate USB device and also ALSA seen it without any kernel suspect error or warning message.
alsamixer correctly see the device without any accessible control as expected.
arecord also see the device, so I can try to record with the following command:
arecord -D hw:CARD=x20 -f S32_LE -r 48000 -c 8 testrec.wav
!The recorded has the expected format and length but is completely filled of 0!
First though was that my linux system don't correctly handle this kind of device, so I tested a commercial product I have that is based on XMOS L2 processor and (probably) contain nothing more than the example code I'm using:
https://www.minidsp.com/products/usb-au ... sbstreamer
The surprise is that this system perfectly work!!
So I can't understand where the problem can be.
Further test done using a PC with Linux Ubuntu 14.04 and different kernel version show the same problem (interface recognized but recorded file filled with 0).
Only upgrading to the very last kernel 4.4.0-47 the system start record correctly.
I can't figure why the MiniDSP interface work on my linux box and not the xCore MC Audio v2 board (that perfectly work under OSX)!
Can some update to the USB library occurred on porting to xC200 have determined this issue compatibility with linux driver?
Many thanks, Lorenzo