Ask Your Question
0

sound_play consumes high CPU and makes strange voice after some moment

asked 2011-12-06 12:35:13 -0600

130s gravatar image

updated 2011-12-10 04:38:31 -0600

I totally modified the original question description that wasn't clear.

With sound_play, CPU load sometimes reaches 10+ with some of my codes, and sound eventually gets messy and hard to hear.

I found in Ubuntu's Sound Preference panel that sound_play/soundplay_node.py instance keeps populating like in the image below. Sometimes calling stopAll() function decreases the instance, sometimes not. In my understanding, sound_play/soundplay_node.py makes a new instance every time it receives /robosound topic. So instanciating itself is not bad but what's bad is the instance doesn't get removed.

I haven't figured out the condition where I reproduce the phenomenon. This python code I made for debug, which publishes /robosound only regularly with decent amount of sleep after publishing, works well. However, another code of mine that publishes topics irregularly causes an issue above.

I frequently see the following error on the terminal soundplay_node.py runs. But I can't specify when it occurs, even after I briefly looked at soundplay_node.py:

[ERROR] Exception in cleanupdict for sound (%SPOKEN_TEXT%): query failed

Iterative command from commandine like the following doesn't causes the issue until the end.

for i in {0..100} ; do rosrun sound_play say.py 'You got pudding ' ; done

Changing voice types on festival doesn't make any change in terms of this issue.

Because I see the same phenomenon using both .cpp and .py and topic contents are the same, I suspect there's something in how sound_play handles the topics when the interval is irregular/too short, particularly in soundplay_node.py. But I haven't been successful hacking.

Environment-1: Ubuntu 11.04 electric

Environment-2: Ubuntu 10.04 electric (Turtlebot eeepc)

edit retag flag offensive close merge delete

Comments

Self comment; because no workaround was found and hacking was hard, we decided not to use sound_play and use festival directly from python (of which codes was made in an hour...).
130s gravatar image130s ( 2011-12-10 04:40:17 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-12-13 11:09:31 -0600

130s gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-12-06 12:35:13 -0600

Seen: 477 times

Last updated: Dec 10 '11