Wed 14 Jan 2015 07:22:25 PM UTC, comment #8:
markuman was so kind to test this code with matlab R2014b:
The sound stopped after 2 seconds. There was no warning and no error message.
Without second 'q=audioplayer...' it plays 10 seconds, as expected.
So I think the current approach is the right way, but the warning is not neccessary to be MATLAB compatible.
|
Tue 13 Jan 2015 01:27:50 PM UTC, comment #7:
Seems to me cset 9bd2f0a07c95 is causing this issue. The audio data was copied before, so it remains valid within the static callback function.
However, I don't know the MATLAB compatible way. Should it stop playing old audio, when the old object is deleted or should it continue play the old audio?
|
Tue 13 Jan 2015 12:53:54 PM UTC, comment #6:
this has been fixed. no crash now.
|
Tue 13 Jan 2015 12:35:40 PM UTC, comment #5:
sorry I actually used sleep(1)
|
Tue 13 Jan 2015 11:57:28 AM UTC, comment #4:
I think Stefan is right. @Doug: can you please test cset http://hg.savannah.gnu.org/hgweb/octave/rev/62ca016dbb2a
Your second testcase uses "delay". Is this an OCtave function or should this be "sleep"?
|
Tue 13 Jan 2015 10:52:27 AM UTC, comment #3:
My guess: The second q=audioplayer(y,Fs,16); creates a new object and destroys the old 'q'. If the first 'q' is still playing, the old play_callback function wants to access the pointers from the old 'q' object. Since the object was released, the pointers are not valid anymore.
|
Tue 13 Jan 2015 10:39:04 AM UTC, comment #2:
I can confirm this on c36c22808d11.
Looks like the known multithreading problem.
|
Tue 13 Jan 2015 10:30:15 AM UTC, comment #1:
This crashes for me.
+verbatum+
Fs=44100;
t=10;
x=0:1/Fs:t;
y(:,2)=sin(2pi220*x);
y(:,1)=sin(2pi440*x);
q=audioplayer(y,Fs,16);
play(q);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
-verbatum-
and also this:
+verbatum+
Fs=44100;
t=10;
x=0:1/Fs:t;
y(:,2)=sin(2pi220*x);
y(:,1)=sin(2pi440*x);
q=audioplayer(y,Fs,16);
play(q);
delay(1)
play(q)
-verbatum-
|
Tue 13 Jan 2015 03:36:11 AM UTC, original submission:
When using the following prog:
If you hit the blue run icon to start the sound, and then press it again and again, first the sound goes bad and the octave crashes with signal 11 and once with signal 6.
The time with signal 6 there was an error message about a callback problem. I did not get it copied down before octave crashed , and then the message was lost forever.
In summery if you rerun the software before it has finished the first run, it might crash, some times it doesn't.
|