AnsweredAssumed Answered

Have issues trying to get USB Audio Class version 2.0 working on iMX6SL EVK

Question asked by Xuebing Wang on Aug 11, 2014
Latest reply on Jun 22, 2015 by Sebastien Pruvost

Hi Community,

 

I have issues trying to get USB Audio Class version 2.0 working on iMX6SL EVK.

 

My environment is:

-- Hardware: iMX6SL EVK, connect EVK OTG port to Ubuntu 12.04 LTS USB Host

-- Software: Freescale's 3.10.17-1.0.0 Yocto BSP (branch imx-3.10.17-1.0.0_ga)

   -- repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-3.10.17-1.0.0_ga

-- How I build:

   -- Enable CONFIG_USB_AUDIO in "arch/arm/configs/imx_v7_defconfig"

   -- export MACHINE=imx6slevk; source setup-environment build

   -- bitbake fsl-image-test

-- Host PC is Ubuntu 12.04 LTS

 

 

1) After "modprobe g_audio", I have issue about "request length too big for isochronous", EVK serial console output is:

 

root@imx6slevk:~# g_audio gadget: high-speed config #1: Linux USB Audio Gadget

ci_hdrc ci_hdrc.0: request length too big for isochronous

snd_uac2 snd_uac2.0: 1116 Error!

ci_hdrc ci_hdrc.0: request length too big for isochronous

snd_uac2 snd_uac2.0: 1116 Error!

ci_hdrc ci_hdrc.0: request length too big for isochronous

snd_uac2 snd_uac2.0: 1116 Error!

ci_hdrc ci_hdrc.0: request length too big for isochronous

snd_uac2 snd_uac2.0: 1116 Error!

 

 

2) Above error message is from line 797 of file "driver/usb/chipidea/udc.c"

 

I add below changes into file f_uac2.c for variable fs_epout_desc and fs_epin_desc

   ".wMaxPacketSize =       cpu_to_le16(1024),"

 

And I run "bitbake linux-imx -c compile_kernelmodules -f" to rebuild the kernel modules and scp g_audio.ko into /lib/module/.../kernel/driver/usb/gadget.

 

"modprobe g_audio" does not show any error:

 

root@imx6slevk:~# modprobe g_audio  

g_audio gadget: Linux USB Audio Gadget, version: Feb 2, 2012

g_audio gadget: g_audio ready

root@imx6slevk:~# g_audio gadget: high-speed config #1: Linux USB Audio Gadget

 

 

3) But, there is no sound when I try to play sound from my Ubuntu host PC.

 

Here is the message in my Ubuntu PC:

 

xbing@:/usr/share/sounds/alsa$ aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: PCH [HDA Intel PCH], device 0: ALC3202 Analog [ALC3202 Analog]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 1: Gadget [Linux USB Audio Gadget], device 0: USB Audio [USB Audio]

  Subdevices: 0/1

  Subdevice #0: subdevice #0

 

xbing@:/usr/share/sounds/alsa$ aplay -D plughw:CARD=Gadget,DEV=0 Side_Left.wav

Playing WAVE 'Side_Left.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

xbing@:/usr/share/sounds/alsa$

 

It seems PCM data is transferred via USB from Ubuntu PC to EVK. Is my understanding correct?

 

 

4) If I aplay on EVK, then I can hear voice.

 

Here is the serial console message on EVK:

 

root@imx6slevk:~# aplay Side_Right.wav

Playing WAVE 'Side_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

 

 

5) When I run "aplay -L" on EVK, I can get below.

 

root@imx6slevk:~# aplay -L

null

    Discard all samples (playback) or generate zero samples (capture)

sysdefault:CARD=wm8962audio

    wm8962-audio,

    Default Audio Device

sysdefault:CARD=imxspdif

    imx-spdif,

    Default Audio Device

sysdefault:CARD=UAC2Gadget

    UAC2_Gadget, UAC2 PCM

    Default Audio Device

 

aplay does NOT exit (I have to Ctrl-C to abort aplay) if I run below:

 

root@imx6slevk:~# aplay -D sysdefault:CARD=UAC2Gadget Side_Right.wav

Playing WAVE 'Side_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

^CAborted by signal Interrupt...

aplay: pcm_write:1939: write error: Interrupted system call

root@imx6slevk:~#

 

 

6) I have the same issue with Wandboard Quad.

 

 

Any suggestions?

 

Thanks very much.

Outcomes