psychopy.org | Reference | Downloads | Github

Midi working, audio isn't

I have a participant running my code on his PC.

The code is working on my other participants’ computers, so the problem is something specific to his device

For my code to work, all participants need to change their preferences to:

‘audio library’: [u’pygame’,u’pyo’,]
‘audio driver’: [u’portaudio’,]

In a few instances, PsychoPy refuses to make the changes with apostrophes (’). In these instances, it works for participants if they change them to speech marks ("), as follows:

‘audio library’: [u"pygame",u"pyo",]
‘audio driver’: [u"portaudio",]

Having made these changes, for this one participant the section that uses MIDI runs fine, but the section that uses audio gives him the following error message:

From cffi callback <function callback_ptr at 0x1FE3B8F0>:
Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\sounddevice.py”, line 1008, in callback_ptr
return _wrap_callback(callback, data, frames, time, status)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\sounddevice.py”, line 2773, in _wrap_callback
callback(*args)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 194, in callback
toSpk[:len(dat), :] += dat # add to out stream
ValueError: non-broadcastable output operand with shape (128,1) doesn’t match the broadcast shape (128,2)

What does this mean to you? Any ideas for a fix?

On a related note, whenever he re-opens PsychoPy the preferences reset (which doesn’t happen for most participants). He also gets this error message whenever he applies the changes to preferences (also to exit preferences he has to click the red-cross exit button. To my memory, it should automatically exit when you press ‘OK’?):

Error message:

Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\app\preferencesDlg.py”, line 238, in onApply
self.setPrefsFromCtrls()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\app\preferencesDlg.py”, line 361, in setPrefsFromCtrls
self.app.prefs.saveUserPrefs() # includes a validation
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\preferences\preferences.py”, line 185, in saveUserPrefs
self.userPrefsCfg.write()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 2070, in write
out.extend(self.write(section=this_entry))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 2076, in write
comment))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1986, in _write_line
val = self._decode_element(self._quote(this_entry))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1788, in _quote
for val in value])
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1812, in _quote
raise ConfigObjError(‘Value “%s” cannot be safely quoted.’ % value)
configobj.ConfigObjError: Value “Headset (@System32\drivers\bthhfenum.sys,#2;%1 Hands-Free AG Audio%0
;(Mpow Flame))” cannot be safely quoted.
Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\app\preferencesDlg.py”, line 238, in onApply
self.setPrefsFromCtrls()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\app\preferencesDlg.py”, line 361, in setPrefsFromCtrls
self.app.prefs.saveUserPrefs() # includes a validation
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\preferences\preferences.py”, line 185, in saveUserPrefs
self.userPrefsCfg.write()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 2070, in write
out.extend(self.write(section=this_entry))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 2076, in write
comment))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1986, in _write_line
val = self._decode_element(self._quote(this_entry))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1788, in _quote
for val in value])
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1812, in _quote
raise ConfigObjError(‘Value “%s” cannot be safely quoted.’ % value)
configobj.ConfigObjError: Value “Headset (@System32\drivers\bthhfenum.sys,#2;%1 Hands-Free AG Audio%0
;(Mpow Flame))” cannot be safely quoted.
Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\app\preferencesDlg.py”, line 246, in onOK
self.onApply(event=event)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\app\preferencesDlg.py”, line 238, in onApply
self.setPrefsFromCtrls()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\app\preferencesDlg.py”, line 361, in setPrefsFromCtrls
self.app.prefs.saveUserPrefs() # includes a validation
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\preferences\preferences.py”, line 185, in saveUserPrefs
self.userPrefsCfg.write()
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 2070, in write
out.extend(self.write(section=this_entry))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 2076, in write
comment))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1986, in _write_line
val = self._decode_element(self._quote(this_entry))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1788, in _quote
for val in value])
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\configobj.py”, line 1812, in _quote
raise ConfigObjError(‘Value “%s” cannot be safely quoted.’ % value)
configobj.ConfigObjError: Value “Headset (@System32\drivers\bthhfenum.sys,#2;%1 Hands-Free AG Audio%0
;(Mpow Flame))” cannot be safely quoted.

Any thoughts? ‘Mpow Flame’ is apparently the name for his Bluetooth headphones.

Any help appreciated!