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

Windows fails to load avbin.dll #693

Closed
mmagnuski opened this Issue Sep 19, 2014 · 10 comments

Comments

Projects
None yet
4 participants
@mmagnuski
Contributor

mmagnuski commented Sep 19, 2014

I am having problems with running latencyFromTone.py coder demo.
When I run it from the coder view I get the following error:

##### Running: D:\Programy\PsychoPy2\lib\site-packages\psychopy-1.79.01-py2.7.egg\psychopy\demos\coder\input\latencyFromTone.py #####
Traceback (most recent call last):
  File "D:\Programy\PsychoPy2\lib\site-packages\psychopy-1.79.01-py2.7.egg\psychopy\demos\coder\input\latencyFromTone.py", line 9, in <module>
    from psychopy import microphone, sound, core, visual, event
  File "D:\Programy\PsychoPy2\lib\site-packages\psychopy-1.79.01-py2.7.egg\psychopy\visual\__init__.py", line 13, in <module>
    from psychopy.visual.window import Window, getMsPerFrame, openWindows
  File "D:\Programy\PsychoPy2\lib\site-packages\psychopy-1.79.01-py2.7.egg\psychopy\visual\window.py", line 17, in <module>
    import pyglet
  File "D:\Programy\PsychoPy2\lib\site-packages\pyglet\__init__.py", line 68, in <module>
    avbindll = ctypes.cdll.avbin
  File "D:\Programy\PsychoPy2\lib\ctypes\__init__.py", line 435, in __getattr__
    dll = self._dlltype(name)
  File "D:\Programy\PsychoPy2\lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 1114] Procedura inicjowania biblioteki dołączanej dynamicznie (DLL) nie powiodła się

The WindowsError says something like "the procedure of initiating dynamic-link library did not succeed".

My settings:

  • Windows 8
  • PsychoPy has been installed with the installer (version 1.80.04)
  • avbin.dll is present in C:\Windows\SysWOW64\,
  • previouslly all my psychopy experiments worked very well on this computer (although none included sound recording).

My general goal:

I need to record participant's voice responses during the experiment, I was considering pyAudio but would prefer to have it done through psychopy.

@mmagnuski

This comment has been minimized.

Contributor

mmagnuski commented Sep 21, 2014

I tried to run the same demo on a different computer (Windows 7) and got a similar error:

##### Running: E:\Programy\PsychoPy2\lib\site-packages\psychopy-1.80.03-py2.7.egg\psychopy\demos\coder\input\latencyFromTone.py #####
Traceback (most recent call last):
  File "E:\Programy\PsychoPy2\lib\site-packages\psychopy-1.80.03-py2.7.egg\psychopy\demos\coder\input\latencyFromTone.py", line 9, in <module>
    from psychopy import microphone, sound, core, visual, event
  File "E:\Programy\PsychoPy2\lib\site-packages\psychopy-1.80.03-py2.7.egg\psychopy\visual\__init__.py", line 13, in <module>
    from psychopy.visual.window import Window, getMsPerFrame, openWindows
  File "E:\Programy\PsychoPy2\lib\site-packages\psychopy-1.80.03-py2.7.egg\psychopy\visual\window.py", line 16, in <module>
    import pyglet
  File "E:\Programy\PsychoPy2\lib\site-packages\pyglet\__init__.py", line 68, in <module>
    avbindll = ctypes.cdll.avbin
  File "E:\Programy\PsychoPy2\lib\ctypes\__init__.py", line 435, in __getattr__
    dll = self._dlltype(name)
  File "E:\Programy\PsychoPy2\lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 998] Nieprawidłowy dostęp do lokalizacji w pamięci

The widows error this time says something like "incorrect access to memory location"

However PyAudio works very well.

@sci-tab

This comment has been minimized.

sci-tab commented Jan 20, 2018

+1 This happens for me as well. Win10, Win7, text stim only and using the demo scripts provided. It doesn't happen on my Linux or OSx systems. It's certainly reproduce-able. Prematurely closed w/o response in this ticket: #1483

It doesn't seem to impact timing etc, I did some pretty extensive testing but it would be nice to understand why.

@mmagnuski

This comment has been minimized.

Contributor

mmagnuski commented Jan 20, 2018

I switched to using PyAudio back then and it worked well. But in your case if you are only using text stimuli (if I understood you correctly) - you should not need to load avbin. You may be getting the error message but it shouldn't affect your procedure.

@sci-tab

This comment has been minimized.

sci-tab commented Jan 20, 2018

@mmagnuski as I mention, it has not impacted timing or anything, as far as I can tell. It's still a bug though. I think the other ticket addressing it should have been left open - but I put it here since it's still open.

Thanks!

@mmagnuski

This comment has been minimized.

Contributor

mmagnuski commented Jan 20, 2018

In general, yes, you can consider this to be a bug, but avbin has given developers of psychopy nightmares already and they considered using something else. See here for example.

@peircej

This comment has been minimized.

Member

peircej commented Jan 20, 2018

@sci-tab the message about avbin, listed in the other issue, is an annoying but irrelevant message. Yes, it means that avbin doesn't always load reliably, but that is not a library that we created and not something we're going to fix. Basically, it might be a bug but it isn't a bug in PsyhoPy and therefore the issue should not be on our list. The alternatives we've provided (opencv and moviepy options) are not only more stable but also have superior performance. So avbin is broken and we don't need it.

The only way I consider this a bug in PsychoPy is that PsychoPy spouted an out-dated error message that led people to think that avbin was the source of their (unrelated) problem. The fix to that is only to raise the error on occasions where it will impact the user, which is implemented in the repository and will take effect in next release. Hope that helps.

I think we can close this issue as well, but maybe you'd like to make sure the current repository version doesn't give you the error message (unless you try to use a MovieStim instead of MovieStim3 class)

@sci-tab

This comment has been minimized.

sci-tab commented Jan 21, 2018

Hi @peircej, I hear you. I consider it very low priority knowing it's not impacting anything, but outputting irrelevant error messages to my terminal is a bug. I think your next release will suit my needs for Windows, thanks for all the work and support!

@mmagnuski

This comment has been minimized.

Contributor

mmagnuski commented Jan 21, 2018

@peircej If other options are actually better why not get rid of avbin altogether (with a deprecation cycle) in next major release?

@peircej

This comment has been minimized.

Member

peircej commented Jan 21, 2018

OK, great, we'll close this issue as the error message should now be resolved.

@mmagnuski I don't like to remove things unless they're actually obstructive. People like to be able to open an experiment from 5 or 10 years ago and still run it. If it doesn't "just work" (e.g. because they need to update their code to use MovieStim3) then it's annoying. In this case maybe we should remove MovieStim and simply keep it as an alias to MovieStim3 but I prefer to leave the old code present and just advise people to use the new code.

@peircej peircej closed this Jan 21, 2018

@mmagnuski

This comment has been minimized.

Contributor

mmagnuski commented Jan 21, 2018

@peircej I understand, however given some practice teaching psychopy I find that there is usually enough smaller problems (new bugs or regressions) to require a specific psychopy version to run a given experiment without problems. Personally I find it clearer to require a specific version for given experiment (and allow for deprecations to happen) then to use the most recent one and hope it runs OK. But I get that most users may prefer otherwise.

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