Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


volume control by USB keyboard or volume knob
#1
Is there a way to control moOde's volume by using standard USB keyboard volume up/down and mute buttons? I am wanting to use one of those DROK USB volume controls that simply emulate the standard keyboard volume and mute keys. USB keyboard/knob plugged in to USB on the rPi.
Reply
#2
Heres the knob im hoping to use on moOde, works very nicely on my Mac.

USB Volume Control, DROK PC Computer Speaker Audio Volume Remote Controller Knob with One Key Mute Function Support Win7 8 10 XP Mac Vista Android
by DROK
Learn more: https://www.amazon.com/dp/B01MV411BR
Reply
#3
(02-06-2020, 06:48 PM)mtnbrit Wrote: Heres the knob im hoping to use on moOde, works very nicely on my Mac.

USB Volume Control, DROK PC Computer Speaker Audio Volume Remote Controller Knob with One Key Mute Function Support Win7 8 10 XP Mac Vista Android
by DROK
Learn more: https://www.amazon.com/dp/B01MV411BR

Didn't know something like that existed, I want one if it works!
Reply
#4
So I figured out a quick and dirty solution that works for me.


Code:
sudo apt-get install triggerhappy

$vi /etc/triggerhappy/triggers.d/media.conf
KEY_VOLUMEUP     1 /usr/bin/mpc volume +1
KEY_VOLUMEDOWN   1 /usr/bin/mpc volume -1
KEY_MUTE         1 /usr/bin/mpc toggle

/etc/init.d/triggerhappy restart
Caveats:
1. Mute (knob press) actually pauses and un-pauses the player, which is arguably more useful. Also mpc doesnt include a simple way to toggle mute and un-mute, so it would need some script fu to save the volume setting and state around mute/unmute presses.
2. Volume changes aren't reflected on the web GUI. Would love to know if there is a shell command that can change volume and mute/un-mute mpd while correctly updating the GUI?
Reply
#5
(02-08-2020, 07:29 AM)mtnbrit Wrote: So I figured out a quick and dirty solution that works for me.


Code:
sudo apt-get install triggerhappy

$vi /etc/triggerhappy/triggers.d/media.conf
KEY_VOLUMEUP     1 /usr/bin/mpc volume +1
KEY_VOLUMEDOWN   1 /usr/bin/mpc volume -1
KEY_MUTE         1 /usr/bin/mpc toggle

/etc/init.d/triggerhappy restart
Caveats:
1. Mute (knob press) actually pauses and un-pauses the player, which is arguably more useful. Also mpc doesnt include a simple way to toggle mute and un-mute, so it would need some script fu to save the volume setting and state around mute/unmute presses.
2. Volume changes aren't reflected on the web GUI. Would love to know if there is a shell command that can change volume and mute/un-mute mpd while correctly updating the GUI?

check out Kent's post...
http://moodeaudio.org/forum/showthread.p...7#pid11427
----------
bob
Reply
#6
Yep thanks, I just found it also. Its a beautiful thing! its now fully working.


Code:
KEY_VOLUMEUP     1 /var/www/vol.sh -up 1
KEY_VOLUMEDOWN   1 /var/www/vol.sh -dn 1
KEY_MUTE         1 /var/www/vol.sh -mute
Reply
#7
Smile excellent !
I'm sure others will be very interested in this !
----------
bob
Reply
#8
That's pretty cool and a lot easier than installing a rotary encoder. I think I'll attach one to my SIG :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#9
(02-08-2020, 08:03 AM)mtnbrit Wrote: Yep thanks, I just found it also. Its a beautiful thing! its now fully working.


Code:
KEY_VOLUMEUP     1 /var/www/vol.sh -up 1
KEY_VOLUMEDOWN   1 /var/www/vol.sh -dn 1
KEY_MUTE         1 /var/www/vol.sh -mute

Whats the resource utilization look like for triggerhappy?

Maybe run moodeutl -m or top or htop.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#10
No noticeable impact from running triggerhappy, the thd process doesnt even appear in top or htop.


CU: 1.4 GHz | LOAD: 3% | TEMP: 54?C | RAM_USED: 22% | DISK_USED: 79% | DISK_FREE: 686M | FPM_POOL: 8 workers 

this is on a 3B+
Reply


Forum Jump: