Menu

pocketsphinx raspberry pi "failed to calibrate voice activity detection"

Help
Nayak BS
2014-06-02
2016-10-02
  • Nayak BS

    Nayak BS - 2014-06-02

    Hello

    I followed the tutorial given by Jasper Team to check how pocketsphinx works on raspberry pi

    http://jasperproject.github.io/documentation/software/

    I set up the pulse audio and it records the the voice using
    arecord -f S16_LE -r 16000 temp.wav,
    It records signed 16 bit Little Endian , rate 16000 Hz , Mono

    and when i want to play using command
    aplay -D hw:1,0 temp.wav -f S16_LE -r 16000

    It gives output
    Playing WAVE 'temp.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
    aplay: set_params: 1087: Channels count non available

    Finally i installed sphinxbase, pocketsphinx and used the pocketsphinx_continuous with -lm, -hmm, -dic

    It gets compiled properly but with an error message

    pocketsphinx_continuous COMPILED ON: MAY 29 2014 AT: 21:24:37
    FATAL_ERROR:"continuous.c"(371): failed to calibrate voice activity detection
    Although i can guess that problem lies with sound devices.. but i am not able to figure out how should i resolve? I have installed pulse audio properly as mentioned in the tutorial, arecord works properly ! How can i solve this error?

    PS: if somebody has already experienced the same please share approach of solving this.

    Thank you !

     

    Last edit: Nayak BS 2014-06-02
  • Nayak BS

    Nayak BS - 2014-06-03

    As i found the solution .. I update here the solution

    sudo apt-get update
    sudo apt-get upgrade

    cat /proc/asound/cards

    check your microphone is visible or not and if on which usb extension

    sudo nano /etc/modprobe.d/alsa-base.conf

    Now change this

    Keep snd-usb-audio from being loaded as first soundcard
    options snd-usb-audio index=-2

    To

    Keep snd-usb-audio from being loaded as first soundcard
    options snd-usb-audio index=0

    if there is some other options snd-usb-audio index=1 , make it as comment

    sudo reboot
    cat /proc/asound/cards
    check your device is at 0

    sudo apt-get install bison
    sudo apt-get install libasound2-dev

    download sphinxbase latest , extract

    ./configure --enable-fixed
    make
    sudo make install

    download pocketsphinx, extract

    ./configure
    make
    sudo make install

    export LD_LIBRARY_PATH=/usr/local/lib
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

    go to src/programs/

    pocketsphinx_continuous -samprate 16000/8000/48000

    Cheers :)

     
    • Nickolay V. Shmyrev

      Ok, great. Thanks for letting us know.

       
  • Nayak BS

    Nayak BS - 2014-06-04

    Hi Nickolay,

    Initially i used the default acoustic model simplying going to src/programs with pocketsphinx_continuous samprate 16000. It is running faster and promts READY... and Listening every time when some sound is uttered (almost same speed as it runs on my computer).. .

    But when i use my own acoustic model, language model, dictionary copying all files in the home folder and giving its path to pocketsphinx_continuous. It always stucks after the first utterance

    READY ..
    Listening ..

    0000000000 :

    READY ...

    It seems it gets hanged here. I run the same on my computer and it works perfectly.

    What can be the causes ? How can i resolve it ? Any suggestions.

     
  • Nickolay V. Shmyrev

    Maybe it's due to fixed point, try to compile without it.

     
  • Nayak BS

    Nayak BS - 2014-06-06

    Hi.. Sorry for delay.

    I compiled the code on my laptop and then took the executable file to run on pocketsphinx on rasberry.. It works fine on my laptop but stucks in READY.. on rasberry pi

    when i tried to compile the c code in rasberry with the following command (which works fine on my laptop)

    gcc -o continuous_var continuous_var.c -DMODELDIR=\"pkg-config --variable=modeldir pocketsphinx\" pkg-config --cflags --libs pocketsphinx sphinxbase

    but it popped up the error in function main
    %%

    "undefined reference to 'ps_default_search_args'"

    %%
    Is there any different method to be followed in rasberry pi??

    Regarding your suggestion.. i didnt enable fixed point during compilation.

    Best regards

     
    • Nickolay V. Shmyrev

      "undefined reference to 'ps_default_search_args'"

      This error means you have older version of pocketsphinx installed on raspberry. Make sure you compiled the latest version and no older files present.

       
  • Nayak BS

    Nayak BS - 2014-06-18

    Hello Nickolay,

    Sorry for late update.

    I have downloaded now using svn from the trunk and i still not able to compile my own code on raspberry pi

    As i mentioned before it compiles fine on my laptop with ubuntu. How can i solve this issue?

     
    • Nickolay V. Shmyrev

      I have downloaded now using svn from the trunk and i still not able to compile my own code on raspberry pi

      What is the problem exactly?

       
  • Nayak BS

    Nayak BS - 2014-06-19

    hi Nickolay,

    The problem is solved when I removed the following line ps_default_search_args(config);
    ps: This was only showing error when compiling it in raspberry.

    After modifying I recompiled the new c program.. Now it runs fine..

    But,

    I find these warning in the beginning ..although it is recognizing perfectly and same as my laptop.

    1) Warning: Could not find Mic element
    Warning: Could not find Capture element

    even if i put -adcdev default / -adcdev hwplug:0,0 This warning still exist

    2) another lines comes up after each detection

    'Recording is stopped, start recording with ad_start_rec'

    I found as this function is checking whether the recording volume is more than a threshold value but i have checked my recording volume is high enough ..also everything is recognized properly and with same speed of my laptop..

    Then why does this message shows up? How to resolve it?

    Thank you..! :)

     
    • Nickolay V. Shmyrev

      All those errors demonstrate you are using old pocketsphinx version. Checkout latest pocketsphinx and sphinxbase from subversion or github and compile them. Then errors will go away.

       
  • Nayak BS

    Nayak BS - 2014-06-23

    Hello Nickolay,

    As per your suggestion. Ireinstalled with a latest pocketsphinx. All problems are solved :)

    However i have another issue come up and need yopur suggestion

    1) I find the following output most of the time when i say something.. What it is exactly? I googled it but i didnt find much informations.

    input overrun read calls are too rare (non-fatal)

    Sometimes The correct recognized output comes up , but also comes this message
    input overrun read calls are too rare (non-fatal)

    Thank you

     
    • Nickolay V. Shmyrev

      input overrun read calls are too rare (non-fatal)

      This error means that decoder is too slow to process incoming data. You need to make sure it's fast enough otherwise it will loose the audio and accuracy will drop. You can compile pocketsphinx with -O3 for faster decoding and also you can tune parameters as described in http://cmusphinx.sourceforge.net/wiki/pocketsphinxhandhelds

      Overall Pi is pretty slow machine, it's unlikely you will be able to decode anything serious on it, you can only do keyword spotting or grammar recognition of vocabulary less than 10 words.

       
  • Nayak BS

    Nayak BS - 2014-06-27

    Hallo, Sorry for updating late

    It can work fine(although accuracy can differ) if we overclock the PI with following details

    arm_freq 900
    core_freq 350
    gpu_freq 350
    sdram_freq 450

    It is also important to read the datas like Acoustic model, DICT, JSGF or LM from another mounted sources

    Ofcourse, As you suggested -O3 and the parameters as pocketsphinxhandhelds , plays also a important role in making the execution faster.

    Does anyone have any suggestion if there is any alternate to PI which we can use for speech recognition and the speed and accuracy will remain perfect during execution.

    Thank you.

     
    • Nickolay V. Shmyrev

      You can evaluate

      http://www.cubietruck.com

       
  • marcus obrien

    marcus obrien - 2016-10-02

    How can I turn on O3 ?

     
    • Nickolay V. Shmyrev

      make CFLAGS="-g -O3", also you can try -m<arch>

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.