psychojs icon indicating copy to clipboard operation
psychojs copied to clipboard

repeated playing of sound eventually causes crash

Open bollaking opened this issue 3 years ago • 10 comments

I have an oddball experiment that plays a sound in a loop.

If the sound plays more than ~2-300 times it causes the experiment to crash.

An example experiment can be found here: https://gitlab.pavlovia.org/Bollaking/audio-oddball

The loop is adjusted with a code component but the crash also occurs if the loop is controlled with a conditions file.

I have also tried sounds of duration more than 0.5 and less than 0.5 seconds. So it is not dependent of the sound being explicitly "stopped"

Crash happens in Chrome and Opera browsers.

There is nothing I can see in the developer console although there are a lot of logging messages that variables are undefined...

I have attached the logs here run.pavlovia.org-1626315196863.log

bollaking avatar Jul 15 '21 02:07 bollaking

Correction. The experiment does not crash the sounds just stop playing. I demonstrated this by adding text to the screen in each loop. the text continued to display until the full 400 loops were displayed, and the experiment ended normally.

Also sometimes the sound quality deteriorates before the sound stops playing altogether.

bollaking avatar Jul 15 '21 04:07 bollaking

@bollaking Thanks for flagging

thewhodidthis avatar Jul 15 '21 18:07 thewhodidthis

@bollaking Sorry, would it be possible to give me developer access to the repo you link to, so I can investigate some more? Thanks

thewhodidthis avatar Jul 15 '21 19:07 thewhodidthis

I think I am having the same problem in this experiment: https://gitlab.pavlovia.org/erkamil/staircaserdk

We repeatedly play a sound as feedback after each trial. After ~100 trials, the sound plays with decreased quality for a couple of trials and then stops playing. I could also give you developer access if it helps.

Is there anything I can do to debug this? Thanks for your help!

dominikstrb avatar Jul 21 '21 14:07 dominikstrb

@dominikstrb Yes of course, no problem, thanks for flagging

thewhodidthis avatar Jul 21 '21 15:07 thewhodidthis

Cool, I added you as a developer, if you want to have a look. If the project is too cluttered to find the issue with the sound, I can provide a minimal working example.

dominikstrb avatar Jul 21 '21 15:07 dominikstrb

Alright, thanks, let me take a look

thewhodidthis avatar Jul 21 '21 15:07 thewhodidthis

Sorry @dominikstrb I tried the project you link to and have been unable to spot any audio feedback during trials, must be I'm missing something

thewhodidthis avatar Jul 26 '21 12:07 thewhodidthis

@bollaking I can confirm the issue and it seems boilerplate JS / code generation related. Interestingly, using the same Sound instance across trials only fails when the pitch is different. Please bare with me while I look for a fix, x

thewhodidthis avatar Jul 26 '21 13:07 thewhodidthis

I'm experiencing a similar issue currently with running an oddball paradigm with two different pitch tones (1000 tones total in the paradigm). The tones play fine to start with and after a few minutes the tones sound glitches. Is there a fix on the way?

roshiniemotiv avatar Nov 12 '21 01:11 roshiniemotiv