<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8173">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_console: don't read and write at the same time<br><br>It seems that the ALSA backend of PortAudio doesn't know how to both<br>read and write at the same time by adding a per-device mutex.<br><br>FIXME: currently only a draft version. Need to either auto-detect<br>we work with the ALSA backend or add an extra configuration option<br>to use this mutex.<br><br>ASTERISK-27426 #close<br><br>Change-Id: I635eacee45f5413faa18f5a3b606af03b926dacb<br>---<br>M channels/chan_console.c<br>1 file changed, 4 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/73/8173/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_console.c b/channels/chan_console.c<br>index 7c57ec4..7692b26 100644<br>--- a/channels/chan_console.c<br>+++ b/channels/chan_console.c<br>@@ -278,7 +278,9 @@<br> <br>         for (;;) {<br>            pthread_testcancel();<br>+                console_pvt_lock(pvt);<br>                res = Pa_ReadStream(pvt->stream, buf, sizeof(buf) / sizeof(int16_t));<br>+             console_pvt_unlock(pvt);<br>              pthread_testcancel();<br> <br>              if (!pvt->owner) {<br>@@ -611,7 +613,9 @@<br> {<br>        struct console_pvt *pvt = ast_channel_tech_pvt(chan);<br> <br>+     console_pvt_lock(pvt);<br>        Pa_WriteStream(pvt->stream, f->data.ptr, f->samples);<br>+       console_pvt_unlock(pvt);<br> <br>   return 0;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8173">change 8173</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8173"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I635eacee45f5413faa18f5a3b606af03b926dacb </div>
<div style="display:none"> Gerrit-Change-Number: 8173 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>