You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.debug('SIGTERM Sent to pid: %s'%process_group_id)
exceptOSError:
logger.error('Could not find the process to kill')
When starting OMX processes with -o alsa parameter, after quitting a few videos, OMXPlayer freezes, and no other OMXPlayer process can start (even manually from the command line). Any OMXPlayer process currently running cannot be killed (even manually from htop). The only way to fix this by rebooting.
I found this issue when attempting to implement a video switching feature.
Problem reproduction
Start an OMX process as normal with the -o alsa parameter.
Call quit()
Do this a few more times, and eventually you will not be able to start any other process, or start OMXPlayer.
Fix
I believe the issue is due to the fact a SIGTERM sent to OMXPlayer does not call the internal OMXPlayer cleanup functions. When called with ALSA, this leaves some ALSA I/O things open (honestly don't know the details, this is an educated guess), and eventually causes OMXPlayer to completely lock up.
Issue Report
Description
When you quit an OMX process, the wrapper sends a SIGTERM signal:
python-omxplayer-wrapper/omxplayer/player.py
Lines 213 to 219 in a9875e3
When starting OMX processes with
-o alsa
parameter, after quitting a few videos, OMXPlayer freezes, and no other OMXPlayer process can start (even manually from the command line). Any OMXPlayer process currently running cannot be killed (even manually from htop). The only way to fix this by rebooting.I found this issue when attempting to implement a video switching feature.
Problem reproduction
-o alsa
parameter.quit()
Fix
I believe the issue is due to the fact a SIGTERM sent to OMXPlayer does not call the internal OMXPlayer cleanup functions. When called with ALSA, this leaves some ALSA I/O things open (honestly don't know the details, this is an educated guess), and eventually causes OMXPlayer to completely lock up.
Instead, call
_terminal_process
with SIGINT. This will call the internal cleanup functions, and allow the ALSA I/O to cleanup. When using SIGINT, I could no longer replicate the issue. Here is a link to a fork of my fix (the fork also includes other custom functions I added for my application):https://github.com/DazB/python-omxplayer-wrapper/blob/de0ca5eed87ca9094efa81d5b2099d5e9779be86/omxplayer/player.py#L215-L221
BTW thanks for the great library. It's been really useful 👍
Environment details
lsb_release -a
):python-omxplayer-wrapper
0.1.0
python
(python --version
)3.7.3
omxplayer
(omxplayer --version
)2cfe612
(this is a custom build of OMXPlayer with slight modifications)The text was updated successfully, but these errors were encountered: