Chan_alsa declines to load on boot , manually loading works

Hi ,
I am having an issue where chan_alsa will not load on boot. In the log i see loader.c:2508 load_modules: chan_alsa declined to load. but if I load it manually by module load chan_alsa command it loads.

 Loading bridge_softmix.so.
 Loading chan_bridge_media.so.
 Loading codec_a_mu.so.
 Loading codec_alaw.so.
 Loading codec_g722.so.
 Loading codec_g726.so.
 Loading codec_g729.so.
 Loading codec_gsm.so.
 Loading codec_opus_open_source.so.
 Loading codec_ulaw.so.
 Loading func_callerid.so.
 Loading func_cut.so.
 Loading func_dialgroup.so.
 Loading func_hangupcause.so.
 Loading func_logic.so.
 Loading func_strings.so.
 Loading func_timeout.so.
 Loading func_volume.so.
 Loading pbx_config.so.
 Loading pbx_spool.so.
 Loading res_clioriginate.so.
 Loading res_http_media_cache.so.
 Loading res_pjsip_endpoint_identifier_anonymous.so.
 Loading res_stasis_answer.so.
 Loading res_stasis_snoop.so.
 Loading app_speech_utils.so.
 Loading func_pjsip_aor.so.
 Loading func_pjsip_contact.so.
 Loading func_pjsip_endpoint.so.
 Loading res_pjsip_stir_shaken.so.
 Loading res_stasis_playback.so.
 Loading res_ari_channels.so.
[Aug 15 10:09:06] WARNING[2606]: loader.c:2393 load_modules: Some non-required modules failed to load.
[Aug 15 10:09:06] WARNING[2606]: loader.c:2493 load_modules: The deprecated module 'app_macro.so' has been loaded and is running, it may be removed in a future version
[Aug 15 10:09:06] ERROR[2606]: loader.c:2508 load_modules: chan_alsa declined to load.
Asterisk Ready.

below is modules.conf

;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
; An example of loading ODBC support would be:
;preload => res_odbc.so
;preload => res_config_odbc.so
;
; Uncomment the following if you wish to use the Speech Recognition API
;preload => res_speech.so
;
; If you want Asterisk to fail if a module does not load, then use
; the "require" keyword. Asterisk will exit with a status code of 2
; if a required module does not load.
;
; require = chan_sip.so
; If you want you can combine with preload
; preload-require = res_odbc.so
;
; If you want, load the GTK console right away.
;
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
;
load => res_musiconhold.so
;
; Load one of: chan_oss, alsa, or console (portaudio).
; By default, load chan_oss only (automatically).
;

;noload => chan_oss.so
noload => chan_console.so
;noload => chan_sip.so
;;load => chan_oss.so
load => chan_alsa.so

module show like alsa

Module                         Description                              Use Count  Status      Support Level
chan_alsa.so                   ALSA Console Channel Driver              0          Not Running      extended

Are you aware that chan_alsa will be completely removed in next year’s release of Asterisk?

No

May I know whats replacing it. I use chan_alsa to implemnet a PA system. There is an extension when dialed will make a tone, and place the call on alsa so that the caller can speak on the public address system. The audio of the call is output on the spakers.

I believe chan_console replaces it. Although it only has extended support, which means that Sangoma don’t support it and any support will community, but there is no guarantee that anyone in the community is supporting it.

Whilst I can guess why it isn’t considered to suitable for core support, I don’t have access to the decision making process.

i enabled full logs and here is what I get

[Aug 15 11:02:28] ERROR[2586] chan_alsa.c: snd_pcm_open failed: Resource busy
[Aug 15 11:02:28] ERROR[2586] chan_alsa.c: Problem opening alsa capture device
[Aug 15 11:02:29] ERROR[2586] loader.c: chan_alsa declined to load.

alsa.conf

[general]

autoanswer=yes

context=local

extension=s
mohinterpret=default
output_device=plug:dmix
;mute=true
;noaudiocapture=true



The logs are telling you the issue:

[Aug 15 11:02:28] ERROR[2586] chan_alsa.c: snd_pcm_open failed: Resource busy
[Aug 15 11:02:28] ERROR[2586] chan_alsa.c: Problem opening alsa capture device

I haven’t looked into it enough to see why, but it means a resource is in use when the module tries to load at startup, and it’s available later when you try to load it manually.

It could be that something else on your system or during startup causes it to be in use. How are you loading Asterisk? Is it due to a restart, or a cold start?

For example, the same type of thing can happen with sockets if you immediately restart a program that tries to bind on the same port, causing the kernel to think it’s in use when it really isn’t.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.