chan_oss problem


#1

since i installed Asterisk v 1.2 , i have a problem with paging through the sound card, it worked fine for me with version 1.05 . it appears that chan_oss.c was completely re-written , compiled again after renaming the chan_oss_old to chan_oss.c but still have one way audio (from mic to phones) i’m using full duplex sound blaster live.
any help will be appreciated


#2

Firstly, why are you using OSS? Have you tried using chan_alsa instead of chan_oss?

OSS is obsolete and, unless you’re using an old Linux distribution, you’re much better off using ALSA. ALSA is generally the sound system that’s shipped with modern distributions. ALSA has an OSS compatibility layer, so OSS stuff should still work - but if you’ve got the option, it’s best not to use OSS.


#3

in modules.conf if i put load => chan_alsa.so after reboot i get an error message says that file not found even after recompile asterisk it seems that chan_alsa.so is not loaded at channels directory and i got error messages about the source code in chan_alsa.c file, would you please help with this issue, also do i need to creat alsa.conf file as i do with oss.conf, also do i set it up in [general] section as the case of oss.conf?


#4

You will need alsa.conf, yes. It should be included in the sample configs that come with the Asterisk source. What Linux version are you using? What Asterisk version are you using? Is your system actually using ALSA?

Here’s an alsa.conf that should work:

; ; ALSA Console Driver Configuration File ; [general] ; ; Automatically answer incoming calls on the console? Choose yes if ; for example you want to use this as an intercom. ; autoanswer=no ; ; Default context (is overridden with @context syntax) ; context=local ; ; Default extension to call ; extension=s ; ; Default language ; ;language=en ; ; Silence supression can be enabled when sound is over a certain threshold. ; The value for the threshold should probably be between 500 and 2000 or so, ; but your mileage may vary. Use the echo test to evaluate the best setting. ;silencesuppression = yes ;silencethreshold = 1000 ; ; To set which ALSA device to use, change this parameter ;input_device=hw:0,0 ;output_device=default


#5

i’m using Centos v4.1 and asterisk 1.2, after adding chan_alsa.so to makefile and recompile i get lots of error i will list only the top portion here.

chan_alsa.c:23:28: alsa/asoundlib.h: No such file or directory
chan_alsa.c:41:18: busy.h: No such file or directory
chan_alsa.c:42:22: ringtone.h: No such file or directory
chan_alsa.c:69: error: syntax error before "format"
chan_alsa.c:69: warning: type defaults to int' in declaration offormat’
chan_alsa.c:69: error: SND_PCM_FORMAT_S16_LE' undeclared here (not in a function) chan_alsa.c:69: warning: data definition has no type or storage class chan_alsa.c:112: error:ringtone’ undeclared here (not in a function)
chan_alsa.c:112: error: initializer element is not constant
chan_alsa.c:112: error: (near initialization for sounds[0].data') chan_alsa.c:112: error: initializer element is not constant chan_alsa.c:112: error: (near initialization forsounds[0]’)
chan_alsa.c:113: error: busy' undeclared here (not in a function) chan_alsa.c:113: error: initializer element is not constant chan_alsa.c:113: error: (near initialization forsounds[1].data’)
chan_alsa.c:113: error: initializer element is not constant
chan_alsa.c:113: error: (near initialization for sounds[1]') chan_alsa.c:114: error: initializer element is not constant chan_alsa.c:114: error: (near initialization forsounds[2].data’)
chan_alsa.c:114: error: initializer element is not constant
chan_alsa.c:114: error: (near initialization for sounds[2]') chan_alsa.c:115: error: initializer element is not constant chan_alsa.c:115: error: (near initialization forsounds[3]’)
chan_alsa.c:116: error: initializer element is not constant
chan_alsa.c:116: error: (near initialization for sounds[4]') chan_alsa.c:131: error: syntax error before "snd_pcm_t" chan_alsa.c:131: warning: no semicolon at end of struct or union chan_alsa.c:133: warning: type defaults toint’ in declaration of `alsa’
chan_alsa.c:133: warning: data definition has no type or storage class


#6

Well, if you’re editing the Makefile, you obviously know more about this sort of thing than i do (i’m not a C programmer). I’m afraid i can’t help you there.

I can’t see why you’d need to edit the Makefile though, as ALSA support comes configured by default as far as i’m aware. I have always used Asterisk with ALSA and i’ve never had to do anything except, maybe, edit /etc/asterisk/modules.conf