mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
steamcontroller: remove add-on
This commit is contained in:
parent
027def8c89
commit
fb1ecd6c50
@ -1,6 +0,0 @@
|
||||
8.1.101
|
||||
- Update to 60499dc
|
||||
- Fix cpu usage due to high polling rate
|
||||
|
||||
8.0.100
|
||||
- Initial add-on
|
Binary file not shown.
Before Width: | Height: | Size: 30 KiB |
@ -1,48 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="steamcontroller"
|
||||
PKG_VERSION="60499dc"
|
||||
PKG_SHA256="04a846c6f659fb5efca7747fe78e15c1348b5e0579437bb425f538318289bb80"
|
||||
PKG_REV="102"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="MIT"
|
||||
PKG_SITE="https://github.com/ynsta/steamcontroller"
|
||||
PKG_URL="https://github.com/ynsta/steamcontroller/archive/$PKG_VERSION.tar.gz"
|
||||
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host python-libusb1 enum34 linux:host"
|
||||
PKG_SECTION="driver"
|
||||
PKG_SHORTDESC="A standalone userland driver for the steam controller to be used where steam client can't be installed."
|
||||
PKG_LONGDESC="A standalone userland driver for the steam controller to be used where steam client can't be installed."
|
||||
PKG_TOOLCHAIN="manual"
|
||||
|
||||
PKG_IS_ADDON="yes"
|
||||
PKG_ADDON_NAME="Steam Controller Driver"
|
||||
PKG_ADDON_TYPE="xbmc.service"
|
||||
|
||||
pre_make_target() {
|
||||
export PYTHONXCPREFIX="$SYSROOT_PREFIX/usr"
|
||||
export LDSHARED="$CC -shared"
|
||||
}
|
||||
|
||||
make_target() {
|
||||
python setup.py build
|
||||
}
|
||||
|
||||
addon() {
|
||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
|
||||
cp -a $PKG_BUILD/build/scripts-2.7/* $ADDON_BUILD/$PKG_ADDON_ID/bin/
|
||||
|
||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib
|
||||
cp -a $PKG_BUILD/build/lib.linux-*-2.7/* $ADDON_BUILD/$PKG_ADDON_ID/lib/
|
||||
cp -a $(get_build_dir python-libusb1)/build/lib/* $ADDON_BUILD/$PKG_ADDON_ID/lib/
|
||||
cp -a $(get_build_dir enum34)/build/lib/* $ADDON_BUILD/$PKG_ADDON_ID/lib/
|
||||
|
||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/include/linux
|
||||
if [ -f "$(get_build_dir linux)/usr/include/linux/input-event-codes.h" ]; then
|
||||
cp $(get_build_dir linux)/usr/include/linux/input-event-codes.h $ADDON_BUILD/$PKG_ADDON_ID/include/linux/
|
||||
fi
|
||||
cp $(get_build_dir linux)/usr/include/linux/input.h $ADDON_BUILD/$PKG_ADDON_ID/include/linux/
|
||||
|
||||
$TOOLCHAIN/bin/python -Wi -t -B $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/compileall.py $ADDON_BUILD/$PKG_ADDON_ID/lib/ -f 1>/dev/null
|
||||
find $ADDON_BUILD/$PKG_ADDON_ID/lib/ -name '*.py' -exec rm {} \;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
commit 8da1123bcbf3ad12b6c9d7975ebbb3f8663fd166
|
||||
Author: Lukas Rusak <lorusak@gmail.com>
|
||||
Date: Sat Jan 7 13:50:30 2017 -0800
|
||||
|
||||
fix include dir
|
||||
|
||||
diff --git a/src/uinput.py b/src/uinput.py
|
||||
index 684a018..ffc2354 100644
|
||||
--- a/src/uinput.py
|
||||
+++ b/src/uinput.py
|
||||
@@ -36,10 +36,10 @@ from steamcontroller.tools import get_so_extensions
|
||||
from collections import deque
|
||||
|
||||
# Get All defines from linux headers
|
||||
-if os.path.exists('/usr/include/linux/input-event-codes.h'):
|
||||
- CHEAD = defines('/usr/include', 'linux/input-event-codes.h')
|
||||
+if os.path.exists('/storage/.kodi/addons/driver.steamcontroller/include/linux/input-event-codes.h'):
|
||||
+ CHEAD = defines('/storage/.kodi/addons/driver.steamcontroller/include', 'linux/input-event-codes.h')
|
||||
else:
|
||||
- CHEAD = defines('/usr/include', 'linux/input.h')
|
||||
+ CHEAD = defines('/storage/.kodi/addons/driver.steamcontroller/include', 'linux/input.h')
|
||||
|
||||
# Keys enum contains all keys and button from linux/uinput.h (KEY_* BTN_*)
|
||||
Keys = IntEnum('Keys', {i: CHEAD[i] for i in CHEAD.keys() if (i.startswith('KEY_') or
|
@ -1,92 +0,0 @@
|
||||
commit b1bcba9b73d1e5e755ef6cda014ea3cc5a5ba270
|
||||
Author: Lukas Rusak <lorusak@gmail.com>
|
||||
Date: Sat Jan 7 13:51:01 2017 -0800
|
||||
|
||||
append python path
|
||||
|
||||
diff --git a/scripts/sc-callbacks.py b/scripts/sc-callbacks.py
|
||||
index eaeb658..35a272a 100755
|
||||
--- a/scripts/sc-callbacks.py
|
||||
+++ b/scripts/sc-callbacks.py
|
||||
@@ -25,6 +25,8 @@
|
||||
"""Steam Controller Callback Mode example"""
|
||||
import sys
|
||||
|
||||
+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
|
||||
+
|
||||
from steamcontroller import SteamController, SCButtons
|
||||
from steamcontroller.events import EventMapper, Pos
|
||||
from steamcontroller.uinput import Keys
|
||||
diff --git a/scripts/sc-desktop.py b/scripts/sc-desktop.py
|
||||
index 9eff430..e0b8ec7 100755
|
||||
--- a/scripts/sc-desktop.py
|
||||
+++ b/scripts/sc-desktop.py
|
||||
@@ -22,6 +22,10 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
+import sys
|
||||
+
|
||||
+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
|
||||
+
|
||||
"""Steam Controller Mouse, Keyboard mode"""
|
||||
|
||||
from steamcontroller import SteamController, SCButtons
|
||||
diff --git a/scripts/sc-dump.py b/scripts/sc-dump.py
|
||||
index b6f2c24..b582771 100755
|
||||
--- a/scripts/sc-dump.py
|
||||
+++ b/scripts/sc-dump.py
|
||||
@@ -25,6 +25,9 @@
|
||||
"""Steam Controller USB Dumper"""
|
||||
|
||||
import sys
|
||||
+
|
||||
+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
|
||||
+
|
||||
from steamcontroller import SteamController
|
||||
|
||||
def dump(_, sci):
|
||||
diff --git a/scripts/sc-mixed.py b/scripts/sc-mixed.py
|
||||
index 4a9c3c0..5e25af9 100755
|
||||
--- a/scripts/sc-mixed.py
|
||||
+++ b/scripts/sc-mixed.py
|
||||
@@ -22,6 +22,10 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
+import sys
|
||||
+
|
||||
+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
|
||||
+
|
||||
"""Steam Controller XBOX360 Gamepad Emulator"""
|
||||
|
||||
from steamcontroller import \
|
||||
diff --git a/scripts/sc-test-cmsg.py b/scripts/sc-test-cmsg.py
|
||||
index 08c8481..a59fbe9 100755
|
||||
--- a/scripts/sc-test-cmsg.py
|
||||
+++ b/scripts/sc-test-cmsg.py
|
||||
@@ -26,6 +26,9 @@
|
||||
|
||||
import sys
|
||||
import struct
|
||||
+
|
||||
+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
|
||||
+
|
||||
from steamcontroller import SteamController
|
||||
|
||||
def dump(_, sci):
|
||||
diff --git a/scripts/sc-xbox.py b/scripts/sc-xbox.py
|
||||
index 814c8bc..89d4f55 100755
|
||||
--- a/scripts/sc-xbox.py
|
||||
+++ b/scripts/sc-xbox.py
|
||||
@@ -22,6 +22,10 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
+import sys
|
||||
+
|
||||
+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
|
||||
+
|
||||
"""Steam Controller XBOX360 Gamepad Emulator"""
|
||||
|
||||
from steamcontroller import \
|
@ -1,62 +0,0 @@
|
||||
commit 21abfb33340ba34de9c7266568515fc42608b339
|
||||
Author: Lukas Rusak <lorusak@gmail.com>
|
||||
Date: Fri Jan 13 14:27:18 2017 -0800
|
||||
|
||||
wait for controller
|
||||
|
||||
diff --git a/src/__init__.py b/src/__init__.py
|
||||
index 1bf111e..353f032 100644
|
||||
--- a/src/__init__.py
|
||||
+++ b/src/__init__.py
|
||||
@@ -24,7 +24,7 @@ import struct
|
||||
from enum import IntEnum
|
||||
|
||||
from threading import Timer
|
||||
-from time import time
|
||||
+from time import time, sleep
|
||||
|
||||
|
||||
VENDOR_ID = 0x28de
|
||||
@@ -121,24 +121,28 @@ class SteamController(object):
|
||||
self._cmsg = []
|
||||
self._ctx = usb1.USBContext()
|
||||
|
||||
+ _handle = None
|
||||
handle = []
|
||||
pid = []
|
||||
endpoint = []
|
||||
ccidx = []
|
||||
- for i in range(len(PRODUCT_ID)):
|
||||
- _pid = PRODUCT_ID[i]
|
||||
- _endpoint = ENDPOINT[i]
|
||||
- _ccidx = CONTROLIDX[i]
|
||||
-
|
||||
- _handle = self._ctx.openByVendorIDAndProductID(
|
||||
- VENDOR_ID, _pid,
|
||||
- skip_on_error=True,
|
||||
- )
|
||||
- if _handle != None:
|
||||
- handle.append(_handle)
|
||||
- pid.append(_pid)
|
||||
- endpoint.append(_endpoint)
|
||||
- ccidx.append(_ccidx)
|
||||
+
|
||||
+ while _handle is None:
|
||||
+ for i in range(len(PRODUCT_ID)):
|
||||
+ _pid = PRODUCT_ID[i]
|
||||
+ _endpoint = ENDPOINT[i]
|
||||
+ _ccidx = CONTROLIDX[i]
|
||||
+
|
||||
+ _handle = self._ctx.openByVendorIDAndProductID(
|
||||
+ VENDOR_ID, _pid,
|
||||
+ skip_on_error=True,
|
||||
+ )
|
||||
+ if _handle != None:
|
||||
+ handle.append(_handle)
|
||||
+ pid.append(_pid)
|
||||
+ endpoint.append(_endpoint)
|
||||
+ ccidx.append(_ccidx)
|
||||
+ sleep(2)
|
||||
|
||||
if len(handle) == 0:
|
||||
raise ValueError('No SteamControler Device found')
|
@ -1,54 +0,0 @@
|
||||
commit 5947f69820db3ce2d976ac533fb64319637d3f93
|
||||
Author: Lukas Rusak <lorusak@gmail.com>
|
||||
Date: Sat Jan 7 13:53:36 2017 -0800
|
||||
|
||||
use run for pid directory
|
||||
|
||||
diff --git a/scripts/sc-desktop.py b/scripts/sc-desktop.py
|
||||
index e0b8ec7..ad494d8 100755
|
||||
--- a/scripts/sc-desktop.py
|
||||
+++ b/scripts/sc-desktop.py
|
||||
@@ -87,9 +87,9 @@ if __name__ == '__main__':
|
||||
parser.add_argument('-i', '--index', type=int, choices=[0,1,2,3], default=None)
|
||||
args = parser.parse_args()
|
||||
if args.index != None:
|
||||
- daemon = SCDaemon('/tmp/steamcontroller{:d}.pid'.format(args.index))
|
||||
+ daemon = SCDaemon('/run/steamcontroller{:d}.pid'.format(args.index))
|
||||
else:
|
||||
- daemon = SCDaemon('/tmp/steamcontroller.pid')
|
||||
+ daemon = SCDaemon('/run/steamcontroller.pid')
|
||||
|
||||
if 'start' == args.command:
|
||||
daemon.start()
|
||||
diff --git a/scripts/sc-mixed.py b/scripts/sc-mixed.py
|
||||
index 5e25af9..c9139e7 100755
|
||||
--- a/scripts/sc-mixed.py
|
||||
+++ b/scripts/sc-mixed.py
|
||||
@@ -126,9 +126,9 @@ if __name__ == '__main__':
|
||||
parser.add_argument('-i', '--index', type=int, choices=[0,1,2,3], default=None)
|
||||
args = parser.parse_args()
|
||||
if args.index != None:
|
||||
- daemon = SCDaemon('/tmp/steamcontroller{:d}.pid'.format(args.index))
|
||||
+ daemon = SCDaemon('/run/steamcontroller{:d}.pid'.format(args.index))
|
||||
else:
|
||||
- daemon = SCDaemon('/tmp/steamcontroller.pid')
|
||||
+ daemon = SCDaemon('/run/steamcontroller.pid')
|
||||
|
||||
if 'start' == args.command:
|
||||
daemon.start()
|
||||
diff --git a/scripts/sc-xbox.py b/scripts/sc-xbox.py
|
||||
index 89d4f55..0c61b4e 100755
|
||||
--- a/scripts/sc-xbox.py
|
||||
+++ b/scripts/sc-xbox.py
|
||||
@@ -86,9 +86,9 @@ if __name__ == '__main__':
|
||||
parser.add_argument('-i', '--index', type=int, choices=[0,1,2,3], default=None)
|
||||
args = parser.parse_args()
|
||||
if args.index != None:
|
||||
- daemon = SCDaemon('/tmp/steamcontroller{:d}.pid'.format(args.index))
|
||||
+ daemon = SCDaemon('/run/steamcontroller{:d}.pid'.format(args.index))
|
||||
else:
|
||||
- daemon = SCDaemon('/tmp/steamcontroller.pid')
|
||||
+ daemon = SCDaemon('/run/steamcontroller.pid')
|
||||
|
||||
if 'start' == args.command:
|
||||
daemon.start()
|
@ -1,41 +0,0 @@
|
||||
commit 1467b7cd9d153be6680cc818b10c66967a2f0951
|
||||
Author: Lukas Rusak <lorusak@gmail.com>
|
||||
Date: Sat Jan 7 14:11:25 2017 -0800
|
||||
|
||||
steam client will never be running
|
||||
|
||||
diff --git a/src/daemon.py b/src/daemon.py
|
||||
index 964c765..fba7792 100644
|
||||
--- a/src/daemon.py
|
||||
+++ b/src/daemon.py
|
||||
@@ -9,7 +9,6 @@ import time
|
||||
import atexit
|
||||
import signal
|
||||
import syslog
|
||||
-import psutil
|
||||
import traceback
|
||||
import gc
|
||||
|
||||
@@ -92,16 +91,12 @@ class Daemon(object):
|
||||
self.daemonize()
|
||||
syslog.syslog(syslog.LOG_INFO, '{}: started'.format(os.path.basename(sys.argv[0])))
|
||||
while True:
|
||||
- # look if steam is running
|
||||
- if len([p for p in psutil.process_iter() if p.name() == 'steam']) == 0:
|
||||
- try:
|
||||
- self.run()
|
||||
- except Exception as e: # pylint: disable=W0703
|
||||
- syslog.syslog(syslog.LOG_ERR, '{}: {!s}'.format(os.path.basename(sys.argv[0]), e))
|
||||
- syslog.syslog(syslog.LOG_ERR, traceback.format_exc())
|
||||
- gc.collect()
|
||||
- else:
|
||||
- syslog.syslog(syslog.LOG_INFO, '{}: steam client is runing'.format(os.path.basename(sys.argv[0])))
|
||||
+ try:
|
||||
+ self.run()
|
||||
+ except Exception as e: # pylint: disable=W0703
|
||||
+ syslog.syslog(syslog.LOG_ERR, '{}: {!s}'.format(os.path.basename(sys.argv[0]), e))
|
||||
+ syslog.syslog(syslog.LOG_ERR, traceback.format_exc())
|
||||
+ gc.collect()
|
||||
time.sleep(2)
|
||||
|
||||
def stop(self):
|
@ -1,20 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
import subprocess
|
||||
import xbmc
|
||||
import xbmcaddon
|
||||
|
||||
|
||||
class Monitor(xbmc.Monitor):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
xbmc.Monitor.__init__(self)
|
||||
self.id = xbmcaddon.Addon().getAddonInfo('id')
|
||||
|
||||
def onSettingsChanged(self):
|
||||
subprocess.call(['systemctl', 'restart', self.id])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
Monitor().waitForAbort()
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Steam Controller driver
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/python /storage/.kodi/addons/driver.steamcontroller/bin/sc-xbox.py start
|
||||
ExecReload=/usr/bin/python /storage/.kodi/addons/driver.steamcontroller/bin/sc-xbox.py restart
|
||||
ExecStop=/usr/bin/python /storage/.kodi/addons/driver.steamcontroller/bin/sc-xbox.py stop
|
||||
PIDFile=/run/steamcontroller.pid
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user