# Set PPI/DPI for HDMI 4K TV screen

**URL:** <https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329>\
**Category:** balenaOS\
**Created:** [December 1, 2020, 11:31am UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329 "2020-12-01T11:31:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pemmi](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@Pemmi](https://forums.balena.io/u/Pemmi)\
**Post date:** [December 1, 2020, 11:31am UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/1 "2020-12-01T11:31:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rahul-thakoor](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahul-thakoor](https://forums.balena.io/u/rahul-thakoor)\
**Post date:** [December 2, 2020, 5:07am UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/6 "2020-12-02T05:07:35Z")

</div>

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](https://github.com/balenalabs/balena-dash)

Thanks

---

<div class="post-metadata">

**Author:** ![Pemmi](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@Pemmi](https://forums.balena.io/u/Pemmi)\
**Post date:** [December 2, 2020, 7:35am UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/8 "2020-12-02T07:35:53Z")

</div>

Hi Rahul, and thank you.

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

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [December 2, 2020, 4:59pm UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/13 "2020-12-02T16:59:54Z")

</div>

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](https://www.balena.io/docs/reference/supervisor/docker-compose/#labels).

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

---

<div class="post-metadata">

**Author:** ![Pemmi](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@Pemmi](https://forums.balena.io/u/Pemmi)\
**Post date:** [December 3, 2020, 8:41am UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/15 "2020-12-03T08:41:50Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![anujdeshpande](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/anujdeshpande/32/3155_2.png) [@anujdeshpande](https://forums.balena.io/u/anujdeshpande)\
**Post date:** [December 3, 2020, 9:18am UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/19 "2020-12-03T09:18:31Z")

</div>

Hi Peer

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

---

<div class="post-metadata">

**Author:** ![mtoman](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mtoman/32/3599_2.png) [@mtoman](https://forums.balena.io/u/mtoman)\
**Post date:** [December 3, 2020, 11:21am UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/22 "2020-12-03T11:21:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Pemmi](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@Pemmi](https://forums.balena.io/u/Pemmi)\
**Post date:** [December 3, 2020, 12:03pm UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/23 "2020-12-03T12:03:26Z")

</div>

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? 🙂

---

<div class="post-metadata">

**Author:** ![Pemmi](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@Pemmi](https://forums.balena.io/u/Pemmi)\
**Post date:** [December 3, 2020, 12:07pm UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/24 "2020-12-03T12:07:44Z")

</div>

> [@chrisys](#):
>
> echo 1080p60hz \> /sys/class/display/mode

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

---

<div class="post-metadata">

**Author:** ![dtischler](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dtischler/32/2483_2.png) [@dtischler](https://forums.balena.io/u/dtischler)\
**Post date:** [December 4, 2020, 11:27pm UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/26 "2020-12-04T23:27:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![przemek83](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/przemek83/32/5171_2.png) [@przemek83](https://forums.balena.io/u/przemek83)\
**Post date:** [December 31, 2020, 2:56am UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/28 "2020-12-31T02:56:40Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [December 31, 2020, 4:18pm UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/29 "2020-12-31T16:18:00Z")

</div>

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](https://packages.debian.org/buster/x11-xserver-utils).

So a `Dockerfile` would look like:

```auto
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.

---

<div class="post-metadata">

**Author:** ![przemek83](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/przemek83/32/5171_2.png) [@przemek83](https://forums.balena.io/u/przemek83)\
**Post date:** [December 31, 2020, 5:19pm UTC](https://forums.balena.io/t/set-ppi-dpi-for-hdmi-4k-tv-screen/217329/30 "2020-12-31T17:19:37Z")

</div>

Great! Thanks for the explanation!
