If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Announcement
Collapse
No announcement yet.
[ANNOUNCE] SqueezeButtonPi - Tool to use buttons and rotary encoders on a RPi
Some progress, I can change volume using the remote and Linux keytables. So if I change the command to use keys instead it should work.
It is now working with the script amended to
Code:
#!/bin/sh
# start pigpiod daemon
sudo pigpiod -t 0
# give the daemon a moment to start up before issuing the sbpd command
sleep 1
# load uinput module, then set the permission to group writable, so you don't need to run sbpd with root permissions
sudo modprobe uinput
sudo chmod g+w /dev/uinput
# issue the sbpd command
sbpd -d -s b,20,POWR,0,1 b,5,PREV,0,1 b,6,PLAY,0,1 b,12,NEXT,0,1 b,13,KEY:KEY_MINUS,0,1 b,16,KEY:KEY_EQUAL,0,1
Hi everybody,
thanks for this great tool, I've used it sucessfully to add a rotary encoder to a PCP on a RPI Zero W. It controls playback, shutdown (with the push button function of the encoder) and volume of a Denon AVR the playback is going to.
Now I was wondering whether I could use a slider (potentiometer) instead of the rotary encoder to control the volume. There are several cheap sliders (for Arduino etc.), but they all have analogue output.
Would it be possible to use one of them?
Tanks & regards
Martin
PCP (always latest version) on RasPi 3 with PhatDac (player & server)
PCP on several RasPis 2 +3
2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin
Thanks Paul,
I was afraid it wasn't so easy. Now I'm thinking about adapting https://www.circuitbasics.com/using-...-raspberry-pi/ for my purposes. Still missing an idea on how to link it to the player's volume control....
PCP (always latest version) on RasPi 3 with PhatDac (player & server)
PCP on several RasPis 2 +3
2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin
Since volume control within squeezelite/LMS is digital control, and anolog pot is really not much use over an encoder. Just extra complications. To do it, you would read analog voltage and use software to monitor "step" changes in voltage, then send the command to increase or decrease volume.
and anolog pot is really not much use over an encoder.
Basically you are right, of course. But my idea was to have my headless little streaming Pi connected to my fabulous Wega Concept 51k controlling everything related to playback on my Denon AVR (vial Airplay). An a "nice to have" feature would be to have a volume control that actaually shows the state of the player's volume setting when powering the PCP-Pi.
To do it, you would read analog voltage and use software to monitor "step" changes in voltage, then send the command to increase or decrease volume.
Exactly. I believe that's what they did in the project I'd linked to. But thinking this twice, my project would be even more complicated. I realized that I would need one of those motorized linear Alps/Alpine sliders that were (still are?) used in highend sound mixers. See https://www.adafruit.com/product/5466
So the idea is:
After powering up the Zero W, it uses the volume status of a determind player, converts it to voltage and send the slider to the correct position.
When moving the slider manually, voltage difference ist converted to a volume setting in LMS.
PCP (always latest version) on RasPi 3 with PhatDac (player & server)
PCP on several RasPis 2 +3
2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin
Basically you are right, of course. But my idea was to have my headless little streaming Pi connected to my fabulous Wega Concept 51k controlling everything related to playback on my Denon AVR (vial Airplay). An a "nice to have" feature would be to have a volume control that actaually shows the state of the player's volume setting when powering the PCP-Pi.
Exactly. I believe that's what they did in the project I'd linked to. But thinking this twice, my project would be even more complicated. I realized that I would need one of those motorized linear Alps/Alpine sliders that were (still are?) used in highend sound mixers. See https://www.adafruit.com/product/5466
So the idea is:
After powering up the Zero W, it uses the volume status of a determind player, converts it to voltage and send the slider to the correct position.
When moving the slider manually, voltage difference ist converted to a volume setting in LMS.
I've installed this onto a Pi2B and noticed that it seems to constantly consume 1% CPU - not a lot I know, but I'd like to have almost 0% CPU when not playing. This appears to be because the underlying gpiod polls the GPIO pins. From a quick search on github it appears as if pigpio does support using interrupts, but I guess the piogpiod code would need to be updated for this.
The original sbpd uses wiringpi. I've recompiled this on my Pi2B and this does indeed use less CPU.
Apart from wiringpi being deprecated, and needing root privs, are there any other disadvantages?
Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment