Comments (13)
There was a bug resulting in sound objects being removed from the cache but not properly closed, but that was fixed almost 4 years ago: 2657e6b
Obviously the node doesn't crash if you don't play files with it; can you provide a procedure or a script that reproduces the issue?
from audio_common.
@trainman419 Your fix is not enough, because in addition to python, gstreamer also has file descriptor till set_state(gst.STATE_NULL)
is called.
(please note that in current code, __del__
method is not called.)
To reproduce this error, we just need to play sound many times. (approx. 400 times of 10 secs. audio)
You can find by top
command, that soundplay_node.py
has very high load and then crashes with too many open files
.
from audio_common.
I have a collection of sound files in /usr/share/sounds/ubuntu/stereo that are part of the ubuntu-sounds package, so I was finally able to reproduce this by running:
sudo apt-get install ubuntu-sounds # just in case you don't have sound files
rosrun sound_play soundplay_node.py
and in a second terminal:
for ((i=0; i<21; i++)) ; do for f in /usr/share/sounds/ubuntu/stereo/* ; do rosrun sound_play play.py $f & sleep 0.1 ; done ; done
(This would have been much faster and easier if you'd provided explicit reproduction instructions like this along with the initial pull request)
from audio_common.
@trainman419 Sorry for super late reply.
for ((i=0; i<21; i++)) ; do for f in /usr/share/sounds/ubuntu/stereo/* ; do rosrun sound_play play.py $f & sleep 0.1 ; done ; done
I think it does not reproduce the issue because in the script number of sound files is fixed.
Instead please test by running:
# Terminal 1
roslaunch sound_play soundplay_node.launch
# Terminal 2
for ((i=0; i<4000; i++)) ; do
sox -n /tmp/output_$i.ogg synth 3 sin 440 # here new wav file is generated on every for loop
rosrun sound_play play.py /tmp/output_$i.ogg & sleep 0.1
done
You will find that soundplay_node.py
on terminal exits on failure. (I needed approx. 800 files to be played.)
from audio_common.
@trainman419 kindly ping to maintainer.
from audio_common.
@trainman419 ping
from audio_common.
@trainman419 ping
from audio_common.
It seems like your test is playing a huge number of files very quickly, and is therefore filling the cache faster than it can age out old entries. Is this really representative of your usage pattern?
from audio_common.
@trainman419 Yes, we create wave files using speech synthesis on each phrases and play them with sound_play
. And I think we don't let robots speak so frequently, it should be just within normal usage...
from audio_common.
@trainman419 ping
from audio_common.
@trainman419 kindly ping
from audio_common.
It looks like you're playing 800 files different files in 80 seconds, the cache isn't aging out the old files quickly enough.
What sort of fix would you like to see here? Do you want a parameter to decrease the cache retention time? Limit the cache size so that old entries get pushed out sooner?
from audio_common.
@trainman419 Sorry for a late reply.
OK. I'll close this for now since other pull requests are blocked by this issue.
If I find any solution, I'll go back here.
Thank you very much, anyway!
from audio_common.
Related Issues (20)
- memory leak in audio_play HOT 4
- Parameter name error HOT 3
- Convert rclcpp nodes into components HOT 2
- Make all nodes to nodelet
- AudioData 8 bit integer
- Release AudioDataStamped in noetic HOT 2
- Can we play sound in systemd service + no login?
- Backporting plugin feature to ROS2 branch
- Can't get ROS 2 branch to work in ROS2 humble HOT 25
- Importing the sound_play module is slow HOT 1
- sound_play command not being executed in a docker environment HOT 1
- ros2 branch is not compiling for ROS 2 Humble HOT 4
- ROS2 foxy: Problem when writing to wav file. HOT 2
- ros2 branch has ros1 headers HOT 6
- Question/Tutorial : how to effectively use audio_capture_node in ROS2 HOT 3
- ROS2 Branch: SoundClient blocking mode does not work HOT 4
- Add audio common ros2 branch to `iron` distribution HOT 2
- Replacing `GObject` with `GLib` due to deprecation of `threads_init()` and `GObject.MainLoop`
- Can't cancel loop sounds via action
- How can i play an incoming AudioMessage HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audio_common.