Congratulations, good job. I ran the script on Khadas EDGE on the latest SERVER image (5.69 20190111). Installed all components. Launched KODI, it works with HW and plays all my test files (including 4K). In the near future I will check the script in the environment x11 (DE XFCE).