PocketSphinx + Asterisk and unimrcp

230 views
Skip to first unread message

drenda

unread,
Mar 28, 2011, 4:19:26 PM3/28/11
to UniMRCP
Hi,
using the last online tutorial, I configured my server with Asterisk
1.8 + PocketSphinx + Unimrcp.
I'm using this simple dialplan:

exten => 100,1,Answer()
exten => 100,2,SpeechCreate()
exten => 100,3,SpeechLoadGrammar(digit,/opt/unimrcp/data/grammar.jsgf)
exten => 100,4,SpeechActivateGrammar(digit)
exten => 100,5,SpeechBackground(hello-world,4)
exten => 100,6,GotoIf($["${SPEECH(results)}" = "0"]?7:9)
exten => 100,7,Playback(vm-nonumber)
exten => 100,8,Goto(5)
exten => 100,9,Verbose(1,The recognized input is ${SPEECH_TEXT(0)})
exten => 100,10,Verbose(1,The score is ${SPEECH_SCORE(0)})
exten => 100,11,Verbose(1,The matched grammar is ${SPEECH_GRAMMAR(0)})
exten => 100,12,SpeechDeactivateGrammar(digit)
exten => 100,13,SpeechUnloadGrammar(digit)
exten => 100,14,SpeechDestroy()
exten => 100,15,Hangup()

But when I'm calling the 100 extension, unimrcpserver exit with a
failure message:

2011-03-28 22:17:20:222183 [NOTICE] UniMRCP Server [1.0.0]
2011-03-28 22:17:20:222274 [INFO] APR [1.4.2]
2011-03-28 22:17:20:222288 [NOTICE] Create MRCP Server
2011-03-28 22:17:20:222332 [NOTICE] Open Config File [../conf/
unimrcpserver.xml]
2011-03-28 22:17:20:223085 [INFO] Set Property ip:91.121.95.184
2011-03-28 22:17:20:223097 [INFO] Set Property ip:127.0.0.1
2011-03-28 22:17:20:223114 [INFO] Register Codec [PCMU]
2011-03-28 22:17:20:223121 [INFO] Register Codec [PCMA]
2011-03-28 22:17:20:223126 [INFO] Register Codec [L16]
2011-03-28 22:17:20:223145 [NOTICE] Register Resource [speechsynth]
2011-03-28 22:17:20:223156 [NOTICE] Register Resource [speechrecog]
2011-03-28 22:17:20:223165 [NOTICE] Register Resource [recorder]
2011-03-28 22:17:20:223171 [INFO] Register Resource Factory
2011-03-28 22:17:20:223192 [NOTICE] Create SofiaSIP Agent [SIP-
Agent-1] [1.12.10devel] sip:127.0.0.1:8060;transport=udp,tcp
2011-03-28 22:17:20:223200 [INFO] Register Signaling Agent [SIP-
Agent-1]
2011-03-28 22:17:20:223327 [NOTICE] Create UniRTSP Agent [RTSP-
Agent-1] 127.0.0.1:1554 [100]
2011-03-28 22:17:20:223338 [INFO] Register Signaling Agent [RTSP-
Agent-1]
2011-03-28 22:17:20:223350 [NOTICE] Create MRCPv2 Agent [MRCPv2-
Agent-1] 127.0.0.1:1544 [100]
2011-03-28 22:17:20:223429 [INFO] Register Connection Agent [MRCPv2-
Agent-1]
2011-03-28 22:17:20:223442 [NOTICE] Create Media Engine [Media-
Engine-1]
2011-03-28 22:17:20:223456 [INFO] Register Media Engine [Media-
Engine-1]
2011-03-28 22:17:20:223466 [NOTICE] Create RTP Termination Factory
127.0.0.1:[5000,6000]
2011-03-28 22:17:20:223472 [INFO] Register RTP Termination Factory
[RTP-Factory-1]
2011-03-28 22:17:20:223481 [INFO] Load Plugin [PocketSphinx-1] [../
plugin/mrcppocketsphinx.so]
2011-03-28 22:17:20:224909 [INFO] Create PocketSphinx Engine
2011-03-28 22:17:20:224921 [INFO] Register MRCP Engine
[PocketSphinx-1]
2011-03-28 22:17:20:224930 [INFO] Load Plugin [Demo-Synth-1] [../
plugin/demosynth.so]
2011-03-28 22:17:20:225037 [INFO] Register MRCP Engine [Demo-
Synth-1]
2011-03-28 22:17:20:225048 [INFO] Load Plugin [Demo-Recog-1] [../
plugin/demorecog.so]
2011-03-28 22:17:20:225157 [INFO] Register MRCP Engine [Demo-
Recog-1]
2011-03-28 22:17:20:225169 [INFO] Load Plugin [Recorder-1] [../
plugin/mrcprecorder.so]
2011-03-28 22:17:20:225256 [INFO] Register MRCP Engine [Recorder-1]
2011-03-28 22:17:20:225278 [INFO] Register RTP Settings [RTP-
Settings-1]
2011-03-28 22:17:20:225291 [NOTICE] Create MRCPv2 Profile [uni2]
2011-03-28 22:17:20:225303 [INFO] Assign MRCP Engine [speechsynth]
[Demo-Synth-1]
2011-03-28 22:17:20:225309 [INFO] Assign MRCP Engine [speechrecog]
[PocketSphinx-1]
2011-03-28 22:17:20:225314 [INFO] Assign MRCP Engine [recorder]
[Recorder-1]
2011-03-28 22:17:20:225319 [INFO] Register Profile [uni2]
2011-03-28 22:17:20:225326 [NOTICE] Create MRCPv1 Profile [uni1]
2011-03-28 22:17:20:225331 [INFO] Assign MRCP Engine [speechsynth]
[Demo-Synth-1]
2011-03-28 22:17:20:225336 [INFO] Assign MRCP Engine [speechrecog]
[Demo-Recog-1]
2011-03-28 22:17:20:225341 [INFO] Assign MRCP Engine [recorder]
[Recorder-1]
2011-03-28 22:17:20:225346 [INFO] Register Profile [uni1]
2011-03-28 22:17:20:225353 [INFO] Start Task [MRCP Server]
>2011-03-28 22:17:20:225551 [INFO] Open Engine [Demo-Recog-1]
2011-03-28 22:17:20:225568 [INFO] Start Task [Demo Recog Engine]
2011-03-28 22:17:20:225636 [INFO] Open Engine [Recorder-1]
2011-03-28 22:17:20:225649 [INFO] Open Engine [Demo-Synth-1]
2011-03-28 22:17:20:225655 [INFO] Start Task [Demo Synth Engine]
2011-03-28 22:17:20:225685 [INFO] Open Engine [PocketSphinx-1]
2011-03-28 22:17:20:225790 [INFO] Start Task [SIP-Agent-1]
2011-03-28 22:17:20:225830 [INFO] Start Task [RTSP-Agent-1]
2011-03-28 22:17:20:225861 [INFO] Start Task [MRCPv2-Agent-1]
2011-03-28 22:17:20:225891 [INFO] Start Task [Media-Engine-1]
2011-03-28 22:17:20:227063 [NOTICE] MRCP Server Started
2011-03-28 22:17:20:227223 [INFO] Receive SIP Event
[nua_r_set_params] Status 200 OK
2011-03-28 22:17:25:875934 [INFO] Receive SIP Event [nua_i_invite]
Status 100 Trying
2011-03-28 22:17:25:875959 [INFO] Receive SIP Event [nua_i_state]
Status 100 Trying
2011-03-28 22:17:25:875973 [NOTICE] SIP Call State [received]
2011-03-28 22:17:25:875997 [INFO] Create Session 0x642b58 <new>
[uni2]
2011-03-28 22:17:25:876009 [INFO] Remote SDP 0x642b58 <new>
v=0
o=UniMRCPClient 8765988451650284705 7862315183206195393 IN IP4
XX.XX.XX.XX
s=-
c=IN IP4 127.0.0.1
t=0 0
m=application 9 TCP/MRCPv2 1
a=setup:active
a=connection:new
a=resource:speechrecog
a=cmid:1
m=audio 4026 RTP/AVP 0 8 96 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 L16/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendonly
a=ptime:20
a=mid:1

2011-03-28 22:17:25:876236 [NOTICE] Add Session <65ba2c00597811e0>
2011-03-28 22:17:25:876253 [INFO] Receive Offer 0x642b58
<65ba2c00597811e0> [c:1 a:1 v:0]
2011-03-28 22:17:25:876396 [INFO] Add Pending Control Channel
<65ba2c00597811e0@speechrecog> [1]
2011-03-28 22:17:25:886270 [INFO] Enable RTP Session 127.0.0.1:5000
2011-03-28 22:17:25:886312 [INFO] Open RTP Receiver 127.0.0.1:5000
<- 127.0.0.1:4026 playout [50 ms]
2011-03-28 22:17:25:886323 [INFO] Media Path 0x642b58 Source->[PCMU/
8000/1]->Decoder->[LPCM/8000/1]->Bridge->[LPCM/8000/1]->Sink
2011-03-28 22:17:25:886346 [INFO] Open Channel
<65ba2c00597811e0@pocketsphinx>
2011-03-28 22:17:25:886450 [INFO] Run Recognition Thread
<65ba2c00597811e0@pocketsphinx>
2011-03-28 22:17:25:886542 [INFO] Send Answer 0x642b58
<65ba2c00597811e0> [c:1 a:1 v:0] Status OK
2011-03-28 22:17:25:886580 [INFO] Local SDP 0x642b58
<65ba2c00597811e0>
v=0
o=UniMRCPServer 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=application 1544 TCP/MRCPv2 1
a=setup:passive
a=connection:new
a=channel:65ba2c00597811e0@speechrecog
a=cmid:1
m=audio 5000 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=recvonly
a=ptime:20
a=mid:1

2011-03-28 22:17:25:887260 [INFO] Receive SIP Event [nua_i_state]
Status 200 OK
2011-03-28 22:17:25:887280 [NOTICE] SIP Call State 0x642b58
[completed]
2011-03-28 22:17:25:887755 [INFO] Receive SIP Event [nua_i_ack]
Status 200 OK
2011-03-28 22:17:25:887777 [INFO] Receive SIP Event [nua_i_state]
Status 200 OK
2011-03-28 22:17:25:887787 [NOTICE] SIP Call State 0x642b58 [ready]
2011-03-28 22:17:25:887794 [INFO] Receive SIP Event [nua_i_active]
Status 200 Call active
2011-03-28 22:17:25:888033 [NOTICE] Accepted TCP/MRCPv2 Connection
127.0.0.1:1544 <-> 127.0.0.1:51809
2011-03-28 22:17:25:891646 [INFO] Receive MRCPv2 Stream
127.0.0.1:1544 <-> 127.0.0.1:51809 [132 bytes]
MRCP/2.0 132 SET-PARAMS 1
Channel-Identifier: 65ba2c00597811e0@speechrecog
Recognition-Timeout: 20000
No-Input-Timeout: 15000


2011-03-28 22:17:25:891710 [INFO] Attach Control Channel
<65ba2c00597811e0@speechrecog> to Connection 127.0.0.1:1544 <->
127.0.0.1:51809 [1]
2011-03-28 22:17:25:891732 [INFO] Process SET-PARAMS Request
<65ba2c00597811e0@speechrecog> [1]
2011-03-28 22:17:25:891818 [INFO] Dispatch Request SET-PARAMS
<65ba2c00597811e0@pocketsphinx>
2011-03-28 22:17:25:891905 [INFO] Process SET-PARAMS Response
<65ba2c00597811e0@speechrecog> [1]
2011-03-28 22:17:25:891958 [INFO] Send MRCPv2 Stream 127.0.0.1:1544
<-> 127.0.0.1:51809 [80 bytes]
MRCP/2.0 80 1 200 COMPLETE
Channel-Identifier: 65ba2c00597811e0@speechrecog


2011-03-28 22:17:25:892271 [INFO] Receive MRCPv2 Stream
127.0.0.1:1544 <-> 127.0.0.1:51809 [227 bytes]
MRCP/2.0 227 DEFINE-GRAMMAR 2
Channel-Identifier: 65ba2c00597811e0@speechrecog
Content-Type: application/x-jsgf
Content-Id: digit
Content-Length: 71

#JSGF V1.0;
grammar digits;
public <numbers> = (one | two | three);

2011-03-28 22:17:25:892335 [INFO] Process DEFINE-GRAMMAR Request
<65ba2c00597811e0@speechrecog> [2]
2011-03-28 22:17:25:892357 [INFO] Dispatch Request DEFINE-GRAMMAR
<65ba2c00597811e0@pocketsphinx>
2011-03-28 22:17:25:892373 [INFO] Create Grammar File [../data/
65ba2c00597811e0-digit.gram] <65ba2c00597811e0@pocketsphinx>
INFO: cmd_ln.c(512): Parsing command line:
\
-samprate 8000 \
-hmm ../data/communicator \
-jsgf ../data/65ba2c00597811e0-digit.gram \
-dict ../data/default.dic \
-frate 50 \
-silprob 0.005

Current configuration:
[NAME] [DEFLT] [VALUE]
-agc none none
-agcthresh 2.0 2.000000e+00
-alpha 0.97 9.700000e-01
-ascale 20.0 2.000000e+01
-backtrace no no
-beam 1e-48 1.000000e-48
-bestpath yes yes
-bestpathlw 9.5 9.500000e+00
-bghist no no
-ceplen 13 13
-cmn current current
-cmninit 8.0 8.0
-compallsen no no
-debug 0
-dict ../data/default.dic
-dictcase no no
-dither no no
-doublebw no no
-ds 1 1
-fdict
-feat 1s_c_d_dd 1s_c_d_dd
-featparams
-fillprob 1e-8 1.000000e-08
-frate 100 50
-fsg
-fsgusealtpron yes yes
-fsgusefiller yes yes
-fwdflat yes yes
-fwdflatbeam 1e-64 1.000000e-64
-fwdflatefwid 4 4
-fwdflatlw 8.5 8.500000e+00
-fwdflatsfwin 25 25
-fwdflatwbeam 7e-29 7.000000e-29
-fwdtree yes yes
-hmm ../data/communicator
-input_endian little little
-jsgf ../data/65ba2c00597811e0-digit.gram
-kdmaxbbi -1 -1
-kdmaxdepth 0 0
-kdtree
-latsize 5000 5000
-lda
-ldadim 0 0
-lextreedump 0 0
-lifter 0 0
-lm
-lmctl
-lmname default default
-logbase 1.0001 1.000100e+00
-logfn
-logspec no no
-lowerf 133.33334 1.333333e+02
-lpbeam 1e-40 1.000000e-40
-lponlybeam 7e-29 7.000000e-29
-lw 6.5 6.500000e+00
-maxhmmpf -1 -1
-maxnewoov 20 20
-maxwpf -1 -1
-mdef
-mean
-mfclogdir
-mixw
-mixwfloor 0.0000001 1.000000e-07
-mllr
-mmap yes yes
-ncep 13 13
-nfft 512 512
-nfilt 40 40
-nwpen 1.0 1.000000e+00
-pbeam 1e-48 1.000000e-48
-pip 1.0 1.000000e+00
-pl_beam 1e-10 1.000000e-10
-pl_pbeam 1e-5 1.000000e-05
-pl_window 0 0
-rawlogdir
-remove_dc no no
-round_filters yes yes
-samprate 16000 8.000000e+03
-seed -1 -1
-sendump
-senmgau
-silprob 0.005 5.000000e-03
-smoothspec no no
-svspec
-tmat
-tmatfloor 0.0001 1.000000e-04
-topn 4 4
-topn_beam 0 0
-toprule
-transform legacy legacy
-unit_area yes yes
-upperf 6855.4976 6.855498e+03
-usewdphones no no
-uw 1.0 1.000000e+00
-var
-varfloor 0.0001 1.000000e-04
-varnorm no no
-verbose no no
-warp_params
-warp_type inverse_linear inverse_linear
-wbeam 7e-29 7.000000e-29
-wip 0.65 6.500000e-01
-wlen 0.025625 2.562500e-02

2011-03-28 22:17:25:894194 [INFO] Init Decoder
<65ba2c00597811e0@pocketsphinx>
FATAL_ERROR: "fe_sigproc.c", line 397: WTF, 4218.750000 < -15.625000 >
4765.625000


Any ideas about the cause of the problem?

Thanks very much

Best regards

Daniele

roko

unread,
Apr 26, 2011, 10:07:57 AM4/26/11
to uni...@googlegroups.com
This error seems to be related with pocketsphinx and not directly to unimrcp. I checked the line 397 at:

http://www.speech.cs.cmu.edu/sphinx/doc/doxygen/sphinxbase/fe__sigproc_8c-source.html

and it is realted with some frequencies... I don't get it.

When this error occurs  ? when talking ?

John O'Gara

unread,
Apr 28, 2011, 3:02:54 PM4/28/11
to UniMRCP
My guess is that the language models you've built with pockesphinx are
of the wrong frequency, you need 8khz language models to use
pocketsphinx with asterisk.
John

On Apr 26, 7:07 am, roko <robert.k...@oocorp.net> wrote:
> This error seems to be related with pocketsphinx and not directly to
> unimrcp. I checked the line 397 at:
>
> http://www.speech.cs.cmu.edu/sphinx/doc/doxygen/sphinxbase/fe__sigpro...
Reply all
Reply to author
Forward
0 new messages