From 5da8db8f5aa6a99046cefa6b7c9b1a7ae0ca4774 Mon Sep 17 00:00:00 2001 From: paddywwoof Date: Mon, 23 Sep 2024 17:37:12 +0100 Subject: [PATCH 1/5] model missing use_sdl2 key, might error if upgrade without altering config --- src/picframe/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/picframe/model.py b/src/picframe/model.py index 55ebf33..069c3a4 100644 --- a/src/picframe/model.py +++ b/src/picframe/model.py @@ -32,6 +32,7 @@ 'display_h': None, 'display_power': 0, 'use_glx': False, # default=False. Set to True on linux with xserver running + 'use_sdl2': False, 'test_key': 'test_value', 'mat_images': True, 'mat_type': None, From 4bd87dbd8aa6f2233c79476fb49d6b67203b7935 Mon Sep 17 00:00:00 2001 From: paddywwoof Date: Sun, 13 Oct 2024 13:49:18 +0100 Subject: [PATCH 2/5] third display_power option to use wlr-randr i.e. for RPi5 wayland desktop --- src/picframe/config/configuration_example.yaml | 2 +- src/picframe/viewer_display.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/picframe/config/configuration_example.yaml b/src/picframe/config/configuration_example.yaml index 7e22b9d..d331a28 100644 --- a/src/picframe/config/configuration_example.yaml +++ b/src/picframe/config/configuration_example.yaml @@ -22,7 +22,7 @@ viewer: display_y: 0 # offset from top of screen (can be negative) display_w: null # width of display surface (null->None will use max returned by hardware) display_h: null # height of display surface - display_power: 0 # default=0. choices={0, 1}, 0 will use legacy `vcgencmd` and 1 will use `xset` to blank the display + display_power: 0 # default=0. choices={0, 1, 2}, 0 will use legacy `vcgencmd`, 1 will use `xset`, 2 will use 'wlr-randr' to blank the display use_glx: False # default=False. Set to True on linux with xserver running. NB use_sdl2 might need to be False for this to work. use_sdl2: False # default=True. pysdl2 can use display without xserver, it should be installed as a dependency of pi3d # but might need `sudo apt install libsdl2-dev` if picframe gives errors about missing sdl2 diff --git a/src/picframe/viewer_display.py b/src/picframe/viewer_display.py index 95e73ce..1cf3cc9 100644 --- a/src/picframe/viewer_display.py +++ b/src/picframe/viewer_display.py @@ -154,6 +154,14 @@ def display_is_on(self, on_off): except Exception as e: self.__logger.debug("Display ON/OFF is xset via dpms, but an error occured") self.__logger.debug("Cause: %s", e) + elif self.__display_power == 2: + try: # try wlr-randr for RPi5 with wayland desktop + wlr_randr_cmd = ["wlr-randr", "--output", "HDMI-A-1"] + wlr_randr_cmd.append('--on' if on_off else '--off') + subprocess.call(wlr_randr_cmd) + except Exception as e: + self.__logger.debug("Display ON/OFF is wlr-randr, but an error occured") + self.__logger.debug("Cause: %s", e) else: self.__logger.warning("Unsupported setting for display_power=%d.", self.__display_power) From 726d0cbc394bec3fb9d1460e204da9930f895032 Mon Sep 17 00:00:00 2001 From: paddywwoof Date: Sun, 13 Oct 2024 15:52:07 +0100 Subject: [PATCH 3/5] sdl2 option needs pi3d v 2.52 for edge case FULLSCREEN_DESKTOP --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1e6b06d..b5c5b4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dynamic = ["version"] dependencies = [ "Pillow>=10.2.0", "defusedxml", - "pi3d>=2.51", + "pi3d>=2.52", "PyYAML", "paho-mqtt", "IPTCInfo3", @@ -76,4 +76,4 @@ style = "pep440" versionfile_source = "src/picframe/_version.py" versionfile_build = "picframe/_version.py" tag_prefix = "" -parentdir_prefix = "picframe-" \ No newline at end of file +parentdir_prefix = "picframe-" From 05cae0c088a49fe9f9543bdeec3d164f40c17e77 Mon Sep 17 00:00:00 2001 From: helgeerbe Date: Fri, 1 Nov 2024 12:51:00 +0100 Subject: [PATCH 4/5] feat: fixes on the default settings, as wayland becomes standard display_power=2 use_sdl2: True --- src/picframe/config/configuration_example.yaml | 4 ++-- src/picframe/model.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/picframe/config/configuration_example.yaml b/src/picframe/config/configuration_example.yaml index d331a28..8f11440 100644 --- a/src/picframe/config/configuration_example.yaml +++ b/src/picframe/config/configuration_example.yaml @@ -22,9 +22,9 @@ viewer: display_y: 0 # offset from top of screen (can be negative) display_w: null # width of display surface (null->None will use max returned by hardware) display_h: null # height of display surface - display_power: 0 # default=0. choices={0, 1, 2}, 0 will use legacy `vcgencmd`, 1 will use `xset`, 2 will use 'wlr-randr' to blank the display + display_power: 2 # default=0. choices={0, 1, 2}, 0 will use legacy `vcgencmd`, 1 will use `xset`, 2 will use 'wlr-randr' to blank the display use_glx: False # default=False. Set to True on linux with xserver running. NB use_sdl2 might need to be False for this to work. - use_sdl2: False # default=True. pysdl2 can use display without xserver, it should be installed as a dependency of pi3d + use_sdl2: True # default=True. pysdl2 can use display without xserver, it should be installed as a dependency of pi3d # but might need `sudo apt install libsdl2-dev` if picframe gives errors about missing sdl2 mat_images: 0.01 # default=0.01, True, automatically mat all images. False, don't automatically mat any images. Real value, auto-mat all images with aspect ratio difference > than value diff --git a/src/picframe/model.py b/src/picframe/model.py index 069c3a4..30b544f 100644 --- a/src/picframe/model.py +++ b/src/picframe/model.py @@ -30,9 +30,9 @@ 'display_y': 0, 'display_w': None, 'display_h': None, - 'display_power': 0, + 'display_power': 2, 'use_glx': False, # default=False. Set to True on linux with xserver running - 'use_sdl2': False, + 'use_sdl2': True, 'test_key': 'test_value', 'mat_images': True, 'mat_type': None, From 94386eea3d84bfbcab0a64f51990f7b0ec0dd8d3 Mon Sep 17 00:00:00 2001 From: helgeerbe Date: Fri, 1 Nov 2024 12:55:37 +0100 Subject: [PATCH 5/5] build: drop support for python < 3.11 --- pyproject.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b5c5b4a..8ebc7b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,10 +28,8 @@ classifiers=[ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Multimedia :: Graphics :: Viewers", ] dynamic = ["version"]