usb_interrupt_read speed different on USB 2 vs 3 port.
Lundberg, Johannes
johannes at brilliantservice.co.jp
Fri Jan 3 13:26:28 UTC 2014
Here you go: (a diff shows no difference between them)
The call is:
usb_interrupt_read(devh, 0x00000083, buf, 0x000002a, 1000);
The code is originally from a reverse engineered linux driver which I
adapted to FreeBSD so there might be something I do wrong perhaps..
--
Johannes Lundberg
BRILLIANTSERVICE CO., LTD.
On Fri, Jan 3, 2014 at 10:13 PM, Hans Petter Selasky <hps at bitfrost.no>wrote:
> On 01/03/14 13:59, Lundberg, Johannes wrote:
> > Hi
> >
> > I had a bug driving me crazy and I finally discovered something weird
> that
> > was the reason.
> >
> > I have a pair of AR glasses from Vuzix which have a
> > gyro/accelerometer/compass which I read from USB using usb_interrupt_read
> > (reading 42 bytes of data).
> >
> > On my laptop I have two USB 2 and one USB 3 port.
> >
> >>From the USB 2 port things behave normally and reading takes a
> millisecond
> > or so.
> >
> >>From the USB 3 port things get weird and the call to usb_interrupt_read
> > takes over 20 milliseconds. I have been running this device on the same
> > laptop for some time and haven't noticed this behavior before.
> >
> > Can it be something that has been introduced recently or perhaps only my
> > system is behaving weird?...
> >
> > # uname -a
> > FreeBSD PC 10.0-BETA1 FreeBSD 10.0-BETA1 #0: Sun Dec 8 16:15:23 JST
> > 2013 root at PC:/usr/obj/usr/src/sys/GENERIC i386
> >
> > Best regards
> > --
> > Johannes Lundberg
> >
>
> Hi,
>
> Can you show output from
> "usbconfig -d X.Y dump_device_desc dump_curr_config_desc"
>
> In both cases?
>
> --HPS
>
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。
もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、
複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message.
-------------- next part --------------
WITH DEVICE IN USB 3 PORT
% usbconfig -d 1.2 dump_device_desc dump_curr_config_desc
ugen1.2: <Wrap USB Adapter Vuzix Corporation> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0110
bDeviceClass = 0x0000
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0008
idVendor = 0x1bae
idProduct = 0x014b
bcdDevice = 0x0102
iManufacturer = 0x0001 <Vuzix Corporation>
iProduct = 0x0002 <Wrap USB Adapter>
iSerialNumber = 0x0000 <no string>
bNumConfigurations = 0x0001
Configuration index 0
bLength = 0x0009
bDescriptorType = 0x0002
wTotalLength = 0x010f
bNumInterfaces = 0x0004
bConfigurationValue = 0x0001
iConfiguration = 0x0000 <no string>
bmAttributes = 0x00a0
bMaxPower = 0x00fa
Interface 0
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0000
bAlternateSetting = 0x0000
bNumEndpoints = 0x0000
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0001
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x0a
bDescriptorType = 0x24
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x0a, 0x24, 0x01, 0x00, 0x01, 0x75, 0x00, 0x02,
0x08 | 0x01, 0x02
Additional Descriptor
bLength = 0x0c
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0c, 0x24, 0x02, 0x03, 0x01, 0x01, 0x00, 0x02,
0x08 | 0x03, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x0c
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0c, 0x24, 0x02, 0x01, 0x01, 0x02, 0x07, 0x01,
0x08 | 0x01, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x24
bDescriptorSubType = 0x06
RAW dump:
0x00 | 0x09, 0x24, 0x06, 0x02, 0x01, 0x01, 0x03, 0x00,
0x08 | 0x00
Additional Descriptor
bLength = 0x0d
bDescriptorType = 0x24
bDescriptorSubType = 0x04
RAW dump:
0x00 | 0x0d, 0x24, 0x04, 0x04, 0x02, 0x03, 0x02, 0x02,
0x08 | 0x03, 0x00, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x0a
bDescriptorType = 0x24
bDescriptorSubType = 0x06
RAW dump:
0x00 | 0x0a, 0x24, 0x06, 0x05, 0x04, 0x01, 0x01, 0x02,
0x08 | 0x02, 0x00
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x24
bDescriptorSubType = 0x03
RAW dump:
0x00 | 0x09, 0x24, 0x03, 0x06, 0x01, 0x03, 0x00, 0x05,
0x08 | 0x00
Additional Descriptor
bLength = 0x0c
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0c, 0x24, 0x02, 0x07, 0x01, 0x02, 0x01, 0x01,
0x08 | 0x01, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x24
bDescriptorSubType = 0x06
RAW dump:
0x00 | 0x09, 0x24, 0x06, 0x08, 0x07, 0x01, 0x03, 0x00,
0x08 | 0x00
Additional Descriptor
bLength = 0x0c
bDescriptorType = 0x24
bDescriptorSubType = 0x04
RAW dump:
0x00 | 0x0c, 0x24, 0x04, 0x0a, 0x01, 0x08, 0x01, 0x01,
0x08 | 0x00, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x24
bDescriptorSubType = 0x03
RAW dump:
0x00 | 0x09, 0x24, 0x03, 0x0b, 0x01, 0x01, 0x00, 0x0a,
0x08 | 0x00
Interface 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0001
bAlternateSetting = 0x0000
bNumEndpoints = 0x0000
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Interface 1 Alt 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0001
bAlternateSetting = 0x0001
bNumEndpoints = 0x0001
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x07
bDescriptorType = 0x24
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x07, 0x24, 0x01, 0x03, 0x01, 0x01, 0x00
Additional Descriptor
bLength = 0x0b
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0b, 0x24, 0x02, 0x01, 0x02, 0x02, 0x10, 0x01,
0x08 | 0x44, 0xac, 0x00
Endpoint 0
bLength = 0x0009
bDescriptorType = 0x0005
bEndpointAddress = 0x0001 <OUT>
bmAttributes = 0x0009 <ADAPT-ISOCHRONOUS>
wMaxPacketSize = 0x00c0
bInterval = 0x0001
bRefresh = 0x0000
bSynchAddress = 0x0000
Additional Descriptor
bLength = 0x07
bDescriptorType = 0x25
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x07, 0x25, 0x01, 0x01, 0x00, 0x00, 0x00
Interface 2
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0002
bAlternateSetting = 0x0000
bNumEndpoints = 0x0000
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Interface 2 Alt 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0002
bAlternateSetting = 0x0001
bNumEndpoints = 0x0001
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x07
bDescriptorType = 0x24
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x07, 0x24, 0x01, 0x0b, 0x01, 0x01, 0x00
Additional Descriptor
bLength = 0x0b
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0b, 0x24, 0x02, 0x01, 0x01, 0x02, 0x10, 0x01,
0x08 | 0x44, 0xac, 0x00
Endpoint 0
bLength = 0x0009
bDescriptorType = 0x0005
bEndpointAddress = 0x0082 <IN>
bmAttributes = 0x000d <SYNC-ISOCHRONOUS>
wMaxPacketSize = 0x00c0
bInterval = 0x0001
bRefresh = 0x0000
bSynchAddress = 0x0000
Additional Descriptor
bLength = 0x07
bDescriptorType = 0x25
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x07, 0x25, 0x01, 0x01, 0x00, 0x00, 0x00
Interface 3
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0003
bAlternateSetting = 0x0000
bNumEndpoints = 0x0002
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0000
bInterfaceProtocol = 0x0000
iInterface = 0x0003 <Vuzix Head Tracker>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x00
RAW dump:
0x00 | 0x09, 0x21, 0x00, 0x01, 0x00, 0x01, 0x22, 0x29,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0083 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x002a
bInterval = 0x000a
bRefresh = 0x0000
bSynchAddress = 0x0000
Endpoint 1
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0004 <OUT>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0040
bInterval = 0x000a
bRefresh = 0x0000
bSynchAddress = 0x0000
-------------- next part --------------
WITH DEVICE IN USB 2 PORT
% usbconfig -d 2.3 dump_device_desc dump_curr_config_desc
ugen2.3: <Wrap USB Adapter Vuzix Corporation> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0110
bDeviceClass = 0x0000
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0008
idVendor = 0x1bae
idProduct = 0x014b
bcdDevice = 0x0102
iManufacturer = 0x0001 <Vuzix Corporation>
iProduct = 0x0002 <Wrap USB Adapter>
iSerialNumber = 0x0000 <no string>
bNumConfigurations = 0x0001
Configuration index 0
bLength = 0x0009
bDescriptorType = 0x0002
wTotalLength = 0x010f
bNumInterfaces = 0x0004
bConfigurationValue = 0x0001
iConfiguration = 0x0000 <no string>
bmAttributes = 0x00a0
bMaxPower = 0x00fa
Interface 0
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0000
bAlternateSetting = 0x0000
bNumEndpoints = 0x0000
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0001
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x0a
bDescriptorType = 0x24
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x0a, 0x24, 0x01, 0x00, 0x01, 0x75, 0x00, 0x02,
0x08 | 0x01, 0x02
Additional Descriptor
bLength = 0x0c
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0c, 0x24, 0x02, 0x03, 0x01, 0x01, 0x00, 0x02,
0x08 | 0x03, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x0c
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0c, 0x24, 0x02, 0x01, 0x01, 0x02, 0x07, 0x01,
0x08 | 0x01, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x24
bDescriptorSubType = 0x06
RAW dump:
0x00 | 0x09, 0x24, 0x06, 0x02, 0x01, 0x01, 0x03, 0x00,
0x08 | 0x00
Additional Descriptor
bLength = 0x0d
bDescriptorType = 0x24
bDescriptorSubType = 0x04
RAW dump:
0x00 | 0x0d, 0x24, 0x04, 0x04, 0x02, 0x03, 0x02, 0x02,
0x08 | 0x03, 0x00, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x0a
bDescriptorType = 0x24
bDescriptorSubType = 0x06
RAW dump:
0x00 | 0x0a, 0x24, 0x06, 0x05, 0x04, 0x01, 0x01, 0x02,
0x08 | 0x02, 0x00
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x24
bDescriptorSubType = 0x03
RAW dump:
0x00 | 0x09, 0x24, 0x03, 0x06, 0x01, 0x03, 0x00, 0x05,
0x08 | 0x00
Additional Descriptor
bLength = 0x0c
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0c, 0x24, 0x02, 0x07, 0x01, 0x02, 0x01, 0x01,
0x08 | 0x01, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x24
bDescriptorSubType = 0x06
RAW dump:
0x00 | 0x09, 0x24, 0x06, 0x08, 0x07, 0x01, 0x03, 0x00,
0x08 | 0x00
Additional Descriptor
bLength = 0x0c
bDescriptorType = 0x24
bDescriptorSubType = 0x04
RAW dump:
0x00 | 0x0c, 0x24, 0x04, 0x0a, 0x01, 0x08, 0x01, 0x01,
0x08 | 0x00, 0x00, 0x00, 0x00
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x24
bDescriptorSubType = 0x03
RAW dump:
0x00 | 0x09, 0x24, 0x03, 0x0b, 0x01, 0x01, 0x00, 0x0a,
0x08 | 0x00
Interface 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0001
bAlternateSetting = 0x0000
bNumEndpoints = 0x0000
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Interface 1 Alt 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0001
bAlternateSetting = 0x0001
bNumEndpoints = 0x0001
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x07
bDescriptorType = 0x24
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x07, 0x24, 0x01, 0x03, 0x01, 0x01, 0x00
Additional Descriptor
bLength = 0x0b
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0b, 0x24, 0x02, 0x01, 0x02, 0x02, 0x10, 0x01,
0x08 | 0x44, 0xac, 0x00
Endpoint 0
bLength = 0x0009
bDescriptorType = 0x0005
bEndpointAddress = 0x0001 <OUT>
bmAttributes = 0x0009 <ADAPT-ISOCHRONOUS>
wMaxPacketSize = 0x00c0
bInterval = 0x0001
bRefresh = 0x0000
bSynchAddress = 0x0000
Additional Descriptor
bLength = 0x07
bDescriptorType = 0x25
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x07, 0x25, 0x01, 0x01, 0x00, 0x00, 0x00
Interface 2
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0002
bAlternateSetting = 0x0000
bNumEndpoints = 0x0000
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Interface 2 Alt 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0002
bAlternateSetting = 0x0001
bNumEndpoints = 0x0001
bInterfaceClass = 0x0001
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x07
bDescriptorType = 0x24
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x07, 0x24, 0x01, 0x0b, 0x01, 0x01, 0x00
Additional Descriptor
bLength = 0x0b
bDescriptorType = 0x24
bDescriptorSubType = 0x02
RAW dump:
0x00 | 0x0b, 0x24, 0x02, 0x01, 0x01, 0x02, 0x10, 0x01,
0x08 | 0x44, 0xac, 0x00
Endpoint 0
bLength = 0x0009
bDescriptorType = 0x0005
bEndpointAddress = 0x0082 <IN>
bmAttributes = 0x000d <SYNC-ISOCHRONOUS>
wMaxPacketSize = 0x00c0
bInterval = 0x0001
bRefresh = 0x0000
bSynchAddress = 0x0000
Additional Descriptor
bLength = 0x07
bDescriptorType = 0x25
bDescriptorSubType = 0x01
RAW dump:
0x00 | 0x07, 0x25, 0x01, 0x01, 0x00, 0x00, 0x00
Interface 3
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0003
bAlternateSetting = 0x0000
bNumEndpoints = 0x0002
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0000
bInterfaceProtocol = 0x0000
iInterface = 0x0003 <Vuzix Head Tracker>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x00
RAW dump:
0x00 | 0x09, 0x21, 0x00, 0x01, 0x00, 0x01, 0x22, 0x29,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0083 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x002a
bInterval = 0x000a
bRefresh = 0x0000
bSynchAddress = 0x0000
Endpoint 1
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0004 <OUT>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0040
bInterval = 0x000a
bRefresh = 0x0000
bSynchAddress = 0x0000
More information about the freebsd-usb
mailing list