All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Asterisk and ALSA/Jack
@ 2009-10-03 13:12 Fabien COMTE
  0 siblings, 0 replies; 2+ messages in thread
From: Fabien COMTE @ 2009-10-03 13:12 UTC (permalink / raw)
  To: alsa-user, alsa-devel

Hi,

I want to use Asterisk with ALSA / Jack audio.

I tried the next configurations :

1 ) app_jack.so -> does not work.

2 ) chan_alsa.so without jackd started
my .asoundrc :
pcm.!default 
{
    type hw
    card 1
}
pcm.jack1 {
    type jack
    playback_ports {
        0 alsa_pcm:playback_1
        1 alsa_pcm:playback_2
    }
    capture_ports {
        0 alsa_pcm:capture_1
        1 alsa_pcm:capture_2
    }
}

pcm.jack1b {
    type plug
    device jack1b
    server linux

	
    slave {
    	 pcm "jack1"
        rate 8000
        format FLOAT
	 channels 2
    }
}

ctl.mixer0 {
    type hw
    card 1
}

in alsa.conf :
input_device=default
output_device=default

That works fine.

3 ) chan_alsa.so with jackd started
Jackd launch command :
jackd --port-max 16 --realtime --no-mlock -d alsa --playback hw:1,0
--capture hw:1,0 --rate 8000 --period 1024 --shorts --inchannels 2
--outchannels 2 --dither triangular &

my .asoundrc :

pcm.!default 
{
    type plug
    slave {
    	 pcm "jack1"
        rate 8000
        format FLOAT
	 channels 2
    }
}
pcm.jack1 {
    type jack
    playback_ports {
        0 alsa_pcm:playback_1
        1 alsa_pcm:playback_2
    }
    capture_ports {
        0 alsa_pcm:capture_1
        1 alsa_pcm:capture_2
    }
}

pcm.jack1b {
    type plug
    device jack1b
    server linux

	
    slave {
    	 pcm "jack1"
        rate 8000
        format FLOAT
	 channels 2
    }
}


ctl.mixer0 {
    type hw
    card 1
}

in alsa.conf :
input_device=default
output_device=default

It doesn't work. Asterisk outputs are :
[Oct  3 10:34:50] ERROR[1364]: chan_alsa.c:175 alsa_card_init: snd_pcm_open
failed: No such file or directory
[Oct  3 10:34:50] ERROR[1364]: chan_alsa.c:175 alsa_card_init: snd_pcm_open
failed: No such file or directory
[Oct  3 10:34:50] ERROR[1364]: chan_alsa.c:272 soundcard_init: Problem
opening ALSA I/O devices

But aplay my_test_file.wav works fine and arecord too...

Does anyone have an idea ?

Thanks,

Fabien

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Asterisk and ALSA/Jack
       [not found] <000101ca442b$20b13f90$6213beb0$@comte@ercogener.com>
@ 2009-10-05  8:02 ` Pavel Hofman
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Hofman @ 2009-10-05  8:02 UTC (permalink / raw)
  To: Fabien COMTE; +Cc: alsa-user, alsa-devel

Fabien COMTE wrote:
> Hi,
> 
> I want to use Asterisk with ALSA / Jack audio.
> 
> I tried the next configurations :
> 
> 1 ) app_jack.so -> does not work.
> 
> 2 ) chan_alsa.so without jackd started
> my .asoundrc :
> pcm.!default 
> {
>     type hw
>     card 1
> }
> pcm.jack1 {
>     type jack
>     playback_ports {
>         0 alsa_pcm:playback_1
>         1 alsa_pcm:playback_2
>     }
>     capture_ports {
>         0 alsa_pcm:capture_1
>         1 alsa_pcm:capture_2
>     }
> }
> 
> pcm.jack1b {
>     type plug
>     device jack1b
>     server linux
> 
> 	
>     slave {
>     	 pcm "jack1"
>         rate 8000
>         format FLOAT
> 	 channels 2
>     }
> }
> 
> ctl.mixer0 {
>     type hw
>     card 1
> }
> 
> in alsa.conf :
> input_device=default
> output_device=default
> 
> That works fine.
> 
> 3 ) chan_alsa.so with jackd started
> Jackd launch command :
> jackd --port-max 16 --realtime --no-mlock -d alsa --playback hw:1,0
> --capture hw:1,0 --rate 8000 --period 1024 --shorts --inchannels 2
> --outchannels 2 --dither triangular &
> 
> my .asoundrc :
> 
> pcm.!default 
> {
>     type plug
>     slave {
>     	 pcm "jack1"
>         rate 8000
>         format FLOAT
> 	 channels 2
>     }
> }
> pcm.jack1 {
>     type jack
>     playback_ports {
>         0 alsa_pcm:playback_1
>         1 alsa_pcm:playback_2
>     }
>     capture_ports {
>         0 alsa_pcm:capture_1
>         1 alsa_pcm:capture_2
>     }
> }
> 
> pcm.jack1b {
>     type plug
>     device jack1b
>     server linux
> 
> 	
>     slave {
>     	 pcm "jack1"
>         rate 8000
>         format FLOAT
> 	 channels 2
>     }
> }
> 
> 
> ctl.mixer0 {
>     type hw
>     card 1
> }
> 
> in alsa.conf :
> input_device=default
> output_device=default
> 
> It doesn't work. Asterisk outputs are :
> [Oct  3 10:34:50] ERROR[1364]: chan_alsa.c:175 alsa_card_init: snd_pcm_open
> failed: No such file or directory
> [Oct  3 10:34:50] ERROR[1364]: chan_alsa.c:175 alsa_card_init: snd_pcm_open
> failed: No such file or directory
> [Oct  3 10:34:50] ERROR[1364]: chan_alsa.c:272 soundcard_init: Problem
> opening ALSA I/O devices
> 
> But aplay my_test_file.wav works fine and arecord too...
> 
> Does anyone have an idea ?
> 
Does asterisk run under the same user as the .asoundrc is defined for?

Since your card is nb. 1, perhaps asterisk uses a default configuration
for card0 which may not be present on your system.


Pavel.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-05  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <000101ca442b$20b13f90$6213beb0$@comte@ercogener.com>
2009-10-05  8:02 ` Asterisk and ALSA/Jack Pavel Hofman
2009-10-03 13:12 Fabien COMTE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.