Kodi Community Forum
Release [RELEASE] Bluetooth Delay - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: Release [RELEASE] Bluetooth Delay (/showthread.php?tid=366574)

Pages: 1 2 3


[RELEASE] Bluetooth Delay - vip. - 2022-01-17

Bluetooth Delay for Kodi
script.bluetooth.delay

This addon makes it easy to use Kodi with Bluetooth headphones.

With this addon you can set up audio delay for one or two devices, and toggle between them via a shortcut on your home screen, or a shortcut on your keyboard.

You can download and install the repo from here or install via 'Add Source' with this URL https://mar-official.github.io

To set a keyboard shortcut:
For toggle:       RunScript(script.bluetooth.delay)
For speakers:  RunScript(script.bluetooth.delay,0)
For bluetooth: RunScript(script.bluetooth.delay,1)

Image

Image

Image

Image


RE: [RELEASE] Bluetooth Delay - devkid - 2022-01-30

This looks great, I will try as I just bought a bluetooth headset and I was shocked about the delay it introduces.


RE: [RELEASE] Bluetooth Delay - devkid - 2022-01-31

Hm, is it possible to toggle between devices using JSON RPC? As far as I know it is not allowed to use RunScript via JSON RPC:
https://forum.kodi.tv/showthread.php?tid=178881


RE: [RELEASE] Bluetooth Delay - vip. - 2022-02-03

@devkid 
RunScript is for keyboard.xml file.
Also, for a smartphone, it is possible to toggle by clicking on the shortcut on the home page, as in the picture above.

For the Yatse app, you can use JSON RPC:

Addons.ExecuteAddon
{"addonid": "script.bluetooth.delay"}
Image


RE: [RELEASE] Bluetooth Delay - devkid - 2022-02-04

I patched the addon to accept external delay values as provided by JSON RPC calls using ExecuteAddon so it can be remote controlled. If you are interested in that I can send a PR if the source code is available on GitHub.


RE: [RELEASE] Bluetooth Delay - vip. - 2022-02-06

(2022-02-04, 00:02)devkid Wrote: I patched the addon to accept external delay values as provided by JSON RPC calls using ExecuteAddon so it can be remote controlled. If you are interested in that I can send a PR if the source code is available on GitHub.
I did not understand exactly what you mean "accept external delay values".
Anyway, I'd be happy if you post PR here.
Thanks


RE: [RELEASE] Bluetooth Delay - devkid - 2022-02-08

Am I right that this addon does not work for all skins? I am having trouble on my Kodi using Aeon MQ8 and I think that those used IDs might be skin dependent and Aeon MQ8 might be using different IDs?
python:
            xbmc.executebuiltin('SetFocus(-73)')
            xbmc.executebuiltin("Action(select)")
            xbmc.executebuiltin('SetFocus(11)')
            xbmc.executebuiltin("Action(select)", wait=True)
            time.sleep(s)
            xbmc.executebuiltin("Action(close)", wait=True)



RE: [RELEASE] Bluetooth Delay - devkid - 2022-02-08

(2022-02-06, 20:06)vip. Wrote:
(2022-02-04, 00:02)devkid Wrote: I patched the addon to accept external delay values as provided by JSON RPC calls using ExecuteAddon so it can be remote controlled. If you are interested in that I can send a PR if the source code is available on GitHub.
I did not understand exactly what you mean "accept external delay values".

The idea is to let the user configure custom values (that differ from the two configured values) by passing it in a JSON RPC request:
:
curl -s --data-binary '{ "jsonrpc": "2.0", "method": "Addons.ExecuteAddon", "params": { "wait": false, "addonid": "script.bluetooth.delay", "params": { "delay": "-340"} }, "id": 2 }' -H 'content-type:application/json;' http://192.168.1.1:8080/jsonrpc
Note the "delay" parameter in the request.

So the addon could be fully remote controlled.


RE: [RELEASE] Bluetooth Delay - vip. - 2022-02-08

(2022-02-08, 09:53)devkid Wrote: Am I right that this addon does not work for all skins? I am having trouble on my Kodi using Aeon MQ8 and I think that those used IDs might be skin dependent and Aeon MQ8 might be using different IDs?
Yes you are right. The Aeon MQ8 should have 'SetFocus(-74)' instead of -73.
I preferred to use SetFocus rather than send 'Action(Down)', because then I need extra sleep and also because of the option of "audio stream" that sometimes the button is grayed out.
I will probably need to add an exception for the Aeon MQ8 with the appropriate SetFocus.
Thanks


RE: [RELEASE] Bluetooth Delay - vip. - 2022-02-08

(2022-02-08, 10:34)devkid Wrote: The idea is to let the user configure custom values (that differ from the two configured values) by passing it in a JSON RPC request
If you mean "one-time" value, even now you can, by pressing A, then with the right/left arrows change the delay.


RE: [RELEASE] Bluetooth Delay - devkid - 2022-02-08

Are you interested in the remote feature? It's totally fine if you are not but then I can save the work to add it and send a PR.


RE: [RELEASE] Bluetooth Delay - vip. - 2022-02-08

(2022-02-08, 09:53)devkid Wrote: I am having trouble on my Kodi using Aeon MQ8 
Now (version 1.1.0) it should work with these skins:
-Ace 2
-Aeon MQ 8
-Aeon Nox: SILVO
-Aeon Tajo
-fTV
-Madnox
-Pellucid
-Quartz
-Xperience1080
-Mimic LR

Thank you


RE: [RELEASE] Bluetooth Delay - vip. - 2022-02-08

(2022-02-08, 19:44)devkid Wrote: Are you interested in the remote feature? It's totally fine if you are not but then I can save the work to add it and send a PR.
Yes, I want to try it, if you can send.


RE: [RELEASE] Bluetooth Delay - devkid - 2022-02-10

Thanks for the fix for Aeon and the other skins.

I have my remote control feature here and will test/use it as that:
https://github.com/verybadsoldier/script.bluetooth.delay/tree/feat/remote_control

Since the original addon comes with quite some code duplications I created some functions that should be possible to reuse later at other parts in the code to reduce duplications.


RE: [RELEASE] Bluetooth Delay - vip. - 2022-02-13

Nice.
Missing reset (lines 217-243) for after using the mouse then the stepLength changes.