From afeaaa0cb2808db2331e290ee8186d5b0fc6af8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Wed, 29 Jan 2025 12:10:08 +0200 Subject: [PATCH] Add a temp fix for audio issues with Qt 6.8.1 See https://bugreports.qt.io/browse/QTBUG-130273 for a discussion and the suggested "dirty workaround", which is applied here. --- kiosk/kiosk_browser/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kiosk/kiosk_browser/__init__.py b/kiosk/kiosk_browser/__init__.py index 25e22bc4..2fa7f128 100644 --- a/kiosk/kiosk_browser/__init__.py +++ b/kiosk/kiosk_browser/__init__.py @@ -1,4 +1,5 @@ import sys +import os import logging import signal from PyQt6.QtCore import Qt, QUrl @@ -7,10 +8,22 @@ from kiosk_browser import main_widget +# Workaround for https://bugreports.qt.io/browse/QTBUG-130273 in Qt 6.8.1 +# Should be fixed with QT 6.8.2 +# Note: doing this via env variables rather than passing `--webEngineArgs`, +# because the env variable overrides the args (and so is easy to break in tests, +# etc) +def tempFixAudioIssues(): + curFlags = os.environ.get('QTWEBENGINE_CHROMIUM_FLAGS', "") + os.environ['QTWEBENGINE_CHROMIUM_FLAGS'] = curFlags + " --disable-features=FFmpegAllowLists" + + def start(kiosk_url, settings_url, toggle_settings_key, fullscreen = True): logging.basicConfig(level=logging.INFO) + tempFixAudioIssues() + app = QApplication(sys.argv) app.setApplicationName("kiosk-browser")