Summary: | ASTERISK-27426: chan_console: cannot read and write at the same time with alsa backend | ||
Reporter: | Tzafrir Cohen (tzafrir) | Labels: | |
Date Opened: | 2017-11-16 10:26:53.000-0600 | Date Closed: | |
Priority: | Major | Regression? | |
Status: | Closed/Complete | Components: | Channels/General |
Versions: | GIT | Frequency of Occurrence | |
Related Issues: | |||
Environment: | Attachments: | ||
Description: | 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. Note that this applies to the ALSA backend. This does not happen when the OSS backend of portaudio is used (device /dev/dsp1 and such). | ||
Comments: | By: Asterisk Team (asteriskteam) 2017-11-16 10:26:54.342-0600 Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report. Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. By: Richard Mudgett (rmudgett) 2017-11-16 15:51:54.129-0600 Will you be supplying patches? The console channel drivers (chan_console, chan_alsa, and chan_oss) are extended support and don't see much activity. By: Asterisk Team (asteriskteam) 2017-12-01 12:00:01.220-0600 Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines By: Friendly Automation (friendly-automation) 2018-02-09 09:26:58.382-0600 Change 8174 merged by Jenkins2: chan_console: don't read and write at the same time [https://gerrit.asterisk.org/8174|https://gerrit.asterisk.org/8174] By: Friendly Automation (friendly-automation) 2018-02-09 09:32:42.919-0600 Change 7657 merged by Jenkins2: chan_console: don't read and write at the same time [https://gerrit.asterisk.org/7657|https://gerrit.asterisk.org/7657] By: Friendly Automation (friendly-automation) 2018-02-09 11:19:19.857-0600 Change 8173 merged by George Joseph: chan_console: don't read and write at the same time [https://gerrit.asterisk.org/8173|https://gerrit.asterisk.org/8173] |