Did I loss something when I setting the uvc 1080p descriptors based on AN75779?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
TaLe_3708091
Level 1
Level 1
First like received

  I have changed the firmware provided in AN75779.zip  to meet the requirement with the following features:

1.32-bit synchronous parallel data interface

2.16 bits per pixel

3.YUY2 color space

4.1920*1080 pixel resolution

5.45 frames per second

6.Active high frame, line valid signals.

For 32-bit synchronous parallel data interface, I go to the interface definition tab in GPIF II Designer and choose 32bit option, and change the counter limit value of LD_DATA_COUNT & LD_ADDR_COUNT to 4091. after that i update the cyfxgpif2config.h

I also make sure the iomatrix configuration in the firmware has the isDQ32Bit parameter set to CyTrue.

For 1920*1080 pixel resolution, I change some descriptions as follow

/* UVC Probe Control Settings for a USB 3.0 connection. */

uint8_t glProbeCtrl[CY_FX_UVC_MAX_PROBE_SETTING] = {

    0x00, 0x00,                 /* bmHint : no hit */

    0x01,                       /* Use 1st Video format index */

    0x01,                       /* Use 1st Video frame index */

    0x0E, 0x64, 0x03, 0x00,     /* Desired frame interval in the unit of 100ns: 45 fps */

    0x00, 0x00,                 /* Key frame rate in key frame/video frame units: only applicable

                                   to video streaming with adjustable compression parameters */

    0x00, 0x00,                 /* PFrame rate in PFrame / key frame units: only applicable to

                                   video streaming with adjustable compression parameters */

    0x00, 0x00,                 /* Compression quality control: only applicable to video streaming

                                   with adjustable compression parameters */

    0x00, 0x00,                 /* Window size for average bit rate: only applicable to video

                                   streaming with adjustable compression parameters */

    0x00, 0x00,                 /* Internal video streaming i/f latency in ms */

    0x00, 0x48, 0x3F, 0x00,     /* Max video frame size in bytes */

    0x00, 0x40, 0x00, 0x00,      /* No. of bytes device can rx in single payload = 16 KB */

const uint8_t CyFxUSBSSConfigDscr[] ={

.....

/* Class specific Uncompressed VS format descriptor */

    0x1B,                           /* Descriptor size */

    0x24,                           /* Class-specific VS I/f Type */

    0x04,                           /* Subtype : uncompressed format I/F */

    0x01,                           /* Format desciptor index */

    0x01,                           /* Number of frame descriptor followed */

    0x59,0x55,0x59,0x32,            /* GUID used to identify streaming-encoding format: YUY2  */

    0x00,0x00,0x10,0x00,

    0x80,0x00,0x00,0xAA,

    0x00,0x38,0x9B,0x71,

    0x10,                           /* Number of bits per pixel */

    0x01,                           /* Optimum Frame Index for this stream: 1 */

    0x10,                           /* X dimension of the picture aspect ratio; Non-interlaced */

    0x09,                           /* Y dimension of the pictuer aspect ratio: Non-interlaced */

    0x00,                           /* Interlace Flags: Progressive scanning, no interlace */

    0x00,                           /* duplication of the video stream restriction: 0 - no restriction */

/* Class specific Uncompressed VS frame descriptor */

    0x1E,                           /* Descriptor size */

    0x24,                           /* Descriptor type*/

    0x05,                           /* Subtype: uncompressed frame I/F */

    0x01,                           /* Frame Descriptor Index */

    0x01,                           /* Still image capture method 1 supported */

    0x80, 0x07,                     /* Width in pixel */

    0x38, 0x04,                     /* Height in pixel */

    0x00,0x80,0x53,0x3B,            /* Min bit rate bits/s. */

    0x00,0x80,0x53,0x3B,            /* Max bit rate bits/s. */

    0x00,0x48,0x3F,0x00,            /* Maximum video or still frame size in bytes(Deprecated)*/

    0x0E, 0x64, 0x03, 0x00,         /* 45fps */

    0x01,

    0x0E, 0x64, 0x03, 0x00,

    ....

}

I don't know why Image streaming is not working.

I hope someone colud help me, thank you.

Taeyoung Lee 님이 메시지를 편집했습니다.

1 Solution

Hello,

The statement CyU3PDeviceReset(CyFalse); was just used to check whether the control reaches SET_CUR under COMMIT_CTRL. That can be removed as we understood that the control is reaching there. But fps need not be changed, you can keep it at 45fps itself.

Please confirm that you are trying to stream a data format that is UVC compliant. This is because AMCap can understand only those data formats that are UVC compliant. Also, from your previous responses, I understood that you are not using an image sensor, instead you are generating a pattern using FPGA. Please let me know at what frame rate have you configured the FPGA to send out the frames.

Also, I can see a Clear Feature request being issued by the host. Is this because you are closing the host application in between streaming? If not, when does this occur?

For testing you can further do some changes inside the uvc.c source. The following changes are to be made. The changes can be found in the following snippets.

1. Initialize the following variables (g1tempfmsize, g1fmsize, fmflag);

pastedImage_0.png

2. Inside the PROD_EVENT in DMA Call back, add the modifications as shown below:

pastedImage_1.png

3. Under DEBUG_PRINT_FRAME_COUNT, do the following changes

pastedImage_0.png

After doing the above changes, please share the UART logs.

Best Regards,​

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
17 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please let me know the following details:

1. Why are you using 32 bit synchronous parallel data interface? I understood that your image sensor describes each pixel using 16 bits. So is it like the sensor sends out 2 pixels per PCLK?

2. The default AN75779 example streams 720p at 30fps on superspeed link and VGA at 15fps on 2.0 link. Are you trying to replace 720p with 1080p or are you trying to add 1080p along with 720p?

3. Please share the complete project so that I can understand the situation better.

4. Have you configured the sensor to stream at the new resolution?

5. What exactly do you see on the host application when you try to stream the data? Share the debug prints using teraterm and USB logs using wireshark so that we can know where the data transfer is failing or if data transfer is happening or not.

6. Is the device enumerating properly as FX3 under camera. Also, is the new resolution found in the host application? If both these are successful, then the descriptors are fine.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hello,

first of all Thanks for reply.

1. Why are you using 32 bit synchronous parallel data interface? I understood that your image sensor describes each pixel using 16 bits. So is it like the sensor sends out 2 pixels per PCLK?

- I plan to develop Lattice VIP board connected some Image Sensor(raw10). Currently it is streaming image data by pattern generation. I confirmed by using lattice example source. but I need to customize fx3 firmware to control I2C & others.

- PCLK is 81MHz.

2. The default AN75779 example streams 720p at 30fps on superspeed link and VGA at 15fps on 2.0 link. Are you trying to replace 720p with 1080p or are you trying to add 1080p along with 720p?

- Actually the goal is that streams 1080p at 45fps on superspeed.

3. Please share the complete project so that I can understand the situation better.

- please check the source.

4. Have you configured the sensor to stream at the new resolution?

- Maybe It doesn't need to configure the sensor. because I use pattern generation.

5. What exactly do you see on the host application when you try to stream the data? Share the debug prints using teraterm and USB logs using wireshark so that we can know where the data transfer is failing or if data transfer is happening or not.

- Please check the logs

UsbEventCB: Detected SS USB Connection

USBSetupCB:In SET_FTR 0::1

USBSetupCB:In SET_FTR 0::1

USBSetupCB:In SET_FTR 0::1

USBSetupCB:In SET_FTR 0::1

USBSetupCB:In SET_FTR 0::1

USBSetupCB:In SET_FTR 0::1

USBSetupCB:In SET_FTR 0::1

UVC: Completed 0 frames and 0 buffers

UVC: Completed 0 frames and 0 buffers

UVC: Completed 0 frames and 0 buffers

UVC: Completed 0 frames and 0 buffers

UVC: Completed 0 frames and 0 buffers

USBSetupCB:In SET_FTR 0::1

UsbEventCB: SUSPEND encountered

USBSetupCB:In SET_FTR 0::1

Leaving Suspend Mode

UVC: Completed 0 frames and 0 buffers

Clear feature request detected...

please let me know that there is not enough of explain.

thanks a lot.

best reagards,

TaeYoung Lee

0 Likes

Hello,

Sorry If I didnt understand you properly. But can you please let me know why exactly you are making use of 32 bit parallel interface?

Also, please let me know if the device is enumerating properly as FX3 under camera in device manager. Also, is the new resolution i.e 1080p found in the host application? If both these are successful, then the descriptors are fine.

From the logs I understand that nothing is actually sent to the host. I understand from your previous reply that you are making use of some patterns for streaming image data. Please explain how these patterns are provided to GPIF of FX3.

Please probe FV, LV and PCLK and share the traces.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hello,

I am making use of 32 bit parallel interface to improve streaming performance.

- I am using Amcap or VirtualDub as host application.

- surely  I check fx3 camera in the device manager

- I can't prove FV, LV, PCLK (there is not TP..)

Please check upload files.

maybe it can help you to understand

best reagards,

TaeYoung Lee

0 Likes

Hello,

I'm not able to open the project that you shared. Please share it again.

Also, please let me know if you are able to select 1080p in AMCAP.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

hello,

Please check it again.

thanks

Best Reagards,

TaeYoung Lee

0 Likes

Hello,

Thanks Iam able to open the source now.

Please let me know if you are able select 1080p resolution in AMCap?

Please make use of API CyU3PDeviceReset(CyFalse); under CY_FX_USB_UVC_SET_CUR_REQ inside the switch case CY_FX_UVC_COMMIT_CTRL found in the function UVCHandleVideoStreamingRqts. This is to find whether the control reaches this point. If it reaches there, i.e SET_CUR request is obtained from the host, then FX3 will enumerate as bootloader device. Otherwise the device will still show up as FX3 camera in device manager.

Please perform this test and let me know the result.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hello,

thanks for your reply.

first of all, Maybe AMCap supports 1080p resolution automatically.

I tried use of API CyU3PDeviceReset(CyFalse), but It didn't work...

I don't understand that exactly. i.i

Best Reagards,

TaeYoung Lee

0 Likes

Hello,

1. Please let me know if you are able to see FX3 camera under Devices Tab of AMCap.

2. If you are able to see this, then open options -> Video Capture Pin... . You will be able to see the following dialog box:

pastedImage_0.png

You should see 1080p under Output Size. Then click Apply and hit Save.

3. Once this is done, the host will set the device to stream at 1080p resolution.

4. If you have placed CyU3PDeviceReset(CyFalse); inside CY_FX_USB_UVC_SET_CUR_REQ as shown below, then it should reset the device.

pastedImage_1.png

This is because this request is used by the host to select the parameters for video stream. If the host properly selects the resolution, then the control should reach here. Please verify whether you followed all the steps mentioned above.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hello,

1. Please let me know if you are able to see FX3 camera under Devices Tab of AMCap.

- I confirmed that.

12345.png

2. If you are able to see this, then open options -> Video Capture Pin... . You will be able to see the following dialog box:

You should see 1080p under Output Size. Then click Apply and hit Save.

- I confirmed that.

1234.png

3. Once this is done, the host will set the device to stream at 1080p resolution.

- Before following your suggests, AMCap is stopped.

Now AMCap is still working (but there is black screen..)

4. If you have placed CyU3PDeviceReset(CyFalse); inside CY_FX_USB_UVC_SET_CUR_REQ as shown below, then it should reset the device.

- As soon as AMCap program start, fx3 device driver is disconnected right away.

Best Regards,

TaeYoung Lee.

0 Likes

Hello,

So, now are you able to see FX3 enumerated as a bootloader device in control center?

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

yes, I am able to see FX3 Device Driver after upload the image

- Actually now I am uploading the image file on RAM for test

123.png

123.png

Best Regards,

TaeYoung Lee.

0 Likes

I try to modify some codes,

(remove CyU3PDeviceReset(CyFalse);, set FrameRate(46fps).. etc)

and then I got some log below..

but I still see the black screen.

Do you have some advice for this?

Best Regards,

TaeYoung Lee.

pastedImage_0.png

0 Likes

Hello,

The statement CyU3PDeviceReset(CyFalse); was just used to check whether the control reaches SET_CUR under COMMIT_CTRL. That can be removed as we understood that the control is reaching there. But fps need not be changed, you can keep it at 45fps itself.

Please confirm that you are trying to stream a data format that is UVC compliant. This is because AMCap can understand only those data formats that are UVC compliant. Also, from your previous responses, I understood that you are not using an image sensor, instead you are generating a pattern using FPGA. Please let me know at what frame rate have you configured the FPGA to send out the frames.

Also, I can see a Clear Feature request being issued by the host. Is this because you are closing the host application in between streaming? If not, when does this occur?

For testing you can further do some changes inside the uvc.c source. The following changes are to be made. The changes can be found in the following snippets.

1. Initialize the following variables (g1tempfmsize, g1fmsize, fmflag);

pastedImage_0.png

2. Inside the PROD_EVENT in DMA Call back, add the modifications as shown below:

pastedImage_1.png

3. Under DEBUG_PRINT_FRAME_COUNT, do the following changes

pastedImage_0.png

After doing the above changes, please share the UART logs.

Best Regards,​

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

hi, Jayakrishna

I try to follow your guide, so finally solve the problems.

Thanks you for your help.

Best Regards,

TaeYoung Lee.

0 Likes

Hello,

Good to hear that the problem is resolved. Please let me know which step helped you to solve the problem.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hello,

In the previous reply make sure that you dont miss to make g1tempfmsize and fmflag to 0 in the appropriate location as mentioned in the snippet.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes