Amplifier Switch Plugin

Discuss, contribute and orient Volumio development!

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

Amplifier Switch Plugin

Postby Fightclub » Fri Feb 03 2017 19:48

Dear community,

I'm happy to present my first plugin to you. The Amplifier Switch was born out of a need: I'm using an external Class-D amplifier that will be inaccessible in in it's final case. While the RPI with volumio should be powered all the time, the amp clearly shouldn't. I also didn't want to turn the amp on/off by hand every time.
Once activated, the AmpSwitch plugin will listen for status changes in the player and automatically turn on/off a user-selected output when music starts/stops. This way AmpSwitch will make your volumio behave like the amplifier is always on, with the power saving as if you would turn it on/off by hand every time.
As some amplifiers may require an inverted signal, the settings of AmpSwitch allow you to set it to inverted mode.

You can download ampswitch for volumio here.
If you encounter any bugs using AmpSwitch, please report them on GitHub.
User avatar
Fightclub
Serious Listener
Serious Listener
 
Posts: 80
Joined: Tue Feb 09 2016 18:28
Location: Germany

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


Amplifier Switch Plugin

Postby steph99_de » Mon Jun 05 2017 15:09

hi!

great plugin!
Would it be possible to add a (variable/user-specified) pause before the amp is switched-off?
Can I add a line of code in index.js or is it more complicated than that?
Any hints or tips would be much appreciated!
Thanks for this great plugin!
stephan
Random avatar
steph99_de
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Mon Jun 05 2017 15:04


Amplifier Switch Plugin

Postby Fightclub » Wed Jun 14 2017 19:48

Sorry for the delayed reply, didn't check back for a while. I also thought about adding a delay, but wasn't sure whether it was actually something that someone would be interested in. It's a little more complex, but not much. I'll try to add it in the next few days
User avatar
Fightclub
Serious Listener
Serious Listener
 
Posts: 80
Joined: Tue Feb 09 2016 18:28
Location: Germany


Amplifier Switch Plugin

Postby cldebuhr » Thu Jun 15 2017 00:03

Outstanding! This is a great plug is as is, but a delay (5 - 10s? Ideally user specified) would make it even better. I've been using this for a while an it works perfectly, but whenever I switch playlists/ radio streams/ etc., the amp power cycles. Not the end of the world, but a little bit irritating. A short delay would fix that completely.

Thanks for the great work!
Random avatar
cldebuhr
Sunday DIYer
Sunday DIYer
 
Posts: 19
Joined: Sun May 14 2017 22:52


Amplifier Switch Plugin

Postby Fightclub » Thu Jun 15 2017 17:16

Interesting, thanks for the bug report. Regardless of any delay, it shouldn't power cycle when changing play source. Can you give some more details on when this happens? After every song? Only when changing song manually? With songs in one playlist? This will help a lot to trace what's going on.
User avatar
Fightclub
Serious Listener
Serious Listener
 
Posts: 80
Joined: Tue Feb 09 2016 18:28
Location: Germany


Amplifier Switch Plugin

Postby steph99_de » Thu Jun 15 2017 21:15

Hi Fightclub,
great news! a user-defined delay would be perfect! I am looking for a delay of 15 to 30 minutes. I don't mind my amps to be switched on for quite a while (class D). I'd just like them to be turned off automatically over night or when we are on vacation and so on. I tried to forget to switch them off. ;)
Again: great plugin and thanks a lot!!
regards Stephan
Random avatar
steph99_de
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Mon Jun 05 2017 15:04


Amplifier Switch Plugin

Postby cldebuhr » Fri Jun 16 2017 02:52

Fightclub wrote:Interesting, thanks for the bug report. Regardless of any delay, it shouldn't power cycle when changing play source. Can you give some more details on when this happens? After every song? Only when changing song manually? With songs in one playlist? This will help a lot to trace what's going on.


Hi,

I'm not sure I'd call it a bug ... I'd have reported an issue on your GitHub in that case. As near as I can tell, the plug is is performing perfectly to specifications. If I'm playing a predefined playlist, everything is perfect ... no power cycles between tracks. But If I command volumio to play something else (different track, new playlist, different webradio stream, etc.), then for a second or three (while volumio is figuring out how to get its act together and follow the new instructions), playback stops. And when playback stops, your plug-in says "Turn off the amplifier!", just as its supposed to. And then when playback resumes, the amp comes back on and all is right in the world again (well - at this little corner of it anyway). As I said, only mildly annoying, and far less so than either leaving the amp on all the time or switching it manually! Now if Amplifier Switch were to wait a few seconds before powering down ... that would be perfection! I'd be happy with 5-10 seconds, Stephan sounds like he'd prefer 900s-1800s, a bit long for my taste, but I could live with that. Optimal, however, would be a user definable shutdown delay.

As I said before, great plug in ... use it all the time. With or without the enhancement of a (user defined?) shutdown delay, I will continue happily using it with many thanks to you!
Random avatar
cldebuhr
Sunday DIYer
Sunday DIYer
 
Posts: 19
Joined: Sun May 14 2017 22:52


Amplifier Switch Plugin

Postby Morphy99 » Wed Jul 19 2017 22:25

I'm wondering how easy this would be to adapt this plugin to use for a smartplug scenario? Instead of using GPIO it would send a UDP command to the smart plug?
Random avatar
Morphy99
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Sun Jul 09 2017 21:51


Amplifier Switch Plugin

Postby Fightclub » Thu Aug 10 2017 14:54

Hey guys, sorry for the delay, couldn't find the time to implement this, yet. But I didn't forget about it.
Considering the smart plug, this totally depends on the smart plug that's being used. If it's really just a simple UDP package that needs to be send it's fairly simple. But for the majority of large brands I doubt that it's that easy. If they use some form of proprietary protocol than it all depends on whether there is a library that you can call.
User avatar
Fightclub
Serious Listener
Serious Listener
 
Posts: 80
Joined: Tue Feb 09 2016 18:28
Location: Germany


Amplifier Switch Plugin

Postby Fjellhoy » Sun Aug 20 2017 09:45

Hi. I try to download this but i get " error 404 page not exist". Will this plugin be available to download again?
Random avatar
Fjellhoy
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Mon Aug 07 2017 20:52

Next

Return to Development talks

Who is online

Users browsing this forum: No registered users and 1 guest
cron