Search code examples
pythonmacosgstreamerpocketsphinx

Pocketsphinx with gstreamer on mac osx. AudioUnitRender returned -10863


I am trying to run livedemo.py from the pocketsphinx source after installing it and stumble upon pocketsphinx problem. Narrowing it down, the problem is in pocketsphinx gsteamer plugin.

Simply running this:

gst-launch-0.10 autoaudiosrc ! audioconvert ! audioresample ! vader name=vad auto-threshold=true ! pocketsphinx name=asr  ! fakesink

produces this debugging output (GST_DEBUG=*:2):

...

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
0:00:00.074397000 89084 0x7fe358c38690 WARN             osxaudiosrc gstosxaudiosrc.c:292:gst_osx_audio_src_io_proc:<osxringbuffer0> AudioUnitRender returned -10863
0:00:00.085992000 89084 0x7fe358c38690 WARN             osxaudiosrc gstosxaudiosrc.c:292:gst_osx_audio_src_io_proc:<osxringbuffer0> AudioUnitRender returned -10863
0:00:00.097520000 89084 0x7fe358c38690 WARN             osxaudiosrc gstosxaudiosrc.c:292:gst_osx_audio_src_io_proc:<osxringbuffer0> AudioUnitRender returned -10863

...

Nothing gets through pocketsphinx and no voice recognition of course. In comparison, this line outputs an audio recording without problems:

 gst-launch-0.10 osxaudiosrc ! audioconvert ! audioresample ! wavenc ! filesink location=temp.wav

Setup: I tried on OS X Lion and Yosemite, both with Homebrew and Macports. Here's what I did when using macports:

sudo port install python27

sudo port install python_select

sudo port select --set python python27

sudo port install py27-pygtk

sudo port install gstreamer010 gstreamer010-gst-plugins-bad gstreamer010-gst-plugins-good gstreamer010-gst-plugins-ugly

sudo port install py27-gst-python

Build and install sphinxbase and pocketsphinx

sudo port install swig swig-python

git clone https://github.com/cmusphinx/sphinxbase.git

git clone https://github.com/cmusphinx/pocketsphinx.git

cd sphinxbase/

./autogen.sh

./configure --prefix=/opt/local/ --disable-debug --disable-dependency-tracking

sudo make install
cd ../pocketsphinx && ./autogen.sh
./configure --prefix=/opt/local/ --disable-dependency-tracking && sudo make install

Solution

  • This is a gstreamer bug on OSX:

    https://bugzilla.gnome.org/show_bug.cgi?id=711764