[asterisk-bugs] [JIRA] (ASTERISK-14942) [patch] App_jack.so JACK_HOOK half works

Sean Bright (JIRA) noreply at issues.asterisk.org
Thu May 25 11:21:57 CDT 2017


    [ https://issues.asterisk.org/jira/browse/ASTERISK-14942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157642#comment-157642 ] 

Sean Bright edited comment on ASTERISK-14942 at 5/25/17 11:21 AM:
------------------------------------------------------------------

Ok, that's probably the response.

I wanted to do this (ASCII art is more difficult)

{noformat}
channel A......(in)JACK_HOOK(out).............channel B
-----------.....|.................|...............-----------
...rx ----------+------------|-- [bridge] --------> tx
...tx <----------------------+-- [bridge] --------- rx
{noformat}

With jack_hook, I wanted to plug a software element that analyse incoming sound and add some sound to the transmitted.

The problem is the patch I proposed works is this case :

{noformat}
; do a call with console
exten => _0.,1,Answer 
exten => _0.,n,Set(JACK_HOOK(manipulate,c(asterisk)i(from_voip:input)o(to_voip:output))))=on)
exten => _0.,n,Dial(SIP/sip-out/${EXTEN:1})
{noformat}

But not in this one :

{noformat}
; answer a call with console
exten => _0.,1,Answer 
exten => _0.,n,Set(JACK_HOOK(manipulate,c(asterisk)i(from_voip:input)o(to_voip:output))))=on)
exten => _0.,n,Dial(console/alsa/1) 
{noformat}

Do you have you have any examples or links to understand how to to use the M() command. I will test it with a your approach.

The problem is that there are not a lot of exemples... Do you have any exemples with JACK() too ?




was (Author: fabien comte):
Ok, that's probably the response.

I wanted to do this (ASCII art is more difficult)
channel A......(in)JACK_HOOK(out).............channel B
-----------.....|.................|...............-----------
...rx ----------+------------|-- [bridge] --------> tx
...tx <----------------------+-- [bridge] --------- rx

With jack_hook, I wanted to plug a software element that analyse incoming sound and add some sound to the transmitted.

The problem is the patch I proposed works is this case :

; do a call with console
exten => _0.,1,Answer 
exten => _0.,n,Set(JACK_HOOK(manipulate,c(asterisk)i(from_voip:input)o(to_voip:output))))=on)
exten => _0.,n,Dial(SIP/sip-out/${EXTEN:1})

But not in this one :

; answer a call with console
exten => _0.,1,Answer 
exten => _0.,n,Set(JACK_HOOK(manipulate,c(asterisk)i(from_voip:input)o(to_voip:output))))=on)
exten => _0.,n,Dial(console/alsa/1) 

Do you have you have any exemples or links to understand how to to use the M() command. I will test it with a your approach.

The problem is that there are not a lot of exemples... Do you have any exemples with JACK() too ?



> [patch] App_jack.so JACK_HOOK half works
> ----------------------------------------
>
>                 Key: ASTERISK-14942
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-14942
>             Project: Asterisk
>          Issue Type: Bug
>          Components: Applications/app_jack
>            Reporter: fabien comte
>            Severity: Minor
>         Attachments: app_jack.patch
>
>
> Hello,
> My configuration is :
> Card 0 - kernel dummy sound card
> Card 1 - my soundcard
> I have a jackd running in background. My jackd launch command is :
> 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 &
> 1 ) I open asterisk with chan_alsa.so connected (with asoundrc) to the kernel dummy sound card (allow me dial command). I do a call with a JACK_HOOK from app_jack.so, sound is sent but no one is received.
> My extensions.conf :
> exten => _0.,1,Answer 
> exten => _0.,n,Set(JACK_HOOK(manipulate,c(asterisk))i(from_voip:input)o(to_voip:output)))=on)
> exten => _0.,n,Dial(SIP/freephonie-out/${EXTEN:1})
> Asterisk command :
> console dial 0xxxxxxxx
> 2) Jackd works well with anothers applications when I force them to use jack as input/output. -> probably not a jack configuration problem.
> 3) If I kill jackd and I use chan_alsa.so with the real soundcard, it works. -> probably not a network or sip configuration problem.
> 4) If I replace "f_buf[i] = s_buf[i] * (1.0 / SHRT_MAX);" with "f_buf[i] = 0.5 * sin(0.3454 * ((float) i));" in app_jack.c and I retry the test 2, I get test sound. 
> It looks like no sound was read in channel...



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list