Open Nurgak opened 3 weeks ago
Here is a request about this: https://github.com/MichaIng/DietPi/issues/5585
In addition, since KMS is mandatory for Chromium, can you try whether it works (instead of using any X config or xrandr
) to add
video=HDMI-A-1:768x1024,rotate=90
to /boot/cmdline.txt
(space-separated). In case it is not the right HDMI display, find the correct one in /sys/class/drm/
, and adjust the resolution as intended. I am actually not sure whether the values need to be inverted with rotate=90
.
@MichaIng
Thank you for the reference and the information. I have tried different options in /boot/cmdline.txt
, but none work the way I expect. Before Chromium starts the screen resolution is maxed out no matter what options I use.
However, I found the option that does what I need:
dietpi.txt
SOFTWARE_CHROMIUM_RES_X=720
SOFTWARE_CHROMIUM_RES_Y=1280
config.txt
framebuffer_width=720
framebuffer_height=1280
display_hdmi_rotate=1
In dietpi-config
set Display Options -> Display Resolution to 720p
. When set to vc4-kms-v3d
it does not work.
I wonder if I can get graphical acceleration working in Chromium without setting vc4-kms-v3d
...
Just to update this question with my experience so far:
/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh
to have OpenGL acceleration enabled (RPi4).
DISPLAY
environment variable is not set, or OpenGL will not be available.dietpi.txt
, cmdline.txt
or config.txt
options that would allow screen resolution/orientation definition for Chromium in Kiosk mode, it will be reset to the maximum in landscape upon the script execution.
xrandr -d :0 -o right -s 1280x900
once Chomium is started./var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh
) has flawed instructions on how to customize the options: CHROMIUM_OPTS+=' --...'
does not work (options are not appended, they are ignored).
CHROMIUM_OPTS="${CHROMIUM_OPTS} --..."
.@Nurgak I forgot the video
option 🙈, can you try with this:
video=HDMI-A-1:768x1024,rotate=90
Hence same but with the actual option video=
prefixed, as the remains are a value of this option.
About your points:
/boot/cmdline.txt
.var+=value
is bash
-only, while the script is executed with dash
since a while, so that this line throws a syntax error. Fixed with: https://github.com/MichaIng/DietPi/commit/497d95d@MichaIng Thank you for the correction and help.
I tried to add the option to /boot/cmdline.txt
, it did have an effect while booting (console view), but the screen resolution/orientation was reset to maximum and portrait mode when Chromium started, as before.
I always start from a fresh DietPi flash, and reboot it for good measure, but the configuration is not what I expect.
Calling the xrandr
command, after Chromium has started, is the only thing that helps right now.
@Nurgak can you share your diff of chromium-autostart.sh
? I'm trying to achieve the same result, but resolution is not changing.
@cadavre I did not touch chromium-autostart.sh
, ideally I would not want to as it's a generated file.
The resolution can only be set using xrandr -d :0 -o right -s 1280x900
from the command line. Perhaps this command can be added to chromium-autostart.sh
?
Creating a feature request
Is your feature request related to a problem? Please describe:
In Kiosk mode, sometimes it is useful to set a custom resolution and orientation, rather than the maximum and landscape.
However, currently the Kiosk mode will force the screen resolution to the maximum and orientation to landscape. The only way to change it is via
xrand
, such asxrandr -d :0 -o right -s 1280x900
. This needs to be called every time when Kiosk mode starts.I'm sure there is a more elegant way to do it, but I have not been successful finding it. The settings in
/boot/config.txt
(RPi-specific?) only apply for the command line, not in Kiosk mode. Generally speaking, the browser itself should always be maximized in Kiosk mode, so this issue is related.Describe the solution you'd like:
Ideally, I'd like the settings in
/boot/config.txt
to apply in Kiosk mode, both for the screen size as well as orientation.Describe alternatives you've considered:
I considered modifying the Kiosk mode startup script in
/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh
, to addxrandr -d :0 -o right -s 1280x900
, but I don't like it because this cannot be configured before first boot.Additional context
My use-case is to display some JavaScript animation. More pixels to refresh is more demanding, and will slow down the animation. Having a more "pixelated" screen is not an issue. This is why a lower screen resolution is useful for me (also portrait orientation).
Related request: I'd like the
CHROMIUM_OPTS
of the Kiosk mode to be exposed (uncommented) so it could be configured before first boot indietpi.txt
. This is useful as it allows to hide the cursor (and other improvements).