Amplifier Switch Plugin

Could you share your logs and config? The delay feature was introduced to tackle exactly the play - pause - play issue you are having. So when a pause or stop command is received, it waits for the prescribed time before turning off the GPIO.

Of course, only I’m not entirely sure how to obtain the logs. I have close to no experience with Pi’s or the underlying OS.

The config:

The output is inverted, as the hardware behaved opposite of my intentions. I have the GPIO trigger a 5V relay through a logic level converter. Maybe it’s the inversion that’s the problem?

Well, I have a simple test – set a 0 delay, and check if the amp comes on when you hit Play, and goes off when you hit Pause - then the outputs are configured correctly :wink:

If your on a relatively new version of Volumio, head over to the ip.address/dev page and enable the live log. Then on a new page, start a webradio and change stream. You should see some line such as [ASDebug] InitTimeout - Amp off in...

Cool, thanks - I’ll try that as soon as I get the network running again. I accidentally gave the Pi a fixed IP in another subnet, so I have to setup a monitor and keyboard to get it going again. If it aint broken, dont… :roll_eyes:

I’ll get back :+1:

This is trully a great plugin, however it does not cooperate with roon endpoint plugin. Is there any way to modify it so that it turns the amplifier on even if volumio is playing as roon endpoint?
Thanks!

Hi. I recently retired, so decided to build a streaming amplifier that I can also connect my analogue inputs to. The key parts are Volumio 2.917 on a raspberry pi4 with the audiophonics I-Sabre ES9038Q2M dac (hat) to handle the streaming, and an external (but in my custom built case) amplifier. The amp power supply is fed from a soft start module (purchased from Audiophonics) - which allows me to use a switch, push button or trigger to turn the amp on/off. I’m currently using a push button. Everything is working superbly, but this plugin seems an ideal ‘upgrade’. I have very little electronic knowledge, and my ‘skill’ is pretty much limited to soldering !

The pi4 only outputs 5v or 3.3v, and the soft start module needs a 12v trigger. Audiophonics (who’ve supplied most of the hardware) have been helpful, and indicated a module that will boost the pi4 output to 12v. Only I’ve no idea how to connect everything up to the pi4 gpio pins. I suspect it’s simple, but despite reading reams of online content on how to use the pi to drive external devices, I’m still clueless.

Can anyone point me to a helpful site, or provide a picture/diagram ?

As I’m in the UK, Audiophonics want me to spend a lot of money before they will ship to me. If you know of a suitable module to trigger the soft start module, please share.

Many thanks

Heya Mike!

I would pick up one of these cheap relay boards of ebay/amazon.

One such example would be

These guys essentially let you switch either AC or DC loads, using the pi’s gpios via an optocoupler. So, just many words for a switch that the pi (via this plugin) can operate.

You should be able to feed 12v source to the relay, and when it closes, trigger the amp’s soft start. The plugin let’s you either set the amp to always on/off or send a pulse.

This should give you some hints, let us know if you are in into issue!

Cheers

Thanks Ashthespy !

Having followed the links to instructions, this makes sense to me. I think Audiophonics were suggesting using the pi 5v as the (switched) power supply to a ‘booster’ module that then provided the 12v to the trigger.

Just a little nervous about connecting anything other than a 5v supply to anything connected to the pi - I don’t want to frazzle the pi (or the more expensive DAC) in the event of some failure (almost certainly attributable to me), but I guess the optocoupler will prevent that.

It will take a few days, but I’ll let you know how I get on.

Mike

If the soft start module is this one

https://www.audiophonics.fr/en/softstart-protection/audiophonics-module-softstart-for-control-and-delay-for-amplifier-p-4155.html

Confirm with them, as their documents mention a 2-12v trigger, in which case you can just use the pi’s gpio (which is 3.3v)
Also, given the 3.3v levels for the pi’s gpio, this 5v → 12v booster wouldn’t work from first glance…

1 Like

That’s interesting, because that is the soft start module and I sent a query to them last week as I’d checked their site and couldn’t see the trigger voltage. Maybe they’ve updated the page, or maybe I just missed it. C’est la vie !

I’ll check with them that 3.3v will trigger anyway.

So, having just about got my head around using a relay, would I just (for example) connect the soft start module trigger + terminal to pin 16 (GPIO 23) and the other terminal to pin 14 (ground), and then configure the plugin ?

In essence yes - but I would ask them for a datasheet/schematic to confirm what type of trigger is required.

Thanks - will do

@ashthespy will there be a version for volumio 3?

I’m not the author of this, you would have to ask them directly…

But I can confirm the plugin works just fine on Volumio 3. Doesn’t require any code change. You only need to rebuild the modules. There should be quite a few posts here on instructions on how to do it, while we await the official plugin.

I have one problem with this plugin. In my setup I have an external AMP with integrated USB DAC. So when I shut down the AMP, the USB DAC is switched of and not available for ALSA. So I can’t start play in Volumiop and thus there is no trigger event to sitch the GPIO.
Could I be listening to another event in order to switch the DAC / AMP on again?
I hav eno problme coding and modifying the plugin, but I have not found a suitable event to listen for.

I have just successfully installed AmpSwitch by manually installing it. If you’re comfortable in the terminal window and can SSH into your Volumio player, you can accomplish this. I used the following commands:

Note: I’m not sure if this will complicate the Volumio installation when the plugin is eventually added to the Official Volumio Plugin repo but for those of us who depend on these plugins, it’s a useful workaround.

sudo apt-get update
sudo apt-get -y install build-essential
cd ~
wget http://plugins.volumio.org/plugins/volumio/armhf/miscellanea/ampswitch/ampswitch.zip
mkdir ./ampswitch
miniunzip ampswitch.zip -d ./ampswitch
cd ampswitch
npm install --save onoff@6.0.0
volumio plugin install

It seems like the author is not active(?). The plugin works for Volumio 3. I have forked it and made minor updates to upgrade the downstream packages, so securety vulnerabilities are resolved. I also change the trigger slightly, so the plugin works with an external DAC that canbe triggered by the plugin.

If anybody is interested, my version can be found at volumio-plugins/plugins/miscellanea/ampswitch at master · schusto/volumio-plugins · GitHub

If the people in this thread are interested, I can try to submit this version of the plugin to the plugin store in Volumio 3 with all cred to the original author in place.

Please follow instructions Plugin Submission Checklist | Volumio Developers Documentation
before submitting.
Category must be changed as described and package.json too. Test carefully your work.
Thanks.

Thanks. Not a straight forward process, but now there is a PR for the ampswitch plugin and it has been submitted to the store through volumio plugin submit.

Let’s see when it shows up.

1 Like

I’ve also submitted and updated my gpio_control plugin with new functionality, which might also be of benefit to users of the amplifier switch plugin as an alternative. Hopefully it’ll be approved…