You are not logged in.

#1 2017-01-17 11:32:56

Denshou
Member
Registered: 2017-01-17
Posts: 25

Unable to display screen display on TV through HDMI

Hello everyone !

I have installed Archlinux on an old laptop and have been using it for quite some time now. So far, I managed to resolve every problem I faced by myself (or by browsing the web), but this time, I couldn't find any solution so I decided to ask for some help.

I am currently trying to set up HDMI so I can watch what's displayed on my laptop screen on my TV. While it doesn't seem to be such a big deal, I'm pretty stuck on this thing. Since it didn't work by simply plugging a cable, I did some research.
Apparently, the CLI tool to use is xrandr, but unfortunately, using it doesn't show the HDMI ouput.

Here's what I get from

lspci | grep -e VGA -e 3D 

00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Park [Mobility Radeon HD 5430/5450/5470] (rev ff)

Looks like my old laptop have two video cards. I don't know much about which is used for what and when (I'd be glad to know more about that) so I installed a driver for each, based on the ArchWiki's Xorg page : xf86-video-nouveau and xf86-video-ati

I guess I already had a driver for at least one of the card from back from when I first installed the OS (otherwise I wouldn't have a display manager, nor a window manager, right ?), but maybe installing a new driver uninstall the previoulsy used by the card ? I don't know. Anyway, I checked and these two are the only video cards drivers on my system at the moment.

Still no HDMI ouput showing while using xrandr, even after doing sudo pacman -Syu and rebooting the computer (just in case). But I saw here and there on the web to look for the logs in vim /var/log/Xorg.0.log, which I did.

I'm not very good at this, so I don't know what to do with this, but I looked for "HDMI" in the said file and here's what I found :


[    23.610] (II) RADEON(G0): Output HDMI-1-0 has no monitor section
[    23.748] (II) RADEON(G0): EDID for output HDMI-1-0
[    23.748] (--) RADEON(G0): HDMI max TMDS frequency 225000KHz
[    23.748] (II) RADEON(G0): Printing probed modes for output HDMI-1-0

But the most interessant seems to be the last two lines with HDMI in them :

[    27.229] (II) config/udev: Adding input device HDA ATI HDMI HDMI/DP,pcm=3 (/dev/input/event17)
[    27.229] (II) No input driver specified, ignoring this device.

Funny enough, I also have a Xorg.0.log.old and a Xorg.0.1.log. Can you explain to me why ? The three files contain the last two lines mentioned above.


So here I am. I really don't know what to do in order to get this to work, so I'd be very thankful if someone here could give me some help and explain to me so I know what I'm doing.

I'm sorry if this is kind of confusing, English is not my native language. Thank you for taking the time to read me anyway.

See you guys around !

Last edited by Denshou (2017-01-18 07:41:46)

Offline

#2 2017-01-17 18:30:48

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Unable to display screen display on TV through HDMI

Please post the output of "xrandr".

Please post the output of "pacman -Qq | grep xf86-video".

Please use the BBCode "code" tag when posting your answers here.

smile

Offline

#3 2017-01-18 07:47:30

Denshou
Member
Registered: 2017-01-17
Posts: 25

Re: Unable to display screen display on TV through HDMI

Thank you for your answer. As requested, I edited my previous post with the said tags.

Here's the output of xrandr :

$ xrandr
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1366x768      59.99*+
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   800x600       60.00    60.32    56.25  
   700x525       59.98  
   640x512       60.02  
   640x480       60.00    59.94  
   512x384       60.00  
   400x300       60.32    56.34  
   320x240       60.05  
VGA-1 disconnected (normal left inverted right x axis y axis)

As I stated before, the HDMI ouput is nowhere to be found.

As for the other command you asked for, here goes :

$ pacman -Qq | grep xf86-video
xf86-video-ati
xf86-video-nouveau

These are the two drivers I installed for my two video cards, just as I said. Does this give you any idea ?

Offline

#4 2017-01-18 16:18:48

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Unable to display screen display on TV through HDMI

Ok, I did some quick research... smile

It looks like you have Radeon and Intel graphics cards, but you have Radeon and Nvidia "xf86-video" drivers installed. That seems strange...

I did a search for "linux ati intel switchable graphics", which led me to this information on hybrid graphics.

That website says you might need to use PRIME to enable / disable video cards. And there is also information on that page for issues where xrandr specifies only 1 output provider.

...That's all the information I have. I'm sorry, I've never used hybrid graphics. I hope that helps you find a solution. smile

Offline

#5 2017-01-20 16:00:23

Denshou
Member
Registered: 2017-01-17
Posts: 25

Re: Unable to display screen display on TV through HDMI

Please excuse me for taking so long to answer. I wasn't able to test your suggestion until a few moments ago.

Well, that did it. First, thanks for pointing out the fact that I had the wrong driver installed for my Intel card. Actually, thank you for everything, just like you said, the solution was to use PRIME. Here's what I did in case this can help someone :

First, I ran :

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x96 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 3 associated providers: 1 name:Intel
Provider 1: id: 0x56 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 3 associated providers: 1 name:ATI Mobility Radeon HD 5000 Series @ pci:0000:01:00.0

Then I used the following command (also known as Reverse PRIME) to use outputs from my secondary GPU :

$ xrandr --setprovideroutputsource 'ATI Mobility Radeon HD 5000 Series @ pci:0000:01:00.0' Intel

And finally all I had to do was to run :

$ xrandr --output HDMI-1-0 --auto

Thanks again for your help ! smile

Now, I wonder if there is a way to automatically start all of  the actions above when I plug the HDMI cable. Do you think that's doable ? Since the HDMI ouput isn't available until I run use Reverse PRIME...

Last edited by Denshou (2017-01-20 17:05:22)

Offline

#6 2017-01-20 18:20:03

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Unable to display screen display on TV through HDMI

Yay! smile

Denshou wrote:

Now, I wonder if there is a way to automatically start all of  the actions above when I plug the HDMI cable. Do you think that's doable ? Since the HDMI ouput isn't available until I run use Reverse PRIME...

If you want to make it automatic, you can write a "udev" rule that will run a command when an HDMI cable is plugged in. (Search for "udev rule connect hdmi".) I am not smart enough to be able to understand how to write udev rules. tongue

As for me, I would rather have a keyboard shortcut that will toggle the HDMI screen on and off, which is pretty easy to set up.

Good luck!

Offline

#7 2017-01-21 16:27:38

Denshou
Member
Registered: 2017-01-17
Posts: 25

Re: Unable to display screen display on TV through HDMI

In the end I added :

$ xrandr --setprovideroutputsource 'ATI Mobility Radeon HD 5000 Series @ pci:0000:01:00.0' Intel

to my .xprofile file, right before my window manager. Since any xrandr configuration only last for the current session, I had to type in this command each time after several boots, which lead me to this decision. I don't think this does any harm, but please, tell me if I'm mistaken.

drcouzelis wrote:

f you want to make it automatic, you can write a "udev" rule that will run a command when an HDMI cable is plugged in. (Search for "udev rule connect hdmi".) I am not smart enough to be able to understand how to write udev rules. tongue

Don't say that. tongue
I searched about udev rules this afternoon, it doesn't seem that hard to set up. However, most of the udev rules I saw involved a script in order to switch (or not) to another screen based on if a HDMI cable is plugged or not. This is set by the following function :

status="$(cat /sys/class/drm/card0-HDMI-A-1/status)"

I did try to use some of those scripts, but it never worked out for me. Then I tried to run the said command on its own and noticed something strange : the status isn't updated until I run the xrandr command. For instance, if a HDMI cable is plugged when I boot my computer, the status will be "connected" even if I unplug the cable, as long as I don't run the xrandr command. This also apply to the opposite case, of course.

This issue prevent me from running a script based on if a cable is plugged or not and a udev rule by the same mean. I looked for something online, but couldn't find anything related. Any idea how to solve this ?

drcouzelis wrote:

As for me, I would rather have a keyboard shortcut that will toggle the HDMI screen on and off, which is pretty easy to set up.

This is pretty much what I did since I couldn't find any better solution. If anyone's interested, I added the following lines to my .config/i3/config file :

# OUTPUT DISPLAY
# Switch screen display to the second monitor through HDMI output (mode optimised for TV)
bindsym $mod+Next exec xrandr && xrandr --output LVDS1 --off --output HDMI-1-0 --mode 1360x768

# Switch screen display back to the main monitor through HDMI output
bindsym $mod+Prior exec xrandr && xrandr --output LVDS1 --auto --output HDMI-1-0 --off

# Display on both monitors (mode optimised for TV)
bindsym $mod+equal exec xrandr && xrandr --output LVDS1 --auto --output HDMI-1-0 --mode 1360x768

As you can see, my keyboard shortcuts call for the xrandr command to update the HDMI output status before starting the requested actions (switching to the other monitor or displaying on both). It doesn't work without that because, as I stated above, my computer won't detect on its own if the cable has been plugged or unplugged after boot until I run this specific command. And of course, you'll also have to run the

$ xrandr --setprovideroutputsource 'ATI Mobility Radeon HD 5000 Series @ pci:0000:01:00.0' Intel

command beforehand to get the whole thing to work for your current session, or add it to your .xprofile file like I did to make it permanent.

While this works, this set up is only optimised for one device, pretty sure I'll have to change the value of the --mode option each time I want to connect to a different monitor. And I can't help but think this is a pretty dirty solution.

Plus, I'd really like to set up a udev rule with a script for that. Not only for the convenience, but also because this is an opportunity to test and learn about a new (for me) feature of systemd. So, if you have any idea how to solve this "output status update" issue, that'd be, once again, a huge help.

Thank you for your help up until now anyway ! big_smile

Offline

#8 2017-01-23 18:09:49

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Unable to display screen display on TV through HDMI

Very nice! And you're welcome. smile

At this point, my advice would be to mark this thread as "SOLVED" (since your original question is solved). Then, work on setting up your computer how you want it (it sounds to me like you're already done with this step!) and when you get stuck, open a new thread asking your new detailed question (for example, about udev rules...) and see if anyone has any advice. You can include a link to THIS thread, for people to reference.

That might help any "udev masters" notice your question. big_smile

Offline

Board footer

Powered by FluxBB