bvdwhiteytighties
Posts: 2
Joined: Mon Nov 18, 2019 8:37 am

HDMI Switcher - Detect Selected Input

Mon Nov 18, 2019 9:10 am

So I've had this idea of a project I'd like to execute in the not-too-distant future, and I'm trying to understand how I might go about doing it.

The idea: I want to have an HDMI switcher setup where I can detect which input is currently selected. My immediate goal for using this information is to have a light turned on based on which input is being output and displayed on the TV.

While conceptually simple, as someone extremely new to RPi (and, realistically, hardware stuff) I'm not sure what type of setup could be possible. I haven't found any HDMI switchers that have any sort of open source hardware configuration or API or anything like that. I was imagining some type of hardware integration, hooking into existing pins on the switcher.. but that would be very specific to the switcher selected I would think. I also thought maybe there would be a way to make the RPi act as the switcher, but it doesn't seem like that would be possible..

I'm a software developer, so writing some code to manage anything shouldn't be a problem. I just haven't had much hardware experience since college. Any ideas/conversation would be much appreciated!

User avatar
neilgl
Posts: 2226
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: HDMI Switcher - Detect Selected Input

Mon Nov 18, 2019 12:09 pm

If it was a cheap swith like this onehttps://www.amazon.co.uk/HDMI-Switch-Bi ... 764&sr=8-3
you could have two LDRs (light dependent resistors) "looking" at the LEDs and wired to GPIO pins on the pi. Then a python script to react accordingly to turn on lights etc.

LTolledo
Posts: 3585
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: HDMI Switcher - Detect Selected Input

Mon Nov 18, 2019 1:19 pm

There are off-the-shelf HDMI switchers with LED indicators for which channel is selected.

mine is a 4-port KVM switch (though the "M" in the "KVM" is hdMi) with LED indicators to display which HDMI input is currently being fed to the output HDMI monitor

or as a personal challenge to your coding skills you want make one using the RPi (zeroW?) and some sensors?
the coding challenge may also done on other of-the-shelf micro-controller modules, just using the RPi as a programming platform
(like I always do) :mrgreen:
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

hippy
Posts: 7911
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: HDMI Switcher - Detect Selected Input

Mon Nov 18, 2019 7:30 pm

bvdwhiteytighties wrote:
Mon Nov 18, 2019 9:10 am
I was imagining some type of hardware integration, hooking into existing pins on the switcher.. but that would be very specific to the switcher selected I would think.
The HDMI switcher won't have any API because it's completely standalone, usually auto-selects which input to use based on which has 5V present on pin 18 or some other means of determining a signal is being put in, or will be entirely manually operated.

To read which input has been selected you will want a switcher with LED's. Those can be read using LDR's as suggested and potentially directly from wires soldered to the LED internally if the other side of the LED goes to 0V or +V - But check the voltage before connecting directly to a Pi.
bvdwhiteytighties wrote:
Mon Nov 18, 2019 9:10 am
I also thought maybe there would be a way to make the RPi act as the switcher, but it doesn't seem like that would be possible.
The switcher probably has a button on it and you may be able to fake a button push direct from a Pi signal - checking voltage first.

If you have an IR remote controlled switcher you can either generate the requisite IR sequence through an IR transmitter and you may be able to feed a Pi signal directly into it instead of or in parallel with the IR receiver chip, given most IR receivers have open-collector outputs - Again check the voltages first.

I would use a cheap micro which can interface to the HDMI switcher, read the LED's and activate the button / IR receiver, then use a UART connection to the Pi so it can be commanded which to select and send back which is currently selected.

It is a feasible project - one I'm going to get round to doing myself at some point - but it will be switcher specific as you surmised.

trejan
Posts: 2238
Joined: Tue Jul 02, 2019 2:28 pm

Re: HDMI Switcher - Detect Selected Input

Mon Nov 18, 2019 7:46 pm

There are HDMI switches have a RS232 port on them that lets you query the currently selected input and change to a new input. They're usually more expensive though as they deem it to be a high end feature for more complex AV setups. There is no standard for this control so you need to work it out yourself if the manufacturer doesn't offer a protocol description.

I've taken apart one without RS232 control before and found a 3.3V UART inside. They were using the same microcontroller for controlling the HDMI switch chip as on their higher end models. They just don't have the RS232 socket + level translation circuitry. No guarantees this is true for all models though.

bvdwhiteytighties
Posts: 2
Joined: Mon Nov 18, 2019 8:37 am

Re: HDMI Switcher - Detect Selected Input

Thu Nov 21, 2019 8:10 am

Thanks for all the replies! Hooking up to the existing LEDs to detect the status.. something I should have thought of, but makes total sense! Probably the simplest approach

Return to “Beginners”