USB UAC1 on i.MX6SL EVK not detected by Windows 7

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB UAC1 on i.MX6SL EVK not detected by Windows 7

Jump to solution
5,203 Views
xuebingwang
Contributor III

Hi Community,

This is similar to https://community.freescale.com/thread/328781

(UAC2 does not work on i.MX6SL 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_GADGET_UAC1, 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

Serial message from i.MX6SL EVK is:

root@imx6slevk:~# modprobe g_audio

g_audio gadget: Hardware params: access 3, format 2, channels 2, rate 48000

g_audio gadget: audio_buf_size 48000, req_buf_size 200, req_count 256

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

g_audio gadget: ep1out queue req: err = -22

g_audio gadget: ep1out queue req: err = -22

We have the same issue on Wandboard Solo, Wandboard Quad too.

Any suggestions? Did anyone get UAC1 work on any iMX6 platform?

Thank you very much.

Tags (2)
0 Kudos
Reply
1 Solution
3,701 Views
xuebingwang
Contributor III

Karina and Adeneo Engineering Team,

I fixed the Windows 7 issue and get UAC1 working with Windows 7 host.

Thanks for your looking into this issue.

View solution in original post

0 Kudos
Reply
14 Replies
3,701 Views
xuebingwang
Contributor III

The remaining issue is that EVK (with UAC1) can NOT get detected by Windows 7 Host, after "modprobe g_audio"

I post a question to linux-usb mailing list, with message as below:

--------------------------------------------

Subject: [linux-usb] USB Gadget drivers Windows 7/8 support and .bAlternateSetting in interface descriptor

Hi Community,

My environment is Freescale i.MX6SL EVK board (as USB peripheral device), which is based on kernel 3.10.17. i.MX6SL uses ChipIdea dual-role controller.

My problem is that gadget drivers g_ether and g_audio (UAC1 enabled) can NOT be detected by Windows 7 natively, while g_mass_storage, g_serial, g_hid can be detected by Windows 7 natively.

1) I found that both Ether and USB Audio uses .bAlternateSetting, while Mass Storage, Serial and HID do NOT. I am wondering if this is related to how Gadget framework handles USB_REQ_SET_INTERFACE request?

2) Also, I am not sure if it is related to ChipIdea quirk (gadget_supports_altsettings in file gadget_chips.h)?

Any suggestions / comments on this? Thanks.

--

Thanks,

Xuebing Wang

--------------------------------------------

0 Kudos
Reply
3,701 Views
karina_valencia
NXP Apps Support
NXP Apps Support

Deactivated user can you  help to  attend this case?

0 Kudos
Reply
3,702 Views
xuebingwang
Contributor III

Karina and Adeneo Engineering Team,

I fixed the Windows 7 issue and get UAC1 working with Windows 7 host.

Thanks for your looking into this issue.

0 Kudos
Reply
3,701 Views
fabio_estevam
NXP Employee
NXP Employee

Xuebing,

Could you post the solution here, please?

Do we need to apply any kernel patches? If so, please post them here and I can help you to upstream them.

0 Kudos
Reply
3,701 Views
xuebingwang
Contributor III

Fabio,

Yes, we need to apply kernel patches. I am planning to fix other UAC1 issues, and then submit patch set to you to upstream. Is it ok?

The issues I observed now:

1) Warning message "ci_hdrc ci_hdrc.0: enabling a non-empty endpoint!", this results in 2 real problems. i) can not playback from Ubuntu 12.04 LTS 2) on Mac, can not play again after stop playing.

2) Volume control?

3) Add Mic capture

4) Other issues I am going to describe in detail in my patchset

0 Kudos
Reply
3,701 Views
fabio_estevam
NXP Employee
NXP Employee

Xuebing,

I can help you with the uspstream process, but as suggested in the linux-usb list:

http://www.spinics.net/lists/linux-usb/msg112207.html

,please run the tests on 3.16.1 or 3.17-rc.

Regards,

Fabio Estevam

0 Kudos
Reply
3,701 Views
xuebingwang
Contributor III

Fabio,

I do not have environment for 3.16, or 3.17. Do you mean that you have this environment and willing to review/test my patches? Thanks.

0 Kudos
Reply
3,701 Views
fabio_estevam
NXP Employee
NXP Employee

Xuebing,

The mainline kernel can be installed from kernel.org.

What I meant (and the other folks at linux-usb) is that you should use the latest kernel and provide patches against it, so your patches could be reviewed in the linux-usb list and then applied into the kernel.

0 Kudos
Reply
3,701 Views
xuebingwang
Contributor III

Fabio,

I understand. And sorry I might be unclear.

My question is: how can I get mainline kernel running on i.MX6SL EVK (or my Wandboard), thus I can run the test of UAC1 on different Host before submitting for review?

Thanks.

0 Kudos
Reply
3,701 Views
fabio_estevam
NXP Employee
NXP Employee

git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

Create a local branch based om 3.16

make imx_v6_v7_defconfig

make

make imx6sl-evk.dtb

0 Kudos
Reply
3,701 Views
xuebingwang
Contributor III

I managed to get i.MX6SL EVK (for UAC1) detected by Linux and Mac with below patch after "modprobe g_audio"

From: Xuebing Wang <xbing6@gmail.com>

Date: Sun, 17 Aug 2014 11:06:04 +0800

Subject: [PATCH] UAC1: Enable CONFIG_GADGET_UAC1 and fix the -22 in

f_audio_set_alt issue

Error message from serial console is:

g_audio gadget: ep1out queue req: err = -22

Signed-off-by: Xuebing Wang <xbing6@gmail.com>

---

arch/arm/configs/imx_v7_defconfig | 1 +

drivers/usb/gadget/f_uac1.c       | 2 ++

2 files changed, 3 insertions(+)

diff --git a/arch/arm/configs/imx_v7_defconfig b/arch/arm/configs/imx_v7_defconfig

index 4c47406..d312f7b 100644

--- a/arch/arm/configs/imx_v7_defconfig

+++ b/arch/arm/configs/imx_v7_defconfig

@@ -249,6 +249,7 @@ CONFIG_USB_PHY=y

CONFIG_NOP_USB_XCEIV=y

CONFIG_USB_MXS_PHY=y

CONFIG_USB_GADGET=y

+CONFIG_GADGET_UAC1=y

CONFIG_USB_AUDIO=m

CONFIG_USB_G_HID=m

CONFIG_USB_ZERO=m

diff --git a/drivers/usb/gadget/f_uac1.c b/drivers/usb/gadget/f_uac1.c

index fa8ea4e..a4e8e30 100644

--- a/drivers/usb/gadget/f_uac1.c

+++ b/drivers/usb/gadget/f_uac1.c

@@ -544,6 +544,7 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt)

{

     struct f_audio        *audio = func_to_audio(f);

     struct usb_composite_dev *cdev = f->config->cdev;

+    struct usb_gadget *gadget = cdev->gadget;

     struct usb_ep *out_ep = audio->out_ep;

     struct usb_request *req;

     int i = 0, err = 0;

@@ -553,6 +554,7 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt)

     if (intf == 1) {

         if (alt == 1) {

             usb_ep_enable(out_ep);

+            config_ep_by_speed(gadget, f, out_ep);

             out_ep->driver_data = audio;

             audio->copy_buf = f_audio_buffer_alloc(audio_buf_size);

             if (IS_ERR(audio->copy_buf))

--

2.0.1

0 Kudos
Reply
3,701 Views
xuebingwang
Contributor III

With above patch, I still can NOT hear sound at i.MX6SL EVK.

After using UAC2 mechanism for handling ALSA sound card part, then I can hear sound after connecting EVK to both Linux and Mac. The patchset of using UAC2 sound card mechanism is too big to be posted here.

0 Kudos
Reply
3,701 Views
Raana
Contributor III

Hi Xuebing,

Currently, I'm using SabreSD based custom board with Yocto3.10.17.


I'm also facing the issue in UAC2 like,

ci_hdrc ci_hdrc.0: request length too big for isochronous

snd_uac2 snd_uac2.0: 1116 Error!

Please share your patch or code or knowledge to Fix this issue.

I put SR for the same but no reply from freescale side.

Thanks in Advance.
J.P.Raja

0 Kudos
Reply
3,701 Views
bellzhong
Contributor II

Hi Xuebing,

Congratulation for UAC2 fixes! I am working this issue now, could you please provide any ideas or your code for fixing it?

Thank you in advance!

Bell

0 Kudos
Reply