sound_play consumes high CPU and makes strange voice after some moment
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
)