linuxmint / hypnotix

An M3U IPTV Player
1.16k stars 160 forks source link

Black screen trying to play stations - mpv option does not exist: --sub-codepade #185

Open kneekoo opened 2 years ago

kneekoo commented 2 years ago

OS: Linux Mint 20.2 Cinnamon Hypnotix 2.0

Problem

While trying to play any channel, what I got was the activity/loading spinner on a black screen.

Troubleshooting

I started Hypnotix from the terminal and I found a typo in an MPV option. I'm not sure how that got there. It should be --sub-codepage. I checked Celluloid's Preferences -> Miscellaneous and it has hwdec=yes --sub-codepage=iso-8859-2, so that's a correct config and obviously not the one used in Hypnotix.

nicu@nas:~/Downloads/OS/LinuxMint/Testing$ hypnotix 
nicu@nas:~/Downloads/OS/LinuxMint/Testing$ Loading providers...
Free-TV: Getting playlist...
Free-TV: Checking playlist...
Free-TV: Loading channels...
Traceback (most recent call last):
  File "/usr/lib/hypnotix/hypnotix.py", line 1227, in on_mpv_drawing_area_realize
    self.reinit_mpv()
  File "/usr/lib/hypnotix/hypnotix.py", line 1247, in reinit_mpv
    self.mpv = mpv.MPV(**options, script_opts='osc-layout=box,osc-seekbarstyle=bar,osc-deadzonesize=0,osc-minmousemove=3', input_default_bindings=True, \
  File "/usr/lib/hypnotix/mpv.py", line 820, in __init__
    _mpv_set_option_string(self.handle, k.replace('_', '-').encode('utf-8'), istr(v).encode('utf-8'))
  File "/usr/lib/hypnotix/mpv.py", line 133, in raise_for_ec
    raise ex(ec, *args)
AttributeError: ('mpv option does not exist', -5, (<MpvHandle object at 0x7ffa3c34e740>, b'--sub-codepade', b'iso-8859-2'))
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_lib_hypnotix_hypnotix.py.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/hypnotix/hypnotix.py", line 1227, in on_mpv_drawing_area_realize
    self.reinit_mpv()
  File "/usr/lib/hypnotix/hypnotix.py", line 1247, in reinit_mpv
    self.mpv = mpv.MPV(**options, script_opts='osc-layout=box,osc-seekbarstyle=bar,osc-deadzonesize=0,osc-minmousemove=3', input_default_bindings=True, \
  File "/usr/lib/hypnotix/mpv.py", line 820, in __init__
    _mpv_set_option_string(self.handle, k.replace('_', '-').encode('utf-8'), istr(v).encode('utf-8'))
  File "/usr/lib/hypnotix/mpv.py", line 133, in raise_for_ec
    raise ex(ec, *args)
AttributeError: ('mpv option does not exist', -5, (<MpvHandle object at 0x7ffa3c34e740>, b'--sub-codepade', b'iso-8859-2'))

I also looked for a user config and the default one, but it looks like that comes from somewhere else. Apparently I have no Hypnotix user config either.

nicu@nas:~$ ls -l ~/.config/mpv/
total 0
nicu@nas:~$ ls -l ~/.mpv
ls: cannot access '/home/nicu/.mpv': No such file or directory
nicu@nas:~$ more /etc/mpv/mpv.conf 
hwdec=vaapi
nicu@nas:~$ ls -lR ~ | grep -i hypnotix
nicu@nas:~$

Then I tried adding the codepage to the system-wide MPV configuration and I restarted Hypnotix, but it broke the same way.

nicu@nas:~$ more /etc/mpv/mpv.conf 
hwdec=vaapi --sub-codepage=iso-8859-2

Then I copied the default config to my account and Hypnotix failed the same.

nicu@nas:~$ cp /etc/mpv/mpv.conf .config/mpv/

I then tried searching for the config typo in all the files under /etc, /usr and /var - no results.

Finally, I ended up looking in the Hypnotix options and I found this:

hwdec=auto-safe --sub-codepade=iso-8859-2

I fixed the typo and it complained the same, although the option was now correct.

nicu@nas:~/.config/mpv$ hypnotix 
nicu@nas:~/.config/mpv$ Loading providers...
Free-TV: Getting playlist...
Free-TV: Checking playlist...
Free-TV: Loading channels...
Traceback (most recent call last):
  File "/usr/lib/hypnotix/hypnotix.py", line 1227, in on_mpv_drawing_area_realize
    self.reinit_mpv()
  File "/usr/lib/hypnotix/hypnotix.py", line 1247, in reinit_mpv
    self.mpv = mpv.MPV(**options, script_opts='osc-layout=box,osc-seekbarstyle=bar,osc-deadzonesize=0,osc-minmousemove=3', input_default_bindings=True, \
  File "/usr/lib/hypnotix/mpv.py", line 820, in __init__
    _mpv_set_option_string(self.handle, k.replace('_', '-').encode('utf-8'), istr(v).encode('utf-8'))
  File "/usr/lib/hypnotix/mpv.py", line 133, in raise_for_ec
    raise ex(ec, *args)
AttributeError: ('mpv option does not exist', -5, (<MpvHandle object at 0x7fd5319c7740>, b'--sub-codepage', b'iso-8859-2'))
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_lib_hypnotix_hypnotix.py.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/hypnotix/hypnotix.py", line 1227, in on_mpv_drawing_area_realize
    self.reinit_mpv()
  File "/usr/lib/hypnotix/hypnotix.py", line 1247, in reinit_mpv
    self.mpv = mpv.MPV(**options, script_opts='osc-layout=box,osc-seekbarstyle=bar,osc-deadzonesize=0,osc-minmousemove=3', input_default_bindings=True, \
  File "/usr/lib/hypnotix/mpv.py", line 820, in __init__
    _mpv_set_option_string(self.handle, k.replace('_', '-').encode('utf-8'), istr(v).encode('utf-8'))
  File "/usr/lib/hypnotix/mpv.py", line 133, in raise_for_ec
    raise ex(ec, *args)
AttributeError: ('mpv option does not exist', -5, (<MpvHandle object at 0x7fd5319c7740>, b'--sub-codepage', b'iso-8859-2'))

Does Hypnotix crash because of the FileNotFoundError or AttributeError?

Axel-Erfurt commented 2 years ago

replace

--sub-codepage=iso-8859-2

with

sub-codepage=iso-8859-2