Hello,
I am a bit of a noob with respect to pocketsphinx so I might be dealing with a
simple problem but I guess it doesn't hurt to try anyway. I have been getting
a "cmd_ln_parse_r failed" error while running pocketsphinx_continuous which I
traced following the error to the utility file "cmd_ln.c", line 648 found in
libsphinxbase. (That was the line displayed by the error). Having looked
around I have come to believe it is a missing configuration file being
requested by sphinxbase. having installed pocketsphinx on 3 separate laptops
and one smartphone (all running ubuntu distros), I have gotten pocketsphinx to
work only on one (it worked right off the bat using the same svn checkout
method of installation.) On the other two laptops including the smartphone, I
keep getting this error which I can't seem to resolve. Any ideas?
pocketsphinx_tidigits seems to attain a ready state though although I've not
been able to get it to recognize the input from the usb microphone. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Having looked around I have come to believe it is a missing configuration
file being requested by sphinxbas
No, the issue is that you provided incorrect configuration options. Since you
didn't mention what options are you using to initialize the decoder it's hard
to say what have you done wrong exactly. Usually you can just look at options
and their values and find a typo or missing space. Or write them here, we'll
find it for you.
Any ideas? pocketsphinx_tidigits seems to attain a ready state though
although I've not been able to get it to recognize the input from the usb
microphone
By default pocketsphinx records from default device. You probably need to
point the input device name with -adcdev option of the pocketsphinx
continuous. You can find list of the devices with "arecord -l". Read alsa
introduction for more details.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Thanks for your reply. The issue with the usb microphone has been fixed thanks
to you and I've successfully tested speech recognition on working laptop. The
problem is with the other machines. What I had done earlier was I had after
downloading sphinxbase and pocketsphinx using subversion, I simply ran make
and make install after the ./autogen.sh --prefix=/usr. Then having installed
pocketsphinx, i ran the command pocketsphinx_continuous and
pocketsphinx_tidigits. pocketsphinx_tidigits went to the ready state while
pocketsphinx_continuous brought up the cmd_ln_parse_r failed error. I tried
reinstalling pocketsphinx after reading your post sort of as a backtrack and
this time I ran a make check with produced the following error: (I simply
copied the only failed test because the rest had returned a pass so I didn't
bother.)
pocketsphinx_continuous brought up the cmd_ln_parse_r failed error.
It should do so since you need to specify it hmm model folder, dictionary and
a language model as options. Look inside pocketsphinx_tidigits script for
sample. In the beginning it wrote you a hint:
ERROR: "cmd_ln.c", line 630: No arguments given, exiting
4 of 25 tests failed
it happens with the development version of pocketsphinx. If you need working
tests, use released version please.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm sorry if this appears extremely newbish but I have not been able to get to
change the usb mic recognized by pocketsphinx. I tried the command
pocketsphinx_continuous -adcdev hw:1,0 (where hw:1,0 corresponds to my usb
microphone but was unable to get anything other than an error telling me to
specify -hmm location or something. Right now I am simply trying to test run
pocketsphinx_tidigits but I can't because it won't recognize my usb microphone
(although alsa does: I can succesfully run arecord). Can anyone provide a
command line that I can use to simply have pocketsphinx recocgnize my mic and
run pocketsphinx_tidigits? The usb mic is on card 0, subdevice 0 and we can
assume the name to be <usbmic>. I know it seems like spoonfeeding but google
turns up very little information for a beginner like me and I have already
tried too many options with no success. Thanks.</usbmic>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just to clear up any confusion the earlier post which stated that I had gotten
usb working was due to the fact that I had already set the usb as the default
device on the earlier working computer (outside pocketsphinx) and had
forgotten, so though the earlier command had given me errors, I had assumed it
to have worked somehow (yeah... not the smartest thing). So I would really
appreciate any assistance on the above. Oh and the usb mic is actually oncard
1, subdevice 0.
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The present error is:
ad_oss.c(103): Failed to open audio device(plughw:U0xd8c0x0c): No such file or
directory
FATAL_ERROR: "continuous.c", line 259: ad_open_dev failed
Which leaves me at odds as to what to do now since my USB mic is at present my
sole means of audio capture. So any other microphone is presently out of the
question.
Any other suggestions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh, I have also tried setting my usb as the default microphone but
pocketsphinx_tidigits still doesn't detect any audio input. Meanwhile using
arecord -f cd -D plughw:1,0 -d 20 test.wav
and
aplay -D plughw:1,0 test.wav
and I was able to playback a sound recording of myself so the microphone works
and is detected. This is just some extra information that might be useful. I
really appreciate the help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ad_oss.c(103): Failed to open audio device(plughw:U0xd8c0x0c): No such file
or directory
It looks like you compiled pocketsphinx with oss audio backend. That's
probably because alsa headers were not installed. Could you please try to
compile it with alsa. Check config.log in sphinxbase for the reason of
problems:
Well, that's definitely new. It seems I'd have to reinstall pocketsphinx then?
How do I compile with alsa? Is there a way it can still be used with the oss
backend?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey nshmyrev,
Thanks a bunch for your help. The problem was solved by appending dev/dsp1 to
the pocketsphinx_tidigits script. It worked flawlessly and i have also been
able to pass on the same arguments to pocketsphinx_continuous running my own
custom language model and dictionary.
I do have a final request/question. Do you have any idea about how to use
pocketsphinx in starting an application with speech? (for instance using
pocketsphinx to open a browser) I understand this might require a whole new
thread but an overview of some sort or a link to where I can get started would
be most helpful.
Thanks again!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, but how does one implement it? Is there a pipe command for linux that
can enable it to run a script or executable from terminal or does one have to
directly add a command to the pocketsphinx _continuous source code using
include (system). I am trying to use pocketsphinx to execute a variety of
applications like browser, terminal, voice control as well as any scripts I
might manually create. My overall aim is to write a software which eliminates
keyboard and mouse input and depends solely only speech recognition.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One would take a text editor or start an IDE and will write the code.
Is there a pipe command for linux that can enable it to run a script or
executable from terminal
pocketsphinx_continuous -args .... 2>&1 | while read line; do
if line .....
run command
fi
done
l or does one have to directly add a command to the pocketsphinx _continuous
source code using include
(system).
This is also possible
I am trying to use pocketsphinx to execute a variety of applications like
browser, terminal, voice control as well as
any scripts I might manually create. My overall aim is to write a software
which eliminates keyboard and mouse input and
depends solely only speech recognition.
That's a great goal. I'm sure you'll succeed!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks. I was thinking of using a JAVA IDE though. I'm trying to use JAVA as
an interface between pocketsphinx and the Linux OS. How does one use java to
make a call to pocketshinx thus enabling JAVA to serve as a interface to
different aspects of the operating system? Would you know any links to anyone
that has done this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, I have written a script which causes linux to search inside a text file
and start an application based on whichever strings it locates in that file.
Now I need to incorporate it inside pocketsphinx so as to have pocketsphinx
continuously reference the script at runtime This is so as to have linux run a
search on the speech generated commands which I have piped to a custom text
file I created. Can you tell me the location of the pocketsphinx source code
after installation or is there an easier way of doing this? I thought of
writing a control script to start up pocketsphinx but it has no way of
accessing the continuous loop that causes pocketsphinx to go into a ready
state after each recognition. It is at that instance I would need the script
to do a search for the recognized word and execute a command. Thanks for the
help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay I'll rephrase. Imagine I have an application like 'mplayer' which i'd
like to run only when the words 'start video player' are recognized by
pocketsphinx. Right now, I would like application to run thus:
pocketsphinx launches -> goes into 'READY' state awaiting input from user -> User says 'start video player' -> ** mplayer runs ->** meanwhile
pocketsphinx is back in the READY state.It means while pocketsphinx is within
the loop (from recognition to ready state) it should execute the command
before it returns to the READY state.
RIght now, using bash scripting. It only runs the application after
pocketsphinx terminates, which means I might have to write a function to make
an application call from within the pocketsphinx source code. Or at least to
reference my script WITHIN that loop. If I am correct what would the name of
that source file be and where would its location be? If I am not correct is
there a cleaner solution to the problem above?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So pretty much my question is... how do you tackle the above problem using
pipe (from terminal) and/or from within the pocketsphinx_continuous source
code?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
how do you tackle the above problem using pipe (from terminal)
I wrote you above
pocketsphinx_continuous -hmm
/home/shmyrev/local/share/pocketsphinx/model/hmm/wsj1/ -lm
/home/shmyrev/local/share/pocketsphinx/model/lm/wsj/wlist5o.3e-7.vp.tg.lm.DMP
-dict /home/shmyrev/local/share/pocketsphinx/model/lm/wsj/wlist5o.dic 2>&1 |
while read line; do match=echo $line | grep THE; if ; then echo "RUNNING
IT"; fi; done
and/or from within the pocketsphinx_continuous source code? If I am correct
what would the name of that source file be and where would its location be?
It's continuous.c in pocketsphinx/src/programs/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am a bit of a noob with respect to pocketsphinx so I might be dealing with a
simple problem but I guess it doesn't hurt to try anyway. I have been getting
a "cmd_ln_parse_r failed" error while running pocketsphinx_continuous which I
traced following the error to the utility file "cmd_ln.c", line 648 found in
libsphinxbase. (That was the line displayed by the error). Having looked
around I have come to believe it is a missing configuration file being
requested by sphinxbase. having installed pocketsphinx on 3 separate laptops
and one smartphone (all running ubuntu distros), I have gotten pocketsphinx to
work only on one (it worked right off the bat using the same svn checkout
method of installation.) On the other two laptops including the smartphone, I
keep getting this error which I can't seem to resolve. Any ideas?
pocketsphinx_tidigits seems to attain a ready state though although I've not
been able to get it to recognize the input from the usb microphone. Thanks.
No, the issue is that you provided incorrect configuration options. Since you
didn't mention what options are you using to initialize the decoder it's hard
to say what have you done wrong exactly. Usually you can just look at options
and their values and find a typo or missing space. Or write them here, we'll
find it for you.
By default pocketsphinx records from default device. You probably need to
point the input device name with -adcdev option of the pocketsphinx
continuous. You can find list of the devices with "arecord -l". Read alsa
introduction for more details.
Hello,
Thanks for your reply. The issue with the usb microphone has been fixed thanks
to you and I've successfully tested speech recognition on working laptop. The
problem is with the other machines. What I had done earlier was I had after
downloading sphinxbase and pocketsphinx using subversion, I simply ran make
and make install after the ./autogen.sh --prefix=/usr. Then having installed
pocketsphinx, i ran the command pocketsphinx_continuous and
pocketsphinx_tidigits. pocketsphinx_tidigits went to the ready state while
pocketsphinx_continuous brought up the cmd_ln_parse_r failed error. I tried
reinstalling pocketsphinx after reading your post sort of as a backtrack and
this time I ran a make check with produced the following error: (I simply
copied the only failed test because the rest had returned a pass so I didn't
bother.)
/bin/bash: line 4: 2872 Segmentation fault ${dir}$tst
FAIL: test_lm_read
......
......
.....
====================
4 of 25 tests failed
====================
make: *** Error 1
make: Leaving directory
/usr/src/sphinx/pocketsphinx/test/unit' make: *** Error 2 make: Leaving directory/usr/src/sphinx/pocketsphinx/test/unit'make: *** Error 1
make: Leaving directory `/usr/src/sphinx/pocketsphinx/test'
make: *** Error 1
I had obviously missed this during the earlier installation, so hopefully this
gives more information on the problem. I appreciate the feedback.
It should do so since you need to specify it hmm model folder, dictionary and
a language model as options. Look inside pocketsphinx_tidigits script for
sample. In the beginning it wrote you a hint:
ERROR: "cmd_ln.c", line 630: No arguments given, exiting
it happens with the development version of pocketsphinx. If you need working
tests, use released version please.
I'm sorry if this appears extremely newbish but I have not been able to get to
change the usb mic recognized by pocketsphinx. I tried the command
pocketsphinx_continuous -adcdev hw:1,0 (where hw:1,0 corresponds to my usb
microphone but was unable to get anything other than an error telling me to
specify -hmm location or something. Right now I am simply trying to test run
pocketsphinx_tidigits but I can't because it won't recognize my usb microphone
(although alsa does: I can succesfully run arecord). Can anyone provide a
command line that I can use to simply have pocketsphinx recocgnize my mic and
run pocketsphinx_tidigits? The usb mic is on card 0, subdevice 0 and we can
assume the name to be <usbmic>. I know it seems like spoonfeeding but google
turns up very little information for a beginner like me and I have already
tried too many options with no success. Thanks.</usbmic>
Just to clear up any confusion the earlier post which stated that I had gotten
usb working was due to the fact that I had already set the usb as the default
device on the earlier working computer (outside pocketsphinx) and had
forgotten, so though the earlier command had given me errors, I had assumed it
to have worked somehow (yeah... not the smartest thing). So I would really
appreciate any assistance on the above. Oh and the usb mic is actually oncard
1, subdevice 0.
Thank you.
You need to add adcdev hw:1,0 inside pocketsphinx_tidigits script:
$S2CONTINUOUS \
-adcdev hw:1,0 \
-fwdflat no -bestpath no \
-lm ${LMFILE} \
-dict ${DICT} \
-hmm ${HMM} \
-samprate 8000 \
-nfft 256 $@
Okay as per your suggestion I've tried appending all of the following to the
pocketsphinx_ tidigits script:
-adcdev hw:1,0 \
-adcdev hw:1 \
I even went further and following the instructions here:
https://sourceforge.net/projects/cmusphinx/forums/forum/5471/topic/2828780 i
tried:
-adcdev plughw:1,0 \
-adcdev plughw:1 \
However I still get the error:
ad_oss.c(103): Failed to open audio device(any of the above) No such file or
directory
Here is my arecord -l output:
* List of CAPTURE Hardware Devices *
card 0: Intel , device 0: ALC880 Analog
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel , device 4: ALC880 Analog
Subdevices: 2/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
card 1: U0xd8c0x0c , device 0: USB Audio
Subdevices: 1/1
Subdevice #0: subdevice #0
Based on the how to here
http://www.voxforge.org/home/forums/message-boards/speech-recognition-engines
/howto-use-pocketsphinx?pn=2
I also tried
-adcdev U0xd8c0x0c /
- adcdev hw:U0xd8c0x0c /
-adcdev plughw: U0xd8c0x0c /
My pocketsphinx_tidigits script as of right now stands as thus:
$S2CONTINUOUS \
-adcdev plughw:U0xd8c0x0c \
-fwdflat no -bestpath no \
-lm ${LMFILE} \
-dict ${DICT} \
-hmm ${HMM} \
-samprate 8000 \
-nfft 256 $@
The present error is:
ad_oss.c(103): Failed to open audio device(plughw:U0xd8c0x0c): No such file or
directory
FATAL_ERROR: "continuous.c", line 259: ad_open_dev failed
Which leaves me at odds as to what to do now since my USB mic is at present my
sole means of audio capture. So any other microphone is presently out of the
question.
Any other suggestions?
Oh, I have also tried setting my usb as the default microphone but
pocketsphinx_tidigits still doesn't detect any audio input. Meanwhile using
arecord -f cd -D plughw:1,0 -d 20 test.wav
and
aplay -D plughw:1,0 test.wav
and I was able to playback a sound recording of myself so the microphone works
and is detected. This is just some extra information that might be useful. I
really appreciate the help.
Hi, from
It looks like you compiled pocketsphinx with oss audio backend. That's
probably because alsa headers were not installed. Could you please try to
compile it with alsa. Check config.log in sphinxbase for the reason of
problems:
Well, that's definitely new. It seems I'd have to reinstall pocketsphinx then?
How do I compile with alsa? Is there a way it can still be used with the oss
backend?
Thanks.
You need to recompile and reinstall sphinxbase
Just make sure alsa is properly installed
yes, but adcdev should be something likde /dev/dsp1 then I suppose
Hello wilhemina. As of today, all tests should pass without issues.
Hey nshmyrev,
Thanks a bunch for your help. The problem was solved by appending dev/dsp1 to
the pocketsphinx_tidigits script. It worked flawlessly and i have also been
able to pass on the same arguments to pocketsphinx_continuous running my own
custom language model and dictionary.
I do have a final request/question. Do you have any idea about how to use
pocketsphinx in starting an application with speech? (for instance using
pocketsphinx to open a browser) I understand this might require a whole new
thread but an overview of some sort or a link to where I can get started would
be most helpful.
Thanks again!
Application invocation in Linux could be done with system() call
http://linuxmanpages.com/man3/system.3.php
or with fork/exec
no
Okay, but how does one implement it? Is there a pipe command for linux that
can enable it to run a script or executable from terminal or does one have to
directly add a command to the pocketsphinx _continuous source code using
include (system). I am trying to use pocketsphinx to execute a variety of
applications like browser, terminal, voice control as well as any scripts I
might manually create. My overall aim is to write a software which eliminates
keyboard and mouse input and depends solely only speech recognition.
One would take a text editor or start an IDE and will write the code.
pocketsphinx_continuous -args .... 2>&1 | while read line; do
if line .....
run command
fi
done
This is also possible
That's a great goal. I'm sure you'll succeed!
Thanks. I was thinking of using a JAVA IDE though. I'm trying to use JAVA as
an interface between pocketsphinx and the Linux OS. How does one use java to
make a call to pocketshinx thus enabling JAVA to serve as a interface to
different aspects of the operating system? Would you know any links to anyone
that has done this?
What about switching to sphinx4 then, it will be way easier to use it from
java?
http://en.wikipedia.org/wiki/Java_Native_Interface
Okay, I have written a script which causes linux to search inside a text file
and start an application based on whichever strings it locates in that file.
Now I need to incorporate it inside pocketsphinx so as to have pocketsphinx
continuously reference the script at runtime This is so as to have linux run a
search on the speech generated commands which I have piped to a custom text
file I created. Can you tell me the location of the pocketsphinx source code
after installation or is there an easier way of doing this? I thought of
writing a control script to start up pocketsphinx but it has no way of
accessing the continuous loop that causes pocketsphinx to go into a ready
state after each recognition. It is at that instance I would need the script
to do a search for the recognized word and execute a command. Thanks for the
help!
Sorry, I haven't got your question.
Okay I'll rephrase. Imagine I have an application like 'mplayer' which i'd
like to run only when the words 'start video player' are recognized by
pocketsphinx. Right now, I would like application to run thus:
pocketsphinx launches -> goes into 'READY' state awaiting input from user
-> User says 'start video player' -> ** mplayer runs ->** meanwhile
pocketsphinx is back in the READY state.It means while pocketsphinx is within
the loop (from recognition to ready state) it should execute the command
before it returns to the READY state.
RIght now, using bash scripting. It only runs the application after
pocketsphinx terminates, which means I might have to write a function to make
an application call from within the pocketsphinx source code. Or at least to
reference my script WITHIN that loop. If I am correct what would the name of
that source file be and where would its location be? If I am not correct is
there a cleaner solution to the problem above?
So pretty much my question is... how do you tackle the above problem using
pipe (from terminal) and/or from within the pocketsphinx_continuous source
code?
I wrote you above
pocketsphinx_continuous -hmm
/home/shmyrev/local/share/pocketsphinx/model/hmm/wsj1/ -lm
/home/shmyrev/local/share/pocketsphinx/model/lm/wsj/wlist5o.3e-7.vp.tg.lm.DMP
-dict /home/shmyrev/local/share/pocketsphinx/model/lm/wsj/wlist5o.dic 2>&1 |
while read line; do match=
echo $line | grep THE; if ; then echo "RUNNINGIT"; fi; done
It's continuous.c in pocketsphinx/src/programs/