cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

Fly135
New Contributor

I'm having a strange problem supporting more than one resolution in my project. The following code sample is typical of sample code to handle this issue.  I get the correct resolution (frame) index in glCommitCtrl[3] when the wValue is PROBE, but I always get glCommitCtrl[3] = 1 when the wValue is COMMIT. 

In addition, the values in glCommitCtrl[18]-[21] contain the frame size when these commands are received.  The frame size is actually correct for the intended resolution (per the descriptors).  For example if 640x480 is index #1 and 320x240 is index #2 and 320x240 is the intended resolution then the frame size will be correct for 320x240 but the index will be 1 (640x480).  I am able to get around this problem by storing the frame index when I get the set PROBE and ignoring the value when I set the set COMMIT and using the one stored from PROBE.

Just wondering if this issue is familiar to anyone and they were able to solve it.

 

 

 

 

 

    /* Set Probe Control */
    if (wValue == CX3_APP_VS_PROBE_CONTROL)
    {
        glCurrentFrameIndex = glCommitCtrl[3];
    }
    else
    {
        /* Set Commit Control and Start Streaming*/
        if (wValue == CX3_APP_VS_COMMIT_CONTROL)
        {
            CyCx3AppImageSensorSetVideoResolution (glCommitCtrl[3]);

            if (glIsApplnActive)
            {
#ifdef CX3_DEBUG_ENABLED
                CyU3PDebugPrint (4, "\n\rUSB Setup CB:Call AppSTOP1");
#endif
                CyCx3AppStop();
            }

            CyCx3AppStart();
        }
    }
}

 

 

 

  

John A

0 Likes
1 Solution
Fly135
New Contributor

I believe I have solved my own problem.  There is a line in the ProbeCtrl data for each resolution....

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

I had a "1" in this field for each of the two resolutions.  The second one should be a "2".  In this project I manually added the second resolution and made the mistake.  I created a new project with two resolutions and was able to spot the discrepancy between the two projects in the cycx3_uvcdscr.c file.

John A

View solution in original post

0 Likes
1 Reply
Fly135
New Contributor

I believe I have solved my own problem.  There is a line in the ProbeCtrl data for each resolution....

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

I had a "1" in this field for each of the two resolutions.  The second one should be a "2".  In this project I manually added the second resolution and made the mistake.  I created a new project with two resolutions and was able to spot the discrepancy between the two projects in the cycx3_uvcdscr.c file.

John A

View solution in original post

0 Likes