Syncplay / syncplay

Client/server to synchronize media playback on mpv/VLC/MPC-HC/MPC-BE on many computers
http://syncplay.pl/
Apache License 2.0
2.07k stars 211 forks source link

Syncplay dependency issue #673

Open ChunkyPanda03 opened 5 months ago

ChunkyPanda03 commented 5 months ago

Describe the bug syncplay is not work currently working on Debian while I have not tried a fresh install i.e. vm following the build instructions yields dependency issues

To Reproduce Steps to reproduce the behavior: follow

Expected behavior syncplay gui should start

output running syncplay using $syncplay -g yeilds: syncplay -g /usr/lib/syncplay/syncplay/utils.py:304: SyntaxWarning: invalid escape sequence '\g' return re.sub(constants.ROOM_NAME_STRIP_REGEX, "\g<roomnamebase>", RoomName) /usr/lib/syncplay/syncplay/utils.py:482: SyntaxWarning: invalid escape sequence '\+' CONTROLLED_ROOM_REGEX = re.compile("^\+(.*):(\w{12})$") /usr/lib/syncplay/syncplay/utils.py:483: SyntaxWarning: invalid escape sequence '\d' PASSWORD_REGEX = re.compile("[A-Z]{2}-\d{3}-\d{3}") /usr/lib/syncplay/syncplay/constants.py:115: SyntaxWarning: invalid escape sequence '\.' FILENAME_STRIP_REGEX = "[-~_\.\[\](): ]" /usr/lib/syncplay/syncplay/constants.py:116: SyntaxWarning: invalid escape sequence '\-' CONTROL_PASSWORD_STRIP_REGEX = "[^a-zA-Z0-9\-]" /usr/lib/syncplay/syncplay/constants.py:117: SyntaxWarning: invalid escape sequence '\+' ROOM_NAME_STRIP_REGEX = "^(\+)(?P<roomnamebase>.*)(:)(\w{12})$" /usr/lib/syncplay/syncplay/constants.py:165: SyntaxWarning: invalid escape sequence '\m' MPC64_EXECUTABLES = ["mpc-hc64.exe", "mpc-hc64_nvo.exe", "x64\mpc-hc\shoukaku.exe"] /usr/lib/syncplay/syncplay/constants.py:303: SyntaxWarning: invalid escape sequence '\.' MPLAYER_ANSWER_REGEX = "^ANS_([a-zA-Z_-]+)=(.+)$|^(Exiting)\.\.\. \((.+)\)$" Could not import GUI libraries. If you do not have PySide installed then you will need to install it for the GUI to work. Hostname can't be empty! Some necessary arguments are missing, refer to --help I think this is an issue with python version (i have messed around with older version) so i run from the release tarball $ python3.12 syncplayClient.py python3.12 syncplayClient.py -g Could not import GUI libraries. If you do not have PySide installed then you will need to install it for the GUI to work. Hostname can't be empty! Some necessary arguments are missing, refer to --help Version and platform: -Debian 12

side note I do not know if this is a me issue however I have also run from a venv and received the same result I would recommend making a flatpak of the app to fix future dependency issues.

Et0h commented 5 months ago

I'm not a Linux user so will mostly rely on others to provide support on this, but I do have some questions that will hopefully move things forwards:

  1. What version of Syncplay and PySide are you using?
  2. Does Syncplay run okay if you run it in --no-gui mode?

side note I do not know if this is a me issue however I have also run from a venv and received the same result I would recommend making a flatpak of the app to fix future dependency issues.

According to https://github.com/Syncplay/syncplay/issues/199 Flatpak "seems to be incompatible with current model of integration with media players Syncplay uses".

As per https://github.com/Syncplay/syncplay/issues/643 we tried AppImages and Snap and it ended up causing more compatibility issues than it solved. That issue does however include a potential option in terms of using pipx but nobody has tried it yet to see if it works.

daniel-123 commented 5 months ago

@ChunkyPanda03 All of the problems you described aside - Syncplay is just in the Debian repositories. So unless you really need the latest version, you can just # apt install syncplay.

I'll second the question of @Et0h what version of pyside do you have and how it is installed? The message you are getting is basically a simple wrapper on failed import of pyside.

Regarding flatpak, as well as snaps and appimages - between Syncplay being Python application that also uses Qt and the need to control external media player, it turned out in our experience that packaging it into any of those is very difficult. For flatpak we never figured where to even start and AppImage as well as Snap that we managed to build at some point were either unreliable or straight up broken.

ChunkyPanda03 commented 4 months ago

@daniel-123 running it through the downloaded deb apt repo gets me this however I know my current set up is messy and slightly unorthodox so I don't know if this is a me issue.

@Et0h Syncplay was running whatever the latest "release" build was on the git repo and what command should I run to find the pyside version I know there are deb packages and pip installs. And on the terms of flatpak and other runners is there any provided venv configurations you all use? Also it does work fine in "--no-gui" mode I think it is a pyside issue.

running the old apt image works fine however.

this is when running the apt install version

Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
Traceback (most recent call last):
  File "/usr/bin/syncplay", line 33, in <module>
    sys.exit(load_entry_point('syncplay==1.6.9', 'gui_scripts', 'syncplay')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/syncplay/ep_client.py", line 8, in main
    SyncplayClientManager().run()
  File "/usr/lib/python3/dist-packages/syncplay/clientManager.py", line 9, in run
    config = ConfigurationGetter().getConfiguration()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/syncplay/ui/ConfigurationGetter.py", line 544, in getConfiguration
    self._forceGuiPrompt()
  File "/usr/lib/python3/dist-packages/syncplay/ui/ConfigurationGetter.py", line 455, in _forceGuiPrompt
    for key, value in list(self._promptForMissingArguments().items()):
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/syncplay/ui/ConfigurationGetter.py", line 420, in _promptForMissingArguments
    gc.run()
  File "/usr/lib/python3/dist-packages/syncplay/ui/GuiConfiguration.py", line 40, in run
    dialog = ConfigDialog(self.config, self._availablePlayerPaths, self.error, self.defaultConfig)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/syncplay/ui/GuiConfiguration.py", line 1420, in __init__
    self.setWindowFlags(self.windowFlags() & Qt.WindowCloseButtonHint & ~Qt.WindowContextHelpButtonHint)
TypeError: 'PySide2.QtCore.Qt.WindowFlags' object cannot be interpreted as an integer
Et0h commented 4 months ago

I have now updated Syncplay to hopefully provide more detail in the error messages when loading PySide fails. See GIT HEAD / https://github.com/Syncplay/syncplay/actions/runs/7978410389

My understanding is that if you are using Python >=3.12 then you will need to have PySide6 installed as earlier versions of PySide only support up to 3.11.

A quick look on packages.debian.org seems to indicate that there is no PySide6 packages for Debian yet. I assume this means you would either need to install PySide6 via pip install pyside6 or equivalent or move to Python 3.11 so you can use sudo apt install python3-pyside2.qtgui, but I don't use Debian so I can't say for sure.

ChunkyPanda03 commented 4 months ago

ok I have it,

I first off purged and fixed some of my python packages and installs I think that my installed old python 3.4 build was messing with me.

then after some on and off tinkering I have a method for getting it to run

1) when making and installing somehow the internal permissions of the install location were incorrect. found this when it was claiming that certain files didn't exist. fixed it by nuking it with a sudo chmod 777 -R ... on the affected folders. I will look into this more later to see if this is my fault.

2) the program started working but with no gui fixed this by pip install pyside6 then it complained that qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. this was fixed by 'sudo apt install libxcb-cursor0'

tada syncplay -g now works

edit: this is using python 13

ChunkyPanda03 commented 4 months ago

going to keep this open to test the odd folder permission issue will close later

izissise commented 4 months ago

If you use flatpak vlc you can add the extension by creating a directory $HOME/.var/app/org.videolan.VLC/data/vlc/lua/intf/ and copying syncplay.lua in it