DeX with USB-C HDMI Adapter

pRo_lama

Senior Member
May 10, 2008
1,389
339
0
Prague
Thanks, I think the log already starts short after connecting, would be nice to have one that starts before connecting.

You can try some of these while connected via usb-c and remote debugging is working but probably they will not work:
  • adb shell am start com.sec.android.app.desktoplauncher/com.android.launcher3.Launcher
  • adb shell am broadcast -a com.android.launcher3.action.LAUNCH -f 16 --es MultiScreenLaunchParams "mDisplayId=0 mBaseDisplayId=0 mFlags=0"
  • adb shell am start com.sec.android.app.desktoplauncher/com.android.launcher3.settings.DesktopSettingsActivity
After a while old logs will be removed. So just keep the testing and log short.
And one more thing: Please make the log when connecting with the DeX station not with USB-C. Thanks!
I have problem to make a logcat.

Code:
adb server is out of date.  killing...
ADB server didn't ACK
* failed to start daemon *
error:
error:
 

Hollam

Senior Member
May 1, 2011
50
4
0
I have problem to make a logcat.

Code:
adb server is out of date.  killing...
ADB server didn't ACK
* failed to start daemon *
error:
error:
Did you switch back to USB debugging first?

Hi did you try with remote debugging:

  1. Connect device via USB and make sure debugging is working, then run:
  2. adb tcpip 5555
  3. adb connect <DEVICE_IP_ADDRESS>:5555
  4. Disconnect USB and proceed with wireless debugging.
  5. When you're done and want to switch back to USB debugging, run:
  6. adb -s <DEVICE_IP_ADDRESS>:5555
 

pRo_lama

Senior Member
May 10, 2008
1,389
339
0
Prague
Did you switch back to USB debugging first?
This message will appear when I try to connect to the IP address (and yes, I'm in same WiFi network with S8 and PC). Yesterday was everything working.

I tried apps in mobile phone like aLogCat, SysLog, etc. but none of the apps worked. Before I posted first log everything was working.
 

Hollam

Senior Member
May 1, 2011
50
4
0
This message will appear when I try to connect to the IP address (and yes, I'm in same WiFi network with S8 and PC). Yesterday was everything working.

I tried apps in mobile phone like aLogCat, SysLog, etc. but none of the apps worked. Before I posted first log everything was working.
Try adb kill-server first and then check if adb devices lists your usb connected device again.
 

pRo_lama

Senior Member
May 10, 2008
1,389
339
0
Prague
Try adb kill-server first and then check if adb devices lists your usb connected device again.
I successfully killed the server and it tells me that I'm connected and even so, my Android Studio does not log on, nor through CMD. I don't know. Something went south and I can not log.

I tried apps in phone and result is the same.
 

Hollam

Senior Member
May 1, 2011
50
4
0
I successfully killed the server and it tells me that I'm connected and even so, my Android Studio does not log on, nor through CMD. I don't know. Something went south and I can not log.

I tried apps in phone and result is the same.
Following things could help:
  • Change USB mode to PTP (picture transfer mode) on the phone
  • Revoke the USB debugging permissions in the developer settings on the phone
  • Restart the phone & Laptop
 

pRo_lama

Senior Member
May 10, 2008
1,389
339
0
Prague
Following things could help:
  • Change USB mode to PTP (picture transfer mode) on the phone
  • Revoke the USB debugging permissions in the developer settings on the phone
  • Restart the phone & Laptop
This was the first what I did. Nothing is working.

Odoslané z SM-G950F pomocou Tapatalku
 

erclalle

Senior Member
Jul 2, 2009
96
24
0
Just got my S8, rooted and TWRP, so I'd like to revive the efforts to launch DeX mode (supposing it's just a software limitation) using any usb c dock. I created a shortcut to the launcher app, and here are the logs for when it fails to boot into DeX mode.
Anyone can replicate this using the real DeX and a shortcut for DeX mode, from mirror-screen mode? My guess is, if the switch from mirror-screen mode to DeX mode can be made via the shortcut, it may be easy to fake device ID verification doing the same thing on a regular type C dock
https://ufile.io/3ze6s
 
  • Like
Reactions: Hawke84

karatekid430

Senior Member
May 28, 2017
84
39
0
Interesting information

Hello all,

I just signed up for XDA account because I feel like I have information which might be of use for making DeX work without the station.

A bit of info on my devices and accessories:
- I have Samsung Galaxy S8+ SM-G955F - NOT ROOTED - so somebody with a rooted device will need to help here.
- I have the DeX station - Samsung says it fast charges with the Samsung TabPro S charger (25W 12V) but I do not have this to try. It does not fast charge with the 9V Samsung Fast Adaptive Charger. But it does fast charge with a USB-C PD charger, can confirm.
- My PD charger is the Asus UPD 3.1 Panel, paired with an 8ware 1m black USB 3.1 Type-C to Type-C IF-certified 100W cable.
- Galaxy S8 fast charges from USB-C PD - but until I get around to buying the USB-C power meter, I do not know what voltage or current it uses. Although something makes me think I read that it was 5V 3A. Cannot remember what makes me think that.
- I bought the Samsung TabPro S Multiport Adapter - it works but always stuck in USB 2.0 mode, whether or not HDMI connected. The HDMI is limited to 30Hz at 3840x2160px. It cannot fast charge through it, even with USB-C laptop chargers, and my 100W PD charger.
- I bought the official Samsung USB-C to HDMI adapter. It works at 60Hz at 3840x2160p, confirmed.
- I use the DeX with the Dell S2340T touch screen and the touch from the monitor works in DeX and in screen mirroring. I had the Galaxy Note 7 SM-N930F and it did not work (pretty sure I tried).
- I found that Realtek rtl8153 devices work great, and if the OTG adapter or cable is wired correctly, I can iPerf about 800-900Mbps over 1GBASE-T Ethernet. It even works with a D-Link (Asix) whereas the Galaxy Tab S2 only worked with the Realtek.

If I can try anything out for people with all my accessories, let me know.

I can also confirm that that DeX HDMI option in settings that was mentioned earlier in the thread only appeared after using DeX for the first time. I know it definitely was not there beforehand, because I had been using the nearby Ethernet settings with USB Ethernet dongles. I would have noticed.

But what I really wanted to point out, is that when the Galaxy S8+ is connected to the TabPro S Multiport Adapter, then 'cat /sys/class/switch/ccic_dock/state' returns 109, and when connected to the DeX Station it returns 110. When disconnected it returns 0.

Somebody with root could try and modify the state to 110 and see what happens. Also, it would be helpful if somebody could find a USB-C extension cable, like for Nintendo Switch, and connect the dock to a Thunderbolt 3 laptop (Thunderbolt ensures alt-modes are available) and list out the hardware that the computer detects. I had a small extension cord but it does not work properly because somehow the devices detect its presence. We need one that is completely passive / pass-through.

For people interested in seeing the Android Activities, get the MyAndroid-Tools app and go to Services, System, Samsung DeX Home, and click on one of the top icons to expand the activities list out into full form.
I tried launching from Terminal Emulator (you need --user '0' appended to the normal am start command) and it does nothing when disconnected, it does nothing when connected to DeX in screen mirroring mode, but when DeX is already running, you get a different error (Warning: Activity not started, its current task has been brought to the front).
So I want to know what the Android System Notification saying "DeX available, tap to switch" launches when clicked. I cannot find out how to get the information from notifications. Again, a root user might get further.

Great work so far, people, and I hope I can be of help.
 

karatekid430

Senior Member
May 28, 2017
84
39
0
New adapters

Hello all,

I finally received my adapters from Ebay. I cannot post links yet. But the exact item string is "15cm USB-C to DISPLAYPORT DP 4K Adapter + USBC Power Delivery MONITOR B3414" from seller "lets-buy-cables".

They have a DisplayPort (3840x2160p 60Hz) and a USB-C PD port for up to [email protected] charge through. They are the first USB-C adapters I have owned that allow DisplayPort - so I can finally try that out.

Something I wondered previously was whether the Galaxy S8 would say "DisplayPort Cable Connected" instead of "HDMI Cable Connected". It turns out it doesn't. It still says HDMI, which reflects the sad consumer state where the inferior HDMI is king just because of people with TVs instead of monitors.

What blew my mind was that my monitor (Samsung U32E850R) reported that it was using FreeSync. I know it is part of the DisplayPort spec now, but I was not expecting a phone to support something that came from AMD, primarily for desktop gaming. I played Goat Simulator and I saw no frame tearing whatsoever, even when the frame rate dropped. I love how Samsung now allows changing resolutions (QHD or higher is often absurd for mobile gaming - wastes battery and heats up the device) and a framerate counter. It was something I yearned for in past flagships, but couldn't do it without rooting.

Since I ordered two adapters, I tried to daisy-chain them for fun - eventually I fast charged my Galaxy S8+ through two of them - but it required a lot of fiddling to convince them to work that way. They don't seem to like daisy-chaining power delivery much.

Anyway, the only downside to USB-C is that you can only fit one signal out at once. Even though the Galaxy S8 is capable of producing a 10Gbps USB SS+ signal and a 3840x2160p 60Hz DisplayPort signal simultaneously, you cannot get both out of the port at once.

Hence, unfortunately, you normally have to have an adapter without the USB port on there to get 3840x2160p 60Hz. The exception is the extremely rare and hard to find adapter that has a USB port rated only for 480Mbps - because even with a full DisplayPort signal, the legacy High-Speed USB signal is routed with dedicated D- and D+ wires (does not have to share). I found one on Alibaba (mini Displayport, USB-C PD and USB 2.0), they said I could purchase a single one for a higher price. If you are interested then PM me for the link.

But anyway, this adapter is as perfect as you can get - provided you don't need USB at the same time. Ideally the USB-C cord would be detachable to allow the connection of a longer one, but I feel like I need to wait a few years before I can up my standards.

The motivation for all of this? I want X86 dead and ARM to dominate - because of its inherent efficiency. My Exynos 8895 is faster than my Surface Pro 4 (Intel Core i5 Skylake) in Geekbench 4. The Samsung DeX, combined with this USB-C connectivity, brings a phone one step closer to making that a reality. There is a long way to go, but I will support whatever efforts there are, no matter how small.

I don't want to make the Galaxy S8 work in DeX mode without the dock to save money - or to undermine Samsung's profits. I want people to buy the Samsung DeX Station because they want to, and because it is the best solution. Not because it is the only choice. Currently, their dock is limited to 3840x2160p 30Hz and only has USB 2.0 support - which isn't even up at the limits of the USB-C port. The USB-C port should be able to do 3840x2160p 30Hz and USB 5.0Gbps (AFAIK). They could have thrown in Gigabit Ethernet, also. Although 100MBASE-T is inherently more reliable than Wi-Fi, it is definitely not as fast. If it is reliability you want, then you are set. But if you want speed, it is a disappointment. And although the kernel recognises extra Ethernet adapters (I had it connected to the DeX and had two USB Ethernet adapters attached), the menu only lists out eth0. You can show that they are all recognised with '</proc/net/dev grep eth' command in terminal. But until they fix this, you cannot use another Ethernet adapter while using DeX - it will likely default to the inbuilt one due to race conditions.

But aside from the poor specs of the DeX Station, it is also chunky - I cannot chuck it in my Surface Pro bag and bring it with me. On the other hand, the Samsung TabPro S Multiport Adapter (despite its mediocre performance with the Galaxy S8+ as described in my previous post in this thread), takes up a fraction of the size. I could bring that and a USB Ethernet adapter and theoretically have the same DeX experience, but in a more versatile and portable form factor.

Keep posting, people! The thread has gone quiet, but I hope that somebody with a rooted device can use the information shared here to find a hack to make DeX work with ordinary adapters. PM me or reply to this thread if I can try something out for you or answer some question regarding my experiences with my devices.
 

scarp

Member
Jul 12, 2012
5
2
0
Hello karatekid430,

Would you mind to help confirm whether the Samsung DeX station can support [email protected] in mirror mode with S8+ plugged in?(I suppose the desktop mode will only support up to 1080p?)

The other thing is about the the official Samsung USB-C to HDMI adapter. I know it works at 60Hz at 3840x2160p as you confirmed(Just to be sure, this was confirmed with S8+ in use with the adapter, right?). And one step further, how do you charge the S8+ while having this adapter plugged in the S8+'s USB-C port? I think there's no way to charge it except wireless charging although I'm not sure if wireless charging will work in this case? Cos you can't practically use this adapter to output display signal at 60Hz at 3840x2160p without charging it cos this display output will consume a lot of power and the battery alone can't stand it for long like a movie's time or a couple TV episodes, right? Gotta have a steady power supply.

Also how about the S8+ body heat while using the DeX station and/or USB-C to HDMI adapter to output [email protected]? Is the heat as high as to concern you if you are to continue use it?

I just want [email protected] output from my S8+, and I am not sure whether to choose the DeX station or USB-C to HDMI adapter.

Thanks a lot. Cheers!
 

russ18uk

Senior Member
Aug 1, 2011
472
80
0
FreeSync is just AMD marketing speech for Adaptive Sync, which is in the VESA spec.

Yes you can charge your phone when you have a hub or other device plugged into the S8 if it has a charging port. YMMV with them - the two hubs I've tried do not charge fast enough to not still drain the battery when screen is on.
 

karatekid430

Senior Member
May 28, 2017
84
39
0
FreeSync is just AMD marketing speech for Adaptive Sync, which is in the VESA spec.

Yes you can charge your phone when you have a hub or other device plugged into the S8 if it has a charging port. YMMV with them - the two hubs I've tried do not charge fast enough to not still drain the battery when screen is on.
Your mileage will only vary if you make uneducated purchases. If everything is USB-C PD compliant, and the charger supports the correct power profiles, it does not just charge the Galaxy S8; it fast charges it.

The stuff I have talked about works - for me it is the "15cm USB-C to DISPLAYPORT DP 4K Adapter + USBC Power Delivery MONITOR B3414" from Ebay, and the Asus UPD 3.1 Panel (100W USB-C PD) with 8ware 1M USB-C to USB-C 3.1 10Gbps 100W cable.

If you connect a Samsung adaptive charger or a regular charger to the USB Adapter, it only charges slowly. The Samsung adaptive charger only works fast when connected directly to the Galaxy phone.

Now has anybody investigated the '/sys/class/switch/ccic_dock/state' value and how it is equal to 110 only when connected to DeX? It is 109 when connected to a Samsung TabPro S Multiport adapter. It might hold the secret to unlocking DeX without the official station. Somebody with root could play with this.
 

wujiyu305

Member
Mar 6, 2009
13
0
0
there's something in the /sys/class/dp_sec/ that you might be interested.
I don'rt have a Dex, I can't test what these gonna be when docked, may someone with a Dex have it a look.
Screenshot_20170604-165959.png
 

karatekid430

Senior Member
May 28, 2017
84
39
0
there's something in the /sys/class/dp_sec/ that you might be interested.
I don'rt have a Dex, I can't test what these gonna be when docked, may someone with a Dex have it a look.
View attachment 4170859
Good catch, I did not find those. I should look deeper with the 'find' command for files with interesting names.

The /sys/class/dp_sec/dex has 0 when disconnected, and 1 when on the DeX dock. I just tried it.

It is owned by android.uid.system (uid=1000), so if somehow you could hijack a system app, it could be changed without root access. Although realistically, that would require the signing key from Samsung to install a system app with the shared UID for system.

Could somebody with root please 'echo 1 > /sys/class/dp_sec/dex' and report on the results? Does it stick? Does it allow the launching of the DeX activity with another adapter connected?

Thank you!
 

SilentMobius

Senior Member
Apr 17, 2007
269
39
0
Hi All, I just had a look through the S8 kernel source as I figured that anything in /sys/class would most likely have kernel code to support it, looks like the "Dex check" is as follows:

Code:
bool check_dex_support(struct displayport_device *displayport)
{
	if (displayport->ven_id == SAMSUNG_VENDOR_ID
			&& displayport->prod_id == DEXDOCK_PRODUCT_ID)
		return true;

#ifdef CONFIG_DISPLAYPORT_ENG 
	return true;
#else
	return false;
#endif
}
Which is pretty ****ty IMHO. CONFIG_DISPLAYPORT_ENG is a define that isn't set in the release kernel so, it looks like the only way to do this would be to spoof the vend/prod id's on the displayport adapter. I'm not sure id these ID's are displayport native data or USB ID's that then signal the electrical change of using the alt-mode pairs, though it's stored in the "dispayport" struct.

That is assuming that this check echo's out to /sys/class/dp_sec/dex and the dex_home checks it.

That said, for unlocked/rooted users if the samsung source compiles it should be a simple job to compile with CONFIG_DISPLAYPORT_ENG set

EDIT:
the prod/Ven ID's do come from the USB subsystem when a CCIC_NOTIFY_ATTACH is sent:

Code:
displayport->ven_id = usb_typec_info.sub2;
displayport->prod_id = usb_typec_info.sub3;

if(check_dex_support(displayport))
    displayport_info("Dex mode supported product connected\n");
Also, here are the numbers it's expecting:
Code:
/* Samsung Acc VID */
#define SAMSUNG_VENDOR_ID		0x04E8
#define SAMSUNG_MPA_VENDOR_ID	0x04B4
/* Samsung Acc PID */
#define DEXDOCK_PRODUCT_ID		0xA020
#define HDMI_PRODUCT_ID			0xA025
#define MPA_PRODUCT_ID			0x2122
 
Last edited:

karatekid430

Senior Member
May 28, 2017
84
39
0
Hi All, I just had a look through the S8 kernel source as I figured that anything in /sys/class would most likely have kernel code to support it, looks like the "Dex check" is as follows:

Code:
bool check_dex_support(struct displayport_device *displayport)
{
	if (displayport->ven_id == SAMSUNG_VENDOR_ID
			&& displayport->prod_id == DEXDOCK_PRODUCT_ID)
		return true;

#ifdef CONFIG_DISPLAYPORT_ENG 
	return true;
#else
	return false;
#endif
}
Which is pretty ****ty IMHO. CONFIG_DISPLAYPORT_ENG is a define that isn't set in the release kernel so, it looks like the only way to do this would be to spoof the vend/prod id's on the displayport adapter. I'm not sure id these ID's are displayport native data or USB ID's that then signal the electrical change of using the alt-mode pairs, though it's stored in the "dispayport" struct.

That is assuming that this check echo's out to /sys/class/dp_sec/dex and the dex_home checks it.

That said, for unlocked/rooted users if the samsung source compiles it should be a simple job to compile with CONFIG_DISPLAYPORT_ENG set

EDIT:
the prod/Ven ID's do come from the USB subsystem when a CCIC_NOTIFY_ATTACH is sent:

Code:
displayport->ven_id = usb_typec_info.sub2;
displayport->prod_id = usb_typec_info.sub3;

if(check_dex_support(displayport))
    displayport_info("Dex mode supported product connected\n");
Also, here are the numbers it's expecting:
Code:
/* Samsung Acc VID */
#define SAMSUNG_VENDOR_ID		0x04E8
#define SAMSUNG_MPA_VENDOR_ID	0x04B4
/* Samsung Acc PID */
#define DEXDOCK_PRODUCT_ID		0xA020
#define HDMI_PRODUCT_ID			0xA025
#define MPA_PRODUCT_ID			0x2122
Okay I am going to be doing some major rallying at Samsung for them to change that. It is pretty ****ty. After my exam tomorrow I might try to start a petition.

Although in another thread, https://forum.xda-developers.com/galaxy-s8/how-to/wip-samsung-s8-dex-dex-station-t3605933/page2, somebody with root did # echo 1 > /sys/class/dp_sec/dex and it did not work, they said they had Microsoft HD-500 dock connected at the time.

If somebody with root is willing to recompile the kernel, then that would be amazing. But honestly we just need to convince Samsung to open it up.

But please post the values of SAMSUNG_VENDOR_ID and DEXDOCK_PRODUCT_ID for now; somebody might have the knowledge to modify a normal adapter. EDIT: Sorry, you already did.

I assume the fact that there are IDs means it needs to have an active converter from DisplayPort to HDMI, as a DisplayPort output would not require any intervention.

Thank you for the effort!
 
Last edited: