[PLUGIN] GPIO CONTROL: CONTROL GPIO WITH VOLUMIO2 EVENTS

Have you looked at ampswitch plugin that is available from the plugin store? It allows you to set a delay for exactly such use cases…

1 Like

Can you rename the attachment and try and reupload again?

I would love to add more functionality when I get more time. A delay could be an option,

Maybe you could buy a NOT gate and use that to invert the state?

Yes, I think a delay could be implemented.

Hi supercrab,
thanks to your plugin, it works fine in my installation.

maybe when you add some functionality to your plugin, in is possible to add three GPIO Controls to indicate the sampling rate.

Example:
Sampling rate higher than 96 =(176, 192, …) -> GPIO 5, 6, 13 are high
Sampling rate higher than 48 less and eq 96 =(88, 96) -> GPIO 5 is low, 6, 13 are high
Sampling rate higher or eq than 44 and less 88 =(44, 48) -> GPIO 5, 6 are low, 13 is high
Sampling rate less 44 -> GPIO 5 is high, 6 is low, 13 is high

Here is a thread, whrere the readout of the sampling rate was discussed

reboot

Hi,
Hey this is great, really useful )))
I’ll use it to control an optical Toslink switcher so it switches to the Digi+ Pro when playing and all other sources if not. It will mean modding an RC controlled switcher, however shouldn’t be too difficult.
Cheers,
Malcolm

1 Like

Hi

Glad you like the plugin :slight_smile: That is a good idea, hopefully I’ll be able to find some time to do it…

Mase

Hi

I’m glad you find the plugin useful. :smiley:

I don’t understand your question sorry. The link you supplied is about using PWM to control LEDs but it looks like you want an input to be sampled? Not sure if it possible. I tried to use Pigpio once for PWM but I couldn’t get it working :frowning:

Mase

Hi supercrab,

thanks to your reply.

no i want no sampling the input.
i only want to signal by LED what sampling rate is playing.

when switching the GPIO 5,6,13 by this schema

Sampling rate higher than 96 =(176, 192, …) -> GPIO 5, 6, 13 switch to high
Sampling rate higher than 48 less and eq 96 =(88, 96) -> GPIO 5 switch to low, 6, 13 switch to high
Sampling rate higher or eq than 44 and less 88 =(44, 48) -> GPIO 5, 6 switch to low, 13 switch to high
Sampling rate less 44 -> GPIO 5 switch to high, 6 switch to low, 13 switch to high

it is possible to use a RGB LED to GPIO 5,6,13

reboot

Hi

It was not possible to use PWM without running the plug-in as root unfortunately. The bit that does PWM needed root :pensive:

I don’t know how to get the sampling rate sorry. It could be possible by calling a web service thats run locally on volumio.

Cheers
Mase

I guess from here
proc/asound/card0/pcm0p/sub0/hw_params

Does that return the sample rate of the sound device or the currently playing media source?

It returned the Curently playing media info

Cool, there’s also a web service that returns JSON that’s probably easier to digest. Trouble is I found no way of doing PWM within a plug-in :weary:

Have you looked at api/v1/getstate it has both samplerate and bitdepth fields…

Yes, that’s the one - I forgot what it was called, so thank you very much for that!

Hi Mase,

I am trying to install the plugin from Github, but I don’t know how to do it without Zip. I am completely new with this. Could you please give a suggestion to install it?

I have a RPI4 with Hifiberry DAC2 and run volumio (obviously :expressionless: )

Thanks a lot! Steve

Hi, you shouldn’t need to install from zip, it is already bundled within volumio. You should be able to find it in Plugins, Search Plugins, System Tools…

Hi,

I must be blind as a bat. Have been looking for it several times.

Thanks anyway! Cheers

1 Like