hydrus icon indicating copy to clipboard operation
hydrus copied to clipboard

MPV not working on Ubuntu 22.04

Open blipdrifter opened this issue 3 years ago • 15 comments

Hydrus version

482

Operating system

Linux (specify distro and version in comments)

Install method

Extract

Install and OS comments

Linux version: Ubuntu 22.04 LTS Installed via: tar.gz file

Bug description and reproduction

  1. Recently reinstalled my OS and reimported my db from my old 20.04 install
  2. Try to play video with audio in hydrus client, client complains it can't find mpv
  3. Close hydrus, install libmpv1 and made sure that python-mpv 0.4.5 was installed
  4. Re-open hydrus, still doesn't work
  5. Try to install latest version of python-mpv instead, still doesn't work

Log output

v482, 2022/04/25 09:40:09: hydrus client started
v482, 2022/04/25 09:40:10: booting controller…
v482, 2022/04/25 09:40:10: booting db…
v482, 2022/04/25 09:40:10: checking database
v482, 2022/04/25 09:40:10: preparing db caches
v482, 2022/04/25 09:40:10: initialising managers
v482, 2022/04/25 09:40:11: booting gui…
v482, 2022/04/25 09:40:11: starting services…
v482, 2022/04/25 09:40:11: Running "client api" on port 45869.
v482, 2022/04/25 09:40:11: services started
v482, 2022/04/25 09:40:20: MPV is not available!
v482, 2022/04/25 09:40:23: If this information helps, MPV failed to import because:
v482, 2022/04/25 09:40:23: Traceback (most recent call last):
  File "PyInstaller/loader/pyimod04_ctypes.py", line 53, in __init__
  File "ctypes/__init__.py", line 373, in __init__
OSError: /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined symbol: g_module_open_full

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "hydrus/client/gui/ClientGUIMPV.py", line 25, in <module>
    import mpv
  File "/tmp/embedded.zrgpt4d0.zip/shibokensupport/__feature__.py", line 142, in _import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
  File "mpv.py", line 52, in <module>
  File "PyInstaller/loader/pyimod04_ctypes.py", line 55, in __init__
pyimod04_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'libmpv.so.1'. Most likely this dynlib/dll was not found when the application was frozen.

blipdrifter avatar Apr 25 '22 16:04 blipdrifter

Hey, I am sorry for the trouble. I am not an expert on this issue, but I know some others had it when Fedora and Arch went through a similar system level update. I think it is related to us building hydrus on 18.04 Ubuntu and some .so that is bundled is unhappy talking to your newer 20.04 one. Please check the discussion archives here for detail:

https://8chan.moe/hydrus/res/16965.html#17021 https://8chan.moe/hydrus/res/15850.html#16937

Specifically, this may solve your problem:

I copied my system's libraries (from /usr/lib64/) to my Hydrus directory (while Hydrus was completely stopped). Be sure to have a fresh backup before doing anything though!

Here's what I copied over:

  • /usr/lib64/libmpv.so.1.109.0 to libmpv.so.1 (comes from mpv-libs-0.34.0-1.fc35.x86_64)
  • /usr/lib64/libcrypto.so.1.1.1l to libcrypto.so.1.1 (comes from openssl-libs-1.1.1l-2.fc35.x86_64)
  • /usr/lib64/libgmodule-2.0.so.0.7000.1 to libgmodule-2.0.so.0 (comes from glib2-2.70.1-1.fc35.x86_64)

Please try just doing libgmodule first, as that may be the only file you need to copy. And let me know if that helps! Several people have had this, so I should write up a formal solution in the help that we can point to.

hydrusnetwork avatar Apr 27 '22 21:04 hydrusnetwork

I tried that, but when I went to /usr/lib64/ there were no files in the folder. Any reason why?

blipdrifter avatar May 02 '22 18:05 blipdrifter

Hey, sorry again for the trouble. Another user had this same problem and let me know they found their files under:

/usr/lib/x86_64-linux-gnu/

Any good? If not, can you search /usr/ for anything libgmodule*?

Also, there are two reports now that you only need to copy the 'libgmodule' file to hydrus. I am writing this up in the official hydrus help now for tomorrow's release, so I am crossing my fingers this is a universal solution. If you do have the files but in a different location, please let me know where you find them!

hydrusnetwork avatar May 11 '22 02:05 hydrusnetwork

Did that. Found a file in there called libgmodule-2.0.so.0.7200.1, copied and renamed it in my client folder, tried to launch the client and got this in terminal:

inbtwn@inbtwn-ubuntu:~/hydrus/Hydrus Network$ ./client
v483, 2022/05/11 16:10:26: hydrus client started
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

(client:74039): GLib-GIO-ERROR **: 16:10:26.840: Settings schema 'org.gnome.settings-daemon.plugins.xsettings' does not contain a key named 'antialiasing'
Trace/breakpoint trap (core dumped)

Now what? :P

blipdrifter avatar May 11 '22 23:05 blipdrifter

The exact same problem on my arch system

  File "PyInstaller/loader/pyimod04_ctypes.py", line 53, in __init__
  File "ctypes/__init__.py", line 373, in __init__
OSError: /home/diridibindy/Programs/HydrusNetwork/libmpv.so.1: undefined symbol: wl_proxy_marshal_flags

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "hydrus/client/gui/ClientGUIMPV.py", line 25, in <module>
    import mpv
  File "/tmp/embedded.p05spk5d.zip/shibokensupport/__feature__.py", line 142, in _import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
  File "mpv.py", line 52, in <module>
  File "PyInstaller/loader/pyimod04_ctypes.py", line 55, in __init__
pyimod04_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'libmpv.so.1'. Most likely this dynlib/dll was not found when the application was frozen.

Tried the fix suggested here, but it didn't do anything

Diridibindy avatar May 12 '22 16:05 Diridibindy

Damn, I am sorry for the trouble. If you have been able to get libmpv1 installed on your machine--most distros seem to be able to get it with apt--another user said they had to do the same 'copy these .so files from your system to the hydrus install folder' for:

libmpv.so libcdio.so

The libmpv.so might have a slightly different name, like libmpv.so.1 etc..., so searching for libmpv* is probably the thing to try.

hydrusnetwork avatar May 24 '22 23:05 hydrusnetwork

The issue does not get resolved by using system libraries.

Diridibindy avatar Jun 07 '22 14:06 Diridibindy

This exact problem has been a long-running issue for me on Void Linux, and simply removing the bundled libgmodule-2.0.so.0 solves it on client 488 - actually replacing it with my OS's native library (/usr/lib/libgmodule-2.0.so.0.7200.0) also works, but seems to be unnecessary. At least on my machine, the client falls back to the native library automatically.

twingofan avatar Jun 09 '22 22:06 twingofan

Deleting the library doesn't help. The issue still persists on Arch Linux with all the latest libraries.Can you provide your libgmodule library? It may be an issue with the Arch Linux library being broken.

Diridibindy avatar Jun 13 '22 09:06 Diridibindy

Void's glib is a couple minor versions behind Arch, and dynamically linked, so it's unlikely to just drop-in. Hope this still helps somehow. libgmodule.tar.gz

twingofan avatar Jun 15 '22 01:06 twingofan

Yeah, the library itself functions but mpv still cannot get imported

Diridibindy avatar Jun 18 '22 18:06 Diridibindy

This update actually did change something, MPV does launch from source, not from the package though

Diridibindy avatar Sep 16 '22 16:09 Diridibindy

I tried copying all the .so files to the hydrus directory and none of them worked, so I ended up just switching to the Flatpak version of hydrus. Naturally, mpv works fine under flatpak hydrus.

blipdrifter avatar Sep 18 '22 17:09 blipdrifter

You should have tried running it from source just like the changelog said.

Diridibindy avatar Sep 23 '22 03:09 Diridibindy

Update: Just this week I've started running hydrus from source and thankfully mpv works just fine with it. Huge ups to hydev for adding the venv build scripts. If you haven't tried running from source yet I highly recommend it.

blipdrifter avatar Nov 13 '22 07:11 blipdrifter