Jump to content

Asus Tinker Board HDMI (hotplug/etc)


TonyMac32

Recommended Posts

This will be a catch-all for HDMI-related things. 

 

Sep. 29, 2017 UPDATE First up is hotplugging in Mainline. Script/rule added to build system.  Thank you @botfap for the script

 

 

        I am getting the system events triggered saying the HDMI is unplugged/replugged, (using udevadm -monitor) however nothing is happening in response to the events it would seem, the screen is still blank.  I could hook a script to the event, but I'm not exactly sure what I would tell it to do...

 

Any thoughts would be great, I'll be researching.

 

Link to comment
Share on other sites

I havent tried Armbian yet but I had the same problem when I created a buildroot based firmware using eudev.

 

I added a new udev rule:

SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/hdmi-toggle"

in a new file (hdmi.rules) in /etc/udev/rules.d

 

Then save the bash script below to /usr/local/bin/ which will be triggered by the udev rule and toggle the display

#!/usr/bin/env bash

USER="$(who | grep :0\) | cut -f 1 -d ' ')"
export XAUTHORITY=/home/$USER/.Xauthority
export DISPLAY=:0

########### Settings ###########

# Use 'xrandr' to find these
DP="DP-1"
VGA="VGA-1"
HDMI="HDMI-1"
INTERNAL_DISPLAY="LVDS-1"

# Check /sys/class/drm for the exact location
DP_STATUS="$(cat /sys/class/drm/card0-DP-1/status)"
VGA_STATUS="$(cat /sys/class/drm/card0-VGA-1/status)"
HDMI_STATUS="$(cat /sys/class/drm/card0-HDMI-A-1/status)"

# Do no change!
EXTERNAL_DISPLAY=""

# Check to see if the external display is connected
if [ "${DP_STATUS}" = connected ]; then
	EXTERNAL_DISPLAY=$DP
fi
if [ "${VGA_STATUS}" = connected ]; then
	EXTERNAL_DISPLAY=$VGA
fi
if [ "${HDMI_STATUS}" = connected ]; then
	EXTERNAL_DISPLAY=$HDMI
fi

# The external display is connected
if [ "$EXTERNAL_DISPLAY" != "" ]; then
	# Set the display settings
	xrandr
	xrandr  --output HDMI-1 --auto
else
	# Restore to single display
	xrandr --output HDMI-1 --off
fi

exit 0

 

Link to comment
Share on other sites

Excellent. Ive simplified the toggle script. The one above monitors VGA, HDMI and DisplayPort connections. Obviously that's not need for most ARM SoC devices so the version below only toggles / monitors the HDMI port

#!/usr/bin/env bash
USER="$(who | grep :0\) | cut -f 1 -d ' ')"
export XAUTHORITY=/home/$USER/.Xauthority
export DISPLAY=:0
HDMI_STATUS="$(cat /sys/class/drm/card0-HDMI-A-1/status)"

# Check to see if HDMI connected or not and toggle if change
if [ "${HDMI_STATUS}" = connected ]; then
	xrandr
	xrandr --output HDMI-1 --auto
else
	xrandr --output HDMI-1 --off
fi

exit 0

 

Link to comment
Share on other sites

Post me the output (for the potato board) of:

tree /sys/class/drm
xrandr

Firstly with the HDMI unplugged, then with it plugged in.

 

Include any messages udev or syslog spits out at the same time as you unplug / plug the HDMI port.

 

You should also be able to toggle the display on manually via ssh with

export XAUTHORITY=/home/$USER/.Xauthority
export DISPLAY=:0
xrandr --output HDMI-1 --auto

 

Link to comment
Share on other sites

I was able to toggle the display with the xrandr commands last night, just the script wasn't working.  I'll do those tests once I finish my paying job.  ;-)

 

@Igor, with this ironed out should I add it to the bsp-specific scripts like the C2-hdmi script?

Link to comment
Share on other sites

root@lepotato:~# tree /sys/class/drm
/sys/class/drm
├── card0 -> ../../devices/platform/soc/d0100000.vpu/drm/card0
├── card0-Composite-1 -> ../../devices/platform/soc/d0100000.vpu/drm/card0/card0-Composite-1
├── card0-HDMI-A-1 -> ../../devices/platform/soc/d0100000.vpu/drm/card0/card0-HDMI-A-1
└── version
root@lepotato:~# xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 3840 x 2160
Composite-1 connected primary (normal left inverted right x axis y axis)
   720x576i      50.00
   720x480i      59.94
HDMI-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080     60.00*+
   1280x720      60.00

 

The commands work manually, I'm going to test it again to make sure I didn't have anything strange going on with the image.

Link to comment
Share on other sites

Your output is exactly as it should be and you can toggle manually which means that UDEV probably isnt triggering the rule.

 

Im going to have a look at Armbian tonight (I have never come across it before). Can you tell me what build / version / source tree, etc you are running on the Tinker then I can have a proper look.

 

And what would be the best kernel to build a desktop with libmali (egl, gles) and VPU support? Ive got an ubuntu 17.10 beta image up this morning on the stock asus 4.4 kernel and managed to get a gpu accelerated wayland/weston gnome 3 session up and running on the debian stretch mali r9 drivers/userspace which seems a long way from the current r19. Performance is not much better than swrast and the mouse cursor feels out of sync with the rest of the desktop but its a starting point.

 

Link to comment
Share on other sites

The default legacy kernel would be the simplest, and if you clone the build system it will pull the sources/etc for you, https://docs.armbian.com

The rk3288 kernel is based on the mqmaker source tree, so it's patching is becoming extensive, we might have to look at that if there aren't any updates from the vendor soon.  Mainline does not support the vcodec yet, so that is a stumbling block.

 

Documentation is there for about everything, including how to make patches.  

 

I flashed a new image for Le potato, starting from scratch, and it worked fine, I probably had messed something up in past testing.  Now working it into the build system.

Link to comment
Share on other sites

I have just downloaded, installed (etcher), updated, restartet: Armbian_5.34_Tinkerboard_Ubuntu_xenial_next_4.13.7_desktop.7z

It is attached to a HDMI-to-DVI cable to a 1280x1024 monitor (for testing). Screen stays black, not a blink.

root@tinkerboard:~# xrandr 
Can't open display 

root@tinkerboard:~# tree /sys/class/drm
-bash: tree: command not found

root@tinkerboard:~# export XAUTHORITY=/home/$USER/.Xauthority
root@tinkerboard:~# export DISPLAY=:0
root@tinkerboard:~# xrandr --output HDMI-1 --auto

root@tinkerboard:~# xrandr 
Screen 0: minimum 320 x 200, current 320 x 200, maximum 4096 x 4096
HDMI-1 disconnected (normal left inverted right x axis y axis)

root@tinkerboard:~# uname -a
Linux tinkerboard 4.13.7-rockchip #38 SMP PREEMPT Tue Oct 17 21:05:24 CEST 2017 armv7l armv7l armv7l GNU/Linux

armbianmonitor -u   has been uploaded to http://sprunge.us/cYCd

I will later connect it to the TV (Full HD) HDMI-HDMI and see if it works there - I'll be back :ph34r:

 

Edit: Works perfect on the TV

Edited by Tido
TV tested
Link to comment
Share on other sites

I'm having the same issue here with an odroid XU4,  latest legacy kernel and firmware.

 

Strange things is that I got my display back if I blindly switch to a 'text' tty ( alt + f2 ).

But when I try to recover my 'graphic' tty there's no display on it.

 

Thanks for your help, will gladly test some potential solutions.

 

 

Link to comment
Share on other sites

Sorry to bring this thread back to life but I've run into the same issue.  I use an HDMI switch for my several computers and of course only Tinkerboard refuses to come back.  As krpt mentions above, switching between text consoles gets text video back but not the X display.   I'm unsure what to do next.  Do we need to implement the rules and script described above even if not rolling our own kernel?  Is this documented as bug/enhancement for a future drop of Armbian?

 

[Update] I learned to read! :)  followed the instructions from botfap and it's worked great.  Happy to return it's working very well at 4K with a Samsung 28"  monitor.  Seems native resolution to me, so great!  BTW this is with legacy kernel.

Edited by Jose Deras
Solution
Link to comment
Share on other sites

Hi,

A little intro, I started to read a book about learning C. Now and then I have to do some examples and sometimes just read. While the examples are pretty easy and my environment to code "Geany" is very lightweight I thought a SBC would be enough instead of running the Tower PC.
My 19" 1280x1024 DVI-to-HDMI runs fine on tinker board - ARMBIAN 5.38 stable Ubuntu 16.04.3 LTS 4.14.14-rockchip (beta).

 

Now the situation is, that the Monitor takes more power than the SBC.. so I was looking in Armbian's XFCE for Screensaver.


ScreenSaver
I didn't find that option - so I guess it cannot turn off the screen after couple minutes?

 

Standby/Suspend
In the menu it offers Suspend, that would do the job as well - click.
The Monitor went black and so did all LEDs on the tinker board. And I couldn't wake it up either.

 

This is the first time for me using the SBC for Desktop tasks. Can they do what I ask above and just tinker board's SW is not ready?

Link to comment
Share on other sites

On 2/19/2018 at 2:43 PM, Tido said:

This is the first time for me using the SBC for Desktop tasks. Can they do what I ask above and just tinker board's SW is not ready?

 

I believe this is the case.  suspend/resume is supposed to be a possibility, but I've spent no time working on it as yet.  Now, the experimental 4.4 kernel will power down the display after a period of time. 

Link to comment
Share on other sites

1 hour ago, TonyMac32 said:

Changing Default kernel, Testing needed

That was the only major bug I am aware of if you want to roll out a new Rockchip-default image.

My 19" 1280x1024 DVI-to-HDMI runs fine on tinker board - 4.14   once the fresh image 4.4 is available I will give it a try if it likes my Monitor :-)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines