1
Discussion - Hardware / Re: FT602 protocol on DATA bus
« on: March 25, 2020, 04:57:37 pm »
Okay, after two weeks of studying all this stuff, I found out all the limitations. Maybe someone will find it useful.
Twelve bytes of header 0x0000_820C, 0xBABE_FACE, 0xBABE_FACE actually are UVC Payload header. First word also could (and should) be 0x0000_820C or 0x0000_830C - with FID bit in Bit field header toggling each new frame. As PTS and SCR bits are cleared, and header length is 12 bytes, bytes that left (00 00 CE FA BE BA CE FA BE BA) are just some non-standard metadata, that will be ignored by standard video streaming applications.
Size of frame after that header is also super important. It should be 38400 of 32-bit YUY2 data words for 320x240; 153600 for 640x480 and so on. Calculation assumes that each YUY2 32-bit data word contains two pixels, so (320/2)*240 = 38400.
Before start of each frame user should send 0x0000_0055 in 32-bit DATA bus with 0x1 on 4-bit BE bus.
Main limitation I found: if frame size exceeds 2 megabytes (2097152 bytes) - FTDI driver will not even try to get any data from FT602. So, I can get 1941x1080 resolution frame (1.98 megabytes), but not 1942x1080 resolution frame (2.000198 megabytes). That is definetely limitation in FTDI driver, cause USB2.0 maximum transfer rate is not met.
Twelve bytes of header 0x0000_820C, 0xBABE_FACE, 0xBABE_FACE actually are UVC Payload header. First word also could (and should) be 0x0000_820C or 0x0000_830C - with FID bit in Bit field header toggling each new frame. As PTS and SCR bits are cleared, and header length is 12 bytes, bytes that left (00 00 CE FA BE BA CE FA BE BA) are just some non-standard metadata, that will be ignored by standard video streaming applications.
Size of frame after that header is also super important. It should be 38400 of 32-bit YUY2 data words for 320x240; 153600 for 640x480 and so on. Calculation assumes that each YUY2 32-bit data word contains two pixels, so (320/2)*240 = 38400.
Before start of each frame user should send 0x0000_0055 in 32-bit DATA bus with 0x1 on 4-bit BE bus.
Main limitation I found: if frame size exceeds 2 megabytes (2097152 bytes) - FTDI driver will not even try to get any data from FT602. So, I can get 1941x1080 resolution frame (1.98 megabytes), but not 1942x1080 resolution frame (2.000198 megabytes). That is definetely limitation in FTDI driver, cause USB2.0 maximum transfer rate is not met.