amilino
Posts: 98
Joined: Fri Feb 05, 2016 6:01 pm

Hdmi hotplug not usefull

Sat Jul 13, 2019 8:11 am

Hi, I am using this option hdmi_force_hotplug=1 in case when I start my raspberry pi before turning on my TV. Now this is super option but in my case not that usefull.

Thing is that when I turn on my TV, resolution will not be the highest so I need to manually change it to auto via GUI application called Display settings (lxrandr). Tried to play around with UDEV rules to detect hdmi state changes to change resolution on the fly but it doesn't work. Also I do not know how to change resolution to the highest supported by attached device, TV in my case.

Any idea how to automate this? Alternative solution for my case is to turn off this hdmi_force_hotplug=1 feature and have in mind that I first need to turn on my TV and then RPi, what is totaly stupid.

User avatar
HawaiianPi
Posts: 5996
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Hdmi hotplug not usefull

Sat Jul 13, 2019 9:24 am

amilino wrote:
Sat Jul 13, 2019 8:11 am
... and have in mind that I first need to turn on my TV and then RPi, what is totaly stupid.
How is the Pi supposed to know what TV or monitor you have? I'm pretty sure psychic silicon has not been invented yet. The display needs to be on because the Pi has to read the EDID data from the display in order to know how to configure itself properly.

You can manually set the resolution in the Raspbian configuration utility, in which case the hotplug setting will be useful again.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

amilino
Posts: 98
Joined: Fri Feb 05, 2016 6:01 pm

Re: Hdmi hotplug not usefull

Sat Jul 13, 2019 9:30 am

The same way Raspbian configuration utility knows about resolutions of TV, the same way it should be possible to do it via terminal and with trigger on hdmi connection to RPi. It is all about automation on thing that exist and work if I do it manually. But if I have to do it manually, then I rather switch RPi off and on. 😀

amilino
Posts: 98
Joined: Fri Feb 05, 2016 6:01 pm

Re: Hdmi hotplug not usefull

Sat Jul 13, 2019 9:48 am

Ok this is how it can be done without GUI

Code: Select all

xrandr -d :0 -- output HDMI-1 --auto
But how to run it on hdmi hotplug?

pik33
Posts: 195
Joined: Thu Sep 10, 2015 4:26 pm

Re: Hdmi hotplug not usefull

Sat Jul 13, 2019 10:46 am

config.txt file:

hdmi_group=
hdmi_mode=

Check the list of HDMI groups and modes here https://www.raspberrypi.org/documentati ... t/video.md , then add appropriate numbers after =

amilino
Posts: 98
Joined: Fri Feb 05, 2016 6:01 pm

Re: Hdmi hotplug not usefull

Sat Jul 13, 2019 4:36 pm

pik33 wrote:
Sat Jul 13, 2019 10:46 am
config.txt file:

hdmi_group=
hdmi_mode=

Check the list of HDMI groups and modes here https://www.raspberrypi.org/documentati ... t/video.md , then add appropriate numbers after =
I know about that but I would like to have a more generic solution. What if I have two TV's where I am switching RPi from one to another and they both have different resolution?

amilino
Posts: 98
Joined: Fri Feb 05, 2016 6:01 pm

Re: Hdmi hotplug not usefull

Tue Jul 16, 2019 9:46 am

Ok, udev rule not triggered by hotplug of hdmi and tvservice -s always showing connected. I will return one step back and disable this feature, if someone have a different idea I am willing to test it. 🙂

User avatar
HawaiianPi
Posts: 5996
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Hdmi hotplug not usefull

Tue Jul 16, 2019 10:25 am

The Pi computers don't support HDMI hotplug.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9891
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Hdmi hotplug not usefull

Tue Jul 16, 2019 11:19 am

This sounds like it is more down to your monitor than the Pi.
The EDID should be readable even when the display is powered off - there's even a 5V line up the HDMI cable to power the EDID EEPROM. Testing on my Dell monitor here I can read the EDID happily when it is turned off via the soft power button (not when physically unplugged from the mains).

The Pi has never supported full hotplug. It supports more display outputs than it can drive simultaneously, therefore detects what is connected at boot.

With FKMS (and eventually full KMS) it already reads the EDID on demand. We can probably plumb in the connector status to allow monitor switching once booted. Whether the change is also made to make the assumption that if no other displays are attached that HDMI should be active and wait for a hotplug connect status is a different question.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

amilino
Posts: 98
Joined: Fri Feb 05, 2016 6:01 pm

Re: Hdmi hotplug not usefull

Tue Jul 16, 2019 2:45 pm

6by9 wrote:
Tue Jul 16, 2019 11:19 am
This sounds like it is more down to your monitor than the Pi.
The EDID should be readable even when the display is powered off - there's even a 5V line up the HDMI cable to power the EDID EEPROM. Testing on my Dell monitor here I can read the EDID happily when it is turned off via the soft power button (not when physically unplugged from the mains).

The Pi has never supported full hotplug. It supports more display outputs than it can drive simultaneously, therefore detects what is connected at boot.

With FKMS (and eventually full KMS) it already reads the EDID on demand. We can probably plumb in the connector status to allow monitor switching once booted. Whether the change is also made to make the assumption that if no other displays are attached that HDMI should be active and wait for a hotplug connect status is a different question.
Ok, now it is clear. Tnx for explanation.

Return to “Graphics programming”