0

I've been struggling to make pocketsphinx work with the audio system of my raspberry pi. As stated in pocketsphinx's website, one of the steps to build it for a raspberry pi is to execute this:

./configure --enable-fixed

What this does is to setup the environment prior to actually compile the program. I just have ALSA installed (no PulseAudio, no JACK), but configure continues to say that I has found JACK. So, when I run make, it compiles sphinxbase to use JACK. Then, when I try to run pocketsphinx, of course it fails with the following message:

jack server not running?
FATAL_ERROR: "continuous.c", line 246: Failed to open audio device

Why does pocketsphinx want to use JACK? How can I force it to use ALSA (which is the only audio system available by the way). Thanks!

jotadepicas
  • 394
  • 4
  • 15

1 Answers1

3

Configure looks for the presence of the development libraries of PulseAudio, Jack and ALSA, in that order.

That is why in answers like this it is mentioned that "...It also appears that ALSA will not be used if PulseAudio is installed...".

In my particular case, I didn't have anything else installed besides ALSA. But then I remembered that I did some tests with JACK, not by installing the actual package but compiling it by hand and things like that.

Those tests left behind the file jack.h, and configure found it. I have manually renamed that file to jack.h.disabled (prior to actually deteting it) and now configure outputs this:

checking pulse/pulseaudio.h usability... no
checking pulse/pulseaudio.h presence... no
checking for pulse/pulseaudio.h... no
checking jack/jack.h usability... no
checking jack/jack.h presence... no
checking for jack/jack.h... no
checking alsa/asoundlib.h usability... yes
checking alsa/asoundlib.h presence... yes
checking for alsa/asoundlib.h... yes
checking for snd_pcm_open in -lasound... yes

I then completed the necessary steps for building and installing pocketsphinx and now everything works ok! So remember, install alsa development package (sudo apt-get install libasound2-dev), be sure not to have puleaudio or jack installed, and look carefully for the output of the configure command.

jotadepicas
  • 394
  • 4
  • 15