tangent.gardner
Posts: 17
Joined: Sun Jan 24, 2016 4:13 am

cli: switching between projectors

Sun Jan 24, 2016 4:36 am

Please,
[Pi 2 Model B, Raspian]

I need to be able to switch video output between two identical projectors (something like: http://www.ebay.co.uk/itm/1200-lumen-Mi ... SwJcZWcmUh). I have to do this on the fly using a bash or perl script - using say xrandr.

My objective is to show video 1 on projector 1, then show video 2 on projector 2. All this automagically, no human intervention.

Should I install a 2nd hdmi port, try switching primary output from hdmi to usb, ....... ?

I'll take any advice I can get. Thanks.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: cli: switching between projectors

Sun Jan 24, 2016 9:13 am

You need an HDMI switch. It is a spearate device.

Perhaps you can find an USB-controllable model ? In that case
pester the seller to learn if the device is supported by Linux.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: cli: switching between projectors

Sun Jan 24, 2016 8:17 pm

Get a second Raspberry.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: cli: switching between projectors

Sun Jan 24, 2016 11:08 pm

ghans wrote:You need an HDMI switch. It is a spearate device.

Perhaps you can find an USB-controllable model ? In that case
pester the seller to learn if the device is supported by Linux.

ghans
I mentor kids in technology things.

One of them created a presentation controller on a Pi
Libreoffice Impress to run a slideshow
Relay board to control lighting
HDMI switcher to switch between projectors (push-button controlled unit, wired it into the GPIO to simulate button presses).
a python script to synchronise the lot (slide transitions, lights, projector)

So.... it's possible, but in the end (as has been pointed out) the cheaper/easier option may be a second Pi.
(does anyone do a PiZero daughter-board for the Pi?)

I suppose you could also try to use the HDMI and AV output (with suitable adapter) and swap outputs or something. Again, the adapter will probably cost more than a second Pi.

tangent.gardner
Posts: 17
Joined: Sun Jan 24, 2016 4:13 am

Re: cli: switching between projectors

Mon Jan 25, 2016 5:26 am

Yes, I normally do have seconds for desert, so I think a second Pie is the way to go:-) It'll be more fattening, but more fun.

My project is really very interesting - a work of art in the form of a show. It celebrates the achievements of a local observatory, over 100+ years!

The 1st pie plays a continual audio (poetry), then after fixed elapsed times it: opens and closes a door, opens and closes a travel chest, plays video 1, switches on lights and finally switches everything off and prepares of the next "performance".

After some predefinted time the 1st pie will ssh to the other one and run the 2nd video. Easy peasy. I just hope the 2nd pie isn't jealous!

Thanks a lot to everyone, Joe.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: cli: switching between projectors

Mon Jan 25, 2016 10:11 am

You'll need to create some form of command and control system so that RPi#1 can signal RPi#2 that it's dormant and ready to hand over the baton to the second RPi.

That sort of thing tends to look like an ideal job for MQTT using Mosquitto on one RPi as the pub/sub broker. The first RPi can publish a message on a topic for the second RPi when it's ready to hand over control. Likewise the second can publish another message to hand the baton back.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

tangent.gardner
Posts: 17
Joined: Sun Jan 24, 2016 4:13 am

Re: cli: switching between projectors

Tue Jan 26, 2016 5:09 am

Hmmmm, I am not so sure I need anything as complex as that.

Pi#1 runs a perl script that monitors a GPIO pin. Once that pin goes high, it simply starts watching elapsed time. At some time T it ssh's to Pi#2 and runs Video 2.

Pi#1 knows how long it takes Video 2 to run, so it knows when to proceed with the rest of the show. Simple.

Time is not critical. If things are out by a second or two, it won't really matter. Each event in the show has its own start and stop time.

Thanks a lot, Joe.

Return to “Graphics, sound and multimedia”