I've a tweaked version of app_amd that instead of waiting for audio in the receive direction, it begins streaming audio right away. The problem is it's occasionally throwing this error as well as stopping the stream for a second or two then continuing. I think the error is being caused by either ast_sched_wait() or ast_sched_runq().<br><br>Example:<br><br>ast_stopstream(chan);<br>res = ast_streamfile(chan, filetoplay, chan-&gt;language);<br><br>while ((res = ast_waitfor(chan, -1)) &gt; -1) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp; res = ast_sched_wait(chan-&gt;sched);<br><br>&nbsp;&nbsp;&nbsp;&nbsp; Do some stuff ..<br><br>&nbsp;&nbsp;&nbsp;&nbsp; ast_frfree(f);<br>&nbsp;&nbsp;&nbsp;&nbsp; ast_sched_runq(chan-&gt;sched);<br><br>}<br><br>I'm not entirely sure of the purpose of these functions but without them the stream won't continue during the loop.<br><br>Any ideas why the sched functions are needed and it's relationship to streaming audio as well as what would cause the error
 and streaming problems I am seeing?<br><br>Thanks.<br><p>&#32;