[Home]

Summary:ASTERISK-02116: [patch] chan_alsa doesn't transmit, ignores configuration
Reporter:mutterc (mutterc)Labels:
Date Opened:2004-07-26 20:29:11Date Closed:2008-01-15 15:03:38.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_alsa.c.patch
( 1) my-alsa-and-asterisk-config.tar.gz
Description:On my system, when I called anyone (including echotest) from the ALSA console channel, nothing was transmitted (you couldn't hear me talking into my console mike). I could record sound isung 'arecord' on that card.
Updated to latest CVS and did a bunch of experimenting. Turns out that alsa_read() wasn't being called, because select() never showed data ready to read on the in-card, because the PCM stream hadn't been started. There's an autostart set up so that when you try to read, it'll start the stream, but * won't try to read until the stream is started... I added snd_pcm_prepare() and snd_pcm_start() to everywhere that we do an 'answer' in chan_alsa.c.
Also, the card I wanted to use was the second. * insisted on using the first card. Turns out this is because it opens the sound card before reading the config file. I moved the config read to be the very first thing in load_module().
Patch attached with both fixes, tested OK on my system.
My /etc/asound.conf and * configs are attached as well.

****** STEPS TO REPRODUCE ******

With this config, 'dial echotest' then 'answer' will let me hear my speaking into console mic with the patch, does not without the patch. 'dial inside' will call my internal phone, wife can hear me with the patch, not without.

****** ADDITIONAL INFORMATION ******

Card 0 in this system is an SBLive. Card 1 is an Intel 82801 on the motherboard. They're using the ALSA kernel drivers from kernel 2.6.6 and ALSA lib 1.0.5. I defined the card I wanted to use as 'onboard' in asound.conf, used the 'plughw' device so that the sample rate / channels that * wants are done in SW (the HW doesn't support them directly).
Comments:By: mutterc (mutterc) 2004-07-26 20:30:51

Oh yeah... I have no diclaimer on file yet, but one will be winging its way to you via USPS tomorrow.

By: Mark Spencer (markster) 2004-07-26 22:52:17

USPS, now that's hard core!

By: Mark Spencer (markster) 2004-07-26 23:00:34

I went ahead and put it in CVS since your disclaimer is in the mail :)

By: Digium Subversion (svnbot) 2008-01-15 15:03:38.000-0600

Repository: asterisk
Revision: 3519

U   trunk/channels/chan_alsa.c

------------------------------------------------------------------------
r3519 | markster | 2008-01-15 15:03:38 -0600 (Tue, 15 Jan 2008) | 2 lines

Merge ALSA fixes (bug ASTERISK-2116)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=3519