USB-C Dock and HDMI, revison 1.2 (Modded)
#1
*Edit* Please see https://wiki.mobian-project.org/doku.php?id=mods
Update ANX chip firmware https://xnux.eu/devices/feature/anx7688.html
Note: this should be run as root user and not through sudo
*This line is important. Note 2: Clone the repository rather than directly downloading the .bin file. For some reason, directly downloading it does not give you the correct image and errors on the “echo” command.

*Original Post*
I have been testing out a USB-C dock for a couple days now. USB device work (mouse, flash drives), SD-card reader, and power deliver all work. However, I can not get a monitor to detect the HDMI signal, dmesg shows when HDMI is plugged in an detected. Has anyone successfully used display out on Mobian? I am hitting a wall troubleshooting this, and have ruled out the dock itself.

Unplugged HDMI: anx7688 0-0028: dp state changed to 0x00
Plugged in HDMI: anx7688 0-0028: dp state changed to 0x03

Note to anyone wondering my phone is hardware modded (switches removed)
#2
I have a hardware modified Braveheart as per https://xnux.eu/devices/feature/anx7688.html. I flashed the anx7688 using the firmware from megous at https://megous.com/git/linux-firmware/pl...688-fw.bin. I basically get the same message from dmesg:

[18985.913240] anx7688 0-0028: dp state changed to 0x00
[19026.231163] anx7688 0-0028: dp state changed to 0x03

Not sure how the usb c alternate mode is switched to.

There appears to be a kernel module which isn't modprobed  - /lib/modules/5.7-pinephone/kernel/drivers/usb/typec/altmodes/typec_displayport.ko.

There's some kernel doco here which doesn't really clear things up (not that I really understand it anyway) - https://www.kernel.org/doc/html/latest/d...c_bus.html.

I saw that Marrtijn Braam from postmarketos did a youtube video showing it working but I can't find any doco from him on this wiki or his blog. It looks like the postmarketos people have looked at packaging up the firmware so maybe they are sorting out the whole issue. I have been using Mobian and have no idea what they are up to in this are. 

It looks like, if there is any doco on this, it hasn't been put anywhere easy to find. If it is as simple as plugging in a usb c dock and it all should work, why is it not working for some people (including me)? If someone is aware of all the caveats/gotchas, that coulsd include hardware version etc., could they please enumerate them here.

Thanks.
#3
(07-17-2020, 10:21 PM)hetp Wrote: I have a hardware modified Braveheart  as per https://xnux.eu/devices/feature/anx7688.html. I flashed the anx7688 using the firmware from megous at https://megous.com/git/linux-firmware/pl...688-fw.bin. I basically get the same message from dmesg:

[18985.913240] anx7688 0-0028: dp state changed to 0x00
[19026.231163] anx7688 0-0028: dp state changed to 0x03

Not sure how the usb c alternate mode is switched to.

There appears to be a kernel module which isn't modprobed  - /lib/modules/5.7-pinephone/kernel/drivers/usb/typec/altmodes/typec_displayport.ko.

There's some kernel doco here which doesn't really clear things up (not that I really understand it anyway) - https://www.kernel.org/doc/html/latest/d...c_bus.html.

I saw that Marrtijn Braam from postmarketos did a youtube video showing it working but I can't find any doco from him on this wiki or his blog. It looks like the postmarketos people have looked at packaging up the firmware so maybe they are sorting out the whole issue. I have been using Mobian and have no idea what they are up to in this are. 

It looks like, if there is any doco on this, it hasn't been put anywhere easy to find. If it is as simple as plugging in a usb c dock and it all should work, why is it not working for some people (including me)? If someone is aware of all the caveats/gotchas, that coulsd include hardware version etc., could they please enumerate them here.

Thanks.
I got it working, it's a bit finicky but it works.
The wiki here https://wiki.mobian-project.org/doku.php?id=mods has a important part "Note 2: Clone the repository rather than directly downloading the .bin file. For some reason, directly downloading it does not give you the correct image and errors on the “echo” command."
Then follow the rest of the wiki page.
#4
I got the soldering work done,

What command would I use to clone the driver file in the tree? Sorry I'm kinda slow with the linux terminal.
Thanks!
#5
# git might not be installed by default - on debian use 'apt install git' to install it, on manjaro use 'pacman -Syu git'
git clone https://megous.com/git/linux-firmware
cd linux-firmware/
sudo cp anx7688-fw.bin /lib/firmware/

# you must be root for the next bit as sudo does not work
su -
echo 1 > /sys/class/typec/port0/device/flash_eeprom
# control d to logout of root (or type exit and hit enter) - never stay logged in as root (use sudo where possible)

At the moment getting the hdmi to work is very hit and miss. So keep plugging away. I can't give you any hints because I haven't found any pattern yet.
#6
(08-03-2020, 04:37 PM)hetp Wrote: # git might not be installed by default - on debian use 'apt install git' to install it, on manjaro use 'pacman -Syu git'
git clone https://megous.com/git/linux-firmware
cd linux-firmware/
sudo cp anx7688-fw.bin /lib/firmware/

# you must be root for the next bit as sudo does not work
su -
echo 1 > /sys/class/typec/port0/device/flash_eeprom
# control d to logout of root (or type exit and hit enter) - never stay logged in as root (use sudo where possible)

At the moment getting the hdmi to work is very hit and miss. So keep plugging away. I can't give you any hints because I haven't found any pattern yet.
I wrote a long detailed post but the format keeps getting messed up. So, here is a trimmed short version.

This post https://forum.pine64.org/showthread.php?tid=10907 provided me information on being able to use both the Pinephone screen and external screen at the same time. Assumed hardware fix and anx firmware has been flashed. Install wlr-randr. Connect dock, cables, keyboard, etc.

Have Pinephone screen on, then "wlr-randr --output HDMI-A-1 --on", "wlr-randr --output HDMI-A-1 --mode 1280x720@50Hz". If there are noticeable graphical issues restart Phosh "sudo systemctl restart phosh.service", then set the external resolution again ""wlr-randr --output HDMI-A-1 --mode 1280x720@50Hz".


Possibly Related Threads…
Thread Author Replies Views Last Post
  Ethernet through the dock? Diagon 22 3,605 01-25-2021, 01:05 PM
Last Post: zborgerd
  screen goes blank when I insert pinephone dock, or usb-a to usb-c adaptor rp3 3 704 01-12-2021, 05:06 AM
Last Post: rp3
  HDMI on Mobian sundog 2 1,405 09-08-2020, 09:19 AM
Last Post: sundog

Forum Jump:


Users browsing this thread: 1 Guest(s)