script.module.inputstreamhelper icon indicating copy to clipboard operation
script.module.inputstreamhelper copied to clipboard

Improving performance

Open dagwieers opened this issue 5 years ago • 3 comments

So now that we have unit tests, the logging output shows a few things we are doing on every run:

Debug: [script.module.inputstreamhelper-0.3.5]: Platform information: ('Linux', 'moria.gent.internal', '5.2.6-1.el7.elrepo.x86_64', '#1 SMP Sun Aug 4 10:13:32 EDT 2019', 'x86_64', '')
Debug: [script.module.inputstreamhelper-0.3.5]: inputstreamhelper is enabled. You can disable inputstreamhelper by setting "disabled" to "true" in settings.xml         (Note: only recommended for developers knowing what they're doing!)
Debug: [script.module.inputstreamhelper-0.3.5]: jsonrpc payload: {u'params': {u'addonid': u'inputstream.adaptive'}, u'jsonrpc': u'2.0', u'id': 1, u'method': u'Addons.GetAddonDetails'}
Debug: [script.module.inputstreamhelper-0.3.5]: jsonrpc response: {"id":1,"jsonrpc":"2.0","result":{"addon":{"enabled": "true"}}}
Debug: [script.module.inputstreamhelper-0.3.5]: inputstream.adaptive is installed.
Debug: [script.module.inputstreamhelper-0.3.5]: jsonrpc payload: {u'params': {u'properties': [u'enabled'], u'addonid': u'inputstream.adaptive'}, u'jsonrpc': u'2.0', u'id': 1, u'method': u'Addons.GetAddonDetails'}
Debug: [script.module.inputstreamhelper-0.3.5]: jsonrpc response: {"id":1,"jsonrpc":"2.0","result":{"addon":{"enabled": "true"}}}
Debug: [script.module.inputstreamhelper-0.3.5]: inputstream.adaptive 0.3.5 is enabled.
Debug: [script.module.inputstreamhelper-0.3.5]: inputstream.adaptive 0.3.5 is installed and enabled.
Debug: [script.module.inputstreamhelper-0.3.5]: Found Widevine binary at /home/dag/home-made/script.module.inputstreamhelper/test/cdm/libwidevinecdm.so
Debug: [script.module.inputstreamhelper-0.3.5]: [u'ldd', u'/home/dag/home-made/script.module.inputstreamhelper/test/cdm/libwidevinecdm.so'] cmd executed successfully.
Debug: [script.module.inputstreamhelper-0.3.5]: [u'ldd', u'/home/dag/home-made/script.module.inputstreamhelper/test/cdm/libwidevinecdm.so'] cmd output: 
	linux-vdso.so.1 =>  (0x00007fff063bd000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f00a75f8000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f00a72f6000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f00a70f2000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f00a6eea000)
	libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f00a6bd4000)
	libnss3.so => /lib64/libnss3.so (0x00007f00a68a5000)
	libnssutil3.so => /lib64/libnssutil3.so (0x00007f00a6675000)
	libnspr4.so => /lib64/libnspr4.so (0x00007f00a6437000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f00a6221000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f00a5e53000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f00a7ed6000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f00a5bf1000)
	libplc4.so => /lib64/libplc4.so (0x00007f00a59ec000)
	libplds4.so => /lib64/libplds4.so (0x00007f00a57e8000)

Debug: [script.module.inputstreamhelper-0.3.5]: There are no missing Widevine libraries! :-)
Debug: [script.module.inputstreamhelper-0.3.5]: Widevine update check was made on 2019-08-21T21:55:03

We can see the following things:

  1. A uname -a is performed
  2. A message is logged wrt. disabling the plugin
  3. inputstream.adaptive is tested (or possibly installed) and activated
  4. Widevine library is detected and ldd is run
  5. All required libraries are being detected

And I wonder if all of this is really required on every video playback.

As I indicated before #69, if we could detect that Widevine failed we can do all these things only on failure, rather than every time before playing. But lacking this possibility ATM could we get rid of any of this anyhow?

If we tested Widevine CDM properly after installation, do we still need to test it before every playback?

dagwieers avatar Aug 21 '19 22:08 dagwieers

What we could do have these tests also as part of a Troubleshooting section in the settings. This way if people do have playback issues with Widevine, they can run those. Or they could reinstall Widevine to have it retested, obviously.

dagwieers avatar Aug 21 '19 22:08 dagwieers

idk how long it takes to run _supports_widevine() but most of it (except maybe the Kodi version) won't ever change, so I guess that could be improved.

horstle avatar Aug 23 '19 07:08 horstle

When check_inputstream() is run and there is no update required, we look for the best image twice.

Debug: [script.module.inputstreamhelper-1.2.3]: Find best ARM image to use from recovery.conf
Debug: [script.module.inputstreamhelper-1.2.3]: SKATE (2128801384) is smaller than BOB (3373181067)
Debug: [script.module.inputstreamhelper-1.2.3]: ELM (12239.67.0) is newer than SKATE (12105.100.0)
Debug: [script.module.inputstreamhelper-1.2.3]: HANA (3373917985) is smaller than ELM (3374763553)
Debug: [script.module.inputstreamhelper-1.2.3]: BIG (2139898279) is smaller than HANA (3373917985)
Debug: [script.module.inputstreamhelper-1.2.3]: Find best ARM image to use from recovery.conf
Debug: [script.module.inputstreamhelper-1.2.3]: SKATE (2128801384) is smaller than BOB (3373181067)
Debug: [script.module.inputstreamhelper-1.2.3]: ELM (12239.67.0) is newer than SKATE (12105.100.0)
Debug: [script.module.inputstreamhelper-1.2.3]: HANA (3373917985) is smaller than ELM (3374763553)
Debug: [script.module.inputstreamhelper-1.2.3]: BIG (2139898279) is smaller than HANA (3373917985)
Debug: [script.module.inputstreamhelper-1.2.3]: Latest Chrome OS version is 12239.67.0
Debug: [script.module.inputstreamhelper-1.2.3]: Current Chrome OS version installed is 12239.67.0
Debug: [script.module.inputstreamhelper-1.2.3]: User is on the latest available Chrome OS version.

dagwieers avatar Aug 29 '19 17:08 dagwieers