USB 3 transfer failures

@RNZNobody
L4T 23.2, I don’t know what the status of the firmware patch is under 24.1.

@Kangalow
I’m also having issues with the RGB color stream. How did you fix the conversion of color formats?

@zebra50
The Jetson JPEG hardware decoder produces a RGBA format color stream, the viewer is for BGRA. I didn’t look through much of the code other than to satisfy my curiosity, note that there may already be proper conversion code available within the libfreenect2 library. 5 minute, brain dead slow code for the Protonect example follows. If you’re going to use this for reals, you should invest in optimizing the code, this looks suspiciously like something one could do in parallel.

libfreenect2::Frame *rgb = frames[libfreenect2::Frame::Color];
    // On the Jetson, the hardware decoder produces RGBA
    // The viewer uses BGRA, this is the brain dead approach to conversion
    unsigned char *convertedData = (unsigned char*) malloc(rgb->height*rgb->width*rgb->bytes_per_pixel) ;
    int offset = 0;
    for (unsigned int y = 0 ; y < rgb->height; y++) {
        for (unsigned int x=0 ; x < rgb->width; x++) {
            convertedData[offset] = rgb->data[offset+2] ;
            convertedData[offset+1] = rgb->data[offset+1];
            convertedData[offset+2] = rgb->data[offset+0];
            convertedData[offset+3] = rgb->data[offset+3];
            offset += 4;
        }
    }
    memcpy(rgb->data,convertedData,rgb->height*rgb->width*rgb->bytes_per_pixel);
   // Free the data somewhere
    free(convertedData) ;

Testing another camera with this JTX1 patch, the Intel RealSense R200. The R200 identifies correctly, but does not start streaming. The R200 works correctly with the previous firmware.

@Kangalow

Actually you can fix it by changing the line 56 from viewer.h

typedef ImageFormat<4, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE> F8C4;

to

typedef ImageFormat<4, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE> F8C4;

I am using libfreenect from Qt application and getting BGRA frames is an issue since QImage which I am converting the frame, doesn’t support BGRA format. Some kind of solution would be needed either to libfreenect or tegra’s libjpeg.
Are there sources for tegra libjpeg somewhere?
I could try to recompile it changing the RGB offsets from jmorecfg.h and use it only on libfreenect since it is using dlopen instead of linking.

I tried and libfreenect2 works in this case. However, the performance here is very very poor. But Kinect 2 connected to an external USB expansion card can reach the normal performance.

Will the patch work on Jetson TK1?

On R24 revision 2.1, I am seeing the Kinect v2 work intermittently, but drop out with transfer failure errors after a few minutes. Is the only solution to this a PCIe USB expansion? We are using a 3rd party carrier board with no PCIe port, only an M.2 port for an ssd (Auvidea J120)

Hi haljarrett, please attach the log for reference. Is it possible to try it on devkit?

Find attached the relevant section of the dmesg log file - It is about 10 seconds worth of messages, most of which seem related. This seems to be the most relevant section, but I am not sure which other parts hold significance:

[Tue Jul 11 18:58:03 2017] usb 2-2.1: reset SuperSpeed USB device number 37 using tegra-xhci
[Tue Jul 11 18:58:03 2017] usb 2-2.1: Parent hub missing LPM exit latency info. Power management will be impacted.

A bunch of:

[Tue Jul 11 18:58:03 2017] platform c9.regulator: Driver reg-fixed-sync-voltage requests probe deferral
[Tue Jul 11 18:58:03 2017] platform ca.regulator: Driver reg-fixed-sync-voltage requests probe deferral
[Tue Jul 11 18:58:03 2017] platform cb.regulator: Driver reg-fixed-sync-voltage requests probe deferral
[Tue Jul 11 18:58:03 2017] platform cc.regulator: Driver reg-fixed-sync-voltage requests probe deferral
[Tue Jul 11 18:58:03 2017] platform cd.regulator: Driver reg-fixed-sync-voltage requests probe deferral
[Tue Jul 11 18:58:03 2017] reg-fixed-sync-voltage ce.regulator: Consumer c0 does not have device name


And finally:

[Tue Jul 11 18:58:03 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?
[Tue Jul 11 18:58:03 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?
[Tue Jul 11 18:58:03 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?
[Tue Jul 11 18:58:05 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?
[Tue Jul 11 18:58:05 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?
[Tue Jul 11 18:58:05 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?
[Tue Jul 11 18:58:06 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?
[Tue Jul 11 18:58:06 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?
[Tue Jul 11 18:58:06 2017] tegra-xhci tegra-xhci: WARN Event TRB for slot 7 ep 2 with no TDs queued?

As for running it on the devkit, by that do you mean the default provided development board?

Yes, there is a USB3 port on the default development board. Can you try with it?

Is the firmware patch mentioned here required for TX2? Is it the same patch?

You may try it if you see same error, but the result is uncertain.