Set PPI/DPI for HDMI 4K TV screen

Hi there,

I’ve tried every setting for my HDMI Output on a Intel NUC. I get a crisp 4K signal@60hz a the tv-screen, so all seems to be good. I use Balena Dashboard, and it runs great - it shows a dashboard webpage. The html supports the 4K resolution just fine, but the ppi is incorrect. Text is too small. It used to look good on a clean Ubuntu, so it’s got to have something to do with the Balena settings I think.

Ideally I would like to just output a clean HD signal instead of the 4K, and then the TV could just scale it up. But when I set HDMI output to 1080x1920 - the NUC outputs at full 4K signal, and place the HD content on the top left corner… I can see in the tv-menu that the signal is endeed 4K.

Can I somehow force 1080x1920 output somewhere else than in the variables in the Balena cloud dashboard?

Hey @Pemmi

Welcome to the forums!

I use Balena Dashboard

I don’t want to assume anything so can you please confirm that you are using the balenaDash project

Thanks

Hi Rahul, and thank you.

You are absolutely right; I do use the balenaDash project (https://github.com/balenalabs/balena-dash)

Thanks :slight_smile:

Hey @Pemmi as far as I can tell we don’t have a method for you to do this out of the box, but it should definitely be possible and we’d like to hear what works if you do figure it out.

It’s hard to give a step by step method to achieve this without your exact hardware setup but I’d recommend taking a look at both the fbset and xrandr utilities. One of these should be able to change the resolution of the display. You may also be able to write directly to /sys/class/display/mode with something like echo 1080p60hz > /sys/class/display/mode. To access this from a container you’d need to add the io.balena.features.sysfs label to the compose file as mentioned here.

I hope this gives some pointers to help figure this out but do post again if you need more help!

Thanks!

Trying to understand the way this works on a x86 generic image; on an Intel Compute Stick, using the built in HDMI output. On all of my HD tv screens this works perfect - but the issue persists on the 4K tv. Cannot force HD format output.
I cannot find the /display folder when I login into the device via the Balena dashboard (terminal -> kiosk). Am I missing something?

When I try to read out HDMI settings I with xrandr, I just get “Can’t open display” …?
Thank you for helping :slight_smile:

Hi Peer

Have you added the label as Chris suggested and tried to debug it with writing to /sys/class/display?

Hi,

you mention the site looking good on Ubuntu. Would you be able and willing to check whether Ubuntu has scaling (and fractional scaling) enabled in display settings? This might be the reason why the fonts are bigger. Eventually you could try setting the scale to 100% and you should get the same behavior as with balenaDash.

I cannot at the moment, as I have only one 4K screen. But it did output 1080px image, when asked, to the 4K screen. The NUC will not output anyting else than 4K. Just tried the same build on a pc (generic Lenovo), and it outputs HD just fine to the 4K display.

How can I play around with the xrandr command on Balena? :slight_smile:

Yes I tried :slight_smile: But the folder “display” doesn’t show when accessing via dashboard Terminal → kiosk → command line

xrandr is not included in the host operating system, balenaOS, so you’d have to build a container with it, and then ensure the container is ‘privileged’ and the io.balena.features.sysfs label is added as Chris mentioned. Then, you could carry out your experiments from within the container.

Thanks for explanation. I am total newbie to balena, can you please provide an example how docker-compose should look like with the service xrandr ?

Thanks!

Hey @przemek83 welcome to the forums. You’ll just need to create a standard Debian container and install the package that contains xrandr, which looks like it’s present in x11-server-utils.

So a Dockerfile would look like:

FROM %%BALENA_MACHINE_NAME%%

RUN install_packages x11-server-utils

CMD ['balena-idle']

You could then connect to that container using the terminal from the dashboard and use the tool manually, or write a script to make any changes.

Great! Thanks for the explanation!