0
$\begingroup$

Rosanswers logo

Hi, I have pocketsphinx installed with hydro and raring ubutu (13.04). I've done the standard installation with gstreamer0.10-pocketsphinx, ros-hydro-pocketsphinx, ros-hydro-audio-common and libasound2.

When it works, it works quite well and will run for hours. However, often when I start it up, it does not respond to the microphone at all. The microphone is still working according to the Sound Settings input page, but pocketsphinx just doesn't seem to receive the input. After it has been running properly, I can just stop it with control C and start it again and it may or may not work properly. No changes are made between stopping and starting it.

I assume that the mike data is getting lost somewhere in the gstreamer connection; but troubleshooting this connection is out of my experience. Online search has many examples of problems in this area, but none of the proposed solutions seem to help. I found gstreamer-properties which seems to allow selection of pulseaudio and my specific microphone; but doesn't make any difference.

Any suggestions will be appreciated. Thanks, Alex


Originally posted by Alex Brown on ROS Answers with karma: 176 on 2014-07-07

Post score: 0


Original comments

Comment by ccapriotti on 2014-07-07:
A few generic points to help troubleshooting. Compare top results when the bug happens and during normal operation. See if there is a process taking more time. Also, it might be that some process went to sleep mode, like a power save feature.

Comment by Alex Brown on 2014-07-07:
Well, what I could see is that PulseAudio %CPU goes up about 50% (10% go 15% roughly) when pocketsphinx is working. I read up on PulseAudio and added some of the tools which made me think I had it fixed. But it went back to not working after 8 or 10 restarts. I'm going to follow up on MIke's answer below.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I've not used 13.04, but on 14.04 I found that pulseaudio+gstreamer was problematic. I found that I could get a more reliable system using ALSA. I've thus added a new parameter "~source" which can be used to specify an arbitrary source input, for instance "alsarsrc" has worked well for me. This is not in debs yet, you would have to install from source (https://github.com/mikeferguson/pocketsphinx)

(for reference, the commit is https://github.com/mikeferguson/pocketsphinx/commit/29628cdf8900ea93c581a786f590a6445ccb4256)


Originally posted by fergs with karma: 13902 on 2014-07-07

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Alex Brown on 2014-07-07:
Hi Mike, The commit link above took me to your indigo release. I assume you are talking about the recognizer.py program. As far as I can see it is just like my hydro version which has a "~source" parameter. I had tried before to use the _device_name_param with no luck.
But, my python is pretty basic (or less) and I don't recognize the syntax on the rospy.has_param arguments. I was assuming "self._device_name_param" was a local param. Is '~source' a global param? My pacmd list-sources doesn't have a 'alsasrc' listing, just much longer names. Do I just add a

to my global params in my launch file?

Comment by Alex Brown on 2014-07-08:
OK, I figured it out. I'm going to have to learn to work with python programs.

Your solution works, the param is local (s/b 'private') so I just added it to my pocketsphinx launch file. Pocketsphinx has opened successfully 20 time in a row. this far exceeds the previous record so I think it is fixed. This was with the ros-hydro-pocketsphinx version of your program just loaded by apt-get. Thanks!

Comment by R@m on 2016-09-20:
Worked perfectly after modifying the source. Thanks buddy!!!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.