Not enough resources USB3 iMX8QM RAW camera

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

Not enough resources USB3 iMX8QM RAW camera

622 Views
rbeims
Contributor II

We have been facing an issue that makes it impossible to use USB3 full HD cameras connected to the iMX8QM. Whenever we start any kind of capture on one of these devices, we get the following output on the kernel logs:

[ 2544.355298] usb 2-1: Not enough host controller resources for new device state. [ 2544.362664] usb 2-1: Not enough bandwidth for altsetting 11

This is the pipeline we use for testing:

gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw, width=1920, height=1080, format=YUY2, framerate=30/1 ! autovideosink

We're using kernel version 5.15.129 for the tests.

Here's what I tried so far:

1) connected the same camera to an iMX8MP based module, and in this case the same pipeline works without problems

 

2) traced the kernel to find out where the issue is being reported. I found out that we get to the point where the command to configure the endpoint is issued, but the controller returns a "Resource Error" back:

387 <idle>-0 [000] d.h2. 656.475330: xhci_inc_deq: EVENT 0000000006a2d056: enq 0x00000000ffffc000(0x00000000ffffc000) deq 0x00000000ffffc640(0x00000000ffffc000) segs 1 stream 0 free_trbs 254 bounce 0 cycle 0
388 v4l2src0:src-871 [002] ..... 656.677979: xhci_ring_alloc: ISOC 0000000096db72d7: enq 0x00000000fff94000(0x00000000fff94000) deq 0x00000000fff94000(0x00000000fff94000) segs 2 stream 0 free_trbs 509 bounce 1024 cycle 1
389 v4l2src0:src-871 [002] ..... 656.677988: xhci_add_endpoint: State disabled mult 3 max P. Streams 0 interval 125 us max ESIT payload 33792 CErr 0 Type Isoc IN burst 10 maxp 1024 deq 00000000fff94001 avg trb len 33792
390 v4l2src0:src-871 [002] d..1. 656.697918: xhci_configure_endpoint_ctrl_ctx: Add: slot 1in
391 v4l2src0:src-871 [002] d..1. 656.697925: xhci_configure_endpoint: RS 00000 super-speed Ctx Entries 15 MEL 0 us Port# 2/0 [TT Slot 0 Port# 0 TTT 0 Intr 0] Addr 0 State enabled/disabled
392 v4l2src0:src-871 [002] d..1. 656.697935: xhci_queue_trb: CMD: Configure Endpoint Command: ctx 00000000fffd9000 slot 4 flags d: C
393 v4l2src0:src-871 [002] d..1. 656.697939: xhci_inc_enq: CMD 000000004e4d6336: enq 0x00000000ffffe030(0x00000000ffffe000) deq 0x00000000ffffe020(0x00000000ffffe000) segs 1 stream 0 free_trbs 253 bounce 0 cycle 1
394 v4l2src0:src-871 [002] d..1. 656.697944: xhci_ring_host_doorbell: Ring doorbell for Command Ring 0
395 <idle>-0 [000] d.h2. 656.697992: xhci_handle_event: EVENT: TRB 00000000ffffe020 status 'Resource Error' len 0 slot 4 ep 0 type 'Command Completion Event' flags e:c

I attached the full trace output from a pipeline start.

Also, here's the output from lsusb -t:

root@apalis-imx8-06852132:~# lsusb -t
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/3p, 480M
|__ Port 1: Dev 3, If 0, Class=Wireless, Driver=btusb, 480M
|__ Port 1: Dev 3, If 1, Class=Wireless, Driver=btusb, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Video, Driver=uvcvideo, 5000M
|__ Port 1: Dev 2, If 1, Class=Video, Driver=uvcvideo, 5000M
|__ Port 1: Dev 2, If 2, Class=Audio, Driver=snd-usb-audio, 5000M
|__ Port 1: Dev 2, If 3, Class=Audio, Driver=snd-usb-audio, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M

I also attached the output of lsusb -v.

Is there a limitation in the cdns usb3 controller that would limit this kind of device to be connected?

Is there a configuration somewhere that we can use to add whatever resources are missing in this case?

Is there a way to find out exactly what resource is missing?

Any help will be appreciated,

Rafael

0 Kudos
Reply
2 Replies

578 Views
rbeims
Contributor II

We have not tested this on the MEK board, I don't have one available at the moment but we're working on trying it with this setup as well. Because of that, I wouldn't say it's not reproducible on the MEK, it's very likely reproducible. USB3 works, it's this specific camera that presents the stated problem however, as mentioned before, the same camera works without issues on the iMX8MP.

The 5.15.129 kernel is built from the toradex_5.15-2.2.x-imx branch (https://git.toradex.com/cgit/linux-toradex.git/log/?h=toradex_5.15-2.2.x-imx) which is based on https://github.com/Freescale/linux-fslc/tree/5.15-2.2.x-imx .

Is there any reason to believe this was a problem before and should be fixed in some NXP kernel branch?

0 Kudos
Reply

588 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

So the issue of usb3.0 camera not working is reproduced on your board, but it works on mek board, The 5.15.129 is not released version from nxp, so you should port the driver code on this version.

Have you tried to connect the usb3.0 camera on 8qm mek board?

Regards

0 Kudos
Reply