SteUK
Posts: 5
Joined: Mon Apr 22, 2013 1:21 pm

LMS on/off to signal amplifiers on/off

Mon Apr 22, 2013 1:32 pm

Hi chaps/chappettes,

I have a 3 pi, 3 room LMS setup working almost flawlessly, must say it is superb! Big thanks to all those involved in the community for getting me this far.

My desire now is to be able to turn amplifiers on/off in each room via the software player on/off signals (I am using iPeng and the web interface). Are there existing solutions/projects in the works?

Here are my random thoughts on how to get this working:

- LMS plugin to pass on the signal out of the pi.
- Either...IR emitter to send custom signals to perform actions on the amp...or...hard wire into each amps 'on/off' switch.
- Possibly 'Open Remote' might be usable? I have read of pi support.

I am a coder by trade, so that side does not phase me at all :)

Any/all help much appreciated?

Cheers,
Ste

qnology
Posts: 1
Joined: Tue Apr 23, 2013 10:19 pm

Re: LMS on/off to signal amplifiers on/off

Tue Apr 23, 2013 11:16 pm

Just an idea...plug the amp(s) into x10 device and use one of their usb/serial controllers to turn it off/on.

SteUK
Posts: 5
Joined: Mon Apr 22, 2013 1:21 pm

Re: LMS on/off to signal amplifiers on/off

Wed Apr 24, 2013 12:22 am

Good suggestion, but maybe a pricey solution.

Doing some more research I stumbled upon LIRC (linux inrfared remote control)...

http://randomtutor.blogspot.co.uk/2013/ ... ry-pi.html
http://alexba.in/blog/2013/01/06/settin ... spberrypi/
http://aron.ws/projects/lirc_rpi/

So, maybe my solution is to send out IR to the devices...

Though, this would require line of site to the device :-S

SteUK
Posts: 5
Joined: Mon Apr 22, 2013 1:21 pm

Re: LMS on/off to signal amplifiers on/off

Thu Apr 25, 2013 11:59 am

In case anyone is interested (now or in the future), I have purchased some home easy sockets and a refurbished tellstick (from ebay).

Have the daemons/utils for tellstick built on my pi ready to go, and have simple LMS plugin that detects on/off changes. Just need to hook up the two and should be good to go!

My amps are all currently a mishmash affair:
- Bedroom/bathroom : Arcam hi-fi amp separate (mains powered with physical on/off switch)
- Kitchen : Pure DAB alarm radio unit (power button needs to be toggled)
- Lounge : Sony 5.1 amp (hooked up to TV and a whole host of those things - toggle power switch and input selection, can't really see a way this will ever be automated)

With possible future hidden away addition (for the bathroom speakers, so bedroom and bathroom are powered off the same PI with two instances of squeezelite running), an old car head unit powered off a mains PSU.

If/when my automated power system works, I would like to replace them all (except the Arcam) with small stand alone amps, maybe some of the far-east offerings...does anyone have any experience of their quality? Not looking for anything jaw droppingly good just yet.

Will keep those interested posted as/when I get the systems up and running!

User avatar
Mortimer
Posts: 934
Joined: Sun Jun 10, 2012 3:57 pm

Re: LMS on/off to signal amplifiers on/off

Thu Apr 25, 2013 12:51 pm

- Lounge : Sony 5.1 amp (hooked up to TV and a whole host of those things - toggle power switch and input selection, can't really see a way this will ever be automated)
If this is an HDMI AV amplifier, then you might be able to use CEC via the HDMI connection to control it.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

SteUK
Posts: 5
Joined: Mon Apr 22, 2013 1:21 pm

Re: LMS on/off to signal amplifiers on/off

Thu Apr 25, 2013 2:41 pm

Cool! Cheers for the heads up.

It's a Sony Str k880, pushing 10 years old now...doesn't even hook up audio via hdmi :-S so I am not holding out much hope. Might eventually move the Arcam back downstairs and hook up something else in the bedroom.

SteUK
Posts: 5
Joined: Mon Apr 22, 2013 1:21 pm

Re: LMS on/off to signal amplifiers on/off

Fri May 03, 2013 5:31 pm

For anyone interested...

The Tellstick/home easy system is now up and running and works really well!

I have knocked up a small LMS plugin that calls 'tdtool --on/--off <device_name>' to switch on the associated player sockets.

Bought a couple of Dell A525 mini sub + satellite systems an put one in the kitchen, one in the bedroom. Have two squeezelite player instances running on the upstairs pi to feed bedroom and bathroom (output to the pi audio port and a USB dac, will be two dac's once I can de-mess all the cables and box them up for safety - they are loose PCBs).

Also have Telldus Live! python scripted server running on the server pi, which lets me power on/off sockets from my smart phone/tablets! (though the delay is a bit high, certainly higher than switching on/off from my plugin).

Downsides...
- Amp 'pop' when powering on, different severity for each amp obviously.
- iPeng seems to delay commands a second or two after player(amp) on/off. I think this is because calling tdtool takes a few seconds to return...certainly see this when executing the command in a shell.

All in all, very pleased with where my home networked audio solution is right now. Things to change, hmm...
- Clean up cables, routing, add trunking where required, etc
- Put dac's in something to protect them and hook up the other three dac's I have for best quality output.
- Investigate an alternative to Telldus Live! to remove delay in system, add scheduling ability (crontab manipulation maybe).
- Add CD/DVD drive to server pi and setup 'auto-rip to music library. This from experimentation will be sloooooow on the pi, but time is not critical for ripping so...

Thoughts? Suggestions?

Cheers,
Ste

no1knows
Posts: 2
Joined: Sun Nov 10, 2013 8:22 pm

Re: LMS on/off to signal amplifiers on/off

Sun Nov 10, 2013 11:20 pm

Hey Ste,

Could you elaborate a little on the LMS plugin you've created?

Thanks!

robbrad
Posts: 3
Joined: Sat Jul 05, 2014 7:50 am

Re: LMS on/off to signal amplifiers on/off

Sat Jul 05, 2014 7:54 am

Wow. I would REALLY like to see that source code. I would adapt to be used with hdmi cec
Rob

hiltmantroy
Posts: 2
Joined: Mon Jul 14, 2014 1:04 pm

Re: LMS on/off to signal amplifiers on/off

Mon Jul 14, 2014 1:14 pm

Hi Ste, I am looking to achieve exactly what you have, though I can't find much in the way of this, I did find some stuff for xbmc which would allow setting the GPIO to trigger the relay on/off when sound was playing but I can's work out how to get that to work with either the LMS or the squeezelite side of things. Where did you get up to on this? Steep old learning curve this one I think

Cheers

Peter

rom650
Posts: 3
Joined: Mon Aug 04, 2014 3:16 pm
Location: Lyon, France

Re: LMS on/off to signal amplifiers on/off

Mon Aug 04, 2014 3:17 pm

Me too...
I'm very interested by your script :)

kefa
Posts: 5
Joined: Sat Jan 12, 2013 11:52 pm
Location: London, UK

Re: LMS on/off to signal amplifiers on/off

Sat Aug 30, 2014 12:43 pm

I have integrated LMS 7.8.0 running on Rasbian in 3 ways due to limitations of the way my audio equipment can be controlled:

1. Use Squeezebox classic with the excellent IR-Blaster plugin to learn and playback IR codes to control the volume on my DAC via the volume up/down controls on iPeng or the LMS web interface (note that this does not require any special integration with the RPI - just a IR blaster cable and plugged in to the headphone socket of a Squeezebox Classic.
2. Use 433MHz transmitter/receiver module to control a 4-way adapter wirelessly to turn things on/off at the mains (although my Audiolab M-DAC has a remote control it doesn't control the power state) - I used this 4-way from Lindy which works great (http://www.lindy.co.uk/power-c8/power-a ... -8m-p3791/). I think this should give you a view of the RF modules and how they are connected via GPIO (http://www.hoagieshouse.com/RaspberryPi ... CPlug.html)
3. Trigger my Bryston power amp to take it in and out of standy with a 4-12v trigger (wasn't happy about switching a high power device on/off at the mains due to speaker clicks). Unfortunately the 3.3v GPIO wasn't sufficient voltage so i just stepped this up to 5v using a transistor darlington pair.

For 2 and 3 I used the excellent PowerCenter plugin to run a local gpio_trigger.py python script (see below) on certain LMS events on the Rapspberry Pi combined with codesend and wiring pi to send the to send the codes to control the 4-way over RF (https://github.com/ninjablocks/433Utils). The GPIO high and low commands turn the amp on and back in to standby. There are some delays built in to ensure the sequencing is correct and there is enough for things to complete their power up.

Code: Select all

#!/usr/bin/python

import RPi.GPIO as GPIO
from pylms.server import Server
from pylms.player import Player
import sys
import time
import subprocess

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)

if sys.argv[1] == 'on':
	subprocess.Popen(["/home/pi/codesend", "2175199"])
	time.sleep(0.5)
	subprocess.Popen(["/home/pi/codesend", "2175191"])
	time.sleep(11)
	GPIO.output(18, GPIO.HIGH)
	time.sleep(1)
elif sys.argv[1] == 'off':
	GPIO.output(18, GPIO.LOW)
	time.sleep(3)
	subprocess.Popen(["/home/pi/codesend", "2175198"])
	time.sleep(0.5)
else:
	print "Invalid argument."

Return to “Media centres”