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

concurrent operation on audio file causes behavior to crash #112

Open
MarvinT opened this issue Apr 8, 2016 · 4 comments
Open

concurrent operation on audio file causes behavior to crash #112

MarvinT opened this issue Apr 8, 2016 · 4 comments

Comments

@MarvinT
Copy link
Contributor

MarvinT commented Apr 8, 2016

"2016-04-08 09:50:46,982","ERROR","Unhandled exception: Traceback (most recent call last):
  File "/usr/local/anaconda/bin/behave", line 10, in <module>
    execfile(__file__)
  File "/local/home/bird/Code/pyoperant/scripts/behave", line 135, in <module>
    main()
  File "/local/home/bird/Code/pyoperant/scripts/behave", line 131, in main
    behavior.run()
  File "/local/home/bird/Code/pyoperant/pyoperant/behavior/base.py", line 153, in run
    session=self._run_session)
  File "/local/home/bird/Code/pyoperant/pyoperant/utils.py", line 103, in run_state_machine
    state = state_functions[state]()
  File "/local/home/bird/Code/pyoperant/pyoperant/behavior/base.py", line 215, in _run_session
    post=self.session_post)
  File "/local/home/bird/Code/pyoperant/pyoperant/utils.py", line 103, in run_state_machine
    state = state_functions[state]()
  File "/local/home/bird/Code/pyoperant/pyoperant/behavior/two_alt_choice.py", line 205, in session_main
    run_trial_queue()
  File "/local/home/bird/Code/pyoperant/pyoperant/behavior/two_alt_choice.py", line 162, in run_trial_queue
    self.run_trial()
  File "/local/home/bird/Code/pyoperant/pyoperant/behavior/two_alt_choice.py", line 316, in run_trial
    self.response_main()
  File "/local/home/bird/Code/pyoperant/pyoperant/behavior/two_alt_choice.py", line 448, in response_main
    self.panel.speaker.stop()
  File "/local/home/bird/Code/pyoperant/pyoperant/hwio.py", line 115, in stop
    return self.interface._stop_wav()
  File "/local/home/bird/Code/pyoperant/pyoperant/interfaces/pyaudio_.py", line 95, in _stop_wav
    self.wf.close()
  File "/usr/local/anaconda/lib/python2.7/wave.py", line 183, in close
    self._i_opened_the_file.close()
IOError: close() called during concurrent operation on the same file object.
@MarvinT
Copy link
Contributor Author

MarvinT commented Apr 9, 2016

@neuromusic can you post a stack trace for one of your errors? I think I'm just going to suppress the exceptions because garbage collecting should deal with it automatically I think

@neuromusic
Copy link
Member

Next time I get one I will

On Fri, Apr 8, 2016, 18:48 Marvin T [email protected] wrote:

@neuromusic https://github.com/neuromusic can you post a stack trace
for one of your errors? I think I'm just going to suppress the exceptions
because garbage collecting should deal with it automatically I think


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
#112 (comment)

@neuromusic
Copy link
Member

ERROR at 2016-03-14 11:06:38,341:
Unhandled exception: Traceback (most recent call last):
  File "/usr/local/bin/behave", line 10, in <module>
    execfile(__file__)
  File "/home/bird/Code/pyoperant/scripts/behave", line 135, in <module>
    main()
  File "/home/bird/Code/pyoperant/scripts/behave", line 131, in main
    behavior.run()
  File "/home/bird/Code/pyoperant/pyoperant/behavior/base.py", line 153, in run
    session=self._run_session)
  File "/home/bird/Code/pyoperant/pyoperant/utils.py", line 103, in run_state_machine
    state = state_functions[state]()
  File "/home/bird/Code/pyoperant/pyoperant/behavior/base.py", line 215, in _run_session
    post=self.session_post)
  File "/home/bird/Code/pyoperant/pyoperant/utils.py", line 103, in run_state_machine
    state = state_functions[state]()
  File "/home/bird/Code/pyoperant/pyoperant/behavior/two_alt_choice.py", line 198, in session_main
    run_trial_queue()
  File "/home/bird/Code/pyoperant/pyoperant/behavior/two_alt_choice.py", line 164, in run_trial_queue
    self.run_trial()
  File "/home/bird/Code/pyoperant/pyoperant/behavior/two_alt_choice.py", line 318, in run_trial
    self.response_main()
  File "/home/bird/Code/pyoperant/pyoperant/behavior/two_alt_choice.py", line 450, in response_main
    self.panel.speaker.stop()
  File "/home/bird/Code/pyoperant/pyoperant/hwio.py", line 115, in stop
    return self.interface._stop_wav()
  File "/home/bird/Code/pyoperant/pyoperant/interfaces/pyaudio_.py", line 95, in _stop_wav
    self.wf.close()
  File "/usr/lib/python2.7/wave.py", line 184, in close
    self._i_opened_the_file.close()
IOError: close() called during concurrent operation on the same file object.

@MarvinT
Copy link
Contributor Author

MarvinT commented Apr 11, 2016

so different spot in pyoperant, but stilli in the same spot in _stop_wav

I think I'm going to try just suppressing the exception... I'll add a logger and warning though

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

2 participants