-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sound_play/scripts/soundplay_node.py] updates states and force stop after play #78
Conversation
created patched debian file for hydro user (because of EOL of hydro) |
self.sound.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, 0) | ||
self.sound.set_state(gst.STATE_PLAYING) | ||
elif self.state == self.COUNTING: | ||
self.stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff looks like it's fixing looping behavior; did this make it into the PR by mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trainman419 You are correct. I fixed.
I've seen the "too many open files" bug before, and the fix at the time was to make sure that each sound object properly cleaned up its file handles when it was removed from the cache. It looks like this fix calls |
@trainman419 Actual part that close file descriptor is at https://github.com/furushchev/audio_common/blob/682e48cd2529f715a9134d1adc8a18882ac5f057/sound_play/scripts/soundplay_node.py#L134. |
…when ends playing
@@ -188,6 +188,14 @@ def stopall(self): | |||
self.stopdict(self.filesounds) | |||
self.stopdict(self.voicesounds) | |||
|
|||
def update(self): | |||
for sound in self.builtinsounds.values(): | |||
sound.update() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanupdict() is already iterating through all of the sounds looking for things that need to be cleaned up; it seems like it would be better to call update there instead of introducing a new code path.
This has been blocked for a long time because it hasn't been easy for me to reproduce it. Do you still need this merged into the hydro-devel branch or should I re-target it into indigo-devel? |
@trainman419 Sorry for very late reply. I answered at #75. |
Closed. See #75 |
This pull request is minimum fix of bug reported at #75 from #77.
(Still other bugs are left without fix)
bugfix: 'too many files open' (reported at soundplay_node.py crashes with "Too many open files" #75 )
This bug occurs because
soundplay_node
holds file descriptor of all playing wave files even after finished playing.