yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy S8 Guides, News, & Discussion] brigantti:
thank you for the update
[Samsung Galaxy S8 Guides, News, & Discussion] Meleor:
Hi guys :cool:,

I do not know if it can help but I found some information on the electronic design of the Dex:

Samsung uses Cypress usb type-c reference design for docking solution like this one:

http://www.cypress.com/documentation/reference-designs/ez-pd-ccg2-usb-type-c-monitordock-solution

I opened my Dex station and I found the DisplayPort to HDMI video interface converter, It is the PS176:

https://www.paradetech.com/products/ps176/

USB/DisplayPort product and vendor Ids seems to be the only way for Samsung to prevent Dex from launching with other docks/adapters.

NB:

I tested Dex dock with others smartphones supporting displayport over usb type c and it worked well. (Lumia and LG G5)

Source:

http://www.prnewswire.com/news-rele...-power-delivery-to-samsung-dex-300454898.html

Cheers,
[Samsung Galaxy S8 Guides, News, & Discussion] kbarni:
Then I don't understand why my modified kernel didn't launch DEX. I don't have much time at the moment to dig into debugging the kernel, but looking at the source code I see no other check for the DEX hub in the displayport driver.

I suggest to build a custom kernel, it might be easier (even to get support from the developer for selecting the right toolchain). Back up your current system (ALWAYS!), then flash the new kernel to test, and finally restore the stock kernel from the backup. When we got a working kernel with DEX output, we can apply the patches to the stock kernel or any other custom kernel.
[Samsung Galaxy S8 Guides, News, & Discussion] joshua.tew:
Ok I'm a bit dumb here,...can this dex thingy be use on laptop?
[Samsung Galaxy S8 Guides, News, & Discussion] SilentMobius:
While it does look like the S8[+] does only support DP alt mode over USBC I just thought I should point out that USBC alt mod can carry HDMI natively (And a whole load of other types of signal in fact) and hence without any kind of active (AKA IC) based conversion.

http://www.hdmi.org/manufacturer/hdmialtmodeusbtypec.aspx
[Samsung Galaxy S8 Guides, News, & Discussion] russ18uk:
That's quite recent though. The SoC may not be able to output HDMI to MUX.

In any case, I have ordered the CF003 and will see if I can find anything that my 1054z can decode. I don't have the original DeX to compare to. I can at least look at any IIC data but probably not much else though.
[Samsung Galaxy S8 Guides, News, & Discussion] kbarni:
As a matter of fact, USB-C has alternative modes (or native support) for four display standards: DP, HDMI, MHL and Thunderbolt. So even if the HDMI over USB-C is a more recent standard, the adapter might still use the MHL standard which is directly compatible with HDMI. See this wikipedia article.

I hope I'll have a chance to check the modified kernel with a Usb-C -> DP converter in the following days.
[Samsung Galaxy S8 Guides, News, & Discussion] russ18uk:
One thing is unclear with HDMI over Type-C Alt Mode: whether Data can be supplied with it. DisplayPort does.

HDMI also needs to die anyway. DisplayPort is royalty-free, has supported Adaptive Sync for years. It's also only HDMI 1.4b.
[Samsung Galaxy S8 Guides, News, & Discussion] SilentMobius:
HDMI alt mode consumes all 4 of the superspeed pairs (As can DP alt mode if you drive it hard enough, but it can consume less) but USBC always has a standard USB2.0 pair available.

But you are right that the DP alt mode and DP in general is superior to HDMI, I was just making the point in case anyone else took away the wrong information and later applied it to something else. I'd hate for someone to buy USBC-HDMI stuff assuming it was USBC-DP-HDMI
[Samsung Galaxy S8 Guides, News, & Discussion] russ18uk:
Yeah, forgot about the 2.0. Not great if you want to use something like DeX transferring large files and would be unable to support gigabit Ethernet PHY with that.

But you'll have to qualify why you would hate someone buying C-DP-H adapter objectively speaking. Can you tell it's of a lower quality?

What I would hate is for someone connecting their C-DP-H to an HDR panel only to find that the HDMI output doesn't support HDR when the DP out does. At least using C-DP-H you get 2.0 support...
[Samsung Galaxy S8 Guides, News, & Discussion] SilentMobius:
I'm not talking about the relative merits of the two alt modes. All I'm saying is that if someone took the previous post as fact,

...and bought an actual (HDMI alt mode) USBC->HDMI adapter to use with a device that only supported DP alt mode (Mistakenly assuming that any USBC->HDMI adapter was actually using DP alt mode.) then they would be out of pocket because I failed to bring up the existence of HDMI alt mode.
[Samsung Galaxy S8 Guides, News, & Discussion] EDIDProgrammer:
So basically Samsung S8 identify DeX station by its EDID vendor and product id data?

It sounds rather strange because many different monitors with different resolutions can be connected to a DeX station and phone should recognize them and change resolution accordingly. This document (can't post a link google "PARADE’S PS176 DISPLAYPORT TO HDMI 2.0 CONVERTER ADOPTED BY SAMSUNG DEX") also suggest that the DeX actually contains a passive DisplayPort-HDMI adapter (PARADE PS176) and it just pass EDID data from the monitor to the S8 phone without change.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Well, I assume that custom kernels are based off the stock ones. So if my stock one compiles, but does not work, without any modifications, then how does the custom one work?

Besides, I do not want a custom kernel. I love how Samsung does their software. It really makes Android for me. I just want the exact kernel, except with the CONFIG_DISPLAYPORT_ENG=y set. My ultimate aim would be to own the latest Samsung device, with everything stock, except root and DeX allowed on any hardware, without KNOX tripped. I guess if we made huge leaps in integer factorisation, then we would be able to turn the public keys into private keys and sign the firmware as official. I can only hope.

Anyway, the README.KERNEL.txt suggests to compile ARCH=arm64 but with the eabi (arm 32-bit) and it most certainly does not even compile. It errors out on unknown compiler flags. So I think this information is in error.

If I have stock Ubuntu 17.04, download the git repo from google aarch64-gcc 4.9, do CROSS_COMPILE=aarch64-....- and ARCH=arm64, and it compiles, but with a section relocation, and does not boot, then what more can I do?

Does anybody know if there are toolchains capable of compiling this on Windows?

Or does anybody know enough about assembly to locate the return byte from the DeX check function and change it with a hex editor to true (0x1)?

Thanks, people.
[Samsung Galaxy S8 Guides, News, & Discussion] kbarni:
Maybe you can ask for help in the Q&A section. I'm not an experienced developer either, so I can't help a lot - but there are at least a dozen developers who built kernels for the S8.

You're right, especially as I read that most custom ROMs don't work well with DEX yet.

That won't happen.

Well, probably it's not so simple... These things are very optimized, so you won't find a one-to-one correspondence between the source code and the built kernel.
[Samsung Galaxy S8 Guides, News, & Discussion] NeedleGames:
Wait, has anyone ever tried using dex with tripped knox? Maybe they protected it just like samsung pay or s-health
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Yes, it works with KNOX tripped. I had it rooted with Magisk and everything. Which is thankful because I paid $350 for a smashed af Galaxy S8 with the screen not working (touch was fine, but couldn't make anything out). I am using it to play with DeX without messing with my main Galaxy S8+.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Hello.

I finally gave in and tried your kernel. It gets further than mine (blue LED comes on) but still boot loops. SM-G950F. Is your kernel for the SM-G950F or SM-G955F? If it was for SM-G955F then could you please make one for the SM-G950F? I am losing my mind right now, nothing I do can make this work!

Thanks.
[Samsung Galaxy S8 Guides, News, & Discussion] drmodify:
wow genious. One of the reasons I joined xda is for workarounds like these
[Samsung Galaxy S8 Guides, News, & Discussion] fonix232:
Sorry, bit of a late reply, missed your comment.

Sure, Samsung is trying to push their accessory, but we're talking about pushing the device to its very limits for the DeX stuff. If Samsung allowed any device to work as a DeX dock, imagine people stuffing their phones under their pillows, connected to a hub that goes away and away, and the phone heats up, gets damaged, and people sue Samsung (or even worse, the phone starts a fire, et cetera). This is a VERY edge usecase for the phone, where certified hardware must be present, otherwise Samsung would be full of warranty claims. Same thing applies to e.g. the Nintendo Switch dock - Nintendo locked it down partly because it's their product and don't want people to buy other manufacturers' devices, but partly because they cannot guarantee the safety of the devices in question with a third-party dock. Sure, many have appeared, and most just use the official dock's PCB plus some tinkering, because of this hardware lock. It is understandable from a business viewpoint.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Hello people, I have made massive progress.

Firstly, I got sick of blindly poking around in TWRP with a broken AMOLED panel (could only see a faint outline of distinctive features, and it vibrated when you hit something meaningful). I got the Galaxy S8 repaired by Samsung, after arguing about them about the tripped KNOX. They gave in, I said as I was paying for the service (not under warranty), they should not care.

Kernels I had previously compiled worked - but not when zipped into the Jesse zip file (semi-stock). I used "Android.Image.Kitchen.v2.8-Win32" to pack the compiled kernel (Linaro, although I will give the Google aarch64 one another shot soon).

kbarni, your kernel never worked for me. I tried it recently after I succeeded, and I even took the kernel out of your zip and repacked it into a boot.img and flashed it alone. Must be a bootloader mismatch. But I figured out why your touch screen was not working. One of my earlier kernels did the same thing. What solved it was repacking with the dtb produced when compiling. The issue is that the Jesse kernel does not come with the dtbtool, and the one off GitHub would not work. In the end, I pinched a dtbtool from a Git repository of an Exynos 8890 kernel of some developer, and hand-wrote the command to apply it. Not pretty.

ALL THE BACKGROUND ASIDE - where I am at now is that I have managed to hardcode some sysfs values (/sys/class/dp_sec/dex = 1 and /sys/class/dp_sec/dex_ver = FE49). The CONFIG_DISPLAYPORT_ENG is set. DeX still works when I connect the official station, but I still cannot get DeX to work at all with any other adapter. Perhaps it is doing other checks and expecting the adapter to offer certain functionality. I do not have a HP or Microsoft dock to try with.

I tried with

- USB-C to DisplayPort 3840x2160p60 and 60W PD USB-C port

- Official Samsung HDMI adapter

- Samsung MultiPort adapter from Samsung Galaxy TabPro S

That is all I have aside from the actual DeX station. Ideally it could be modified to work when any display is connected - perhaps even wireless mirroring - although it would be slow and jittery.

My plan is to look deeper into the sysfs kernel code and see if there are any other values to spoof. My fear is that the kernel will also need to have internal state changes to allow it to function correctly with basic display adapters - which will be trickier.

If anybody wants a hand to get to where I am at, let me know and I will give more precise instructions on how to compile and pack a working kernel. Although I still have not gotten the stock Samsung one to work. Just the Jesse kernel.

Keep the hope alive, XDA forum-goers. It might be slow, but we will get there. If we can make a kernel patch to make it work, then we could submit it to Jesse kernel developer and ask them to consider merging it as a feature, and allow less technical people to have the ability to use it.
[Samsung Galaxy S8 Guides, News, & Discussion] kbarni:
Great progress [MENTION=8306329]karatekid430[/MENTION] !

After rooting the Exinos S8, I think enabling DEX is the last big thing to solve on our devices!

I'm also back from my holidays, so I'll have some time to help!

As a first idea, you could add some logging info to the kernel code (the displayport driver and Dex checking and starting code) and see where it stops when connecting to the unofficial hub.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Thanks.

But don't worry. I just got it working! See photo. So far tested with Samsung MultiPort adapter, Samsung HDMI adapter.

I am at university, so I will have to do more extensive testing at home.

I will revise my code and check that all my changes are actually required for it to work, and provide a minimal code patch.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Hi.

Before it would only work with official adapters from Samsung defined in the kernel. Now this is with the B3414 DisplayPort adapter from Ebay (theoretically capable of UHD60 if DeX were to support it).

In the coming days I will make a YouTube video to prove it, and tidy the code up. I have hardly any experience with Git and patches (which I should halfway through my MPE - Software Engineering). Now might be the time to learn.

If I were to offer this as part of the Jesse kernel to its developer, then we would need to decide if warnings need to be placed. Samsung clearly had money in mind when doing this. But some of it might have been to prevent the remote possibility of an explosion after the Note 7 fiasco. So it might be wise to issue a warning to not operate DeX under mountains of garbage on your desk in direct sunlight whilst fast charging with an uncertified charger and multiport adapter.

Anyway, thanks for the help. Although I have had to figure out most of it myself, the clues and hints from here most certainly played a major part in achieving a result. I got my phone back on the afternoon of Monday 2017.08.21 and since then it has all fallen into place, despite having had an assignment deadline for Tuesday. It turns out my previous few weeks of frustration had actually resulted in working kernels, but due to the screen having been smashed, I clearly didn't realise that the problem was a mismatched bootloader.

My hope now is that we can attract enough attention to convince Samsung to open this up to any hardware - or at least start a certification program for other vendors' products. Otherwise, in sheer frustration, I will probably start the futile task of figuring out how to produce hash collisions in order to flash my own kernel without tripping KNOX. Yeah, right. :D

Oops, my date on my phone was set a day behind and I forgot to revert it. They were definitely taken today (23rd)
[Samsung Galaxy S8 Guides, News, & Discussion] Philipp_94:
You guys, you are the reason why I still read xda. Thanks
[Samsung Galaxy S8 Guides, News, & Discussion] Armin1997:
Nice tread, love to see more, Anyone tried one of these? they claim to have DEX functionality baked in.

https://www.aliexpress.com/item/USB-3-1-Type-C-Adapter-with-HDMI-for-Nintendo-Swith-Samsung-S8-DEX-PC-Mode/32828831706.html?spm=2114.search0204.3.24.09MC1H&ws_ab_test=searchweb0_0,searchweb201602_3_10152_10065_10151_10068_5430020_10304_5400017_10307_10137_10060_10302_10155_10154_10333_5370011_10334_10056_10335_10055_10054_10059_10332_100031_10099_5410011_10103_10102_10052_10053_10107_10050_10142_10051_10326_10084_10083_10080_10082_10081_10177_10110_10111_5420020_10112_5390011_10113_10114_10312_10313_10314_10315_10078_10079_10073-10050_10333,searchweb201603_16,ppcSwitch_5_ppcChannel&btsid=9252e884-95ee-4b88-ba27-2952807e0550&algo_expid=9c8561d2-1e0f-405f-b475-4514a5298e9d-3&algo_pvid=9c8561d2-1e0f-405f-b475-4514a5298e9d
[Samsung Galaxy S8 Guides, News, & Discussion] erclalle:
Many people on the GS8+ forum have tried, tested and approved them. If I'm correct these actually use the same chipset as does the actual DeX, and they spoof the verification signals of the original DeX. This is actually huge, since I'm sure many of us already have a USB-C hub!

Great Work [MENTION=8306329]karatekid430[/MENTION] !
[Samsung Galaxy S8 Guides, News, & Discussion] fonix232:
I believe this thing's PCB could even be used to create a lapdock-style shell with a built-in battery, keyboard and touchpad, and even storage!

Imagine buying an 11" or 14" netbook from AliExpress, gutting it, putting in this thing, and with a little bit of soldering, you just plug your phone in and bam, laptop.
[Samsung Galaxy S8 Guides, News, & Discussion] masonbella97:
Could somebody tell me how multiple languages work with Dex?
[Samsung Galaxy S8 Guides, News, & Discussion] Armin1997:
Hahaha no way. That's exactly what I am working on. I am working on CAD models for 3d printing right now. I have plenty of laptop lcd's and keyboard's laying around. Will start a new thread with all info and 3d models after my exams. (15 Sept.) Will keep you posted.

+ Is it possible to use the phone as touchpad?? (Software isn't my strongest part)
[Samsung Galaxy S8 Guides, News, & Discussion] fonix232:
Good thing I have a 3D printer at home ;)

I doubt it would be, since it isn't in the default DeX system AFAIK. I also think that using the linked device as a base, one could create a copy PCB, but with a display controller, USB hub, ethernet, etc. built in, and put it into a shell similar to the Pinebook.

I also started looking into stuff like a QC3.0 compatible charge controller that also supports pass-through charging, so that the device can get the needed charge through, and the secondary battery can also charge. Other than that, one just needs a small USB board that has the ports for the keyboard and touchpad.
[Samsung Galaxy S8 Guides, News, & Discussion] kbarni:
Hey, hey, slowly mate! We just seem to crack the Dex issue, and you already want to build the S8 laptop? ;)

That would be cool. There was some progress in a project called Ubuntu for Android (not the Ubuntu Phone OS), one of the first desktop for smartphone projects. It used a similar solution.

However in this case this would mean to do some heavy modifications in the Dex software, which is not open source.
[Samsung Galaxy S8 Guides, News, & Discussion] russ18uk:
Unless you can make your own PCB with HDMI to LVDS converter chip small enough to fit with the phone inside the case then you may struggle with older LCDs. May be a bit easier with eDP displays.

It would be easier with that custom kernel as you wouldn't need to go Type C > DP > HDMI > eDP. You could build in the keyboard and TP to USB controller.

Adafruit has the Qualia HDMI to eDP driver board for modern screens but it's built specifically for iPad LCDs.
[Samsung Galaxy S8 Guides, News, & Discussion] powercamg4:
Hay i did a video teardown if you want to check it out

https://www.youtube.com/watch?v=Qcqit8YzGlQ
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Thanks!

But when modifying the kernel, I have not encountered any "verification signals". As far as I know, it is just by hardware vendor and product ID. If there is further verification, then I inadvertently bypassed them.

It worked with RTL8153 (USB Gigabit Ethernet) in DeX, so it cannot be verifying all of the exact components of the DeX, either.

The Microsoft Windows phone works with the DeX station, but the Galaxy S8 refuses to work with the Microsoft dock without kernel modification. There is nothing proprietary or unusual about the DeX, except that Samsung programmed their phones to only activate with the official DeX station.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Proof that I got DeX working with other adapters - https://youtu.be/s50GWuKphTI

You can try the boot.img at your own risk. It worked with my device, AP: G950FXXU1AQG7 CP: G950FXXU1AQG5 CSC: G950FXSA1AQFE Model: SM-G950F.

Make sure you backup all data on the device and know how to recover in the event of a failure.

This is using the boot.img-dtb that I compiled - if it would help you to have it, you can extract it from the boot.img with the "Android.Image.Kitchen.v2.8-Win32" toolbox.

https://1drv.ms/u/s!AuN0OlwU3-gMgtcTnrNYvm0YFhWBvQ
[Samsung Galaxy S8 Guides, News, & Discussion] fonix232:
Or, one could convince the manufacturer to make a version of this adapter that has a DisplayPort/Mini DisplayPort connector, to what one could connect an eDP compliant display. It would be cheaper to manufacture (no need to do the DP-HDMI conversion), and easier to work with if we want something built-in.

But it could be made in a way so that the S8/+ connects via a Type C port (so no dock, etc.), and all the internals have are this adapter, the HDMI-LVDS interface, an M.2 SSD with USB interface, and a big battery pack.
[Samsung Galaxy S8 Guides, News, & Discussion] kbarni:
I confirm it's working. I flashed the boot.img on Renovate Ice 5 rom with AQH3 firmware, it booted without problems. As I connected the external screen, it displayed the Dex desktop. Leet! :D
[Samsung Galaxy S8 Guides, News, & Discussion] russ18uk:
Unless you trip KNOX and flash the custom kernel you need the PS176HDM chip though. I have yet to find the proper datasheet so do not know if it does pass-thru of the DP signals.
[Samsung Galaxy S8 Guides, News, & Discussion] fonix232:
You could always have the chip in place, and just duplicate the DP lines into a usable port.
[Samsung Galaxy S8 Guides, News, & Discussion] erclalle:
[MENTION=3194398]kbarni[/MENTION] What model do you have?

[MENTION=8306329]karatekid430[/MENTION] can the boot.img be flashed on any rooted s8, or do I need to edit it to match model/csc?
[Samsung Galaxy S8 Guides, News, & Discussion] kbarni:
I have the Galaxy S8, Exinos variant (SM-G950F). The same code can be built for the S8+, but this image won't work directly on the larger model.

Normally this kernel should work on any (updated) S8, so I think it's safe to try it.

But, as always, be sure to have a backup of your system, in case that anything goes wrong!!!

Create a backup in TWRP, clear Cache/Dalvik, flash the new kernel image (Select image button),

and reboot.

If anything goes wrong, go back to TWRP and restore the system.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Any SM-G950F. Assuming the bootloader meets the standard for the Jesse kernel. It says "

NOTE: As of VERSION 0.3 and SEMI-STOCK RELEASE 6, AQG5 or newer bootloader is required."

---------- Post added at 02:25 PM ---------- Previous post was at 02:23 PM ----------

I can compile for the Samsung S8+ SM-G955F, but I won't be able to be 100% sure it will boot, as my Samsung S8+ is my main driver and is not rooted.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Guys, I just read about the eDP idea. But is there a point when there exist USB-C monitors like Asus MB16AC? Or do you want a completely embedded solution?
[Samsung Galaxy S8 Guides, News, & Discussion] russ18uk:
You would want USB, which brings Ethernet options. You don't get that with going straight to a Type-C display, unless it has its own DP adapter. Not to forget charging.
[Samsung Galaxy S8 Guides, News, & Discussion] kornelkahh:
Can you tell me what you changed in the kernel?:confused:
[Samsung Galaxy S8 Guides, News, & Discussion] kbarni:
USB monitors use Displaylink driver. If you connect it, it won't call the DisplayPort driver (it's a totally different technology) - so you won't have DEX.
[Samsung Galaxy S8 Guides, News, & Discussion] karatekid430:
Legacy USB monitors use DisplayLink. USB-C ones are just the same as having a USB-C to DisplayPort adapter to a monitor.
[Samsung Galaxy S8 Guides, News, & Discussion] kelvingamer:
Any way to work with Lapdock Motorola Atrix?

Http://www.techradar.com/reviews/phones/mobile-phones/motorola-atrix-930919/review/10

Using Samsung Dex Station I get low resolution message (Lapdock maximum resolution is 1366 x 768)