Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: OnReadSample() is called with error status: -1072875772 #2

Open
jackbrookes opened this issue Dec 19, 2018 · 12 comments
Open

Comments

@jackbrookes
Copy link

jackbrookes commented Dec 19, 2018

Attempting to run any of the Python scripts returns an error (even after unlocking device via .exe).

python .\minimumExample.py

Output:

[ WARN:1] videoio(MSMF): OnReadSample() is called with error status: -1072875772
[ WARN:1] videoio(MSMF): async ReadSample() call is failed with error status: -1072875772
[ WARN:2] videoio(MSMF): can't grab frame. Error: -1072875772
[ WARN:2] videoio(MSMF): can't grab frame. Error: -2147483638
Exiting Leap Image Thread!
[ WARN:0] terminating async callback

My system:

Python 3.7.1 64bit
Windows 10
Installed packages numpy+mkl, scipy, opencv-python, and opencv-contrib-python.

@BartArtanim
Copy link

I can confirm I have the exact same issues. The firmware was updated, but after that there are also bandwidth warnings on occasion, even on USB 3.0.

Using Python 3.6.7, but otherwise the data is the same.

@jackbrookes
Copy link
Author

jackbrookes commented Dec 19, 2018

I can confirm I have the exact same issues. The firmware was updated, but after that there are also bandwidth warnings on occasion, even on USB 3.0.

Using Python 3.6.7, but otherwise the data is the same.

I managed to get around the issue, I uninstalled the LM driver via Device Manager, and reinstalled. I also made sure the LM Control Panel app was NOT running. Now, it seems to work fine. Not sure which fixed it.

@mstranne
Copy link

mstranne commented Jan 8, 2019

I had the same issue, but uninstalling and reinstalling the driver and not running the Control Panel just leeds to an similar issue in my case:

python .\cameraControlExample.py

Output:

[ WARN:1] videoio(MSMF): can't grab frame. Error: -2147483638
Exiting Leap Image Thread!

Did you use any specific driver?

btw. I had to change:
leap = leapuvc.leapImageThread() to leap = leapuvc.leapImageThread(source = 1)
otherwise the script was using my laptops built-in camera.

@jackbrookes
Copy link
Author

[ WARN:1] videoio(MSMF): can't grab frame. Error: -2147483638
Exiting Leap Image Thread!

OK so I had this error too - seems to show up when there are other cameras attached to the PC. So to fix this, I disabled the Vive Cam as well as my built-in webcam in device manager.

@mstranne
Copy link

Ok disabling the built-in camera leads me to another error:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\Dell9560\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\Users\Dell9560\Work\Vendors\leapuvc-master\Python\leapuvc.py", line 40, in run
    frame = np.reshape(frame, (self.resolution[1], self.resolution[0]*2))
  File "C:\Users\Dell9560\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\fromnumeric.py", line 279, in reshape
    return _wrapfunc(a, 'reshape', newshape, order=order)
  File "C:\Users\Dell9560\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\fromnumeric.py", line 51, in _wrapfunc
    return getattr(obj, method)(*args, **kwds)
ValueError: cannot reshape array of size 921600 into shape (480,1280)

Did you also had any similar problem? I will have a look at the resolutions, maybe I can fix that.

@OlafHaag
Copy link

OlafHaag commented Feb 24, 2019

To make the can't grab frame errors to go away you need to pause the tracking. You could close the control panel, but pausing is enough. Unfortunately it doesn't solve my problem, as I then get only black images with the minimal example, maybe related to #5 . When I hit q, I get
Exiting Leap Image Thread! [ WARN:1] terminating async callback

Uninstalling the device in device manager and reinstalling the software didn't solve the problem. Just the Name of the device changed. Before it was LeapMotion Devkit or something, and now it's 'Leap Motion Controller'

Win10, Python 3.7.2, Software-Version: 4.0.0+52173, Firmware Revision: 1.7.1

EDIT: Nevermind. Now that it's daylight I see that the screens are black because of the low exposure. So it works. I think this issue is resolved with the solution of pausing the tracking in the control panel.

@tcboy88
Copy link

tcboy88 commented Mar 21, 2019

Can't get the infrared LED to light up after pausing tracking in Leap control panel.
Tried leap.setLeftLED(True) and return true but no effect

@gitunit
Copy link

gitunit commented Sep 7, 2019

@mstranne have you ever solved the following issue?
"ValueError: cannot reshape array of size 921600 into shape (480,1280)"

@gitunit
Copy link

gitunit commented Sep 14, 2019

i figured it out. problem was most probably due to not correct camera access. i noticed that this happens when i have my build-in camera from the notebook disabled. as soon as i have enabled it, the error went away.
also i have tested the leapuvc cam on the recent Raspbian Buster (kernel 4.19) where it worked (but not every setting was supported). it worked as well on Windows 8 and Ubuntu 16.04. it didn't work on Ubuntu 14.04, therefore i guess it needs a certain kernel version (on Debian).

@shivaprasadgh
Copy link

shivaprasadgh commented Jul 22, 2021

minimumExample.py

Process finished with exit code -1

or i keep getting when I run firmware.exe

[Critical] Device stopped sending frames. Attempting to restart streaming.
[Critical] Device stopped sending frames. Attempting to restart streaming.

or usually it shows

Exiting Leap Image Thread!

can anyone please help me solve this issue?

@nada1954
Copy link

I solved it by allowing settings---> control panel ----> camera ----> allow desktop app to access your camera e.g. pythonw
then run the script from pythonw.
sorry I began python coding 6 months ago.

@amgz1997
Copy link

Hello! I try to display the ultraleap frame with the leapuvc but i have the same problem: Exiting leap image Thread!

I had the same error with source=1 or 0

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

No branches or pull requests

9 participants