-
Notifications
You must be signed in to change notification settings - Fork 71
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
[Errno 24] after opening and closing videos constantly #176
Comments
SImilar problem here! Looking for a fix |
Same problem here. Fixing #78 would make this a lot easier to avoid, I would think. |
I've been trying to debug this problem, and I think I've found the issue - but not a fix. Each time the player gets loaded with a source, I see an entry in lsof of type STREAM for the main python process. When player.stop() or .quit() is called, that entry does not go away. For example, after playing a sound effect 7 times, here's an excerpt of lsof | grep 'python':
So far I haven't figured out a way to kill those open streams without killing the main python process, but I'll report back if I do. |
I ran into the same problem and solved it for me with the following workaround: You should not create new instances of |
@michaelnimbs |
Looking at the lsof output, the open fds are UNIX sockets, so I suspect this is the connection to the dbus daemon. Looking at the source, I indeed see that OMXPlayer._connection is created, but it is never actually closed. I suspect that it would be solved by disconnecting dbus on quit, e.g. by adding this to the end of the
Anyone care to test this? |
Hi, using a single instance and only calling It may be that in most cases the garbage collector closes the connections but I encountered resource exhaustion at least once with 140 DBus sockets open in a long running Python process which used omxplayer-wrapper. I'll monkey-patch the quit method to call |
In case it helps someone, a quick patch looks like this: def patch_OMXPLayer_quit():
old_quit = OMXPlayer.quit
def new_quit(self):
self._connection._bus.close()
old_quit(self)
OMXPlayer.quit = new_quit
patch_OMXPLayer_quit() I'll let you know if it solved the problem definitely. |
Ok, I've tested this for quite a long time now and the change I posted definitively fixed the problem with leaking bus connections. |
Thanks @jpc for looking into this, would you be able to open a PR with this change and i'll merge it in! |
I add @matthijskooijman suggestion in player.py at function quit() and it's work.(Tested 72 hours none stop playing 9 mp4 files, until now pi still playing without [Errno 24])
|
Thanks for the confirmation @bonnyone. I'll make the change and make a new release later today. |
@willprice U r welcome. This is my code for test
|
Issue Report
Description
Alternating between two player instances to put a video display on a tour. This eventually produces a [Errno 24] Too many open files after about an hour.
Problem reproduction
this is the current test code
Please let me know if you need more details, amateur here and first time posting.
The text was updated successfully, but these errors were encountered: