Moode Forum
volume control by USB keyboard or volume knob - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: volume control by USB keyboard or volume knob (/showthread.php?tid=2154)

Pages: 1 2 3


RE: volume control by USB keyboard or volume knob - Norbert - 02-16-2020

(02-16-2020, 03:16 PM)Tim Curtis Wrote: Prolly less than robust debounce in the device firmware.

It seems that the output from the knob is ok. See screenshot after a very fast quarter right turn.

I think, the high numbers of ssh coomands per time cannot be followed by the RasPi.

It's not a really problem for me because i set Volume +2 instead of +1 / step. So i can quickly change the volume.

Best regards
Norbert

[attachment=1011]


RE: volume control by USB keyboard or volume knob - TheOldPresbyope - 02-16-2020

That's interesting because I had a different result this morning. Here, for example, is the output for a quick twist of the Drok control knob to the right. Should be a steady steam of KEY_VOLUMEUP events:

Code:
# KEY_VOLUMEUP    1    command
EV_KEY    KEY_VOLUMEUP    0    /dev/input/event3
# KEY_VOLUMEUP    0    command
EV_KEY    KEY_VOLUMEUP    1    /dev/input/event3
# KEY_VOLUMEUP    1    command
EV_KEY    KEY_VOLUMEUP    0    /dev/input/event3
# KEY_VOLUMEUP    0    command
EV_KEY    KEY_VOLUMEDOWN    1    /dev/input/event3
# KEY_VOLUMEDOWN    1    command
EV_KEY    KEY_VOLUMEDOWN    0    /dev/input/event3
# KEY_VOLUMEDOWN    0    command
EV_KEY    KEY_VOLUMEDOWN    1    /dev/input/event3
# KEY_VOLUMEDOWN    1    command
EV_KEY    KEY_VOLUMEDOWN    0    /dev/input/event3
# KEY_VOLUMEDOWN    0    command
EV_KEY    KEY_VOLUMEUP    1    /dev/input/event3
# KEY_VOLUMEUP    1    command
EV_KEY    KEY_VOLUMEUP    0    /dev/input/event3

There still may be timing issues downstream, but the Drok microcode has its own problems.

Sorry, would have posted earlier but I stopped to make lunch Tongue

Regards,
Kent

PS - same "reversal" phenomenon occurs in rapid rotation to the left (counterclockwise), e.g., unexpected KEY_VOLUMEUP events interspersed among KEY_VOLUMEDOWN events


RE: volume control by USB keyboard or volume knob - TheOldPresbyope - 02-17-2020

I modified /var/www/vol.sh to echo its input to a temp file. Ran the control up and down sharply a couple times while monitoring the temp file.
  • the individual inputs to /var/www/vol.sh were always the string "-up 1" or "-dn 1"; there would be occasional occurrences of one or several "-dn 1" in a volume-up sequence, and v.v.
  • although that should cause the moOde volume setting to burble by one or several units, the moOde volume setting drops to 0.
Conclusion: the Drok isn't perfect but there's definitely something happening with the script in this circumstance, although I can't pinpoint what it is from this simple test. If I were a betting man, I'd bet on the interaction with the sqlite3 database, but I've been known to be wrong before, so no bet Tongue

Regards,
Kent


RE: volume control by USB keyboard or volume knob - mtnbrit - 05-06-2020

Try this patch, it fixes the issue for me

https://github.com/moode-player/moode/issues/106#issue-612965109


RE: volume control by USB keyboard or volume knob - TheOldPresbyope - 05-06-2020

(05-06-2020, 02:58 AM)mtnbrit Wrote: Try this patch, it fixes the issue for me

https://github.com/moode-player/moode/issues/106#issue-612965109

Thanks for putting in the hard work. (In one sense I'm relieved to see I wasn't wrong in my suspicion; in another I'm depressed i didn't have the wit to press on to look for error messages.)

I chose to implement the revised patch in his Tim's reply half an hour ago to your issue 106.

No longer see the abrupt jumps to zero volume no matter how fast I spin the knob.

What I do see is an occasional odd burble in the rate of change of volume at intermediate rates of spin but I can live with that.

Nice work!

Regards,
Kent


RE: volume control by USB keyboard or volume knob - Proletheus - 09-04-2020

(02-16-2020, 06:41 PM)Norbert Wrote: It seems that the output from the knob is ok. See screenshot after a very fast quarter right turn.

I think, the high numbers of ssh coomands per time cannot be followed by the RasPi.

It's not a really problem for me because i set Volume +2 instead of +1 / step. So i can quickly change the volume.

Best regards
Norbert

Hello,
how do I have to edit the vol.sh file so that the volume changes in steps of +5 or -5?

THX Smile


RE: volume control by USB keyboard or volume knob - DRONE7 - 09-04-2020

In MoOde 6.7.1 you don't need to edit a file.

M=>Configure=>Audio and scroll down to' Volume step limit' then set your preferred step.

If you are using a USB volume control then set 'USB volume knob' to on. (It is above the ' Volume step limit' setting)


RE: volume control by USB keyboard or volume knob - Proletheus - 09-04-2020

(09-04-2020, 08:33 AM)DRONE7 Wrote: In MoOde 6.7.1 you don't need to edit a file.

M=>Configure=>Audio and scroll down to' Volume step limit' then set your preferred step.

If you are using a USB volume control then set 'USB volume knob' to on. (It is above the ' Volume step limit' setting)

I've already tried that. But only has an effect on the volume circle. When I click on it with the mouse, the volume increases by this set value.

I click e.g. on the plus within the circle, the volume only increases by one step.


RE: volume control by USB keyboard or volume knob - Proletheus - 09-04-2020

Found it out. You have to edit the file /etc/triggerhappy/triggers.d/media.conf.
For me it now looks like this:


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


Thank you anyway. Coming from Volumio and Moode is really the better alternative  Cool