Hi all,
I thought I'd try out James' OSC receiver example scripts but have run into an issue with the audio feedback one. The plot pops up briefly then disappears, but the script still seems to be running and reporting headband fit. The 2 other OSC scripts work perfectly so there doesn't seem to be any issue streaming EEG data over OSC as such, I think the issue is with matplotlib. Here's what I'm getting when I try to run the audio feedback script:
Listening on UDP port 5000
Muse Fit Good
C:\Users\Cyberpowerpc\Desktop\PhD\MUSE SDK\libmuse_windows_7.1.1\OSC Receiver Audio Feedback.py:118: UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail.
ani = FuncAnimation(plt.gcf(), plot_update, interval=100)
C:\Users\Cyberpowerpc\Desktop\PhD\MUSE SDK\libmuse_windows_7.1.1\OSC Receiver Audio Feedback.py:118: UserWarning: frames=None which we can infer the length of, did not pass an explicit *save_count* and passed cache_frame_data=True. To avoid a possibly unbounded cache, frame data caching has been disabled. To suppress this warning either pass `cache_frame_data=False` or `save_count=MAX_FRAMES`.
ani = FuncAnimation(plt.gcf(), plot_update, interval=100)
C:\Users\Cyberpowerpc\Desktop\PhD\MUSE SDK\libmuse_windows_7.1.1\OSC Receiver Audio Feedback.py:120: UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail.
plt.show()
Exception in thread Thread-1 (init_plot):
Traceback (most recent call last):
File "C:\Users\Cyberpowerpc\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1075, in _bootstrap_inner
self.run()
File "C:\Users\Cyberpowerpc\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1012, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Cyberpowerpc\Desktop\PhD\MUSE SDK\libmuse_windows_7.1.1\OSC Receiver Audio Feedback.py", line 120, in init_plot
plt.show()
File "C:\Users\Cyberpowerpc\AppData\Local\Programs\Python\Python312\Lib\site-packages\matplotlib\pyplot.py", line 614, in show
return _get_backend_mod().show(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Cyberpowerpc\AppData\Local\Programs\Python\Python312\Lib\site-packages\matplotlib\backend_bases.py", line 3547, in show
cls.mainloop()
File "C:\Users\Cyberpowerpc\AppData\Local\Programs\Python\Python312\Lib\site-packages\matplotlib\backends\backend_qt.py", line 640, in start_main_loop
with _allow_interrupt_qt(qapp):
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Cyberpowerpc\AppData\Local\Programs\Python\Python312\Lib\contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "C:\Users\Cyberpowerpc\AppData\Local\Programs\Python\Python312\Lib\site-packages\matplotlib\backend_bases.py", line 1641, in _allow_interrupt
old_wakeup_fd = signal.set_wakeup_fd(wsock.fileno())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: set_wakeup_fd only works in main thread of the main interpreter
C:\Users\Cyberpowerpc\AppData\Local\Programs\Python\Python312\Lib\site-packages\matplotlib\animation.py:908: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. `anim`, that exists until you output the Animation using `plt.show()` or `anim.save()`.
warnings.warn(
Any suggestions how to fix this?