stockmind / gpd-pocket-ubuntu-respin

Collection of scripts and tweaks to adapt Ubuntu and Linux Mint ISO images to let them run smooth on GPD Pocket
351 stars 35 forks source link

Feedback: USB-C as video output doesn't work #98

Open matri opened 6 years ago

matri commented 6 years ago

Use Dell da200 usb-c adapter and Dell wd15 usb-c dock to do the test, Gpd pocket can identify the usb-keyboard and usb mouse attached to the dock. But it can't see the monitor on the hdmi port of the dock. No new monitor in display settings.

gpd pocket with ubuntu 16.04 newest patch from this repo newest kernel from matula repo (2018.1.26)

hope it helps, thanks for your hard work to make ubuntu on gpd pocket usable!

kanocz commented 6 years ago

@matri it's known issue and if you see main README of the project you can see:

What Doesn't Work at the Moment: USB-C as video output

b00men commented 6 years ago

Guys, do anyone have a supposition about the root of the issue? It's the most annoying bug but unfortunately the issue looks not really transparent. I see that at the moment related stuff in active development on kernel side. But looks that most part already implemented and I know that there are already exist similar products with workable usb-c video on linux kernel.

I'm really want to make a useful contribution for this part but I'm extremely confused because I didn't see any initial point to start debugging/development.

42Joe commented 6 years ago

Is there any progress? Unfortunately, I am not able to solve this problem - however, I really wait for the possibility to connect the GPD Pocket with a docking station under Linux. This would improve the tiny PC significantly.

Seegras commented 6 years ago

Does anyone have an idea what this depends on? Is this a question of kernel support? I'm running last weeks kernel from https://github.com/jwrdegoede/linux-sunxi and haven't been able to make it work yet.

stockmind commented 6 years ago

Support for USB-C video on some devices seems fairly new (Dell XPS minimum kernel 4.13/14+ ? and the interest/attention is different), Hans has fixed most of the things regarding USB C, but something seems missing in the .. kernel driver? .. to let it work, don't know enough about it, just guessing. @b00men if you have the knowledge to make it work you should probably look around the pi3usb30532 ( this should be the Pocket Type C usb/video internal switch ) and fusb302 kernel modules, but as already said, i don't have the enough knowledge either to identify where to look, i'm just guessing.

jwrdegoede commented 6 years ago

Hi All,

So the problem is that on the GPD win / pocket the Type-C port and its alternative-roles such as DisplayPort over Type-C is fully managed by the kernel, rather then by firmware in the thunderbolt controller. Currently the code for using the DisplayPort alt-mode is not yet ready. Someone from Intel is working on this, but I do not have an ETA.

Regards,

Hans

xzavrel commented 6 years ago

@jwrdegoede Intel has released patchset for i915 in kernel 4.19. There is also patch named: Allow eDP on port C in theory Does it mean there should be DP over USB-C support in 4.19?

https://lists.freedesktop.org/archives/intel-gfx/2018-June/167800.html

jwrdegoede commented 6 years ago

Hi,

On 13-06-18 12:24, Vojtěch Zavřel wrote:

Intel has released patchset for i915 in kernel 4.19. There is also patch named: Allow eDP on port C in theory Does it mean there should be DP over USB-C support in 4.19?

It means that work is underway which should eventually enable DP over USB-C functionality. I'm not sure yet this will all land in 4.19.

Regards,

Hans

fiete201 commented 6 years ago

Hi,

I just build 4.19.0-rc1 and for me with my DELL USB-C Dock the video outputs via USB-C are still not working. So maybe we need to wait for 4.20

Regards, Fritz

42Joe commented 5 years ago

Has anybody new information? The problem seems to be unsovled until today.

jwrdegoede commented 5 years ago

I know some of you have been waiting for this, so I'm happy to announce that my personal kernel-tree now has all the necessary bits to make DisplayPort over Type-C work on the GPD win1 and the pocket1: https://github.com/jwrdegoede/linux-sunxi/commits/master

I hope someone from the forums will do a kernel build for $your-favorite-distro and provide that for people who don't know how to build a kernel themselves.

As always all these changes are heading upstream.

Once you've a kernel build from my latest git master branch, plug in a Type-C to video dongle and then do:

cat /sys/class/typec/port0-partner/port0-partner.0/displayport/pin_assignment

This should give you something like this:

C [D]

Which means that the USB-PD stack / Type-C state-machine in the kernel has correctly negotiated DisplayPort altmode.

I've one Type-C to VGA dongle (without any other functions) where the Type-C mode negotiation fails. This one does work on a XPS 15 so I need to borrow some hardware so that I can capture the USB-PD signals and see what the Alpine Ridge controller does different compared to the in kernel stack and fix this. My other 4 dongles work fine, including this "standard" model: http://media.redgamingtech.com/rgt-website/2015/03/Apple-HDMI-Usb-Type-C-dongle.jpg

TL;DR: if the above cat command fails with a "No such file or directory" error, then your dongle is not compatible with the kernels USB-PD stack for now.

If you do get the expected:

C [D]

Or something similar then everything should just work.

Note the GPU in the Cherry Trail SoC only supports DP 1.1, not 1.2, so no MST, so laptop docks supporting multiple video-outputs through DP-MST will not work. This is a hardware limit.

stockmind commented 5 years ago

Amazing!! Thank you Hans! I will update README with your informations and update the kernel 😄

xzavrel commented 5 years ago

@jwrdegoede I have tried the kernel from your branch with my USB-C dongle with HDMI output. The result of the command cat /sys/class/typec/port0-partner/port0-partner.0/displayport/pin_assignment is C [D] But there is no new monitor in the system-configuration nor arandr. There is no any new output in xrandr output

Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 32767 x 32767
DSI1 connected primary 1920x1200+0+0 right (normal left inverted right x axis y axis) 95mm x 151mm
   1200x1920     60.38*+
   1152x864      60.00  
   1024x768      60.00  
   1024x576      59.90    59.82  
   600x960       60.00  
   960x540       59.63    59.82  
   800x600       60.32    56.25  
   864x486       59.92    59.57  
   640x480       59.94  
   720x405       59.51    58.99  
   640x360       59.84    59.32  
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

When I connect the same monitor through HDMI the xrandr output is

Screen 0: minimum 8 x 8, current 3600 x 1200, maximum 32767 x 32767
DSI1 connected primary 1920x1200+0+0 right (normal left inverted right x axis y axis) 95mm x 151mm
   1200x1920     60.38*+
   1152x864      60.00  
   1024x768      60.00  
   1024x576      59.90    59.82  
   600x960       60.00  
   960x540       59.63    59.82  
   800x600       60.32    56.25  
   864x486       59.92    59.57  
   640x480       59.94  
   720x405       59.51    58.99  
   640x360       59.84    59.32  
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1680x1050+1920+0 (normal left inverted right x axis y axis) 470mm x 300mm
   1680x1050     59.88*+  59.95  
   1280x1024     75.02    60.02  
   1440x900      74.98    59.90  
   1280x960      60.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   832x624       74.55  
   800x600       75.00    60.32    56.25  
   640x480       75.00    59.94  
   720x400       70.08  
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

I cannot see anything suspicous in kernel log.

xzavrel commented 5 years ago

I have discovered that my DP over USB-C has been disabled in the BIOS. But as soon as I have enabled it the charging doesn't work and USB-C DP is still not working.

jwrdegoede commented 5 years ago

Vojtěch,

Stupid question: I assume that you actually have a hdmi cable going to a monitor connected to the dongle?

Have you tried first connecting the hdmi cable and then plugging in the dongle?

It should not matter, but it cannot hurt to try this.

Note the DisplayPort over Type-C BIOS setting does not matter. I've left it in its default state on my machines (which is off IIRC).

Regards,

Hans

xzavrel commented 5 years ago

Yes, of course I have :-).

I have tried all different combination of the cabeling order - HDMI cable, power delivery and connecting to Pocket.

ViktorWalter commented 5 years ago

Hello, just gonna say that I have exactly the same symptoms as @xzavrel - the pin_assignment is C [D], but xrandr does not list the external HDMI as connected, regardless of connection order. My dongle is this chinese thing

jwrdegoede commented 5 years ago

@xzavrel, @ViktorWalter, weird.

The only thing which comes to mind is that we do not setup Vconn correctly yet, to test if this is the cause do:

sudo modprobe i2c_dev
sudo i2cget -y -f 6 0x6e 0x2e

This will likely output: "0x30" or "0x31". If the output is "0x31" then you've booted with the dongle connected and Vconn is enabled. If it is 0x30 then execute the following command to enable Vconn:

sudo i2cset -y -f 6 0x6e 0x2e 0x31

After this unplug and replug the dongle, I don't really expect this to help but it is worth a shot.

ViktorWalter commented 5 years ago

Wow, thanks. That actually did it. I had to install i2c-tools before. Also, the activated video output is listed as DP 2, even though HDMI2 is listed, but disconnected.

jwrdegoede commented 5 years ago

On 17-03-19 23:15, ViktorWalter wrote:

Wow, thanks. That actually did it. I had to install |i2c-tools| before.

Great, that is good to hear. So that means I need to give a little bit higher priority to making that happen automatically on the GPD win and pocket.

jwrdegoede commented 5 years ago

@ViktorWalter I just realized I did not respond to the bit about the monitor showing as being connected to DP2, this is normal all video-output over (non thunderbolt) Type-C is using the DisplayPort over Type-C protocol, so the GPD pocket is actually using Displayport, your dongle contains an IC to convert this to HDMI.

ViktorWalter commented 5 years ago

I see. Does that mean that the HDMI2 output is just a slot that the IGPU has that is not used in the pocket?

jwrdegoede commented 5 years ago

On 3/18/19 9:16 AM, ViktorWalter wrote:

I see. Does that mean that the HDMI2 output is just a slot that the IGPU has that is not used in the pocket?

Right, that is what it means (and the same for DP1).

xzavrel commented 5 years ago

@jwrdegoede my output for sudo i2cget -y -f 6 0x6e 0x2e is 0x18 but as soon as I ran sudo i2cset -y -f 6 0x6e 0x2e 0x31 I have the DP2 in my xrandr as expected.

Just one strange thing. Probably this is an issue in compositor, but I want you to let know. When I'm moving mouse cursor between the screens the pointer sticks on the edge of the screen. Repaint (eg. any window focus) fixs the problem.

jwrdegoede commented 5 years ago

@jwrdegoede https://github.com/jwrdegoede my output for |sudo i2cget -y -f 6 0x6e 0x2e| is |0x18| but as soon as I ran |sudo i2cset -y -f 6 0x6e 0x2e 0x31| I have the DP2 in my xrandr as expected.

Weird, I would have expected it to be 0x30. Anyways the fix is the same and I have an idea how to fix this now so that you do not need to manually do this, to be continued.

Just one strange thing. Probably this is an issue in compositor, but I want you to let know. When I'm moving mouse cursor between the screens the pointer sticks on the edge of the screen. Repaint (eg. any window focus) fixs the problem.

Yes that sounds like a compositor issue to me, definitely not a problem with the Type-C DP code.

dlynchcodes commented 5 years ago

I understand that this is very off topic as I don't have a GPD pocket but I don't see many other people talking about this. Its my understanding that linux kernel 4.19 added support for DP Alternate mode. I've upgraded my kernel on Ubuntu 18.04 to 5.0.3 and I'm still having trouble getting this working. Do you guys know if the Ubuntu 5.0.3 kernel would have this feature in it?

Is there a way to test if my machine/OS supports DP AlternateMode?

(I would look up if my laptop does but its a Xiaomi Mi Notebook Pro and the official specs are quite lacking or are in Chinese.)

I've seen some reports of people successfully using USB-C dongles and getting success in Windows so I'm assuming this laptop in theory does support this.

xzavrel commented 5 years ago

@jwrdegoede I have couple of Lenovo ThinkVision P27h with USB-C but https://psref.lenovo.com/syspool/Sys/PDF/ThinkVision/ThinkVision%20P27h/P27h%20specs.pdf, bu when I try to cat /sys/class/typec/port0-partner/port0-partner.0/displayport/pin_assignment I get no such file or directory error. Should it work? Is the reason because it's not DP->HDMI? Thanks

jwrdegoede commented 5 years ago

Hi,

On 07-04-19 11:09, Vojtěch Zavřel wrote:

@jwrdegoede https://github.com/jwrdegoede I have couple of Lenovo ThinkVision P27h with USB-C but https://psref.lenovo.com/syspool/Sys/PDF/ThinkVision/ThinkVision%20P27h/P27h%20specs.pdf, bu when I try to |cat /sys/class/typec/port0-partner/port0-partner.0/displayport/pin_assignment| I get no such file or directory error. Should it work? Is the reason because it's not DP->HDMI? Thanks

It should work, no idea why it does not work.

Regards,

Hans

xzavrel commented 5 years ago

Hi, is there anything I can do to diagnose the problem?

Regards

Vojta

jwrdegoede commented 5 years ago

is there anything I can do to diagnose the problem?

I cannot think of anything you can do to help diagnose this atm.

fiete201 commented 5 years ago

Hi Hans,

thanks for your work on this! After running the i2c commands listed above to set 0x31 and replugging my usb-c dock my dmesg gets spammed with:

[  567.003091] intel_xhci_usb_sw intel_xhci_usb_sw: Timeout waiting for role-switch
[  574.486529] intel_xhci_usb_sw intel_xhci_usb_sw: Timeout waiting for role-switch
[  575.725216] intel_xhci_usb_sw intel_xhci_usb_sw: Timeout waiting for role-switch

Do you have any idea what to against that?

Best regards fiete

jwrdegoede commented 5 years ago

On 27-05-19 23:27, Fritz Reichwald wrote:

thanks for your work on this! After running the i2c commands listed above to set 0x31 and replugging my usb-c dock my dmesg gets spammed with:

|[ 567.003091] intel_xhci_usb_sw intel_xhci_usb_sw: Timeout waiting for role-switch [ 574.486529] intel_xhci_usb_sw intel_xhci_usb_sw: Timeout waiting for role-switch [ 575.725216] intel_xhci_usb_sw intel_xhci_usb_sw: Timeout waiting for role-switch |

Do you have any idea what to against that?

No that is very strange.

Have you tried turning it off and back on again?

dreirund commented 5 years ago

I run a very recent kernel of Hans (linux-sunxi 5.2.0-rc7), and I just wanted to report that it does not work for me, since /sys/class/typec/port0-partner/port0-partner.0/ is not available, but now it somehow magically appeared ...

So I just report that I still have

i2cget -y -f 6 0x6e 0x2e

0x30 by default, and I can set it succesfully to 0x31 by i2cset -y -f 6 0x6e 0x2e 0x31.

But I have other issues with USB in general, after longer use with connecting and disconnecting USB-C-hub, sleep and suspend-to-disk, USB becomes buggy; one time the kernel did not report anymore a charger connected (but the red firmware-LED did show charging and battery level obervation confirmed that), other time USB failed to work completely (including the onboard keyboard and mouse, only touchscreen still worked). It is still too random to really debug.