[Samsung Galaxy S8 Guides, News, & Discussion] Natrox:
Hello everyone. I've been looking around for ages to find out how to run DeX mode at my TV's resolution (3840x2160). I just wasn't satisfied with the FHD (1080p) limitation and was annoyed that WQHD (1440p) was greyed out (my TV did not support this resolution).

After buying multiple docks, messing with APKs, fiddling around in the terminal and endless amounts of frustration; I've finally found a work-around that will allow DeX to display a decent picture at UDH (2080p).

Before you get too excited, you should know this:

DeX CAN NOT natively render at 4k on the Galaxy S8. It is limited to its internal rendering resolution of 1440p. What you'll see is 1440p upscaled to 2160p (or whichever resolution you choose) by the phone.

You will need to repeat this trick every time you want to reach your desired resolution after re-connecting to your TV/monitor.

This will make your phone run hot, I have only tried this with success on the official Samsung DeX pad, which has fans to cool your phone.

Due to the 1440p limitation, you cannot actually view 4k content using DeX. You can verify this limitation by making a screenshot of your DeX desktop; it will be in 2560x1440.

The upscaling is performance-intensive, don't be surprised if you encounter some stuttering.

I have only tested this on the Exynos model of the Galaxy S8. I have also only tested 3840x2160.

You do this at your own risk. You agree that I will not be held responsible if things don't work or go wrong.

Now, that said, there is still benefit in this. You will be able to make better use of your screen real-estate even if the content is upscaled. However, I'd seriously recommend sticking to FHD if you're just watching videos.

Requirements:

Official Samsung firmware, preferably the latest version of Android 9 available.

Root access through SuperSU or equivalent.

A terminal emulator or shell, I use Termux.

Discipline to follow these steps exactly. Failure to do so will hard reset your phone.

(Optional) A mouse and keyboard for easier use of the terminal.

Now for the steps, please follow these exactly as listed.

Part A - steps to (re)activate your desired resolution:

Connect your phone to your TV/monitor and switch to DeX mode.

Use the DeX settings dialog to select the highest available resolution.

Open up your terminal emulator on the phone screen.

Use

su

to switch to the root user.

Change to the directory where we'll make changes with

cd /sys/class/dp_sec/

and use

ls

to verify that you have the "files" named "dex" and "forced_resolution".

Use this command:

echo 0 > dex

For some reason or the other, this won't disable DeX, but will screw with its rendering and allow you to make resolution changes.

Find your desired resolution using

cat forced_resolution

Mine looks like this:

0 : 640x480p@60
1 : 720x480p@60
2 : 720x576p@50
3 : 1280x800p@60_RB
4 : 1280x720p@50
5 : 1280x720p@60
6 : 1366x768p@60
7 : 1280x1024p@60
8 : 1600x900p@59_98
9 : 1600x900p@60
10 : 1920x1080p@24
11 : 1920x1080p@25
12 : 1920x1080p@30
13 : 1920x1080p@50
14 : 1920x1080p@59
15 : 1920x1080p@59_2
16 : 1920x1080p@60
17 : 2048x1536p@60
18 : 1920x1440p@60
19 : 1440x2560p@60
20 : 2560x1440p@59
21 : 2560x1440p@60
22 : 1440x2560p@75
23 : 3840x2160p@24
24 : 3840x2160p@25
25 : 3840x2160p@30
26 : 4096x2160p@24
27 : 4096x2160p@25
28 : 4096x2160p@30
29 : 3840x2160p@59_RB
30 : 3840x2160p@50
31 : 3840x2160p@60
32 : 4096x2160p@50
33 : 4096x2160p@60

To switch to your desired resolution, use the number listed on your device. For example, I want 3840x2160p@60. My phone associates this resolution with number 31, so I use this command:

echo 31 > forced_resolution

If all went well, DeX is now outputting in WQHD, upscaled to your desired resolution. You can verify this in the DeX settings dialog (do not change this setting while running this hack).

Enjoy. When you're done with DeX, you must follow part B!. Failure to do so will cause a hard reset next time you plug in the phone again and switch to DeX mode.

Part B - required clean-up:

Ensure your phone is not in DeX mode nor Screen Mirror mode. Either disconnect from the dock, or switch to Fast Charging.

Follow steps 1 through 5 from part A.

Reset the forced resolution by using this command:

echo > forced_resolution

Hope this helps you! This stuff could probably be automated with Tasker and some shell scripts - but that's for sometime in the further (you can do it yourself if you'd like).

Let me know what your experience has been and if this is a successful hack for your TV/monitor.

Further things I am looking into:

Hacking the DeX .apk to support native 4k.

Porting the DeX system apps from newer Galaxy phones to the S8 (no luck yet, these apps crash even if API-compatible).

Automation of these steps for the sake of convenience and foolproof-ness.

If this stuff motivates you to do any of those things, feel free to discuss it in this thread and maybe we can make a community effort to improve this.