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 sarma_men » Fri Aug 24 2018 22:46

Anyone, anything :?:
User avatar
sarma_men
Fresh off the boat
Fresh off the boat
 
Posts: 8
Joined: Sat Aug 18 2018 16:48

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


Amplifier Switch Plugin

Postby ashthespy » Fri Aug 24 2018 22:57

sarma_men wrote:Awesome job man. This plugin I almost what I need 

I have two sources, one is TV and the second one pi. Both of them are connected to the same amp.
My problem now is when I stop the music in volumio, my amp turns off and I can watch TV but without sound.

I have played with your plugin and I understand how the plugin works. I would change it to turn on/off the amp with a single switch.
My question is “can somebody give me an example of changing UI”.
I would like to put a button and with that button I would like to open a new page.
In that new page on the top I would put On/Off switch to control the amp.
Here is an example where I would like to put the button for opening the new page.

If that is to complicated, can somebody suggest me something else to try out?

Thank you,
Sarma_men


I would keep the functionality that you are trying to achieve external from this plugin. Either use a hardware based solution, or run a script to toggle the GPIO directly.
User avatar
ashthespy
Objectivist
Objectivist
 
Posts: 288
Joined: Fri Jul 22 2016 08:16


Amplifier Switch Plugin

Postby demandsyoursoul » Tue Sep 04 2018 14:19

As for UI, it should be drawn up by professionals only unless you don't have any plans for further promotion of your project. Here's a list of perfect examples mobile design. Check it.
Random avatar
demandsyoursoul
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Fri Aug 24 2018 10:42


Amplifier Switch Plugin

Postby Ralf_L » Sun Jan 27 2019 13:52

Hi,

this plugin seems to be great but it does not work for my constellation (RaspiB+, IQAudio Pi-DigiAmp+, actual Volumio 2.526.) or maybe I have misunderstood its benefit: I assume, that the Amplifier Switch Plugin will mute the amp when volumio does not play ?

According to the IQAudio documentation the amp on the DigiAmp+ can be switch by GPIO22. If I select channel 22 in the AmpSwitch (version 0.1.1.) configuration and press the save button. I get the message "Port not accessible".

But It works to (un)mute the amp with:
gpio mode 3 out
gpio write 3 1 (for unmute)
gpio write 3 0 (for mute)

Using GPIO3 in the AmpSwitch configuration the DigiAmp does not give any more sounds; even after rebooting.
The mute LED is not changing depending play/stop state.

Do you have an advice how to get this to work ?

Thanks & best regards
Ralf
Random avatar
Ralf_L
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Sun Jan 27 2019 13:32


Amplifier Switch Plugin

Postby ashthespy » Sun Jan 27 2019 19:15

Ralf_L wrote:Hi,

this plugin seems to be great but it does not work for my constellation (RaspiB+, IQAudio Pi-DigiAmp+, actual Volumio 2.526.) or maybe I have misunderstood its benefit: I assume, that the Amplifier Switch Plugin will mute the amp when volumio does not play ?

Do you have an advice how to get this to work ?

Thanks & best regards
Ralf


The plugin is actually meant to switch on/off your amplifier via a relay connected to a GPIO pin, but as all it does is flip some GPIOs no reason you can't use it to mute your amp instead.

The error means that port22 was not accessible via the sysfs interface that the plugin utilises to toggle GPIOs.
Are you able to manually toggle via sysfs?
Code: Select all
$ sudo sh -c "echo 22 > /sys/class/gpio/export"
$ sudo sh -c "echo out >/sys/class/gpio/gpio22/direction"
# Mute
$ sudo sh -c "echo 1 >/sys/class/gpio/gpio22/value"
# Unmute
$ sudo sh -c "echo 0 >/sys/class/gpio/gpio22/value"

# Cleanup
$ sudo sh -c "echo 22 > /sys/class/gpio/unexport


Any reason why you don't use the `auto_mute_amp` overlay for your DigiAmp+? It should automatically mute/unmute the amp based on the alsa playback state.
User avatar
ashthespy
Objectivist
Objectivist
 
Posts: 288
Joined: Fri Jul 22 2016 08:16


Amplifier Switch Plugin

Postby Ralf_L » Sun Jan 27 2019 19:58

Thank you for your hint
Any reason why you don't use the `auto_mute_amp` overlay for your DigiAmp+? It should automatically mute/unmute the amp based on the alsa playback state.


In the meantime I have figured out that the
Code: Select all
dtoverlay=iqaudio-dacplus,auto_mute_amp

must be adjusted in the file /boot/config.txt

With this the mute state is automatically toggled.
Random avatar
Ralf_L
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Sun Jan 27 2019 13:32


Amplifier Switch Plugin

Postby felixheller » Wed Mar 27 2019 23:40

Hello,

I am trying now for about 4 hours to get the plugin working with this relay board https://www.hellasdigital.gr/electronic ... bot/?sl=en

connected vss to 5v, gnd to gnd and In1 to GPIO4 / Pin 7

When i set the output to pin 4 the led on the board will flash and stays on no matter what i do, if i click on save it just blinks for one time and will stay on again.

any ideas what i am doing wrong?

thanks
felix
Random avatar
felixheller
Sunday DIYer
Sunday DIYer
 
Posts: 14
Joined: Sun Mar 17 2019 10:05


Amplifier Switch Plugin

Postby ashthespy » Thu Mar 28 2019 13:40

felixheller wrote:Hello,

I am trying now for about 4 hours to get the plugin working with this relay board https://www.hellasdigital.gr/electronic ... bot/?sl=en

connected vss to 5v, gnd to gnd and In1 to GPIO4 / Pin 7

When i set the output to pin 4 the led on the board will flash and stays on no matter what i do, if i click on save it just blinks for one time and will stay on again.

any ideas what i am doing wrong?

thanks
felix


Probably needs to be inverted? Are you able to manually get the relay module working directly via sysfs (scroll up a few posts and adjust the code for your GPOI)
User avatar
ashthespy
Objectivist
Objectivist
 
Posts: 288
Joined: Fri Jul 22 2016 08:16


Amplifier Switch Plugin

Postby felixheller » Thu Mar 28 2019 23:14

Hello!
I can only turn it on in sysfs but cant turn it of, I/O error appears which i dont understand, even tried it with a second installation of volumio on another sd card..

when i select the desired gpio and submit it will turn on but wont turn off again, when i change the gpio to any other, the light will go off again if that helps troubleshoot the problem? no matter if the status at /dev is on play, pause or stop

any ideas?

felix
Random avatar
felixheller
Sunday DIYer
Sunday DIYer
 
Posts: 14
Joined: Sun Mar 17 2019 10:05


Amplifier Switch Plugin

Postby ashthespy » Fri Mar 29 2019 10:11

felixheller wrote:Hello!
I can only turn it on in sysfs but cant turn it of, I/O error appears which i dont understand, even tried it with a second installation of volumio on another sd card..

any ideas?

felix

If you are using a pi, then GPIO4 is the default pin for onewire driver (w1-gpio). https://pinout.xyz/pinout/1_wire#
You should probably disable it, or use a different pin.
User avatar
ashthespy
Objectivist
Objectivist
 
Posts: 288
Joined: Fri Jul 22 2016 08:16

PreviousNext

Return to Development talks

Who is online

Users browsing this forum: No registered users and 0 guests