Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Runtime error

edited October 31 in OpenSesame

Hi,

How can I correct this error ?


Extension OpenScienceFramework misbehaved on event startup (see debug window for stack trace)
Extension error
item-stack: 
exception type: UnicodeDecodeError
exception message: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte
time: Sat Oct 26 15:17:07 2019
Traceback:
 File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\extensions\_extension_manager.py", line 133, in fire
   ext.fire(event, **kwdict)
 File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\extensions\_base_extension.py", line 410, in fire
   getattr(self, u'event_%s' % event)(**kwdict)
 File "C:\Program Files (x86)\OpenSesame\share\opensesame_extensions\OpenScienceFramework\OpenScienceFramework.py", line 680, in event_startup
   self.__initialize()
 File "C:\Program Files (x86)\OpenSesame\share\opensesame_extensions\OpenScienceFramework\OpenScienceFramework.py", line 838, in __initialize
   tmp_dir = safe_decode(tempfile.gettempdir())
 File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\py3compat.py", line 42, in safe_decode
   return s.decode(enc, errors)
 File "C:\Program Files (x86)\OpenSesame\lib\encodings\utf_8.py", line 16, in decode
   return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte

Thank you in advance,

Gérard

Comments

  • Hi Gérard,

    Thanks for reporting this. This is a bug in the OpenScienceFramework extension, related to special characters in the file paths. The bug seems easily fixed, but it would be helpful if you can test it for us. Could you replace this file:

    C:\Program Files (x86)\OpenSesame\share\opensesame_extensions\OpenScienceFramework\OpenScienceFramework.py
    

    By the attached version of the same file? And then please report back to us as to whether this fixes this issue.

    Cheers!

    Sebastiaan

    Ping @Daniel, if this fixes it, I'll submit a PR.

  • Hi Sebastiaan,

    Your correction fixes the issue. There is no error message any more at startup. However there is another problem: the audio files do not execute correctly, I only hear a click. These problems appear only on a certain computer. Let me give you more information about the context. OpenSesame runs perfectly on 2 computers. I have installed it also on a third one in order to make a certain number of audio feedbacks available in real time. That computer is a Dell Optiplex 9020 whose mother board has been replaced in September because of an overvoltage. However, the operating system, the applications and the data were OK. Only a few drivers had to be replaced. I thought this information might be useful for you.

    The problems with OpenSesame occur on that third computer, although all the other programs run fine. Audio files are OK when executed by a standard player. After fixing the original problem with your patch, I deleted and reinstalled Opensesame but the problems appeared again. Applying the patch once again suppressed the error message. Now I am stuck with that problem of sound ...

    Cheers,

    Gérard

  • Hi Gérard,

    If you only hear a click when playing sound files, this generally indicates that the format of the sound file is different from what OpenSesame expects. (Although I'm not sure why this would happen on some systems and not others.) Unlike most other software, OpenSesame does not automatically detect the format of .wav files. You can either:

    • Open your sound files in a sound editor, such as Audacity, check their format (sampling frequency, mono/stereo, bit depth) and then adjust the sampler settings in the OpenSesame backend settings.
    • Convert the sound files to .ogg , which should be automatically detected.

    Cheers!

    Sebastiaan

  • Hi Sebastiaan,

    The problem is really unusual because it happens whatever the file format, including .ogg. Moreover, the same exact programs and audio files run fine on two other computers. There is obviously a bad interaction between that specific computer and OpenSesame. Could it be that some Python or other underlying files would not have been deleted when I have uninstalled and reinstalled the OS package ? Have you any other idea ?

    Cheers,

    Gérard

  • Hi Gérard,

    Could it be that some Python or other underlying files would not have been deleted when I have uninstalled and reinstalled the OS package ? 

    No, that strikes me as very unlikely. But what it could be I don't know … As you say, it sounds like an interaction between OpenSesame and the computer.

    Sorry that I cannot be of more help!

    Cheers,

    Sebastiaan

  • Hi Sebastiaan,

    I have modified various parameters in OS, including the underlying background package. With PsychoPy, that I use all the time, the only symptom of error is the production of a click in place of a sound. But with Expyriment, the program is stuck and I get the following error message, that shows that the correction of the bug related to special characters in the file path is not fully effective (my user name is gérard and not grard):

    item-stack: Tronc[run].Boucle[run].Signal[run].Rep[run]

    exception type: error

    exception message: Couldn't open c:\users\grard\appdata\local\temp\expyriment_4vp6ot\tmponv4fi.tga

    Does it help ? Don't hesitate to request additional testing if needed.

    Cheers,

    Gérard

  • Hi Sebastiaan (and everyone else),

    I continue to investigate the origin of the problem of the sounds that are replaced by a click.

    I discovered that, if I use PsychoPy, the error that I documented in my previous message does not appear. I verified that the problem is not due to the special character " é " because image files in the temporary pool of OS are correctly handled. So I presume that the path is identified.

    Another interesting information is that if I put a Synth element in the OS sequence, it sounds perfectly. Only the Sampler elements do not work and produce a click. The problem is not linked to the type of sound file (.wav or .ogg). And, of course, I verified that the sound files do work fine with any other program like VLC or Audacity.

    And the same OS sequences work perfectly on two other PCs.

    So where is the bug hiding ??

    Cheers,

    Gérard

  • Hi Gérard,

    Could you upload one of the clicky samples here?

    Cheers!

    Sebastiaan

  • Hi Sebastiaan,

    Please note that ALL the audio files that I use (wav and ogg) behave in the same way on that computer, but not on the others.

    Thank you for your time,

    Gérard

  • Hi Gérard,

    What format is this wave file in exactly? Audacity detects it as a 11025 Khz, mono, float format, but it looks funky to me.

    Cheers,

    Sebastiaan

  • Hi Sebastiaan,

    You will find attached the two versions of another file that is more typical. The previous file may be indeed confusing because it is very short and may look like a clik by itself. This one is more meaningful to the ear.

    As far as the format is concerned, I did not pay attention to it while selecting and adapting the sounds, because I never had any problem working on the computer where I created the programs, as well as on another computer. Moreover, sampling or other sound parameter adjustment is not available in OS with Psychopy in the background. And in addition to that, I don't know how to modify the sampling if needed ...

    The problem is definitely on THAT computer but it is weired to see that only OS is concerned. I have also verified in Windows parameters that the sound card assignment is correct while an OS sequence is running. The sound goes to the right place, but it is shrinked to a short click, whatever the content or the length of the audio file.

    Thank you again for the time that you spend on this very particular case.

    Cheers!

    Gérard

  • Hi Gérard,

    The .wav file format is 32 bit float, 11Khz mono. It does play correctly on my system, although I'm actually surprised by this, because I didn't think that PyGame would be able to handle this format. In any case, what happens if you open this file in a tool like Audacity, and then change its format to 24 bit PC, 48Khz mono?

    Cheers!

    Sebastiaan

  • Hi Sebastiaan,

    I have investigated into many directions and explored the trails that you suggested, with no result. I have also discovered that the same problem has already been reported by Charlotte1990 in October 2018. Apparently it has not been solved yet. I'm pretty stoked...

    Cheers,

    Gérard

Sign In or Register to comment.