From 9e06f4ff82039d28a73755ad5bf633ca32d1c802 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Thu, 23 Nov 2023 20:07:06 +0100 Subject: [PATCH 01/12] rock mods --- .github/workflows/build_package_Rock5.yml | 1 + app/main.cpp | 4 +++- app/util/qopenhd.cpp | 8 ++++++++ app/util/qopenhd.h | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_package_Rock5.yml b/.github/workflows/build_package_Rock5.yml index 2c083d313..d091f3755 100644 --- a/.github/workflows/build_package_Rock5.yml +++ b/.github/workflows/build_package_Rock5.yml @@ -6,6 +6,7 @@ on: - "2.5-evo" - "dev-release" - "release" + - "experiments" paths-ignore: - '**.md' - '**.asciidoc' diff --git a/app/main.cpp b/app/main.cpp index ae7f34f9f..e1ba977bd 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -205,13 +205,15 @@ int main(int argc, char *argv[]) { QSettings settings; qDebug()<<"Storing settings at ["< Date: Thu, 23 Nov 2023 20:48:53 +0100 Subject: [PATCH 02/12] Update install_build_dep.sh --- install_build_dep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_build_dep.sh b/install_build_dep.sh index f89ffdf6b..ceeca2286 100755 --- a/install_build_dep.sh +++ b/install_build_dep.sh @@ -17,7 +17,7 @@ function install_x86_packages { PLATFORM_PACKAGES="qml-module-qt-labs-platform" } function install_rock_packages { -PLATFORM_PACKAGES="qml-module-qt-labs-platform" +PLATFORM_PACKAGES="gst-latest qml-module-qt-labs-platform" } # Add OpenHD Repository platform-specific packages From 77c8663c0dd41d05bce0d64d39b9a00082f417a6 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:21:59 +0100 Subject: [PATCH 03/12] remove logging --- install_build_dep.sh | 1 + systemd/rock3_qopenhd.service | 1 - systemd/rock5_qopenhd.service | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/install_build_dep.sh b/install_build_dep.sh index ceeca2286..e1c1dd713 100755 --- a/install_build_dep.sh +++ b/install_build_dep.sh @@ -23,6 +23,7 @@ PLATFORM_PACKAGES="gst-latest qml-module-qt-labs-platform" # Add OpenHD Repository platform-specific packages apt install -y curl curl -1sLf 'https://dl.cloudsmith.io/public/openhd/release/setup.deb.sh'| sudo -E bash + curl -1sLf 'https://dl.cloudsmith.io/public/openhd/dev-release/setup.deb.sh'| sudo -E bash apt update # Main function diff --git a/systemd/rock3_qopenhd.service b/systemd/rock3_qopenhd.service index d8c02bd16..357bd1392 100644 --- a/systemd/rock3_qopenhd.service +++ b/systemd/rock3_qopenhd.service @@ -5,7 +5,6 @@ After=multi-user.target [Service] Type=simple Environment="QT_QPA_EGLFS_KMS_ATOMIC=1" -Environment="QT_LOGGING_RULES=qt.qpa.egl*=true" Environment="QT_QPA_EGLFS_KMS_PLANE_INDEX=1" Environment="QT_QPA_EGLFS_FORCE888=1" Environment="QT_QPA_EGLFS_SWAPINTERVAL=0" diff --git a/systemd/rock5_qopenhd.service b/systemd/rock5_qopenhd.service index ea8303487..d73626a05 100644 --- a/systemd/rock5_qopenhd.service +++ b/systemd/rock5_qopenhd.service @@ -5,7 +5,6 @@ After=multi-user.target [Service] Type=simple Environment="QT_QPA_EGLFS_KMS_ATOMIC=1" -Environment="QT_LOGGING_RULES=qt.qpa.egl*=true" Environment="QT_QPA_EGLFS_KMS_PLANE_INDEX=5" Environment="QT_QPA_EGLFS_FORCE888=1" Environment="QT_QPA_EGLFS_SWAPINTERVAL=0" From ecf6050aca941d7f4e797da22e13f047c5356d62 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:45:01 +0100 Subject: [PATCH 04/12] Update qopenhd.cpp --- app/util/qopenhd.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/util/qopenhd.cpp b/app/util/qopenhd.cpp index 4a4e3d9b3..c88902391 100644 --- a/app/util/qopenhd.cpp +++ b/app/util/qopenhd.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -305,11 +306,16 @@ bool QOpenHD::is_platform_rpi() bool QOpenHD::is_platform_rock() { -#ifdef IS_PLATFORM_Rock - return true; -#else - return false; -#endif +const char* rockPlatformPath = "/usr/local/share/openhd/platform/rock/"; + struct stat info; + if (stat(rockPlatformPath, &info) != 0) { + return false; + } + if (info.st_mode & S_IFDIR) { + return true; + } else { + return false; + } } void QOpenHD::keep_screen_on(bool on) From 0f315df50630eea1f74b4b0d060c5d5fbd96f833 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Thu, 23 Nov 2023 22:11:13 +0100 Subject: [PATCH 05/12] Update build_chroot.sh --- build_chroot.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build_chroot.sh b/build_chroot.sh index 481fc4fda..06a7bdee6 100644 --- a/build_chroot.sh +++ b/build_chroot.sh @@ -5,6 +5,7 @@ sudo apt install -y python3-pip git sudo pip3 install --upgrade cloudsmith-cli bash install_build_dep.sh rock5 +mkdir -p /usr/local/share/openhd/platform/rock/ sudo ./package.sh arm64 debian bullseye-rock5 || exit 1 mkdir -p /opt/out/ cp -v *.dep /opt/out/ From 5a21bc9b02d0d1049fc84ab3f9a65e109f1ffcb1 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Thu, 23 Nov 2023 22:23:26 +0100 Subject: [PATCH 06/12] use hw-decode on the rock platforms --- app/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/main.cpp b/app/main.cpp index e1ba977bd..53e75de70 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -212,7 +212,16 @@ int main(int argc, char *argv[]) { settings.setValue("global_scale",0.7); } } - + if(QOpenHD::instance().is_platform_rock()){ + if(!settings.value("dev_rpi_use_external_omx_decode_service",true).toBool()){ + qDebug()<<"Disabling RPI decode!"; + settings.setValue("dev_rpi_use_external_omx_decode_service",false); + } + if(!settings.value("dev_always_use_generic_external_decode_service",false).toBool()){ + qDebug()<<"Enable rockchip HW decoding!"; + settings.setValue("dev_always_use_generic_external_decode_service",true); + } + } const int screen_custom_font_dpi = settings.value("screen_custom_font_dpi").toInt(); if (screen_custom_font_dpi) { From 4a5abe3cf3083eebfa5a903244d237a5ee60241a Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Fri, 24 Nov 2023 00:24:55 +0100 Subject: [PATCH 07/12] Update build_chroot.sh --- build_chroot.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build_chroot.sh b/build_chroot.sh index 06a7bdee6..46bce5313 100644 --- a/build_chroot.sh +++ b/build_chroot.sh @@ -2,6 +2,7 @@ #This file is the install instruction for the CHROOT build #We're using cloudsmith-cli to upload the file in CHROOT +echo "____________build like a rockSTAR___________" sudo apt install -y python3-pip git sudo pip3 install --upgrade cloudsmith-cli bash install_build_dep.sh rock5 From 718ffa5a00a5dfee52ed91c7d7d90ca2518a13b2 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Fri, 24 Nov 2023 00:40:28 +0100 Subject: [PATCH 08/12] simple packageconfig --- app/util/qopenhd.cpp | 15 +++++---------- app/videostreaming/avcodec/avcodec_video.pri | 3 +++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/util/qopenhd.cpp b/app/util/qopenhd.cpp index c88902391..114dc60c9 100644 --- a/app/util/qopenhd.cpp +++ b/app/util/qopenhd.cpp @@ -306,16 +306,11 @@ bool QOpenHD::is_platform_rpi() bool QOpenHD::is_platform_rock() { -const char* rockPlatformPath = "/usr/local/share/openhd/platform/rock/"; - struct stat info; - if (stat(rockPlatformPath, &info) != 0) { - return false; - } - if (info.st_mode & S_IFDIR) { - return true; - } else { - return false; - } +#ifdef IS_PLATFORM_ROCK + return true; +#else + return false; +#endif } void QOpenHD::keep_screen_on(bool on) diff --git a/app/videostreaming/avcodec/avcodec_video.pri b/app/videostreaming/avcodec/avcodec_video.pri index a29142325..7de028bd7 100644 --- a/app/videostreaming/avcodec/avcodec_video.pri +++ b/app/videostreaming/avcodec/avcodec_video.pri @@ -32,6 +32,9 @@ CONFIG += link_pkgconfig packagesExist(mmal) { DEFINES += IS_PLATFORM_RPI } +packagesExist(mali) { + DEFINES += IS_PLATFORM_ROCK +} # can be used in c++, also set to be exposed in qml DEFINES += QOPENHD_ENABLE_VIDEO_VIA_AVCODEC From 051402faa6bfe760e49b4ec8bad395c2eb2b8283 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Fri, 24 Nov 2023 00:43:15 +0100 Subject: [PATCH 09/12] Update install_build_dep.sh --- install_build_dep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_build_dep.sh b/install_build_dep.sh index e1c1dd713..df8060319 100755 --- a/install_build_dep.sh +++ b/install_build_dep.sh @@ -17,7 +17,7 @@ function install_x86_packages { PLATFORM_PACKAGES="qml-module-qt-labs-platform" } function install_rock_packages { -PLATFORM_PACKAGES="gst-latest qml-module-qt-labs-platform" +PLATFORM_PACKAGES="qml-module-qt-labs-platform" } # Add OpenHD Repository platform-specific packages From 49f1007a518d3641f8d20d9ca7542a4f2c8d2594 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Fri, 24 Nov 2023 03:01:39 +0100 Subject: [PATCH 10/12] test --- app/videostreaming/avcodec/avcodec_video.pri | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/videostreaming/avcodec/avcodec_video.pri b/app/videostreaming/avcodec/avcodec_video.pri index 7de028bd7..d3f06e5e9 100644 --- a/app/videostreaming/avcodec/avcodec_video.pri +++ b/app/videostreaming/avcodec/avcodec_video.pri @@ -32,9 +32,13 @@ CONFIG += link_pkgconfig packagesExist(mmal) { DEFINES += IS_PLATFORM_RPI } +# Check if mali package exists +message(Mali package exists: $$packagesExist(mali)) + +# If the mali package exists, define IS_PLATFORM_ROCK packagesExist(mali) { DEFINES += IS_PLATFORM_ROCK + message(IS_PLATFORM_ROCK defined because mali package exists) } - # can be used in c++, also set to be exposed in qml DEFINES += QOPENHD_ENABLE_VIDEO_VIA_AVCODEC From 0040214d63d0c5d6aca7a118d8ddce07092735e5 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Fri, 24 Nov 2023 03:37:43 +0100 Subject: [PATCH 11/12] Update avcodec_video.pri --- app/videostreaming/avcodec/avcodec_video.pri | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/videostreaming/avcodec/avcodec_video.pri b/app/videostreaming/avcodec/avcodec_video.pri index d3f06e5e9..ef46819a7 100644 --- a/app/videostreaming/avcodec/avcodec_video.pri +++ b/app/videostreaming/avcodec/avcodec_video.pri @@ -32,13 +32,13 @@ CONFIG += link_pkgconfig packagesExist(mmal) { DEFINES += IS_PLATFORM_RPI } -# Check if mali package exists -message(Mali package exists: $$packagesExist(mali)) -# If the mali package exists, define IS_PLATFORM_ROCK -packagesExist(mali) { - DEFINES += IS_PLATFORM_ROCK - message(IS_PLATFORM_ROCK defined because mali package exists) +exists(/usr/local/share/openhd/platform/rock/) { + message(This is a Rock) + DEFINES += IS_PLATFORM_ROCK +} else { + message(This is not a Rock) } + # can be used in c++, also set to be exposed in qml DEFINES += QOPENHD_ENABLE_VIDEO_VIA_AVCODEC From 5769710cbdad7800fcf378619eeda9388ce601a4 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:18:31 +0100 Subject: [PATCH 12/12] fix fonts --- systemd/rock3_qopenhd.service | 1 + systemd/rock5_qopenhd.service | 1 + 2 files changed, 2 insertions(+) diff --git a/systemd/rock3_qopenhd.service b/systemd/rock3_qopenhd.service index 357bd1392..ab1b5d71f 100644 --- a/systemd/rock3_qopenhd.service +++ b/systemd/rock3_qopenhd.service @@ -5,6 +5,7 @@ After=multi-user.target [Service] Type=simple Environment="QT_QPA_EGLFS_KMS_ATOMIC=1" +Environment="FONTCONFIG_PATH=/etc/fonts" Environment="QT_QPA_EGLFS_KMS_PLANE_INDEX=1" Environment="QT_QPA_EGLFS_FORCE888=1" Environment="QT_QPA_EGLFS_SWAPINTERVAL=0" diff --git a/systemd/rock5_qopenhd.service b/systemd/rock5_qopenhd.service index d73626a05..24341fd12 100644 --- a/systemd/rock5_qopenhd.service +++ b/systemd/rock5_qopenhd.service @@ -4,6 +4,7 @@ After=multi-user.target [Service] Type=simple +Environment="FONTCONFIG_PATH=/etc/fonts" Environment="QT_QPA_EGLFS_KMS_ATOMIC=1" Environment="QT_QPA_EGLFS_KMS_PLANE_INDEX=5" Environment="QT_QPA_EGLFS_FORCE888=1"