[GH-ISSUE #164] possibility to turn on/off gpio when specific zone is playing. #96

Open
opened 2026-02-27 19:28:23 +03:00 by kerem · 11 comments
Owner

Originally created by @p4co86 on GitHub (Feb 18, 2026).
Original GitHub issue: https://github.com/lox-audioserver/lox-audioserver/issues/164

Hi, is it possible to implement an option to switch on a specific gpio when some zones are playing?

Iam using two KAB9 and it is possible to switch it to mute or standby via relays. An option to delay the output of the zones would be also nice.

It is very helpful for minimizing power,

Originally created by @p4co86 on GitHub (Feb 18, 2026). Original GitHub issue: https://github.com/lox-audioserver/lox-audioserver/issues/164 Hi, is it possible to implement an option to switch on a specific gpio when some zones are playing? Iam using two KAB9 and it is possible to switch it to mute or standby via relays. An option to delay the output of the zones would be also nice. It is very helpful for minimizing power,
Author
Owner

@rudyberends commented on GitHub (Feb 18, 2026):

What output are you running? Depending on the output, it might already be available client side. I assume the gpios are also client side?

For example sendspin has hooks for stream start and stream end which allow you to run your own script.

I believe this is also possible with squeezelite, but I am not sure how this works. @mr-manuel might be able to tell you more about it.

Right now lox-Audioserver has this delay, but it is only for alerts. This should be moved to a per zone one time delay when the zone is off. I will look into this.

<!-- gh-comment-id:3922708018 --> @rudyberends commented on GitHub (Feb 18, 2026): What output are you running? Depending on the output, it might already be available client side. I assume the gpios are also client side? For example sendspin has hooks for stream start and stream end which allow you to run your own script. I believe this is also possible with squeezelite, but I am not sure how this works. @mr-manuel might be able to tell you more about it. Right now lox-Audioserver has this delay, but it is only for alerts. This should be moved to a per zone one time delay when the zone is off. I will look into this.
Author
Owner

@p4co86 commented on GitHub (Feb 18, 2026):

i use squeezelite as output. My Hardware is a RPI4.
Thanks

i used the MS4H in the past. Its the old custom Musicserver for loxone by Dieter Schmidberger. There was a powermanger installed with wich you could mute the amps.

https://music-server.net/help/MusikServer4Lox.html?Powermanager1.html

<!-- gh-comment-id:3922717275 --> @p4co86 commented on GitHub (Feb 18, 2026): i use squeezelite as output. My Hardware is a RPI4. Thanks i used the MS4H in the past. Its the old custom Musicserver for loxone by Dieter Schmidberger. There was a powermanger installed with wich you could mute the amps. https://music-server.net/help/MusikServer4Lox.html?Powermanager1.html
Author
Owner

@mr-manuel commented on GitHub (Feb 19, 2026):

Through the command line options of the Squeezelite player you can make yourself a script: github.com/ralph-irving/squeezelite@6d571de8fa/main.c (L64-L150)

Relevant for you:

-S <Power Script>    Absolute path to script to launch on power commands from LMS

Here a sample from ChatGPT: https://chatgpt.com/share/69969707-24ac-8000-bf18-714796eaefa1

<!-- gh-comment-id:3924684024 --> @mr-manuel commented on GitHub (Feb 19, 2026): Through the command line options of the Squeezelite player you can make yourself a script: https://github.com/ralph-irving/squeezelite/blob/6d571de8fa6dfff23a5a0cbb2c81b402d2c30c31/main.c#L64-L150 Relevant for you: ``` -S <Power Script> Absolute path to script to launch on power commands from LMS ``` Here a sample from ChatGPT: https://chatgpt.com/share/69969707-24ac-8000-bf18-714796eaefa1
Author
Owner

@tobsch commented on GitHub (Feb 19, 2026):

I have built a configuration interface to map amps to speakers & zones aswell as a very simple "powermanager" replacement: It watches alsa streams and switches on amps via crelay.

If anyone is interested I am happy to share it.

<!-- gh-comment-id:3930347769 --> @tobsch commented on GitHub (Feb 19, 2026): I have built a configuration interface to map amps to speakers & zones aswell as a very simple "powermanager" replacement: It watches alsa streams and switches on amps via crelay. If anyone is interested I am happy to share it.
Author
Owner

@p4co86 commented on GitHub (Feb 20, 2026):

hi, i havent find the time to test the squeezelite solution.
Wow, that sounds awesome, yes it would be nice you share it with us.

I will test it asap.

<!-- gh-comment-id:3931699916 --> @p4co86 commented on GitHub (Feb 20, 2026): hi, i havent find the time to test the squeezelite solution. Wow, that sounds awesome, yes it would be nice you share it with us. I will test it asap.
Author
Owner

@tobsch commented on GitHub (Feb 21, 2026):

@p4co86 here you go: https://github.com/tobsch/snappy
It's not super self explaining as I purely wrote it for myself initially. But give me feedback, please!

<!-- gh-comment-id:3939530951 --> @tobsch commented on GitHub (Feb 21, 2026): @p4co86 here you go: https://github.com/tobsch/snappy It's not super self explaining as I purely wrote it for myself initially. But give me feedback, please!
Author
Owner

@p4co86 commented on GitHub (Feb 22, 2026):

Hi, thanks, i have solved it with the Multiio Plugin for Loxberry. Here you can turn on GPIO and use the Aufioplayerstate for switching. I have used a Delay for switching off. Worked very well.

<!-- gh-comment-id:3941333052 --> @p4co86 commented on GitHub (Feb 22, 2026): Hi, thanks, i have solved it with the Multiio Plugin for Loxberry. Here you can turn on GPIO and use the Aufioplayerstate for switching. I have used a Delay for switching off. Worked very well.
Author
Owner

@rudyberends commented on GitHub (Feb 22, 2026):

Hi, thanks, i have solved it with the Multiio Plugin for Loxberry. Here you can turn on GPIO and use the Aufioplayerstate for switching. I have used a Delay for switching off. Worked very well.

Will that be enough for you, or do we still need to look for a native powermanagment implementation?

<!-- gh-comment-id:3941354758 --> @rudyberends commented on GitHub (Feb 22, 2026): > Hi, thanks, i have solved it with the Multiio Plugin for Loxberry. Here you can turn on GPIO and use the Aufioplayerstate for switching. I have used a Delay for switching off. Worked very well. Will that be enough for you, or do we still need to look for a native powermanagment implementation?
Author
Owner

@p4co86 commented on GitHub (Feb 22, 2026):

A native solution would be nicer to have all in one, no dependience and so on, but for the first it is ok for me.

<!-- gh-comment-id:3941358914 --> @p4co86 commented on GitHub (Feb 22, 2026): A native solution would be nicer to have all in one, no dependience and so on, but for the first it is ok for me.
Author
Owner

@rudyberends commented on GitHub (Feb 26, 2026):

A native solution would be nicer to have all in one, no dependience and so on, but for the first it is ok for me.

Power management will be in the next beta. Switching will be experimental and ay require some feedback.

https://github.com/lox-audioserver/lox-audioserver/issues/184#issuecomment-3968966279

<!-- gh-comment-id:3969253177 --> @rudyberends commented on GitHub (Feb 26, 2026): > A native solution would be nicer to have all in one, no dependience and so on, but for the first it is ok for me. Power management will be in the next beta. Switching will be experimental and ay require some feedback. https://github.com/lox-audioserver/lox-audioserver/issues/184#issuecomment-3968966279
Author
Owner

@p4co86 commented on GitHub (Feb 27, 2026):

That looks fantastic! Could you tell us when the next beta version will be released so we can test it?

<!-- gh-comment-id:3972792381 --> @p4co86 commented on GitHub (Feb 27, 2026): That looks fantastic! Could you tell us when the next beta version will be released so we can test it?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lox-audioserver#96
No description provided.