kanishka-linux / kawaii-player

Multimedia player, media library manager and portable media server with PC-To-PC casting feature.
GNU General Public License v3.0
617 stars 44 forks source link

Replace mpv_detach_destroy with mpv_destroy #42

Closed sgse closed 1 year ago

sgse commented 1 year ago

Unfortunately, my attempt to try out the Kawaii Player failed.

kawaii-player
/usr/lib/python3.10/site-packages/kawaii_player kawaii_player.py /home/sgs/
['/usr/lib/python3.10/site-packages/kawaii_player', '/usr/bin', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/lib/python3.10/site-packages']
--using default pycurl--
Traceback (most recent call last):
File "/usr/bin/kawaii-player", line 33, in <module>
sys.exit(load_entry_point('kawaii-player==5.0.0', 'gui_scripts', 'kawaii-player')())
File "/usr/bin/kawaii-player", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3.10/site-packages/kawaii_player/kawaii_player.py", line 93, in <module>
from guisignals import GUISignals
File "/usr/lib/python3.10/site-packages/kawaii_player/guisignals.py", line 27, in <module>
from settings_widget import LoginPCToPC
File "/usr/lib/python3.10/site-packages/kawaii_player/settings_widget.py", line 32, in <module>
from widgets.optionwidgets import QPushButtonExtra
File "/usr/lib/python3.10/site-packages/kawaii_player/widgets/optionwidgets.py", line 16, in <module>
from mpv_bak import MPV
File "/usr/lib/python3.10/site-packages/kawaii_player/mpv_bak.py", line 409, in <module>
_handle_func('mpv_detach_destroy',          [],                                         None, errcheck=None)
File "/usr/lib/python3.10/site-packages/kawaii_player/mpv_bak.py", line 366, 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.2: undefined symbol: mpv_detach_destroy
ldconfig -p | grep libmpv
libmpv.so.2 (libc6,x86-64) => /usr/lib/libmpv.so.2
libmpv.so (libc6,x86-64) => /usr/lib/libmpv.so

https://github.com/linuxmint/hypnotix/issues/254

Axel-Erfurt commented 1 year ago

Maybe you must make the changes in /usr/lib/python3.10/site-packages/kawaii_player/mpv_bak.py

sgse commented 1 year ago

Thanks for the tip :-) , after editing now unfortunately comes the following.

kawaii-player
/usr/lib/python3.10/site-packages/kawaii_player kawaii_player.py /home/sgs
['/usr/lib/python3.10/site-packages/kawaii_player', '/usr/bin', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/lib/python3.10/site-packages']
--using default pycurl--
Traceback (most recent call last):
  File "/usr/bin/kawaii-player", line 33, in <module>
    sys.exit(load_entry_point('kawaii-player==5.0.0', 'gui_scripts', 'kawaii-player')())
  File "/usr/bin/kawaii-player", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/kawaii_player/kawaii_player.py", line 93, in <module>
    from guisignals import GUISignals
  File "/usr/lib/python3.10/site-packages/kawaii_player/guisignals.py", line 27, in <module>
    from settings_widget import LoginPCToPC
  File "/usr/lib/python3.10/site-packages/kawaii_player/settings_widget.py", line 32, in <module>
    from widgets.optionwidgets import QPushButtonExtra
  File "/usr/lib/python3.10/site-packages/kawaii_player/widgets/optionwidgets.py", line 16, in <module>
    from mpv_bak import MPV
  File "/usr/lib/python3.10/site-packages/kawaii_player/mpv_bak.py", line 443, in <module>
    _handle_func('mpv_get_sub_api',             [MpvSubApi],                                c_void_p, notnull_errcheck)
  File "/usr/lib/python3.10/site-packages/kawaii_player/mpv_bak.py", line 366, 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.2: undefined symbol: mpv_get_sub_api

The search continues.

Axel-Erfurt commented 1 year ago

python-mpv was made for libmpv.so

libmpv.so.2 has more functions and some deprecated inside.

mpv_get_sub_api is also deprecated.

sgse commented 1 year ago

https://www.ccoderun.ca/programming/doxygen/mpv/deprecated.html Member mpv_sub_api use render.h Mh, missing the _get. This is beyond my capabilities. Sadly. I wonder why kawaii-player is still in chaotic-aur?
@dr460nf1r3 @Technetium1

Axel-Erfurt commented 1 year ago

I think the problem is libmpv

libmpv.so.1 has mpv_get_sub_api

nm -D /lib/x86_64-linux-gnu/libmpv.so.1 | grep mpv_get
00000000000ac780 T mpv_get_property
00000000000ac900 T mpv_get_property_async
00000000000ac8b0 T mpv_get_property_osd_string
00000000000ac860 T mpv_get_property_string
00000000000ae050 T mpv_get_sub_api
00000000000adce0 T mpv_get_time_us
00000000000ad660 T mpv_get_wakeup_pipe
sgse commented 1 year ago

Sorry, I am on Garuda Linux, Arch based. As I said, is not so my construction site. ;-)

nm -D /usr/lib/libmpv.so.* | grep mpv_get
00000000000bbe00 T mpv_get_property
00000000000bbfa0 T mpv_get_property_async
00000000000bbf50 T mpv_get_property_osd_string
00000000000bbf00 T mpv_get_property_string
00000000000bd840 T mpv_get_time_us
00000000000bd1c0 T mpv_get_wakeup_pipe
00000000000bbe00 T mpv_get_property
00000000000bbfa0 T mpv_get_property_async
00000000000bbf50 T mpv_get_property_osd_string
00000000000bbf00 T mpv_get_property_string
00000000000bd840 T mpv_get_time_us
00000000000bd1c0 T mpv_get_wakeup_pipe
lgdsgd2000 commented 1 year ago

我遇到了相同的问题

JordanPlayz158 commented 1 year ago

Not perfect but this gets farther

diff --color -r kawaii_player/mpv_bak.py kawaii_player_modified/mpv_bak.py
409c409
< _handle_func('mpv_detach_destroy',          [],                                         None, errcheck=None)
---
> _handle_func('mpv_destroy',          [],                                         None, errcheck=None)
443c443
< _handle_func('mpv_get_sub_api',             [MpvSubApi],                                c_void_p, notnull_errcheck)
---
> #_handle_func('mpv_get_sub_api',             [MpvSubApi],                                c_void_p, notnull_errcheck)
445,450c445,450
< _handle_gl_func('mpv_opengl_cb_set_update_callback',    [OpenGlCbUpdateFn, c_void_p])
< _handle_gl_func('mpv_opengl_cb_init_gl',                [c_char_p, OpenGlCbGetProcAddrFn, c_void_p],    c_int)
< _handle_gl_func('mpv_opengl_cb_draw',                   [c_int, c_int, c_int],                          c_int)
< _handle_gl_func('mpv_opengl_cb_render',                 [c_int, c_int],                                 c_int)
< _handle_gl_func('mpv_opengl_cb_report_flip',            [c_ulonglong],                                  c_int)
< _handle_gl_func('mpv_opengl_cb_uninit_gl',              [],                                             c_int)
---
> _handle_gl_func('mpv_render_context_set_update_callback',    [OpenGlCbUpdateFn, c_void_p])
> _handle_gl_func('mpv_render_context_create',                [c_char_p, OpenGlCbGetProcAddrFn, c_void_p],    c_int)
> #_handle_gl_func('mpv_opengl_cb_draw',                   [c_int, c_int, c_int],                          c_int)
> _handle_gl_func('mpv_render_context_render',                 [c_int, c_int],                                 c_int)
> _handle_gl_func('mpv_render_context_report_swap',            [c_ulonglong],                                  c_int)
> _handle_gl_func('mpv_render_context_free',              [],                                             c_int)
diff --color -r kawaii_player/mpv_opengl.py kawaii_player_modified/mpv_opengl.py
26,28c26,28
< from mpv_bak import MPV, _mpv_get_sub_api, _mpv_opengl_cb_set_update_callback, \
<         _mpv_opengl_cb_init_gl, OpenGlCbGetProcAddrFn, _mpv_opengl_cb_draw, \
<         _mpv_opengl_cb_report_flip, MpvSubApi, OpenGlCbUpdateFn, _mpv_opengl_cb_uninit_gl
---
> from mpv_bak import MPV, _mpv_render_context_set_update_callback, \
>         _mpv_render_context_create, OpenGlCbGetProcAddrFn, _mpv_render_context_render, \
>         _mpv_render_context_report_swap, MpvSubApi, OpenGlCbUpdateFn, _mpv_render_context_free
diff --color -r kawaii_player/widgets/thumbnail.py kawaii_player_modified/widgets/thumbnail.py
109c109
<                 self.setMaximumHeight(2.5*ui.height_allowed)
---
>                 self.setMaximumHeight(int(2.5*ui.height_allowed))

9697b356460e894c0e405f3e26fe22996a1e08d4

Technetium1 commented 1 year ago

@sgse It's an old request, if it can't be made to work at it then it's possibly a candidate for removal, unless a broken version or the build log still helps the people testing here.

kanishka-linux commented 1 year ago

The issue is due to complete deprecation of opengl-cb from latest mpv. The new opengl-render is already supported by kawaii-player. But need to remove code related to opengl-cb first before it can start working.

After installing latest pympv and removing some code related to opengl-cb things started working again.

I tested on osx with python3.9 and mpv - v0.35, will push the changes by this weekend. with opengl-render and pympv - build process will be a bit difficult - so will have to look into how to simplify it.

By the way - if people don't know kawaii-player also supports libvlc as backend - which I used to try on raspberry-pi.

However I need to remove opengl-cb dependency completely before either libmpv or libvlc can be used as video backend.

Sorry for not looking into it earlier - lately finding it difficult to work on my personal projects - and kawaii-player was working fine on my all machines until some latest update broke it.

Thanks for. all debugging info, it helped.

kanishka-linux commented 1 year ago

fixed! closing the issue.