omegaui / linux-voice-control

Your personal, fully customization, Linux Voice Control Assistant.
GNU General Public License v3.0
132 stars 7 forks source link

❌ [ERROR] Failed MPV native library connection #10

Closed Solirix closed 1 year ago

Solirix commented 1 year ago

Hello! This is quite an interesting project, and i'd love to try it out for myself! I unfortunately am unable to install as I'm getting the same error as a previously closed issue. Your solution in that issue was to reinstall from source, and i've since reinstalled the voice control program from source. The error persists however, and I've also taken the liberty of compiling mpv from source. Is there any reason for this? the error is as follows (I manually installed torchvision hoping it would fix it):

Traceback (most recent call last):
  File "/home/aiden/lvc-bin/main.py", line 19, in <module>
    import chatgpt_port
  File "/home/aiden/lvc-bin/chatgpt_port.py", line 7, in <module>
    import command_manager
  File "/home/aiden/lvc-bin/command_manager.py", line 19, in <module>
    from voice_feedback import give_execution_feedback, speak, give_exiting_feedback
  File "/home/aiden/lvc-bin/voice_feedback.py", line 10, in <module>
    import mpv
  File "/home/aiden/.local/lib/python3.10/site-packages/mpv.py", line 190, in <module>
    _handle_func('mpv_detach_destroy', [], c_int)
  File "/home/aiden/.local/lib/python3.10/site-packages/mpv.py", line 166, in _handle_func
    func = getattr(backend, name)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libmpv.so: undefined symbol: mpv_detach_destroy
omegaui commented 1 year ago

@Solirix Seems like the error is arising due to mismatch versioning between the native library and the source. I'll just check the versions at my side.

omegaui commented 1 year ago

@Solirix image

Can you please tell me what versions of native libraries you have?

omegaui commented 1 year ago

Linked with #7 !

omegaui commented 1 year ago

@Solirix Hey! I just did a rebuild on a new system, I could not reproduce this issue. You can try reinstalling libmpv or equivalent for your distro. I can help you find this out, give me a neofetch of your system.

brad commented 1 year ago

Happening to me with latest from the main branch

➜  linux-voice-control git:(main) mpv --version
mpv 0.35.1-dirty Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on Fri Apr 21 01:35:22 2023
FFmpeg library versions:
   libavutil       58.2.100
   libavcodec      60.3.100
   libavformat     60.3.100
   libswscale      7.1.100
   libavfilter     9.3.100
   libswresample   4.10.100
FFmpeg version: n6.0
omegaui commented 1 year ago

@brad The error is arising from the native library. I need to know the name of your distro. A neofetch would be more helpful.

omegaui commented 1 year ago

Also, have you edited lvc-config.json?

omegaui commented 1 year ago

@brad

I just ran the following command on my live persistent system (Ubunut 22.04),

ubuntu@ubuntu:~$ nm -D /lib/x86_64-linux-gnu/libmpv.so.1 | grep mpv_detach
00000000000b4df0 T mpv_detach_destroy

As its visible, my installation has mpv_detach_destroy attribute.

Also, you have FFmpeg 6.0 installed, This is a major release, various changes have been done and each year, they would be releasing new releases, marking APIs as deprecated when needed and removing them, after every 3 years of time.

Also this looks like you are on an arch distribution means you are always getting the latest packages thus, breaking the voice-control-system.

I built this project originally on Fedora 36, I am currently on Ubuntu 22.04, and I haven't faced this in this course of time.

The possible fix would be to downgrade your installation of mpv and FFmpeg, these are my current mpv lib versions,

ubuntu@ubuntu:~$ mpv --version
mpv 0.34.1 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
FFmpeg library versions:
   libavutil       57.17.100 (runtime 57.28.100)
   libavcodec      59.18.100 (runtime 59.37.100)
   libavformat     59.16.100 (runtime 59.27.100)
   libswscale      6.4.100 (runtime 6.7.100)
   libavfilter     8.24.100 (runtime 8.44.100)
   libswresample   4.3.100 (runtime 4.7.100)
FFmpeg version: 5.1.1-1ubuntu2.1
ondradoksy commented 7 months ago

I had this exact issue on my ArchLinux installation.

mpv v0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on Jan 19 2024 09:09:45
libplacebo version: v6.338.2
FFmpeg version: n6.1.1
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Fixed by installing the newest version of python-mpv (1.0.5)