Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Leia] No module named _multiprocessing #958

Closed
notimp opened this issue Nov 3, 2024 · 6 comments
Closed

[Leia] No module named _multiprocessing #958

notimp opened this issue Nov 3, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@notimp
Copy link

notimp commented Nov 3, 2024

This error started occurring using all versions newer than plugin.video.youtube-7.0.7+beta.1.leia.1 (so starting with beta 2). Until now I simply used 7.0.7 beta 1 - but that version stopped resolving videos this week.

Hope you can look into that, or indicate whats causing the issue.

Behavior: youtube plugin doesnt launch, and even if just the video playback is called, it just errors out.

Kodi version used: 18.1

Operating system: Android

Error log:

                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ImportError'>
                                            Error Contents: No module named _multiprocessing
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/service.py", line 13, in <module>
                                                from youtube_plugin.kodion import service_runner
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/__init__.py", line 13, in <module>
                                                from .abstract_provider import (
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/abstract_provider.py", line 15, in <module>
                                                from .constants import (
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/constants/__init__.py", line 13, in <module>
                                                from . import (
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/constants/const_sort_methods.py", line 15, in <module>
                                                from ..compatibility import xbmcplugin
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/compatibility/__init__.py", line 81, in <module>
                                                from multiprocessing import cpu_count
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-21-release/lib/python2.7/multiprocessing/__init__.py", line 84, in <module>
                                            ImportError: No module named _multiprocessing
                                            -->End of Python script error report<--
2024-11-03 11:13:10.299 T:10854  NOTICE: Indigo NOTICE: Checking for Malicious scripts
2024-11-03 11:13:19.262 T:18272   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ImportError'>
                                            Error Contents: No module named _multiprocessing
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/plugin.py", line 13, in <module>
                                                from youtube_plugin.kodion import plugin_runner
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/__init__.py", line 13, in <module>
                                                from .abstract_provider import (
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/abstract_provider.py", line 15, in <module>
                                                from .constants import (
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/constants/__init__.py", line 13, in <module>
                                                from . import (
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/constants/const_sort_methods.py", line 15, in <module>
                                                from ..compatibility import xbmcplugin
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/compatibility/__init__.py", line 81, in <module>
                                                from multiprocessing import cpu_count
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-21-release/lib/python2.7/multiprocessing/__init__.py", line 84, in <module>
                                            ImportError: No module named _multiprocessing
                                            -->End of Python script error report<--
2024-11-03 11:13:19.283 T:18271   ERROR: GetDirectory - Error getting plugin://plugin.video.youtube/
2024-11-03 11:13:19.349 T:9630   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.youtube/) failed
@notimp notimp added the bug Something isn't working label Nov 3, 2024
@notimp
Copy link
Author

notimp commented Nov 3, 2024

Tested with all versions after 7.0.7+beta.1.leia.1 - Same error.

Tested versions

|____plugin.video.youtube-7.0.7+beta.2.leia.1.zip
|____plugin.video.youtube-7.0.7+beta.3.leia.1.zip
|____plugin.video.youtube-7.0.7+leia.1.zip
|____plugin.video.youtube-7.0.8+beta.1.leia.1.zip
|____plugin.video.youtube-7.0.8+beta.2.leia.1.zip
|____plugin.video.youtube-7.0.8+beta.3.leia.1.zip
|____plugin.video.youtube-7.0.8+beta.4.leia.1.zip
|____plugin.video.youtube-7.0.8+beta.5.leia.1.zip
|____plugin.video.youtube-7.0.8+leia.1.zip
|____plugin.video.youtube-7.0.9.1+leia.1.zip
|____plugin.video.youtube-7.0.9.2+leia.1.zip
|____plugin.video.youtube-7.0.9+beta.1.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.10.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.2.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.3.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.4.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.5.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.6.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.7.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.8.leia.1.zip
|____plugin.video.youtube-7.0.9+beta.9.leia.1.zip
|____plugin.video.youtube-7.0.9+leia.1.zip
|____plugin.video.youtube-7.1.0.1+leia.1.zip
|____plugin.video.youtube-7.1.0+beta.1.leia.1.zip
|____plugin.video.youtube-7.1.0+beta.2.leia.1.zip
|____plugin.video.youtube-7.1.0+beta.3.leia.1.zip
|____plugin.video.youtube-7.1.0+beta.4.leia.1.zip
|____plugin.video.youtube-7.1.0+beta.5.leia.1.zip
|____plugin.video.youtube-7.1.0+leia.1.zip
|____plugin.video.youtube-7.1.1+beta.1.leia.1.zip
|____plugin.video.youtube-7.1.1+beta.2.leia.1.zip
|____plugin.video.youtube-7.1.1+beta.3.leia.1.zip
|____plugin.video.youtube-7.1.1+beta.4.leia.1.zip

@notimp
Copy link
Author

notimp commented Nov 3, 2024

Could "fix" this issue for myself by editing a few lines in two files files in plugin.video.youtube-7.1.0+leia.1.zip

youtube.py edits:

from
from ...kodion.compatibility import cpu_count, string_type, to_str
to
from ...kodion.compatibility import string_type, to_str

from
num_cores = cpu_count() or 1
to
num_cores = 3

(checked my devices core count - its 4... :) I hope setting it to 3 was right, as in 0,1,2,3 cores... :) )

init.py edits (the init.py from the compatibility folder)

removed the following three lines:

'cpu_count',

from os import cpu_count

from multiprocessing import cpu_count

That made the plugin work.

That said, the resolved 1440p links would fail to play using MPEG-DASH

:(

edit: All MPEG-Dash resolved videos fail to play this way. 1080p or 1440p doesnt matter.

If I set the plugin to Ask + Automatic + Quality selection, I see the resolved videos. MPEG-DASH resolved ones with the AVC1 video codec and variable sound bitrate up top fail to play with mpeg dash.

"Normally resolved" ones are listed below and play without issues.

@notimp
Copy link
Author

notimp commented Nov 3, 2024

Did the same edits on plugin.video.youtube-7.1.1+beta.4.leia.1 (one less edit needed in init.py, I think. :) ), it also launches after those edits.

This one fails to resolve AND play the avc1, "dynamic bitrate audio" videos using MPEG-DASH, (it resolved one time, then failed, on the next tries it didnt even resolve the AVC1 videos anymore.. :) h264 versions of the videos play fine).

I'm opening a separate issue ticket for that. :)

edit: The higher than 1080p videos failing to play seems to be intermittent/timing related. So they do work afters some tries. See: #959

@MoojMidge
Copy link
Collaborator

Please supply a full debug log. The information is required to develop a suitable workaround for this device/platform/Python version specific issue.

@MoojMidge
Copy link
Collaborator

Never mind about the log. Was looking to see whether it was possible to get CPU information through Kodi but it looks like the CPU count is not exposed via any interface usable by an addon, and on Android the CPU usage Kodi reports only looks at the first core.

Will just have to fall back to assume thar a single CPU is available.

MoojMidge added a commit to MoojMidge/plugin.video.youtube that referenced this issue Nov 4, 2024
@MoojMidge
Copy link
Collaborator

Can you confirm error no longer occurs using this test version:
https://github.com/MoojMidge/plugin.video.youtube/archive/refs/heads/master.zip

@MoojMidge MoojMidge mentioned this issue Nov 7, 2024
@MoojMidge MoojMidge mentioned this issue Nov 14, 2024
@MoojMidge MoojMidge mentioned this issue Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants