Moode Forum
Rotary Encoder to control volume of Airplay, Spotify and Bluetooth - Printable Version

+- Moode Forum (http://moodeaudio.org/forum)
+-- Forum: moOde audio player (http://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (http://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: Rotary Encoder to control volume of Airplay, Spotify and Bluetooth (/showthread.php?tid=2814)



Rotary Encoder to control volume of Airplay, Spotify and Bluetooth - louleavestheroom@gmail.com - 07-24-2020

Hi, I have a rotary encoder connected to my Raspberry Pin on GPIO pins 23,24, and it is controlling the MPD volume perfectly.  But, I would also like to use it to control Airplay, Spotify and Bluetooth volume as well.

An additional request would be to monitor the volume of the active service, and read it back so that I can adjust some leds that represent the current volume level.

Can I have one master volume variable?  Is there an easy way to send the MPD volume to whichever service is active?

I can't figure it out.

I have been able to create a python service that disables my amplifier when the MPD service has stopped.  And I also monitor a button to switch from my internal audio source to an external audio source.  So programming is well within the possibility to solve my problem.

Thanks,
Gabe


RE: Rotary Encoder to control volume of Airplay, Spotify and Bluetooth - Tim Curtis - 07-24-2020

Renderer volume is always controlled by the client application (iTunes, Spotify, etc). moOde's only role is to set ALSA volume to 0dB so the overall volume when client is set to 100% is 0dB.


RE: Rotary Encoder to control volume of Airplay, Spotify and Bluetooth - louleavestheroom@gmail.com - 07-24-2020

Tim thanks for the reply. Is there a way to monitor the volume of the service? I checked out Shairport and librespot, and I couldn't figure out a way to query the volume level.

I thought it must be possible. For instance, if I change the volume on my sonos speaker with the hardware keys, the volume increase is represented in my client application on my phone. I was hoping I could achieve something like that.


RE: Rotary Encoder to control volume of Airplay, Spotify and Bluetooth - Tim Curtis - 07-24-2020

I don't know how the Sonos speaker is sending volume status back to an Airplay client like iTunes or the Spotify app.

As far as monitoring the volume level sent by the client, in shairport-sync for example there is a metadata feed sent from the Airplay client to shairport-sync and included in that feed is the volume setting. You would need to play around with the shairport-sync metadata reader demo app to figure out how to capture it.

There also might be other ways but I don't have any further experience to contribute.


RE: Rotary Encoder to control volume of Airplay, Spotify and Bluetooth - louleavestheroom@gmail.com - 07-25-2020

Thanks Tim.  By the way, I really appreciate all your work on Moode.  I'm attempting to build a Sonos-style Amplifier around it live on YouTube.

You can see it at


RE: Rotary Encoder to control volume of Airplay, Spotify and Bluetooth - Tim Curtis - 07-25-2020

The link that I removed in your post is to your YT subscribe channel which is commercial in nature.

We are generally pretty flexible about posts that are commercial in nature but in this case your posts in this thread led me to believe that you were a moOde user that needed help with an issue. I spent time responding to your issue only to be later directed to a subscription-based YT channel.