[Asterisk-Users] Problems with asterisk and gnophone on Gentoo box (long)

Kevin asterisk at gnosys.biz
Fri Mar 19 07:49:48 MST 2004


Thanks for your reply, John.

On Thursday 18 March 2004 18:30, John Baker wrote:
> What sound chip are you using?  I thought I had the via82xx and spent
> a couple days jacking with it before I figured out I was wrong.

I suppose that could be my problem, but I'm pretty sure it's not:

On Thursday 18 March 2004 10:40, Kevin wrote:
> My hardware and driver setup is as follows:
>
> ================================================
> => M/B: ASUS A7N8X with onboard nForce2 audio system
>
> => bash-2.05b# lspci|grep audio
> 00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97
> Audio Controler (MCP) (rev a1)
>
> => bash-2.05b# cat /proc/pci
>   Bus  0, device   6, function  0:
>     Multimedia audio controller: nVidia Corporation nForce2 AC97
> Audio Controler (MCP) (rev 161).
>       IRQ 21.
>       Master Capable.  No bursts.  Min Gnt=2.Max Lat=5.
>       I/O at 0xd400 [0xd4ff].
>       I/O at 0xd800 [0xd87f].
>       Non-prefetchable 32 bit memory at 0xe0001000 [0xe0001fff].
>
> => bash-2.05b# lsmod|grep audio
> nvaudio                36180   0
> ac97_codec             13076   0  [nvaudio]
> soundcore               4196   4  [snd nvaudio]
> ================================================

If the nvaudio module from nVidia is not the right module for this sound 
device, does anyone here know which one is?

Or I wonder if the problem lies with that module, since I don't think it 
comes from the alsa development community.  Does the underlying sound 
card module (nvaudio in my case) need to have OSS emulation support 
coded into it?  Or does that happen at a different level?  Maybe nVidia 
just didn't include OSS emulation support in that module---maybe they 
just planned on having it used with alsa and not oss?  I'm reaching 
here...

>
> Here's my alsa setup in modules.conf:
>
> # --- ALSACONF verion 1.0.0pre1 ---
> alias char-major-116 snd
> alias char-major-14 soundcore
> alias char-major-15      off
> alias sound-service-0-0 snd-mixer-oss
> alias sound-service-0-1 snd-seq-oss
> alias sound-service-0-3 snd-pcm-oss
> alias sound-service-0-8 snd-seq-oss
> alias sound-service-0-12 snd-pcm-oss

> alias snd-card-0 snd-intel8x0
> alias sound-slot-0 snd-intel8x0

> # --- END: Generated by ALSACONF, do not edit. --

Here's mine (pretty close):

==========================================
bash-2.05b$ cat /etc/modules.d/alsa|grep -v ^\#

alias char-major-116 snd
alias char-major-14 soundcore

alias snd-card-0 nvaudio # testing
alias snd-slot-0 snd-card-0 # testing

alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

options snd cards_limit=1
==========================================

I note with particular interest your lines:
> alias snd-card-0 snd-intel8x0
> alias sound-slot-0 snd-intel8x0

...whereas in mine, I have:
alias snd-card-0 nvaudio
alias snd-slot-0 snd-card-0

Do you know which is correct?
(sound-slot-0 or snd-slot-0)
 ^^^^^           ^^^

I checked the alsa docs and a sample configuration file and it seems 
that sound-slot-0 is correct, not snd-slot-0.  I got snd-slot-0 from 
Alastair:

On Thursday 18 March 2004 14:57, Alastair Maw wrote:
> But I suspect that your real problem is that in addition to the lines
> you specified in modules.d/alsa, you must have the following:
>
>    alias snd-card-0 snd-via82xx   <-- replace with your ALSA driver
>    alias snd-slot-0 snd-card-0    <-- required for OSS support under

The problem is though, I can't get functional sound with asterisk using 
_either_ configuration!  After re-reading the alsa docs on this, I 
tried changing it back to what I had previously (sound-slot-0) and I 
still get the same error from asterisk (see below).

>
> I'm thinking maybe soundcore is what you're missing, since on mine
> it's definitely used.

Well, as you can see above, I do have soundcore loaded in the kernel and 
it is being used by snd and nvaudio.  Although I'm not sure, I'm 
guessing I wouldn't have any sound at all without it.

>
> As proof, here's the pertinent readoff from lsmod:
>
> snd-mixer-oss          13456   0  (autoclean) [snd-pcm-oss]
> snd-intel8x0           20612   1
> snd-ac97-codec         50176   0  [snd-intel8x0]
> snd-pcm                78464   0  [snd-pcm-oss snd-intel8x0]
> snd-page-alloc          8876   0  [snd-intel8x0 snd-pcm]
> snd-timer              19204   0  [snd-pcm]
> snd-mpu401-uart         4856   0  [snd-intel8x0]
> snd-rawmidi            17728   0  [snd-mpu401-uart]
> snd-seq-device          5644   0  [snd-rawmidi]
> snd                    42468   0  [snd-pcm-oss snd-mixer-oss
> snd-intel8x0 snd-ac97-codec snd-pcm snd-timer snd-mpu401-uart
> snd-rawmidi snd-seq-device]
> soundcore               6244   4  [snd]
>

Well, I didn't have some of these modules loaded.  Not sure why they 
weren't auto-loaded... should they have been?  Or are they associated 
with midi stuff---which I haven't used and maybe that's why they 
weren't auto-loaded?

After reading this, I used modprobe to manually load snd-ac97-codec 
(though I did already have the module, "ac97_codec" loaded into the 
kernel---what is that?  old module?).  In my filesystem, I have the 
following ac97 modules:
/lib/modules/2.4.22-gentoo-r7/kernel/drivers/sound/ac97_codec.o
/lib/modules/2.4.22-gentoo-r7/kernel/sound/pci/ac97/snd-ac97-codec.o

Right now, both are loaded:
bash-2.05b# lsmod|grep ac97
snd-ac97-codec         48428   0  (unused)
snd                    33892   0  [snd-mpu401-uart snd-rawmidi 
snd-ac97-codec snd-pcm-oss snd-pcm snd-mixer-oss snd-seq-oss 
snd-seq-midi-event snd-seq snd-timer snd-seq-device]
ac97_codec             13076   0  [nvaudio]
bash-2.05b#

I then loaded snd-mpu401-uart (which seems to have required and thus 
autoloaded snd-rawmidi).

Now I have:
bash-2.05b# lsmod|grep snd
snd-mpu401-uart         3904   0  (unused)
snd-rawmidi            14688   0  [snd-mpu401-uart]
snd-ac97-codec         48428   0  (unused)
snd-pcm-oss            39140   0  (unused)
snd-pcm                65828   0  [snd-pcm-oss]
snd-page-alloc          6452   0  [snd-pcm]
snd-mixer-oss          13392   0  [snd-pcm-oss]
snd-seq-oss            27456   0  (unused)
snd-seq-midi-event      3840   0  [snd-seq-oss]
snd-seq                40528   2  [snd-seq-oss snd-seq-midi-event]
snd-timer              15556   0  [snd-pcm snd-seq]
snd-seq-device          4176   0  [snd-rawmidi snd-seq-oss snd-seq]
snd                    33892   0  [snd-mpu401-uart snd-rawmidi 
snd-ac97-codec snd-pcm-oss snd-pcm snd-mixer-oss snd-seq-oss 
snd-seq-midi-event snd-seq snd-timer snd-seq-device]
soundcore               4196   4  [snd nvaudio]
bash-2.05b# lsmod|grep audio
nvaudio                36180   0
ac97_codec             13076   0  [nvaudio]
soundcore               4196   4  [snd nvaudio]
bash-2.05b#

I don't think these are required by asterisk, though, and I still have 
the same error from asterisk as before (see below).

> What motherboard are you using?  Again, make sure you've got the
> right chip selected for alsa.

M/B: ASUS A7N8X with onboard nForce2 audio system

Again, thanks very kindly for your reply, John, but nothing seems to be 
working here.  Any other ideas on this folks?

Could this have something to do with the fact that I'm using the devfs 
filesystem on this Gentoo box?

bash-2.05b# mount
/dev/hdb4 on / type reiserfs (rw)
none on /dev type devfs (rw)
none on /proc type proc (rw)
none on /dev/shm type tmpfs (rw)

bash-2.05b# ls -l /dev/dsp
lr-xr-xr-x    1 root     root            9 Mar 19 03:38 /dev/dsp -> 
sound/dsp
bash-2.05b# ls -l /dev/sound/
total 0
crw-------    1 adam     audio     14,   3 Dec 31  1969 dsp
crw-------    1 adam     audio     14,   0 Dec 31  1969 mixer
crw-------    1 adam     audio     14,   1 Dec 31  1969 sequencer
crw-------    1 adam     audio     14,   8 Dec 31  1969 sequencer2

On my SuSE 9.0 box (where I am getting asterisk to run and make 
sound---though it's not getting input from the microphone which is 
another problem...), I'm not using the devfs filesystem.

I'll close with a summary of the error messages I'm getting from 
gnophone and asterisk.

For anyone who's picking up this thread recently, I'll reiterate that I 
_do_ seem to have every other aspect of sound working on this box.

gnophone output:
===================================================
bash-2.05b# gnophone
Card /dev/dsp is no good because Device does not support mono PCM data
Loaded and activated '/usr/lib/gnophone/modules/audio-oss.so'
Loaded and activated '/usr/lib/gnophone/modules/audio-phone.so'
iax.c line 654 in iax_init: Started on port 5036
Listening on port 5036
Initialized phone core
No audio devices found
bash-2.05b#
===================================================


Asterisk output:
===================================================
 [format_vox.so] => (Dialogic VOX (ADPCM) File Format)
  == Registered file format vox, extension(s) vox
 [app_waitforring.so] => (Waits until first ring after time)
  == Registered application 'WaitForRing'
 [app_setcidnum.so] => (Set CallerID Number)
  == Registered application 'SetCIDNum'
 [chan_oss.so] => (OSS Console Channel Driver)
Mar 19 08:40:41 WARNING[16384]: chan_oss.c:352 setformat: Requested 8000 
Hz, got 7866 Hz -- sound may be choppy
Mar 19 08:40:41 WARNING[16384]: chan_oss.c:980 load_module: XXX I don't 
work right with non-full duplex sound cards XXX
  == Registered channel type 'Console' (OSS Console Channel Driver)
  == Parsing '/etc/asterisk/oss.conf': Found
Mar 19 08:40:41 WARNING[229391]: chan_oss.c:238 sound_thread: Read error 
on sound device: Resource temporarily unavailable
 [app_db.so] => (Database access functions for Asterisk extension logic)
  == Registered application 'DBget'
  == Registered application 'DBput'
  == Registered application 'DBdel'
  == Registered application 'DBdeltree'
 [chan_sip.so] => (Session Initiation Protocol (SIP))
  == Parsing '/etc/asterisk/sip.conf': Found
  == SIP Listening on 0.0.0.0:5060
  == Using TOS bits 0
  == Registered channel type 'SIP' (Session Initiation Protocol (SIP))
  == Registered application 'SIPDtmfMode'
  == Parsing '/etc/asterisk/enum.conf': Found
Asterisk Ready.
*CLI> dial
*CLI>     -- Executing Wait("OSS/dsp", "1") in new stack
    -- Executing Answer("OSS/dsp", "") in new stack
 << Console call has been answered >>
    -- Executing DigitTimeout("OSS/dsp", "5") in new stack
    -- Set Digit Timeout to 5
    -- Executing ResponseTimeout("OSS/dsp", "10") in new stack
    -- Set Response Timeout to 10
    -- Executing BackGround("OSS/dsp", "demo-congrats") in new stack
Mar 19 08:41:15 WARNING[262161]: chan_oss.c:408 soundcard_setinput: 
Unable to re-open DSP device: Device or resource busy
Mar 19 08:41:15 WARNING[262161]: chan_oss.c:567 oss_write: Unable to set 
device to input mode
Mar 19 08:41:15 WARNING[262161]: file.c:521 ast_readaudio_callback: 
Failed to write frame
    -- Playing 'demo-congrats' (language 'en')
  == Spawn extension (local, s, 5) exited non-zero on 'OSS/dsp'
 << Hangup on console >>

*CLI>
===================================================

Many thanks to John and Alastair for replies, and I would be most 
grateful for any other replies.

TIA.

-Kevin



More information about the asterisk-users mailing list