[GUIDE][DeX] Using DeX mode at custom resolutions (1440p+) on a rooted phone

Search This thread

Natrox

New member
Jun 30, 2020
1
0
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:
  1. Connect your phone to your TV/monitor and switch to DeX mode.
  2. Use the DeX settings dialog to select the highest available resolution.
  3. Open up your terminal emulator on the phone screen.
  4. Use
    Code:
    su
    to switch to the root user.
  5. Change to the directory where we'll make changes with
    Code:
    cd /sys/class/dp_sec/
    and use
    Code:
    ls
    to verify that you have the "files" named "dex" and "forced_resolution".
  6. Use this command:
    Code:
    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.
  7. Find your desired resolution using
    Code:
    cat forced_resolution
    Mine looks like this:
  8. To switch to your desired resolution, use the number listed on your device. For example, I want [email protected] My phone associates this resolution with number 31, so I use this command:
    Code:
    echo 31 > forced_resolution
  9. 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).
  10. 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:
  1. Ensure your phone is not in DeX mode nor Screen Mirror mode. Either disconnect from the dock, or switch to Fast Charging.
  2. Follow steps 1 through 5 from part A.
  3. Reset the forced resolution by using this command:
    Code:
    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.
 
Last edited:

rn2web

Senior Member
Feb 1, 2011
75
14
Very nice man


:laugh:


maybe if you request a automation inside of this kernel

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.

https://forum.xda-developers.com/ga...velopment/kernel-a2n-kernel-20181205-t3875640

the dev of this kernel has advanced skills to do that
 
Last edited:

macleo

Senior Member
Feb 3, 2008
72
3
Urdaneta City
Very nice man


:laugh:


maybe if you request a automation inside of this kernel

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.

https://forum.xda-developers.com/ga...velopment/kernel-a2n-kernel-20181205-t3875640

the dev of this kernel has advanced skills to do that
It's kinda confusing on Part B, bacause you stated at Part B, step 1.
  1. Ensure your phone is not in DeX mode nor Screen Mirror mode. Either disconnect from the dock, or switch to Fast Charging. Then at Step 2 you say follow steps 1 through 5 at Part A, on which on Part A, step 1. Connect your phone to your TV/monitor and switch to DeX mode., this already a conflict to the Part B, step 1 rule. and you have a warning that failure to do so will cause a hard reset next time you plug in the phone again and switch to DeX mode.
 

macleo

Senior Member
Feb 3, 2008
72
3
Urdaneta City
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:
  1. Connect your phone to your TV/monitor and switch to DeX mode.
  2. Use the DeX settings dialog to select the highest available resolution.
  3. Open up your terminal emulator on the phone screen.
  4. Use
    Code:
    su
    to switch to the root user.
  5. Change to the directory where we'll make changes with
    Code:
    cd /sys/class/dp_sec/
    and use
    Code:
    ls
    to verify that you have the "files" named "dex" and "forced_resolution".
  6. Use this command:
    Code:
    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.
  7. Find your desired resolution using
    Code:
    cat forced_resolution
    Mine looks like this:
  8. To switch to your desired resolution, use the number listed on your device. For example, I want [email protected] My phone associates this resolution with number 31, so I use this command:
    Code:
    echo 31 > forced_resolution
  9. 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).
  10. 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:
  1. Ensure your phone is not in DeX mode nor Screen Mirror mode. Either disconnect from the dock, or switch to Fast Charging.
  2. Follow steps 1 through 5 from part A.
  3. Reset the forced resolution by using this command:
    Code:
    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.
It's kinda confusing on Part B, bacause you stated at Part B, step 1.
  1. Ensure your phone is not in DeX mode nor Screen Mirror mode. Either disconnect from the dock, or switch to Fast Charging. Then at Step 2 you say follow steps 1 through 5 at Part A, on which on Part A, step 1. Connect your phone to your TV/monitor and switch to DeX mode., this already a conflict to the Part B, step 1 rule. and you have a warning that failure to do so will cause a hard reset next time you plug in the phone again and switch to DeX mode.