[asterisk-bugs] [JIRA] (ASTERISK-27426) chan_console: cannot read and write at the same time

Tzafrir Cohen (JIRA) noreply at issues.asterisk.org
Thu Nov 16 10:28:41 CST 2017


Tzafrir Cohen created ASTERISK-27426:
----------------------------------------

             Summary: chan_console: cannot read and write at the same time
                 Key: ASTERISK-27426
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27426
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Channels/General
    Affects Versions: GIT
            Reporter: Tzafrir Cohen


Trying to use chan_console on current master (9eacd55c7191a460fe8704f81b9e5e3beaf014b9). Ran into several issues.

Configured the device. Got error -9997 (paInvalidSampleRate). 

So device does not support 16000Hz. OK, it supports 8000Hz. Easy enough to fix in the code. At least for now.

Now I connect the device and tried: 'channel originate Console/con1 application Playback demo-instruct'. "Nothing happens".

Added some tracing to chan_console.c:console_write(). I see that the function gets called. The result of Pa_WriteStream() there is not checked. When I checked the result I noticed that I keep getting the error -9974 (paCanNotWriteToAnInputOnlyStream).

Looking at the code of portaudio, I noticed that src/hostapi/alsa/pa_linux_alsa.c:ReadStream() temporarily disables writing for the time of the call to the function and likewise WriteStream temporarily disables reading.

Thus I temporarily replaced the call to Pa_ReadStream() with a sleep(), and suddenly I have audio.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list