Unable to connect uvc extension unit using direct show KSproperty

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

cross mob
Anonymous
Not applicable

recently loaded the cypress uvc example. using mircrosoft directshow KSproperty to access the uvc extension unit controls but it returns "element not found", i tried to modify the extension unit descriptor to expose some dummy controls but it still the same. any advice? btw the streamming video works, just the controls are not working

0 Likes
3 Replies
Anonymous
Not applicable

Hi,

   

I am not sure of why this is happening. Can you please connect some non-Cypress UVC Device (may be your webcam) and see if you are able to detect the extension unit descriptor. This is just to narrow down the location of the problem.

   

Regards,

   

-Madhu Sudhan

0 Likes
Anonymous
Not applicable

hi,

   

i tried with our company old uvc device and it is working fine with dshow extension unit query, KSproperty returns S_OK, but with cypress fx3 it returns element not found. in the AN75779 example, it have implemented GET_INFO, GET_LEN, GET_MAX, GET_MIN, GET_CUR, GET_DEF, for extension unit controls. i have also expose the extension control descriptor to reflect support for extension controls.

0 Likes
Anonymous
Not applicable

Hi,

   

Following are the modifications required in example project associated with AN75579:

   

1. Update the 16 byte GUID field of Extension Unit Descriptor in the cyfxuvcdscr.c file with the GUID generated using Visual Studio:                   Go to TOOLS->Create GUID. In the pop-up window, choose Registry Format. A GUID will be generated in the Result field.
2. Update the Number of controls in this terminal field of Extension Unit Descriptor in the cyfxuvcdscr.c file depending on the number of Extension Unit controls to be implemented. Accordingly, update the bmControls field which is a bitmap of the Extension Unit controls implemented. Suppose, four Extension Unit controls have to be implemented, following is an example Extension Unit Descriptor:

   

/* Extension Unit Descriptor */

   

        0x1C,                                             /* Descriptor size */

   

        0x24,                                            /* Class specific interface desc type */

   

        0x06,                                            /* Extension Unit Descriptor type */

   

        0x03,                                           /* ID of this terminal */

   

        0xB8,0x19,0x77,0x02,               /* 16 byte GUID. A unique GUID generated using Visual Studio has to be updated in this field*/

   

        0x7F,0xB0,0x67,0x45,

   

        0x88,0xB1,0x20,0x34,

   

        0x36,0xAD,0xBE,0x5D,

   

        0x04,                                            /* Number of controls in this terminal */

   

        0x01,                                           /* Number of input pins in this terminal */

   

        0x02,                                              /* Source ID : 2 : Connected to Proc Unit */

   

        0x03,                                           /* Size of controls field for this terminal : 3 bytes */

   

        0x0F,0x00,0x00,                                       /* bmControls */

   

        0x00,                                            /* String desc index : Not used */

   

 

   

3. SET_CUR, GET_CUR requests for Extension Unit controls have to be handled in UVCHandleExtensionUnitRqts() function of uvc.c file.

   

Eg:

   

#define  EXTENSION_UNIT_CONTROL (uint16_t) (0x0100)

   

static uint8_t current_value_extension_unit_control;

   

 

   

 /* Handler for control requests addressed to the Extension Unit */

   

static void UVCHandleExtensionUnitRqts (void)

   

{

   

            CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

   

            uint16_t readCount;

   

               switch(wValue){

   

                case EXTENSION_UNIT_CONTROL :

   

                    switch(bRequest){

   

                       case CY_FX_USB_UVC_GET_DEF_REQ:

   

                       case CY_FX_USB_UVC_GET_MIN_REQ:

   

                           glEp0Buffer[0] = 1;

   

                           CyU3PUsbSendEP0Data (1, (uint8_t *)glEp0Buffer);

   

                       break;

   

                       case CY_FX_USB_UVC_GET_RES_REQ:

   

                            glEp0Buffer[0] = 1;

   

                            CyU3PUsbSendEP0Data (1, (uint8_t *)glEp0Buffer);

   

                       break;

   

                       case CY_FX_USB_UVC_GET_MAX_REQ:

   

                           glEp0Buffer[0] = 50;

   

                           CyU3PUsbSendEP0Data (1, (uint8_t *)glEp0Buffer);

   

                       break;

   

                       case CY_FX_USB_UVC_GET_CUR_REQ:

   

                                       glEp0Buffer[0] = current_value_extension_unit_control;

   

                           CyU3PUsbSendEP0Data (1, (uint8_t *)glEp0Buffer);

   

                       break;

   

                       case CY_FX_USB_UVC_GET_LEN_REQ:

   

                           glEp0Buffer[0] = 0x01;

   

                           glEp0Buffer[1] = 0x00;

   

                           CyU3PUsbSendEP0Data (2, (uint8_t *)glEp0Buffer);

   

                       break;

   

                       case CY_FX_USB_UVC_GET_INFO_REQ:

   

                           glEp0Buffer[0] = 3;                        /* GET/SET requests are supported. */

   

                           CyU3PUsbSendEP0Data (1, (uint8_t *)glEp0Buffer);

   

                       break;

   

                       case CY_FX_USB_UVC_SET_CUR_REQ:

   

                           apiRetStatus = CyU3PUsbGetEP0Data (CY_FX_UVC_MAX_PROBE_SETTING_ALIGNED,

   

                                                       glEp0Buffer, &readCount);

   

                           if (apiRetStatus == CY_U3P_SUCCESS){

   

                                       current_value_extension_unit_control = glEp0Buffer[0];

   

                           }

   

                         break;

   

                       default:

   

                                     CyU3PUsbStall (0, CyTrue, CyFalse);

   

                       break;

   

                       }

   

                break;

   

               default:

   

                    CyU3PUsbStall (0, CyTrue, CyFalse);

   

                break;

   

                  }

   

}

   

 

   

In addition to the above mentioned firmware changes, it is required to modify the Host Application code. For the Host Application code to implement UVC Extension Unit, following link from Microsoft can be referred:

   

https://msdn.microsoft.com/en-us/windows/hardware/drivers/stream/uvc-extension-unit-code-samples

0 Likes