I assume you meant that you did an usb capture?
I'm not sure what application you used to do this capture, but anyhow.
The captures should contain some info about what kind of usb packet
the computer is sending or receiving.
And any data that is transmitted.
If you look in the Samples folder of the git repo, you can see some
different captures.
When I do a capture with my own device, I can first see a lot of
regular usb messages going back and forth.
They might look like this:
No. Time Source Destination
Protocol Info
1 0.000000 host 79.0
USB GET DESCRIPTOR Request DEVICE
Frame 1: 64 bytes on wire (512 bits), 64 bytes captured (512 bits)
Arrival Time: Dec 5, 2011 16:26:16.046401000 CET
Epoch Time: 1323098776.046401000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
Frame Length: 64 bytes (512 bits)
Capture Length: 64 bytes (512 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
URB id: 0xffff88012dbe5480
URB type: URB_SUBMIT ('S')
URB transfer type: URB_CONTROL out (0x02)
Endpoint: 0x80
Device: 79
URB bus id: 2
Device setup request: relevant (0)
Data: not present ('<')
URB sec: 1323098776
URB usec: 46401
URB status: Operation now in progress (-EINPROGRESS) (-115)
URB length [bytes]: 40
Data length [bytes]: 0
[Response in: 2]
[bInterfaceClass: VENDOR_SPECIFIC (0xff)]
URB setup
bmRequestType: 0x80
1... .... = Direction: Device-to-host
.00. .... = Type: Standard (0x00)
...0 0000 = Recipient: Device (0x00)
bRequest: GET DESCRIPTOR (6)
Descriptor Index: 0x00
bDescriptorType: DEVICE (1)
Language Id: no language specified (0x0000)
wLength: 40
0000 80 54 be 2d 01 88 ff ff 53 02 80 4f 02 00 00
3c .T.-....S..O...<
0010 98 e2 dc 4e 00 00 00 00 41 b5 00 00 8d ff ff
ff ...N....A.......
0020 28 00 00 00 00 00 00 00 80 06 00 01 00 00 28 00 (.............
(.
0030 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00
00 ................
No. Time Source Destination
Protocol Info
2 0.000141 79.0 host
USB GET DESCRIPTOR Response DEVICE
Frame 2: 82 bytes on wire (656 bits), 82 bytes captured (656 bits)
Arrival Time: Dec 5, 2011 16:26:16.046542000 CET
Epoch Time: 1323098776.046542000 seconds
[Time delta from previous captured frame: 0.000141000 seconds]
[Time delta from previous displayed frame: 0.000141000 seconds]
[Time since reference or first frame: 0.000141000 seconds]
Frame Number: 2
Frame Length: 82 bytes (656 bits)
Capture Length: 82 bytes (656 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
URB id: 0xffff88012dbe5480
URB type: URB_COMPLETE ('C')
URB transfer type: URB_CONTROL out (0x02)
Endpoint: 0x80
Device: 79
URB bus id: 2
Device setup request: not relevant ('-')
Data: present (0)
URB sec: 1323098776
URB usec: 46542
URB status: Success (0)
URB length [bytes]: 18
Data length [bytes]: 18
[Request in: 1]
[Time from request: 0.000141000 seconds]
[bInterfaceClass: VENDOR_SPECIFIC (0xff)]
DEVICE DESCRIPTOR
bLength: 18
bDescriptorType: DEVICE (1)
bcdUSB: 0x0200
bDeviceClass: 0
bDeviceSubClass: 0
bDeviceProtocol: 0
bMaxPacketSize0: 64
idVendor: 0x1c88
idProduct: 0x0007
bcdDevice: 0x0100
iManufacturer: 1
iProduct: 2
iSerialNumber: 3
bNumConfigurations: 1
0000 80 54 be 2d 01 88 ff ff 43 02 80 4f 02 00 2d
00 .T.-....C..O..-.
0010 98 e2 dc 4e 00 00 00 00 ce b5 00 00 00 00 00
00 ...N............
0020 12 00 00 00 12 00 00 00 00 00 00 00 00 00 00
00 ................
0030 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00
00 ................
0040 12 01 00 02 00 00 00 40 88 1c 07 00 00 01 01
02 .......@........
0050 03 01 ..
This is the Host (computer) requesting some standard info from the
device,
and the device's reply.
This is a request of type: "GET DESCRIPTOR", and usualy not of any
interest to us.
The thing we are looking for is packages that look like this:
No. Time Source Destination
Protocol Info
159 75.948778 host 79.0
USB URB_CONTROL out
Frame 159: 64 bytes on wire (512 bits), 64 bytes captured (512 bits)
Arrival Time: Dec 5, 2011 16:27:31.995179000 CET
Epoch Time: 1323098851.995179000 seconds
[Time delta from previous captured frame: 0.008893000 seconds]
[Time delta from previous displayed frame: 0.008893000 seconds]
[Time since reference or first frame: 75.948778000 seconds]
Frame Number: 159
Frame Length: 64 bytes (512 bits)
Capture Length: 64 bytes (512 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
URB id: 0xffff88012eeee680
URB type: URB_SUBMIT ('S')
URB transfer type: URB_CONTROL out (0x02)
Endpoint: 0x80
Device: 79
URB bus id: 2
Device setup request: relevant (0)
Data: not present ('<')
URB sec: 1323098851
URB usec: 995179
URB status: Operation now in progress (-EINPROGRESS) (-115)
URB length [bytes]: 2
Data length [bytes]: 0
[Response in: 160]
[bInterfaceClass: VENDOR_SPECIFIC (0xff)]
URB setup
bmRequestType: 0xc0
1... .... = Direction: Device-to-host
.10. .... = Type: Vendor (0x02)
...0 0000 = Recipient: Device (0x00)
bRequest: 1
wValue: 0x0001
wIndex: 0
wLength: 2
0000 80 e6 ee 2e 01 88 ff ff 53 02 80 4f 02 00 00
3c ........S..O...<
0010 e3 e2 dc 4e 00 00 00 00 6b 2f 0f 00 8d ff ff
ff ...N....k/......
0020 02 00 00 00 00 00 00 00 c0 01 01 00 00 00 02
00 ................
0030 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00
00 ................
No. Time Source Destination
Protocol Info
160 75.948893 79.0 host
USB URB_CONTROL out
Frame 160: 66 bytes on wire (528 bits), 66 bytes captured (528 bits)
Arrival Time: Dec 5, 2011 16:27:31.995294000 CET
Epoch Time: 1323098851.995294000 seconds
[Time delta from previous captured frame: 0.000115000 seconds]
[Time delta from previous displayed frame: 0.000115000 seconds]
[Time since reference or first frame: 75.948893000 seconds]
Frame Number: 160
Frame Length: 66 bytes (528 bits)
Capture Length: 66 bytes (528 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
URB id: 0xffff88012eeee680
URB type: URB_COMPLETE ('C')
URB transfer type: URB_CONTROL out (0x02)
Endpoint: 0x80
Device: 79
URB bus id: 2
Device setup request: not relevant ('-')
Data: present (0)
URB sec: 1323098851
URB usec: 995294
URB status: Success (0)
URB length [bytes]: 2
Data length [bytes]: 2
[Request in: 159]
[Time from request: 0.000115000 seconds]
[bInterfaceClass: VENDOR_SPECIFIC (0xff)]
CONTROL response data
0000 80 e6 ee 2e 01 88 ff ff 43 02 80 4f 02 00 2d
00 ........C..O..-.
0010 e3 e2 dc 4e 00 00 00 00 de 2f 0f 00 00 00 00
00 ...N...../......
0020 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00
00 ................
0030 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00
00 ................
0040 01 07 ..
Here we have a request of type "URB_CONTROL".
This is not a standard usb request.
If your capture program don't give you this info, you can also have a
look at the field called "URB setup".
On my capture it looks like this:
URB setup
bmRequestType: 0xc0
1... .... = Direction: Device-to-host
.10. .... = Type: Vendor (0x02)
...0 0000 = Recipient: Device (0x00)
bRequest: 1
wValue: 0x0001
wIndex: 0
wLength: 2
The important part here is "bmRequestType - Type" this is set to
"Vendor",
this says that this is not an standard USB message, and is probably
important to the device.
Now, the rest of the package is device specific, and this is what we
are looking for.
On my device, the "bRequest" is always set to "1", and the index is
always "0".
The "wValue" field changes based on what we are sending.
"wLength" is the size of data in this request or the expected length
of the data we want to receive from the device.
The byte list in the end is all the raw bytes sent over usb.
The first 64 Bytes, are all part of the standard usb header, so this
is mostly unimportant.
Any bytes beyond these 64 for are important data from the device.
In the message above, you can see that we received "0x01 0x07" as raw
data from the device.
Now, after looking trough your log, you should see that the Host is
sending lots of "URB_CONTROL" messages to the device.
The data-part of these messages should look something like this (13
Bytes):
0b 00 00 82 01 00 35 00 80 14 1b 89 00
Or, they can look like this (notice 0x4a instead of 0x00 in the second
position):
0b 4a c0 01 01 0e 81 ba 02 01 00 00 10
Now, the last message here, is setup information for the SAA7113 chip
in the device.
This message, sets register "0x0e" to "0x81".
Now, after sending lots and lots of this kind of data, eventually you
will see ISOCHRONOUS messages passed between the device and the host.
On my device, they look something like this:
o. Time Source Destination
Protocol Info
622 822.620104 host 78.2
USB URB_ISOCHRONOUS out
Frame 622: 224 bytes on wire (1792 bits), 224 bytes captured (1792
bits)
Arrival Time: Dec 5, 2011 08:55:20.206583000 CET
Epoch Time: 1323071720.206583000 seconds
[Time delta from previous captured frame: 0.000013000 seconds]
[Time delta from previous displayed frame: 0.000013000 seconds]
[Time since reference or first frame: 822.620104000 seconds]
Frame Number: 622
Frame Length: 224 bytes (1792 bits)
Capture Length: 224 bytes (1792 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
URB id: 0xffff8801093eec00
URB type: URB_SUBMIT ('S')
URB transfer type: URB_ISOCHRONOUS out (0x00)
Endpoint: 0x82
Device: 78
URB bus id: 2
Device setup request: not relevant ('-')
Data: not present ('<')
URB sec: 1323071720
URB usec: 206583
URB status: Operation now in progress (-EINPROGRESS) (-115)
URB length [bytes]: 30720
Data length [bytes]: 160
0000 00 ec 3e 09 01 88 ff ff 53 00 82 4e 02 00 2d 3c ..>.....S..N..-
<
0010 e8 78 dc 4e 00 00 00 00 f7 26 03 00 8d ff ff
ff .x.N.....&......
0020 00 78 00 00 a0 00 00 00 00 00 00 00 0a 00 00
00 .x..............
0030 01 00 00 00 00 00 00 00 02 02 00 00 0a 00 00
00 ................
0040 ee ff ff ff 00 00 00 00 00 0c 00 00 00 00 00
00 ................
0050 ee ff ff ff 00 0c 00 00 00 0c 00 00 00 00 00
00 ................
0060 ee ff ff ff 00 18 00 00 00 0c 00 00 00 00 00
00 ................
0070 ee ff ff ff 00 24 00 00 00 0c 00 00 00 00 00 00 .....
$..........
0080 ee ff ff ff 00 30 00 00 00 0c 00 00 00 00 00 00 .....
0..........
0090 ee ff ff ff 00 3c 00 00 00 0c 00 00 00 00 00
00 .....<..........
00a0 ee ff ff ff 00 48 00 00 00 0c 00 00 00 00 00
00 .....H..........
00b0 ee ff ff ff 00 54 00 00 00 0c 00 00 00 00 00
00 .....T..........
00c0 ee ff ff ff 00 60 00 00 00 0c 00 00 00 00 00
00 .....`..........
00d0 ee ff ff ff 00 6c 00 00 00 0c 00 00 00 00 00
00 .....l..........
The data-part of these messages look very different, and should
contain raw video.
The devices we have seen, all seem to split this data into packages of
1024 bytes, that have a header like "00 00 aa aa",
so you can look at your logs, and see if you find this pattern. But I
don't think this is necessary.
If you take a couple of packages of 1024 Bytes and remove the 4 header
bytes.
Then concatenate the remaining bytes, you have the bytes that is sent
from the SAA7113 chip.
This is raw video data, split into packages of 1448 Bytes like this:
[FF 00 00 XX] [1440 Bytes of RAW UYVY Video Data] [FF 00 00 XX]
This is 4 Bytes header, then 1440 Bytes of data, then 4 Bytes footer.
The header and footer bytes are called "Time Reference Code" (TRC) in
the Datasheet.
The last byte of the header/footer is a marker, called Start of Active
Video (SAV) or End of Active Video (EAV).
I hope this answers some of your questions :)
--Jonarne
> ...
>
> read more »