Skip to content

Conversation

@hanyazou
Copy link
Contributor

From #598 (Protonect ignores ^C)

Add timeout argument for waitForNewFrames() in the Protonect main loop. The Protonect exit if no frames come from the Kinect sensor for 10 seconds. This works only with c++11 option.

Tested on Mac OS X and ubuntu.

  • Mac OS X 10.11 with ENABLE_CXX11=ON
    • run "Protonect -frames 1" 40,000 times (about 100 hours)
    • Timeout in waitForNewFrames() occurred 26 times
  • Mac OS X 10.11 with ENABLE_CXX11=OFF
    • build and run "Protonect" normally
  • ubuntu 15.10 (Intel Mac) with ENABLE_CXX11=ON
    • build and run "Protonect -frames 1" 10,000 times. (no timeout occurred)
  • ubuntu 15.10 (Intel Mac) with ENABLE_CXX11=OFF
    • build and run "Protonect -frames 1" 10,000 times. (no timeout occurred)

There are some remaining issues.

ISSUE 1:
Protonect exit abnormally with "Abort trap: 6" in Freenect2DeviceImpl::~Freenect2DeviceImpl() when the timeout fired. The probability is 5/26. (i.e. 5/40,000)
I think we can ignore this issue because the probability is very low.

& ./bin/Protonect -frames 1
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: ./bin/Protonect [-gpu=] [gl | cl | cuda | cpu] []
[-noviewer] [-norgb | -nodepth] [-help] [-version]
[-frames ]
To pause and unpause: pkill -USR1 Protonect
[Info] [OpenCLDepthPacketProcessorImpl] devices:
[Info] [OpenCLDepthPacketProcessorImpl] 0: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (CPU)[Intel]
[Info] [OpenCLDepthPacketProcessorImpl] 1: GeForce GTX 675MX (GPU)[NVIDIA]
[Info] [OpenCLDepthPacketProcessorImpl] selected device: GeForce GTX 675MX (GPU)[NVIDIA]
[Info] [OpenCLDepthPacketProcessorImpl] building OpenCL program...
[Info] [OpenCLDepthPacketProcessorImpl] OpenCL program built successfully
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 13 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @20:16 with serial 005697142447
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] opened
[Info] [Freenect2DeviceImpl] starting...
[Debug] [Freenect2DeviceImpl] status 0x090000: 1024
[Debug] [Freenect2DeviceImpl] status 0x090000: 9729
[Debug] [Freenect2DeviceImpl] status 0x090000: 9731
[Info] [Freenect2DeviceImpl] submitting rgb transfers...
[Info] [Freenect2DeviceImpl] submitting depth transfers...
[Info] [Freenect2DeviceImpl] started
device serial: 005697142447
device firmware: 4.0.3912.0
[Info] [VTRgbPacketProcessor] avg. time: 16.7513ms -> ~59.6968Hz
[Info] [VTRgbPacketProcessor] avg. time: 16.6441ms -> ~60.0814Hz
timeout!
[Info] [Freenect2DeviceImpl] closing...
[Info] [Freenect2DeviceImpl] stopping...
[Info] [Freenect2DeviceImpl] canceling rgb transfers...
libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
82471 Abort trap: 6 ./bin/Protonect cl -frames 1

ISSUE2:
Protonect message end with "status 0x090000: 1024" and does not show the window and images. The probability is 4,586/40,000. I will report this issue later separately.

& ./bin/Protonect -frames 1
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: ./bin/Protonect [-gpu=] [gl | cl | cuda | cpu] []
[-noviewer] [-norgb | -nodepth] [-help] [-version]
[-frames ]
To pause and unpause: pkill -USR1 Protonect
[Info] [OpenCLDepthPacketProcessorImpl] devices:
[Info] [OpenCLDepthPacketProcessorImpl] 0: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (CPU)[Intel]
[Info] [OpenCLDepthPacketProcessorImpl] 1: GeForce GTX 675MX (GPU)[NVIDIA]
[Info] [OpenCLDepthPacketProcessorImpl] selected device: GeForce GTX 675MX (GPU)[NVIDIA]
[Info] [OpenCLDepthPacketProcessorImpl] building OpenCL program...
[Info] [OpenCLDepthPacketProcessorImpl] OpenCL program built successfully
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 13 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @20:31 with serial 005697142447
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] opened
[Info] [Freenect2DeviceImpl] starting...
[Debug] [Freenect2DeviceImpl] status 0x090000: 1024

xlz added a commit that referenced this pull request Mar 13, 2016
Protonect: Add timeout arg for waitForNewFrame()
@xlz xlz merged commit cd77553 into OpenKinect:master Mar 13, 2016
@hanyazou hanyazou deleted the wait_new_frames_timeout branch March 14, 2016 12:27
@xlz xlz mentioned this pull request Mar 18, 2016
@floe
Copy link
Contributor

floe commented Mar 21, 2016

Now also in 0.1 branch, anyone care to re-test 0.1 on MacOS X?

@hanyazou
Copy link
Contributor Author

The -frames option 664ff3c is required to execute my long-run test of these fixes. Will you cherry pick the change to v1.0 branch? Or should I pick it locally to execute my test?

@floe
Copy link
Contributor

floe commented Mar 23, 2016

Ah, OK, I will also pick that one.

@hanyazou
Copy link
Contributor Author

I had no problem to patch that change locally. I started my long-run test. I will update tomorrow.

@hanyazou
Copy link
Contributor Author

I've run ./bin/Protonect cl -frames 1 10,000 times. (It took for about 20 hours.)

You can see the full test log at https://github.com/hanyazou/libfreenect2/blob/254fe1d6b21bdca084a6798d2ed41c5bea098647/test-logs/test.sh-20160325-070241.txt

@floe
Copy link
Contributor

floe commented Mar 26, 2016

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants