RPI3B+, Allo DigiOne and .......

Discuss about Hardware diy and tweaks

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

RPI3B+, Allo DigiOne and .......

Postby damiani8 » Mon Jan 07 2019 16:49

.....I need a suitable rotary pot./volume control.

Whilst I understand the need to have a 'bit perfect' output from the DigiOne, I'd like to vary the volume signal being sent from the Pi to my external DAC. I have Volumio configured for software volume control and this works as expected but I would like the tactile feel of a proper volume control.

Has anyone used (or can recommend) a suitable rotary control for this task?
Random avatar
damiani8
Sunday DIYer
Sunday DIYer
 
Posts: 21
Joined: Sat Jan 05 2019 16:19

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


RPI3B+, Allo DigiOne and .......

Postby Berry » Wed Jan 09 2019 18:35

The https://orchardaudio.com/gala DAC has such a volume knob, it was formerly sold on this volumio shop.
Random avatar
Berry
Audiophile
Audiophile
 
Posts: 119
Joined: Mon Jul 31 2017 17:43
Location: GER


RPI3B+, Allo DigiOne and .......

Postby dresdner353 » Thu Jan 10 2019 01:07

I would suggest you look into using a digital rotary encoder wired to GPIO pins on the Pi and then add some python code to detect the motion as the wheel is turned in either direction.

There's an article on using such an encoder below with a link to python code on how to implement the feature.
https://www.modmypi.com/blog/how-to-use ... spberry-pi

To flesh out that example to drive volume changes, you'd need to add range limits on the value preventing it going above 100 and below 0 and then simply calling into the volumio RESTful API for volume changes or running an OS command to call "volumio volume <value>"

If your DAC is a hat, then you will need to see if any of the GPIO pins are available. I know some of the boards, do offer access to unused pins.
Random avatar
dresdner353
Fresh off the boat
Fresh off the boat
 
Posts: 9
Joined: Sun Dec 30 2018 18:50


RPI3B+, Allo DigiOne and .......

Postby damiani8 » Fri Jan 11 2019 13:21

Thanks for the responses.

I'm not looking at an another external DAC I want the Pi to be the transport to my existing DACs with the Pi being the preamp.

The DigiOne isn't a HAT so I'll have to solder the necessary connectors directly to the header.
Random avatar
damiani8
Sunday DIYer
Sunday DIYer
 
Posts: 21
Joined: Sat Jan 05 2019 16:19


RPI3B+, Allo DigiOne and .......

Postby dresdner353 » Fri Jan 11 2019 13:37

There's also breakout interceptors that can sit between the two, saving the need to try and solder pins etc.

such as:
https://shop.4tronix.co.uk/products/gpi ... spberry-pi


Also, check out the Volumio plugins section, there is already rotary encoder. I noticed it last night and assume its in the general area you're trying to tackle.
Random avatar
dresdner353
Fresh off the boat
Fresh off the boat
 
Posts: 9
Joined: Sun Dec 30 2018 18:50


RPI3B+, Allo DigiOne and .......

Postby damiani8 » Fri Jan 11 2019 13:56

dresdner353 wrote:There's also breakout interceptors that can sit between the two, saving the need to try and solder pins etc.

such as:
https://shop.4tronix.co.uk/products/gpi ... spberry-pi


Also, check out the Volumio plugins section, there is already rotary encoder. I noticed it last night and assume its in the general area you're trying to tackle.


Thanks for that link, it would work, although I might have to cut some more plastic away from my 7" touchscreen case.

I'd noticed the rotary encoder plugin, but never installed it to see what options there were available. Just installed and checked and there's loads to play with there, I will have to give it a go!
Random avatar
damiani8
Sunday DIYer
Sunday DIYer
 
Posts: 21
Joined: Sat Jan 05 2019 16:19


RPI3B+, Allo DigiOne and .......

Postby damiani8 » Mon Jan 14 2019 18:38

Rotary encoder (KY040) connected up and it really needs debouncing, it's hardly working. I've tried soldering 0.1uf caps to the CLK and DATA pins and still no better.
Random avatar
damiani8
Sunday DIYer
Sunday DIYer
 
Posts: 21
Joined: Sat Jan 05 2019 16:19


RPI3B+, Allo DigiOne and .......

Postby damiani8 » Tue Jan 15 2019 09:39

Just an update....

I've written a python routine to poll the rotary and send the correct volumio commands and that works although the volumio GUI is a little sluggish to respond.

Time to have a look at the plugin code and see what the issue is.
Random avatar
damiani8
Sunday DIYer
Sunday DIYer
 
Posts: 21
Joined: Sat Jan 05 2019 16:19


RPI3B+, Allo DigiOne and .......

Postby dresdner353 » Tue Jan 15 2019 10:22

The GUI does have a delay as the websocket API syncs. As long as you feel there is a fast response with the volume updates, tuen you're likely in the right ballpark.

Just do a top -d 1 on the pi to see if the python code is hammering CPU. Also post the code if you wish and I might be able to make some suggestions.
Random avatar
dresdner353
Fresh off the boat
Fresh off the boat
 
Posts: 9
Joined: Sun Dec 30 2018 18:50


RPI3B+, Allo DigiOne and .......

Postby damiani8 » Tue Jan 15 2019 12:32

dresdner353 wrote:The GUI does have a delay as the websocket API syncs. As long as you feel there is a fast response with the volume updates, tuen you're likely in the right ballpark.

Just do a top -d 1 on the pi to see if the python code is hammering CPU. Also post the code if you wish and I might be able to make some suggestions.


I've taken Martin O'Hanlon's code (https://github.com/martinohanlon/KY040) and used his example, using the subprocess module so I can 'call' volumio.

I'm playing with the rotaryBouncetime and the default loop sleep value (to reduce CPU time), although hardly uses any CPU time! I've added this to my rc.local and it's working well.

Pros:
* works better than the plugin (at the moment)

Cons:
* 3rd party Python code
* sluggish volume response in the volumio GUI
* wish the rotary had better weight and inertia
Random avatar
damiani8
Sunday DIYer
Sunday DIYer
 
Posts: 21
Joined: Sat Jan 05 2019 16:19

Next

Return to Diy and Tweaks

Who is online

Users browsing this forum: No registered users and 0 guests