Re: non-working UVC device 058f:5608

2014-07-21 Thread Laurent Pinchart
On Monday 09 June 2014 12:27:37 Johannes Berg wrote:
 On Mon, 2014-06-09 at 11:59 +0200, Johannes Berg wrote:
   Johannes, could you enable USB debugging in the linus/master kernel and
   provide a kernel log ?
  
  I'll try to get some logs (wasn't there tracing added to xhci too? will
  check)
 
 Here we go - log + tracing:
 log: http://p.sipsolutions.net/d5926c43d531e3af.txt
 trace: http://johannes.sipsolutions.net/files/xhci.trace.dat.xz
 
 I plugged in the device, waited a bit, tried to run a camera application
 (didn't work) and then ran lsusb -t and lsusb -v.

Mathias, would you have time to give this a quick look ?

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: non-working UVC device 058f:5608

2014-06-09 Thread Johannes Berg
Hi Laurent,

Thanks for the quick reply!

  and then the kernel message repeats forever, while I can't even exit
  uvccapture unless I kill it hard, at which point I get
  
  xhci_hcd :00:14.0: Signal while waiting for configure endpoint command
  usb 1-3.4.4.3: Not enough bandwidth for altsetting 0
  
  from the kernel.
 
 This looks like low-level USB issues, CC'ing the linux-usb mailing list.

Ok.

  Any thoughts? Just to rule out hardware defects I connected it to my
  windows 7 work machine and it works fine without even installing a
  driver.
 
 Could you try connecting it to an EHCI controller instead of XHCI on a Linux  
 machine ?

Indeed, that works! Interestingly, it works neither on a USB3 port
directly, nor on a USB2 hub behind the USB3 port.

Thanks,
johannes

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: non-working UVC device 058f:5608

2014-06-09 Thread Laurent Pinchart
Hi Johannes,

On Monday 09 June 2014 09:33:06 Johannes Berg wrote:
 Hi Laurent,
 
 Thanks for the quick reply!

You're welcome.

   and then the kernel message repeats forever, while I can't even exit
   uvccapture unless I kill it hard, at which point I get
   
   xhci_hcd :00:14.0: Signal while waiting for configure endpoint
   command
   usb 1-3.4.4.3: Not enough bandwidth for altsetting 0
   
   from the kernel.
  
  This looks like low-level USB issues, CC'ing the linux-usb mailing list.
 
 Ok.
 
   Any thoughts? Just to rule out hardware defects I connected it to my
   windows 7 work machine and it works fine without even installing a
   driver.
  
  Could you try connecting it to an EHCI controller instead of XHCI on a
  Linux machine ?
 
 Indeed, that works! Interestingly, it works neither on a USB3 port
 directly, nor on a USB2 hub behind the USB3 port.

I would thus be tempted to classify this as an XHCI controller issue. linux-
usb should be the right list to get help. I've CC'ed Mathias Nyman, the XHCI 
maintainer.

Johannes, could you enable USB debugging in the linus/master kernel and 
provide a kernel log ?

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: non-working UVC device 058f:5608

2014-06-09 Thread Johannes Berg
On Mon, 2014-06-09 at 11:25 +0200, Laurent Pinchart wrote:

  Indeed, that works! Interestingly, it works neither on a USB3 port
  directly, nor on a USB2 hub behind the USB3 port.
 
 I would thus be tempted to classify this as an XHCI controller issue. linux-
 usb should be the right list to get help. I've CC'ed Mathias Nyman, the XHCI 
 maintainer.

Yeah, I tend to agree.

 Johannes, could you enable USB debugging in the linus/master kernel and 
 provide a kernel log ?

Sure. Note that linus/next is having even more issues with this device,
to the point where I couldn't even get the lsusb I pasted into the first
email. I used 3.13 (because I had it installed on the system in
question) to get that.

It was also throwing an autosuspend warning:
http://mid.gmane.org/1402177014.8442.1.ca...@jlt4.sipsolutions.net

I'll try to get some logs (wasn't there tracing added to xhci too? will
check)

johannes

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: non-working UVC device 058f:5608

2014-06-09 Thread Johannes Berg
On Mon, 2014-06-09 at 11:59 +0200, Johannes Berg wrote:

  Johannes, could you enable USB debugging in the linus/master kernel and 
  provide a kernel log ?

 I'll try to get some logs (wasn't there tracing added to xhci too? will
 check)

Here we go - log + tracing:
log: http://p.sipsolutions.net/d5926c43d531e3af.txt
trace: http://johannes.sipsolutions.net/files/xhci.trace.dat.xz

I plugged in the device, waited a bit, tried to run a camera application
(didn't work) and then ran lsusb -t and lsusb -v.

johannes

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: non-working UVC device 058f:5608

2014-06-09 Thread Johannes Berg
On Mon, 2014-06-09 at 12:27 +0200, Johannes Berg wrote:

 Here we go - log + tracing:
 log: http://p.sipsolutions.net/d5926c43d531e3af.txt
 trace: http://johannes.sipsolutions.net/files/xhci.trace.dat.xz

Oh, and this was the kernel diff to commit
963649d735c8b6eb0f97e82c54f02426ff3f1f45:

diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index eb009a4..00621cb 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -20,6 +20,8 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define DEBUG
+
 #include xhci.h
 
 #define XHCI_INIT_VALUE 0x0
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 6231ce6..70b09cd 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -20,6 +20,8 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define DEBUG
+
 
 #include linux/slab.h
 #include asm/unaligned.h
@@ -287,7 +289,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int 
slot_id, int suspend)
if (virt_dev-eps[i].ring  virt_dev-eps[i].ring-dequeue) {
struct xhci_command *command;
command = xhci_alloc_command(xhci, false, false,
-GFP_NOIO);
+GFP_ATOMIC);
if (!command) {
spin_unlock_irqrestore(xhci-lock, flags);
xhci_free_command(xhci, cmd);
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 8056d90..2ceed51 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -20,6 +20,8 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define DEBUG
+
 #include linux/usb.h
 #include linux/pci.h
 #include linux/slab.h
diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c
index 1eefc98..4b289d6 100644
--- a/drivers/usb/host/xhci-mvebu.c
+++ b/drivers/usb/host/xhci-mvebu.c
@@ -7,6 +7,8 @@
  * version 2 as published by the Free Software Foundation.
  */
 
+#define DEBUG
+
 #include linux/io.h
 #include linux/mbus.h
 #include linux/of.h
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index e20520f..aae5dc9 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -20,6 +20,8 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define DEBUG
+
 #include linux/pci.h
 #include linux/slab.h
 #include linux/module.h
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 29d8adb..2149b0c 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -11,6 +11,8 @@
  * version 2 as published by the Free Software Foundation.
  */
 
+#define DEBUG
+
 #include linux/clk.h
 #include linux/dma-mapping.h
 #include linux/module.h
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index d67ff71..a7eda28 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -64,6 +64,8 @@
  *   endpoint rings; it generates events on the event ring for these.
  */
 
+#define DEBUG
+
 #include linux/scatterlist.h
 #include linux/slab.h
 #include xhci.h
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 2b8d9a2..fd350b7 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -20,6 +20,8 @@
  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define DEBUG
+
 #include linux/pci.h
 #include linux/irq.h
 #include linux/log2.h


johannes

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: non-working UVC device 058f:5608

2014-06-08 Thread Laurent Pinchart
Hi Johannes,

On Saturday 07 June 2014 23:51:43 Johannes Berg wrote:
 I just obtained a new (special-purpose) webcam, and it doesn't seem to
 work at all. On kernel torvals/linux.git next branch, it doesn't even
 really connect, on 3.13 (which I'm running on my laptop) I get errors
 like this:
 
 xhci_hcd :00:14.0: ERROR Transfer event TRB DMA ptr not part of
 current TD
 
 when running uvccapture. When running e.g. cheese or the like, the
 screen stays blank. uvccapture also reports:
 
 ioctl querycontrol error 22
 
 and then the kernel message repeats forever, while I can't even exit
 uvccapture unless I kill it hard, at which point I get
 
 xhci_hcd :00:14.0: Signal while waiting for configure endpoint command
 usb 1-3.4.4.3: Not enough bandwidth for altsetting 0
 
 from the kernel.

This looks like low-level USB issues, CC'ing the linux-usb mailing list.

 The device really is detected as UVC, of course:
 
 [ 3423.299311] usb 1-3.4.4.3: new high-speed USB device number 12 using
 xhci_hcd
 [ 3423.426280] usb 1-3.4.4.3: New USB device found, idVendor=058f,
 idProduct=5608
 [ 3423.426286] usb 1-3.4.4.3: New USB device strings: Mfr=3, Product=1,
 SerialNumber=0 [ 3423.426290] usb 1-3.4.4.3: Product: USB 2.0 PC Camera
 [ 3423.426293] usb 1-3.4.4.3: Manufacturer: Alcor Micro, Corp.
 [ 3423.432137] uvcvideo: Found UVC 1.00 device USB 2.0 PC Camera
 (058f:5608)
 [ 3423.435383] input: USB 2.0 PC Camera as
 /devices/pci:00/:00:14.0/usb1/1-3/1-3.4/1-3.4.4/1-3.4.4.3/1-3.4.4.3
 :1.0/input/input36
 
 (see also full lsusb below)
 
 I see a device from the same manufacturer has a kernel driver as a
 vendor device but actually being UVC, but this one reports being UVC and
 doesn't really work.
 
 Any thoughts? Just to rule out hardware defects I connected it to my
 windows 7 work machine and it works fine without even installing a
 driver.

Could you try connecting it to an EHCI controller instead of XHCI on a Linux  
machine ?

 I can arrange remote access to the device (maybe as a VM to be able to
 experiment with the kernel more easily?) if anyone wants it.
 
 johannes
 
 lsusb:
 
 Bus 001 Device 012: ID 058f:5608 Alcor Micro Corp.
 Device Descriptor:
   bLength18
   bDescriptorType 1
   bcdUSB   2.00
   bDeviceClass  239 Miscellaneous Device
   bDeviceSubClass 2 ?
   bDeviceProtocol 1 Interface Association
   bMaxPacketSize064
   idVendor   0x058f Alcor Micro Corp.
   idProduct  0x5608
   bcdDevice0.03
   iManufacturer   3 Alcor Micro, Corp.
   iProduct1 USB 2.0 PC Camera
   iSerial 0
   bNumConfigurations  1
   Configuration Descriptor:
 bLength 9
 bDescriptorType 2
 wTotalLength  407
 bNumInterfaces  2
 bConfigurationValue 1
 iConfiguration  0
 bmAttributes 0x80
   (Bus Powered)
 MaxPower  200mA
 Interface Association:
   bLength 8
   bDescriptorType11
   bFirstInterface 0
   bInterfaceCount 2
   bFunctionClass 14 Video
   bFunctionSubClass   3 Video Interface Collection
   bFunctionProtocol   0
   iFunction   1 USB 2.0 PC Camera
 Interface Descriptor:
   bLength 9
   bDescriptorType 4
   bInterfaceNumber0
   bAlternateSetting   0
   bNumEndpoints   1
   bInterfaceClass14 Video
   bInterfaceSubClass  1 Video Control
   bInterfaceProtocol  0
   iInterface  1 USB 2.0 PC Camera
   VideoControl Interface Descriptor:
 bLength13
 bDescriptorType36
 bDescriptorSubtype  1 (HEADER)
 bcdUVC   1.00
 wTotalLength   85
 dwClockFrequency   30.00MHz
 bInCollection   1
 baInterfaceNr( 0)   1
   VideoControl Interface Descriptor:
 bLength18
 bDescriptorType36
 bDescriptorSubtype  2 (INPUT_TERMINAL)
 bTerminalID 1
 wTerminalType  0x0201 Camera Sensor
 bAssocTerminal  0
 iTerminal   0
 wObjectiveFocalLengthMin  0
 wObjectiveFocalLengthMax  0
 wOcularFocalLength0
 bControlSize  3
 bmControls   0x
   VideoControl Interface Descriptor:
 bLength 9
 bDescriptorType36
 bDescriptorSubtype  3 (OUTPUT_TERMINAL)
 bTerminalID 3
 wTerminalType  0x0101 USB Streaming
 bAssocTerminal  0
 bSourceID   6
 iTerminal   0
   VideoControl Interface Descriptor:
 bLength

non-working UVC device 058f:5608

2014-06-07 Thread Johannes Berg
I just obtained a new (special-purpose) webcam, and it doesn't seem to
work at all. On kernel torvals/linux.git next branch, it doesn't even
really connect, on 3.13 (which I'm running on my laptop) I get errors
like this:

xhci_hcd :00:14.0: ERROR Transfer event TRB DMA ptr not part of
current TD

when running uvccapture. When running e.g. cheese or the like, the
screen stays blank. uvccapture also reports:

ioctl querycontrol error 22

and then the kernel message repeats forever, while I can't even exit
uvccapture unless I kill it hard, at which point I get

xhci_hcd :00:14.0: Signal while waiting for configure endpoint command
usb 1-3.4.4.3: Not enough bandwidth for altsetting 0

from the kernel.


The device really is detected as UVC, of course:

[ 3423.299311] usb 1-3.4.4.3: new high-speed USB device number 12 using
xhci_hcd
[ 3423.426280] usb 1-3.4.4.3: New USB device found, idVendor=058f,
idProduct=5608
[ 3423.426286] usb 1-3.4.4.3: New USB device strings: Mfr=3, Product=1, 
SerialNumber=0
[ 3423.426290] usb 1-3.4.4.3: Product: USB 2.0 PC Camera
[ 3423.426293] usb 1-3.4.4.3: Manufacturer: Alcor Micro, Corp.
[ 3423.432137] uvcvideo: Found UVC 1.00 device USB 2.0 PC Camera
(058f:5608)
[ 3423.435383] input: USB 2.0 PC Camera as 
/devices/pci:00/:00:14.0/usb1/1-3/1-3.4/1-3.4.4/1-3.4.4.3/1-3.4.4.3:1.0/input/input36

(see also full lsusb below)

I see a device from the same manufacturer has a kernel driver as a
vendor device but actually being UVC, but this one reports being UVC and
doesn't really work.

Any thoughts? Just to rule out hardware defects I connected it to my
windows 7 work machine and it works fine without even installing a
driver.

I can arrange remote access to the device (maybe as a VM to be able to
experiment with the kernel more easily?) if anyone wants it.

johannes

lsusb:

Bus 001 Device 012: ID 058f:5608 Alcor Micro Corp. 
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass  239 Miscellaneous Device
  bDeviceSubClass 2 ?
  bDeviceProtocol 1 Interface Association
  bMaxPacketSize064
  idVendor   0x058f Alcor Micro Corp.
  idProduct  0x5608 
  bcdDevice0.03
  iManufacturer   3 Alcor Micro, Corp.
  iProduct1 USB 2.0 PC Camera
  iSerial 0 
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength  407
bNumInterfaces  2
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0x80
  (Bus Powered)
MaxPower  200mA
Interface Association:
  bLength 8
  bDescriptorType11
  bFirstInterface 0
  bInterfaceCount 2
  bFunctionClass 14 Video
  bFunctionSubClass   3 Video Interface Collection
  bFunctionProtocol   0 
  iFunction   1 USB 2.0 PC Camera
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass14 Video
  bInterfaceSubClass  1 Video Control
  bInterfaceProtocol  0 
  iInterface  1 USB 2.0 PC Camera
  VideoControl Interface Descriptor:
bLength13
bDescriptorType36
bDescriptorSubtype  1 (HEADER)
bcdUVC   1.00
wTotalLength   85
dwClockFrequency   30.00MHz
bInCollection   1
baInterfaceNr( 0)   1
  VideoControl Interface Descriptor:
bLength18
bDescriptorType36
bDescriptorSubtype  2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType  0x0201 Camera Sensor
bAssocTerminal  0
iTerminal   0 
wObjectiveFocalLengthMin  0
wObjectiveFocalLengthMax  0
wOcularFocalLength0
bControlSize  3
bmControls   0x
  VideoControl Interface Descriptor:
bLength 9
bDescriptorType36
bDescriptorSubtype  3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType  0x0101 USB Streaming
bAssocTerminal  0
bSourceID   6
iTerminal   0 
  VideoControl Interface Descriptor:
bLength 7
bDescriptorType36
bDescriptorSubtype  4 (SELECTOR_UNIT)
bUnitID 4
bNrInPins   1
baSource( 0)1
iSelector   0 
  VideoControl Interface Descriptor:
bLength11
bDescriptorType36