-
Notifications
You must be signed in to change notification settings - Fork 216
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
Vlc freezes while sync play is running on Mac OS X El Captian. #83
Comments
This bug has annoyed me for years. The problem is that VLC on macOS does not set the volume to -256 when VLC is closed, so the lua script keeps running endlessly. I am desperately trying to find another variable in the (awful) VLC lua documentation that changes its state after VLC has been closed, so far with no luck. |
Is there a way to detect it from Syncplay itself by running VLC in verbose debug mode, monitoring STDOUT, and looking for a telltale message like "core debug: exiting"? Unfortunately reading STDOUT from VLC3 doesn't work properly in Windows, but it might work on OS X. |
Sorry I am posting and deleting comments, but I am figuring things out. How can I keep monitoring STDOUT and still let twisted.reactor start? Right now the monitoring is interrupted after "Hosting Syncplay" is found. |
It stops paying attention to stdout/stderr once it gets confirmation it worked because else it'd just get into an infinite loop and block other stuff. One possibly way forwards is to create a daemon thread just to check and make it run self.__playerController.drop() if it detects if '[syncplay] core interface debug: removing module "lua"' in line. However, I've not tested to see if this is possible. |
Oh, and in addition to adding --verbose=2 to the args when it is OSX you might also need to add --no-file-logging to prevent VLC settings to save debug logs to a file from being able to steal messages from stdout/stderr. |
Understood, but I do not know how to implement all this, I do not know anything about concurrent threads in python. I will give another look on the __LIstener class tomorrow, but I do not expect to be able to have some code ready soon. |
My guess is that if it is possible then it'd look something like this: constants.py vlc.py
Insert following below 'self._vlcVersion = None' or somewhere more sensible:
Replace 'self.__process.stderr = None' with:
|
It might also want to break after self.__playerController.drop(), I'm not sure. |
This works perfectly. I tested it on macOS 10.11+ on VLC 2.2.6 and 3. I just had to tweak some things a little and I am not entirely sure why. The implementation of the deamon is now:
And its initialization is: I am not sure why it did not work with your code. if you think those changes are fine, I can open a PR. I am currently trying to measure the CPU/battery load introduced by this code. |
The issue might be due to Unicode/ASCII/UTF-8 stuff which is platform/locale dependent. The important thing to check is that if you close via VLC or Syncplay it actually ends the process rather than just hiding VLC. If it does end the process then feel free to open the PR. |
Solved by PR #151. |
If Vlc is closed from the menu or the dock, VLC freezes and closes if I force quit it or close syncplay.
I'm not sure if this is just happening on my end. Can someone please confirm?
Also I'm trying to find the problem in lua script.
Etoh suggested me to have a look at this part of the script.
There's two pieces of closing code, one from Syncplay's side and one from VLC's. It is the latter which causes the problem.
The code is at https://github.com/Syncplay/syncplay/blob/master/resources/lua/intf/syncplay.lua and the logic (in Lua) is as follows:
I'm looking on how I can debug the script so I can find where the problem is happening. I tried commenting the above code and it still freezes, that means the problem is somewhere else.
The text was updated successfully, but these errors were encountered: