Dave Platt
2009-Dec-14 19:02 UTC
[asterisk-users] Asterisk throws error using the alsa, module
>> See if it plays back properly. > > Running aplay as asterisk user seems to be no problem: > > asterisk at puppy$ aplay /usr/share/sounds/alsa/Front_Center.wav > Playing: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit > Little Endian, Rate: 48000 Hz, mono > asterisk at puppy:~$ aplay -Dpulse /usr/share/sounds/alsa/Front_Center.wav > Wiedergabe: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit > Little Endian, Rate: 48000 Hz, mono > asterisk at puppy:~$ aplay -Ddefault /usr/share/sounds/alsa/Front_Center.wav > Wiedergabe: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit > Little Endian, Rate: 48000 Hz, mono > > pulseaudio spawns itself as it should: > > asterisk at puppy:~$ ps -A | grep pulse > 23820 ? 00:00:00 pulseaudio > > > this works as defined in /etc/asound.conf: > > asterisk at puppy:~$ cat /etc/asound.conf > pcm.pulse { > type pulse > } > > ctl.pulse { > type pulse > } > > pcm.!default { > type pulse > } > > ctl.!default { > type pulse > }I haven't used pulseaudio myself, nor the ALSA plugin to redirect audio through it. I infer that by default you're routing ALSA connections through the pulseaudio plugin/connector, and that the pulseaudio daemon has been configured to send its output to a different ALSA device (e.g. to hw: or plughw:)? Best I can suggest, at this point, is that you check to see whether you can turn on some sort of debugging in the pulseaudio daemon, to see what sort of connections it's receiving from clients, and what it's doing with them. It's possible that there's some sort of access-permission problem in pulseaudio and it's refusing to allow connections from asterisk for some reason.> > i've acticated the alsa plugin for asterisk: > > puppy:/etc/asterisk# grep -E 'alsa|oss' modules.conf > load => chan_alsa.so > noload => chan_oss.so > > puppy:/etc/asterisk# grep default alsa.conf > input_device=default > output_device=defaultMight try setting these to "pulse" rather than "default", perhaps?> i'm running pulseaudio on top of alsa. through setting /etc/asound.conf as > above any calls to alsa should be redirected to pulseaudio (at least that's > what i thought).> Asterisk Ready. > *CLI> console dial s > *CLI> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read > error: Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: > Input/output error > [repeated indefinitely until killed]Hmmm. Since these are occurring when reading a channel, it indicates that it's the attempt to read audio from pulseaudio which isn't working. Have you confirmed that pulseaudio is in fact working correctly in both directions (using e.g. both aplay and arecord)?
vitaminx
2009-Dec-14 19:42 UTC
[asterisk-users] Asterisk throws error using the alsa, module
On Mon, 14 Dec 2009 11:02:02 -0800, Dave Platt <dplatt at radagast.org> wrote:>>> See if it plays back properly. >> >> Running aplay as asterisk user seems to be no problem: >> >> asterisk at puppy$ aplay /usr/share/sounds/alsa/Front_Center.wav >> Playing: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit >> Little Endian, Rate: 48000 Hz, mono >> asterisk at puppy:~$ aplay -Dpulse /usr/share/sounds/alsa/Front_Center.wav >> Wiedergabe: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 >> bit >> Little Endian, Rate: 48000 Hz, mono >> asterisk at puppy:~$ aplay -Ddefault/usr/share/sounds/alsa/Front_Center.wav>> Wiedergabe: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 >> bit >> Little Endian, Rate: 48000 Hz, mono >> >> pulseaudio spawns itself as it should: >> >> asterisk at puppy:~$ ps -A | grep pulse >> 23820 ? 00:00:00 pulseaudio >> >> >> this works as defined in /etc/asound.conf: >> >> asterisk at puppy:~$ cat /etc/asound.conf >> pcm.pulse { >> type pulse >> } >> >> ctl.pulse { >> type pulse >> } >> >> pcm.!default { >> type pulse >> } >> >> ctl.!default { >> type pulse >> } > > I haven't used pulseaudio myself, nor the ALSA plugin to > redirect audio through it. I infer that by default > you're routing ALSA connections through the pulseaudio > plugin/connector, and that the pulseaudio daemon has been > configured to send its output to a different ALSA device > (e.g. to hw: or plughw:)? > > Best I can suggest, at this point, is that you check > to see whether you can turn on some sort of debugging > in the pulseaudio daemon, to see what sort of connections > it's receiving from clients, and what it's doing with them. > > It's possible that there's some sort of access-permission > problem in pulseaudio and it's refusing to allow connections > from asterisk for some reason.this i got from syslog: puppy:~# grep pulse /var/log/syslog | tail -3 Dec 14 20:32:45 puppy pulseaudio[25967]: main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally without any error message Dec 14 20:32:46 puppy pulseaudio[25967]: alsa-source.c: snd_pcm_mmap_commit: The device or resource is busy Dec 14 20:39:11 puppy pulseaudio[26368]: main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally without any error message Hmmm, since aplay / arecord are working fine - is it maybe that asterisk wants to lock the soundcard exclusively?>> >> i've acticated the alsa plugin for asterisk: >> >> puppy:/etc/asterisk# grep -E 'alsa|oss' modules.conf >> load => chan_alsa.so >> noload => chan_oss.so >> >> puppy:/etc/asterisk# grep default alsa.conf >> input_device=default >> output_device=default > > Might try setting these to "pulse" rather than > "default", perhaps?The same result :/>> i'm running pulseaudio on top of alsa. through setting /etc/asound.conf >> as >> above any calls to alsa should be redirected to pulseaudio (at least >> that's >> what i thought). > >> Asterisk Ready. >> *CLI> console dial s >> *CLI> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read >> error: Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [Dec 14 02:12:36] ERROR[24945]: chan_alsa.c:456 alsa_read: Read error: >> Input/output error >> [repeated indefinitely until killed] > > Hmmm. Since these are occurring when reading a channel, it indicates > that it's the attempt to read audio from pulseaudio which isn't > working. Have you confirmed that pulseaudio is in fact working > correctly in both directions (using e.g. both aplay and arecord)?recording works as desired: asterisk at puppy:~$ arecord -Ddefault >test.wav Aufnahme: WAVE 'stdin' : Unsigned 8 bit, Rate: 8000 Hz, mono asterisk at puppy:~$ ls -l test.wav -rw-r--r-- 1 asterisk asterisk 17044 14. Dez 20:26 test.wav> _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-- irc ..... #callistix @ freenode mail ..... vitaminx at callistix.net www ..... http://www.callistix.net icecast ..... http://icecast.callistix.net:8000/
vitaminx
2009-Dec-14 20:21 UTC
[asterisk-users] Asterisk throws error using the alsa, module
On Mon, 14 Dec 2009 11:02:02 -0800, Dave Platt <dplatt at radagast.org> wrote:>>> See if it plays back properly. >> >> Running aplay as asterisk user seems to be no problem: >> >> asterisk at puppy$ aplay /usr/share/sounds/alsa/Front_Center.wav >> Playing: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit >> Little Endian, Rate: 48000 Hz, mono >> asterisk at puppy:~$ aplay -Dpulse /usr/share/sounds/alsa/Front_Center.wavHi, I've just tried to make it work without pulseaudio. just plain alsa. it doesn't work :( Asterisk Ready. *CLI> console dial s *CLI> << Console call has been answered >> [Dec 14 21:10:28] ERROR[28575]: chan_alsa.c:456 alsa_read: Read error: Resource temporarily unavailable There is no other program potentially locking the sound device. puppy:/home/vitaminx# grep device /etc/asterisk/alsa.conf | grep -v \; input_device=default output_device=default There was no .asoundrc or /etc/asound.conf defined for this test. seems to be an alsa problem. puppy:/home/vitaminx# aplay -l **** Liste der Hardware-Ger?te (PLAYBACK) **** Karte 0: VT82xx [HDA VIA VT82xx], Ger?t 0: AD198x Analog [AD198x Analog] Sub-Ger?te: 1/1 Sub-Ger?t #0: subdevice #0 Karte 0: VT82xx [HDA VIA VT82xx], Ger?t 1: AD198x Digital [AD198x Digital] Sub-Ger?te: 1/1 Sub-Ger?t #0: subdevice #0 I've tried again with following change: puppy:/home/vitaminx# grep device /etc/asterisk/alsa.conf | grep -v \; input_device=hw:0,0 output_device=hw:0,0 I get: [Dec 14 21:19:05] WARNING[29022]: chan_dahdi.c:17023 process_dahdi: Ignoring any changes to 'hasmanager' (on reload) at line 47. .....................[Dec 14 21:19:05] WARNING[29022]: translate.c:654 __ast_register_translator: plc_samples 160 format f ......[Dec 14 21:19:05] ERROR[29022]: chan_alsa.c:195 alsa_card_init: set_channels failed: Invalid argument [Dec 14 21:19:05] ERROR[29022]: chan_alsa.c:195 alsa_card_init: set_channels failed: Invalid argument [Dec 14 21:19:05] WARNING[29022]: chan_alsa.c:200 alsa_card_init: Rate not correct, requested 8000, got 44100 ..*CLI> ....[Dec 14 21:19:05] WARNING[29022]: res_musiconhold.c:1667 load_module: No music on hold classes configured, disabling music on hold. ... ] Asterisk Ready. *CLI> console dial s *CLI> << Console call has been answered >> Speicherzugriffsfehler (crash) Thanks for any hints :) greetings, vitaminx -- irc ..... #callistix @ freenode mail ..... vitaminx at callistix.net www ..... http://www.callistix.net icecast ..... http://icecast.callistix.net:8000/
Dave Platt
2009-Dec-15 02:11 UTC
[asterisk-users] Asterisk throws error using the alsa, module
> this i got from syslog: > > puppy:~# grep pulse /var/log/syslog | tail -3 > Dec 14 20:32:45 puppy pulseaudio[25967]: main.c: Unable to contact D-Bus: > org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch > terminated abnormally without any error message > Dec 14 20:32:46 puppy pulseaudio[25967]: alsa-source.c: > snd_pcm_mmap_commit: The device or resource is busy > Dec 14 20:39:11 puppy pulseaudio[26368]: main.c: Unable to contact D-Bus: > org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch > terminated abnormally without any error message > > > Hmmm, since aplay / arecord are working fine - is it maybe that asterisk > wants to lock the soundcard exclusively?That would be the case if the ALSA device you were trying to use was "hw:" or "plughw", since these access the hardware directly. By using a PCM device of "pulse" you ought to be preventing Asterisk from attempting to open the sound card directly (either exclusively or shared). Instead, it should be directing the audio I/O through a network/socket connection to the pulseaudio server. Two further thoughts: [1] According to what I've read, pulseaudio requires that all users who are going to be using it must belong to a special user-group. If the user-ID under which you are running the Asterisk server isn't a member of this group, then I think that attempts by Asterisk to connect to the pulseaudio server might very well fail. Check /etc/group, and see if you need to add the pulseaudio group to the definition for your Asterisk daemon user-ID. [2] Are you by any chance running Asterisk in a chroot'ed jail? If so, it may not be able to find some of the programs or sockets that it requires.