1 2 Previous Next 21 Replies Latest reply on Nov 25, 2020 9:00 AM by GrAU_4638336

    CX3: Stream running on Windows but not on Linux/Mac

    GrAU_4638336

      Good day,

       

      In previous posts (mentioned below), I was able to successfully add a CDC debug interface and have my image stream running with a RAW10 format.

       

      CDC Debug interface:
      Debug interface through USB for CX3 + Image sensor application

       

      RAW10 Image stream:

      Stream is not working: Custom board OV9782 / CYUSB3064

       

      Since that, I have been working on enabling/disabling the debug interface for production purpose. Both seem to work as expected on my host (Windows)

      Although I'm struggling to find a way to get the YUV pixels value before automatic reformat by Windows...

      Any hints are welcome, but I'll most probably create another topic for this point.

       

      Anyway! The question for this topic is the following.

       

      I have my camera working as expected on Windows, including or not the CDC interface.
      I have my UVC camera correctly recognise on my linux host as a UVC device without any explicit issue.

       

      See report of sudo dmesg for UVC only firmware:

       

      [  248.912645] usb 1-2.3: new high-speed USB device number 4 using tegra-xusb
      [  248.936318] usb 1-2.3: New USB device found, idVendor=04b4, idProduct=00f3
      [  248.936390] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [  248.936440] usb 1-2.3: Product: WestBridge
      [  248.936484] usb 1-2.3: Manufacturer: Cypress
      [  248.936529] usb 1-2.3: SerialNumber: 0000000004BE
      [  310.382199] usb 1-2.3: USB disconnect, device number 4
      [  310.605183] usb 1-2.3: new high-speed USB device number 5 using tegra-xusb
      [  310.627643] usb 1-2.3: New USB device found, idVendor=04b4, idProduct=00c3
      [  310.627661] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
      [  310.627674] usb 1-2.3: Product: CX3-UVC
      [  310.627685] usb 1-2.3: Manufacturer: Cypress
      [  310.698215] uvcvideo: Found UVC 1.10 device CX3-UVC (04b4:00c3)
      [  310.700264] uvcvideo 1-2.3:1.0: Entity type for entity Extension 3 was not initialized!
      [  310.708365] uvcvideo 1-2.3:1.0: Entity type for entity Processing 2 was not initialized!
      [  310.716709] uvcvideo 1-2.3:1.0: Entity type for entity Camera 1 was not initialized!
      [  310.725437] input: CX3-UVC as /devices/70090000.xusb/usb1/1-2/1-2.3/1-2.3:1.0/input/input4
      [  310.726003] usbcore: registered new interface driver uvcvideo
      [  310.726006] USB Video Class driver (1.1.1)
      [  311.662184] usb 1-2.3: USB disconnect, device number 5
      [  311.917025] usb 1-2.3: new high-speed USB device number 6 using tegra-xusb
      [  311.938896] usb 1-2.3: New USB device found, idVendor=04b4, idProduct=00c3
      [  311.938903] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
      [  311.938907] usb 1-2.3: Product: CX3-UVC
      [  311.938911] usb 1-2.3: Manufacturer: Cypress
      [  311.940507] uvcvideo: Found UVC 1.10 device CX3-UVC (04b4:00c3)
      [  311.942140] uvcvideo 1-2.3:1.0: Entity type for entity Extension 3 was not initialized!
      [  311.950615] uvcvideo 1-2.3:1.0: Entity type for entity Processing 2 was not initialized!
      [  311.961983] uvcvideo 1-2.3:1.0: Entity type for entity Camera 1 was not initialized!
      [  311.973516] input: CX3-UVC as /devices/70090000.xusb/usb1/1-2/1-2.3/1-2.3:1.0/input/input5
      [  314.117384] usb 1-2.3: usb_suspend_both: status 0
      

       

      However, it's impossible to get the stream running, neither OpenCV, Guvc, VLC, V4L have been able to give me an actual image..
      So I just thought 'Ok, let's just debug through the CDC interface', but this one is not recognise either.

       

      See report of sudo dmesg for UVC + CDC interface firmware:

       

      [ 1181.438918] usb 1-2.3: new high-speed USB device number 11 using tegra-xusb
      [ 1181.462045] usb 1-2.3: New USB device found, idVendor=04b4, idProduct=00f3
      [ 1181.462115] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [ 1181.462165] usb 1-2.3: Product: WestBridge 
      [ 1181.462212] usb 1-2.3: Manufacturer: Cypress
      [ 1181.462619] usb 1-2.3: SerialNumber: 0000000004BE
      [ 1212.189895] usb 1-2.3: USB disconnect, device number 11
      [ 1212.413706] usb 1-2.3: new high-speed USB device number 12 using tegra-xusb
      [ 1212.435694] usb 1-2.3: New USB device found, idVendor=04b4, idProduct=00c3
      [ 1212.435701] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
      [ 1212.435706] usb 1-2.3: Product: CX3-UVC
      [ 1212.435710] usb 1-2.3: Manufacturer: Cypress
      [ 1212.437480] uvcvideo: Found UVC 1.10 device CX3-UVC (04b4:00c3)
      [ 1212.441078] uvcvideo 1-2.3:1.0: Entity type for entity Extension 3 was not initialized!
      [ 1212.449238] uvcvideo 1-2.3:1.0: Entity type for entity Processing 2 was not initialized!
      [ 1212.457347] uvcvideo 1-2.3:1.0: Entity type for entity Camera 1 was not initialized!
      [ 1212.465475] input: CX3-UVC as /devices/70090000.xusb/usb1/1-2/1-2.3/1-2.3:1.0/input/input9
      [ 1212.465944] cdc_acm: probe of 1-2.3:1.2 failed with error -22
      [ 1213.469985] usb 1-2.3: USB disconnect, device number 12
      [ 1213.737699] usb 1-2.3: new high-speed USB device number 13 using tegra-xusb
      [ 1213.845906] usb 1-2.3: New USB device found, idVendor=04b4, idProduct=00c3
      [ 1213.845944] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
      [ 1213.845967] usb 1-2.3: Product: CX3-UVC
      [ 1213.845990] usb 1-2.3: Manufacturer: Cypress
      [ 1213.865448] uvcvideo: Found UVC 1.10 device CX3-UVC (04b4:00c3)
      [ 1224.003255] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
      [ 1229.123320] uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 34).
      [ 1229.131667] uvcvideo: Failed to initialize the device (-5).
      [ 1229.139637] cdc_acm: probe of 1-2.3:1.2 failed with error -22
      

       

       

      I tried to find an explanation for the lines:

       

      UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.

      uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 34).

      uvcvideo: Failed to initialize the device (-5).

      cdc_acm: probe of 1-2.3:1.2 failed with error -22

       

      Without being successful..
      I was hoping that someone of you would have the answer for this.

       

      I've attached the current state of my firmware to this post so you can have a look at it.
      Let me know if I can provide anything else to help you understand the issue.

      In the mean time I'll keep looking for a fix on my side.

       

      Thanks in advance for you help!

       

      Greg

        • 1. Re: CX3: Stream running on Windows but not on Linux/Mac
          HemanthR_06

          Hi Greg,

           

          The attached firmware handles GET_DEF (PROBE control) request - line 996 of cycx3_OV9782.c file.

          It sends 34 bytes as expected.

          In spite of this, Linux UVC driver is complaining of non-compliance.

           

          I have seen in other communities that many people have faced it with other UVC devices too. One of the suggestions was to modify QUIRKs. But I do not think this is a good way to handle this, as the device firmware supports GET_DEF request. - You can just try it for debug purpose (Link: https://sourceforge.net/p/linux-uvc/mailman/message/29832729/

          https://www.ideasonboard.org/uvc/faq/ )

           

          It would be helpful if you can take an USB trace to check the request from host and response from the device.

           

          Regards,

          Hemanth

          • 2. Re: CX3: Stream running on Windows but not on Linux/Mac
            GrAU_4638336

            Hi Hemanth,

             

            Thanks for your message, the linux host I am using is a Jetson Nano and does not contain QUIRKs as mentioned in the post linked. For that reason I can't use this temporary fix.

            I will record the USB trace through Wireshark and add them to a message below.

             

            Although I don't understand why the "GET_DEF (PROBE control)" issue is showing up when the CDC debug interface is active and not when the production mode is enabled. This don't make sense since this part of the code is not modified by CX3_DEBUG_ENABLE.

             

            It also seems that the CDC debug interface is raising the error, as cdc_acm: probe of 1-2.3:1.2 failed with error -22 is displayed before the GET_DEF (PROBE).

            Is there some specific compliance needs that are not match in my firmware for this interface?


            Thanks for you help,

             

            Greg

            • 3. Re: CX3: Stream running on Windows but not on Linux/Mac
              GrAU_4638336

              Hi Hemanth,

               

              I have been able to run the firmware example using the CDC interface (OV5640).

              However, there were an issue with linux that some people will encounter. So here is a the fix.

              When dmesg is throwing cdc_acm 2-1.1:1.2: failed to set dtr/rts, this is most likely due to modemmanager trying to use the port.
              You can avoid this by typing sudo apt-get purge modem manager in a terminal. Then the serial communication port is accessible without error.

               

              Sadly, I'm still not able to use my own firmware for the same purpose, which let me think that there is mismatch between the two configurations. I'm going to cross check my work but if someone have a clue of what is causing the issue, a hint would be really much appreciated.

               

              Thanks,

               

              Greg

              • 4. Re: CX3: Stream running on Windows but not on Linux/Mac
                HemanthR_06

                Hi Greg,

                 

                Thank you very much for posting the fix for the issue.  This will help a lot of people facing this issue.

                 

                Regarding your project, please try commenting out CyU3PThreadSleep(1000);  in CyCx3AppInit() - suggesting this suspecting a timing issue in Host-device communication during enumeration.

                 

                Regards,

                Hemanth

                • 5. Re: CX3: Stream running on Windows but not on Linux/Mac
                  GrAU_4638336

                  Hi Hermanth,

                   

                  My pleasure!

                   

                  I already reduced this value to (100) yesterday and the firmware was behaving the same. I've tried your suggestion on commenting out the Sleep statement, this is making the device to crash. I believe the DmaChannelCreate / ChannelReset need this thread sleep to work properly.
                  I have also removed the mpicsiwakeup() in all the switch/case resolution functions and put the XShutDown statement above after the MipicsiInit function. This was creating a double call of the Thread Entry.
                  However this does not fix my current issue...

                   

                  I have other lines in the dmesg:

                  [ 5850.952479] usb 1-2.3: Device not responding to setup address.

                  [ 5851.164453] usb 1-2.3: Device not responding to setup address.

                  [ 5851.375703] usb 1-2.3: device not accepting address 22, error -71

                   

                   

                  Any thought on that?
                  I'm running out of idea..

                   

                  Thanks,

                   

                  Greg

                  • 6. Re: CX3: Stream running on Windows but not on Linux/Mac
                    HemanthR_06

                    Hi Greg,

                     

                    Is it the same firmware posted above, which is giving the error: device not responding to set address. If not, please mention the change done to the firmware.

                     

                    Regards,

                    Hemanth

                    • 7. Re: CX3: Stream running on Windows but not on Linux/Mac
                      GrAU_4638336

                      Hi Hermanth,

                       

                      I believe the only changes I applied are the ones mentioned above.

                      I've attached the last version of it, just in case.

                       

                      I pretty the Setup address issue above is not really important at the moment, it can happen only randomly while programming the CX3.

                       

                      The UVC Probe control which is the potential real blocker happened every single time.

                       

                      Thanks,

                       

                      Greg

                      • 8. Re: CX3: Stream running on Windows but not on Linux/Mac
                        HemanthR_06

                        Hi Greg,

                         

                        Ok. So, the error "UVC non compliance - GET_DEF(PROBE) not supported", comes only for your firmware(even after purge modem manager is called) and not for OV5640 project. Am I correct?

                         

                        Regards,

                        Hemanth

                        • 9. Re: CX3: Stream running on Windows but not on Linux/Mac
                          GrAU_4638336

                          Hi Hermanth,

                           

                          Absolutely correct!
                          I can also provide the OV5640 custom example that I'm using.

                           

                          Thanks,

                           

                          Greg

                          • 10. Re: CX3: Stream running on Windows but not on Linux/Mac
                            GrAU_4638336

                            Hermanth,

                             

                            I should notify you that, compare to the OV5640 example, my image stream is never available until the serial communication terminal has been open.

                            This could be one reason for that issue.

                            EDIT: And the OV5640 is using USB3.0 whereas OV9782 is using USB2.0, don't know if that can help..

                            I have crosscheck the uvc.c files and they are pretty much the same. Really hard to explain what is happening!

                             

                            I'm not able to figure why this is happening.

                            Greg

                            • 11. Re: CX3: Stream running on Windows but not on Linux/Mac
                              GrAU_4638336

                              Hi Cypress,

                               

                              This topic is still a blocker for me, do you have any hints to let me progress on this issue?

                               

                               

                              As a reminder:

                              • OV5640 example firmware working without problems on Windows and Linux host
                              • Custom Firmware OV9782 not working on Linux
                              • Custom debug firmware OV9782 working on Windows only if the CDC interface is opened
                                If the firmware in used in release mode (without CDC interface) image stream can be acquired normally on Windows (not working on Linux).
                              • Both have been tested under USB2.0
                              • Messages given by dmesg command on linux is as follow:

                               

                              UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.

                              uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 34).

                              uvcvideo: Failed to initialize the device (-5).

                              cdc_acm: probe of 1-2.3:1.2 failed with error -22

                               

                              Attached is the current state of the firmware.

                               

                              Thanks in advance for your help,

                               

                              Greg

                              • 12. Re: CX3: Stream running on Windows but not on Linux/Mac
                                HemanthR_06

                                Hi Greg,

                                 

                                I do not see CDC class request handling in the attached firmware. Can you please comment on the same.

                                Also please attach OV5640 firmware which works on Linux.

                                 

                                Regards,

                                Hemanth

                                • 13. Re: CX3: Stream running on Windows but not on Linux/Mac
                                  GrAU_4638336

                                  Hi Herman,

                                   

                                  I have been following the attached firmware example.

                                  Which does not seem to have any CDC class request?

                                   

                                  Could you provide an example of what you are expecting?

                                   

                                  Thanks,

                                   

                                  Greg

                                  • 14. Re: CX3: Stream running on Windows but not on Linux/Mac
                                    HemanthR_06

                                    Hi Greg,

                                     

                                    I was referring to the section Handling CDC Requests and Adding CDC Functionality section of the KBA: Adding Communication Device Class Interface to FX3 Firmware - KBA229099

                                     

                                    When you mentioned "OV5640 example firmware working without problems on Windows and Linux host", were you able receive debug log information on the host? And did you test with the project attached in your last post?

                                     

                                    Regards,

                                    Hemanth

                                    1 2 Previous Next