Merge pull request #4665 from mglae/le10_chrome_audio

chrome: fix default audio device detection
This commit is contained in:
CvH 2020-11-18 11:12:47 +01:00 committed by GitHub
commit 3e933d404c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 21 deletions

View File

@ -12,7 +12,8 @@ PKG_DEPENDS_TARGET="toolchain atk dbus glib libXtst"
PKG_LONGDESC="Protocol definitions and daemon for D-Bus at-spi." PKG_LONGDESC="Protocol definitions and daemon for D-Bus at-spi."
PKG_MESON_OPTS_TARGET="-Denable_docs=false \ PKG_MESON_OPTS_TARGET="-Denable_docs=false \
-Denable-introspection=no" -Denable-introspection=no \
-Ddbus_daemon=/usr/bin/dbus-daemon"
pre_configure_target() { pre_configure_target() {
TARGET_LDFLAGS="$LDFLAGS -lXext" TARGET_LDFLAGS="$LDFLAGS -lXext"

View File

@ -1,3 +1,6 @@
103
- fix getting default audio device
102 102
- add dark mode at options - add dark mode at options
- support for latest Chrome - support for latest Chrome

View File

@ -3,7 +3,7 @@
PKG_NAME="chrome" PKG_NAME="chrome"
PKG_VERSION="1.0" PKG_VERSION="1.0"
PKG_REV="102" PKG_REV="103"
PKG_ARCH="x86_64" PKG_ARCH="x86_64"
PKG_LICENSE="Custom" PKG_LICENSE="Custom"
PKG_SITE="http://www.google.com/chrome" PKG_SITE="http://www.google.com/chrome"

View File

@ -7,11 +7,9 @@ import sys
import time import time
import xbmcaddon import xbmcaddon
import subprocess import subprocess
from xml.dom.minidom import parse import json
sys.path.append('/usr/share/kodi/addons/@DISTRO_PKG_SETTINGS_ID@') import xbmc
import oe
__addon__ = xbmcaddon.Addon(); __addon__ = xbmcaddon.Addon();
__path__ = os.path.join(__addon__.getAddonInfo('path'), 'bin') + '/' __path__ = os.path.join(__addon__.getAddonInfo('path'), 'bin') + '/'
@ -49,7 +47,7 @@ def startchrome(args):
__addon__.getSetting('HOMEPAGE') __addon__.getSetting('HOMEPAGE')
subprocess.call(__path__ + 'chrome-start ' + chrome_params, shell=True, env=new_env) subprocess.call(__path__ + 'chrome-start ' + chrome_params, shell=True, env=new_env)
except Exception as e: except Exception as e:
oe.dbg_log('chrome', e) xbmc.log('## Chrome Error:' + repr(e), xbmc.LOGERROR)
def isRuning(pname): def isRuning(pname):
tmp = os.popen("ps -Af").read() tmp = os.popen("ps -Af").read()
@ -59,21 +57,22 @@ def isRuning(pname):
return False return False
def getAudioDevice(): def getAudioDevice():
try: dev = json.loads(xbmc.executeJSONRPC(json.dumps({
dom = parse("/storage/.kodi/userdata/guisettings.xml") "jsonrpc": "2.0",
audiooutput=dom.getElementsByTagName('audiooutput') "method": "Settings.GetSettingValue",
for node in audiooutput: "params": {
dev = node.getElementsByTagName('audiodevice')[0].childNodes[0].nodeValue "setting": "audiooutput.audiodevice",
if dev.startswith("ALSA:"): },
dev = dev.split("ALSA:")[1] "id": 1,
if dev == "@": })))['result']['value']
return None if dev.startswith("ALSA:"):
if dev.startswith("@:"): dev = dev.split("ALSA:")[1]
dev = dev.split("@:")[1] if dev == "@":
else:
# not ALSA
return None return None
except: if dev.startswith("@:"):
dev = dev.split("@:")[1]
else:
# not ALSA
return None return None
if dev.startswith("CARD="): if dev.startswith("CARD="):
dev = "plughw:" + dev dev = "plughw:" + dev
@ -100,3 +99,4 @@ else:
time.sleep(1) time.sleep(1)
resumeXbmc() resumeXbmc()
del __addon__