Volume control; Linear or logarithmic?

Please report any bug found here

Volume control; Linear or logarithmic?

Postby thommy » 06 May 2014, 14:34

Have just installed rune onto an SD as it was quicker than trying to duplicate my existing raspbian/MPD 'nuts & bolts' installation.

The first thing that I notice is that the volume control seems linear. Anything below 50% is inaudible, and all the action occurs between about 70 & 100. Decibels and of course human hearing work on a logarithmic scale so this volume control just doesn't seem to be working as expected. If I put a linear potentiometer on my preamp it would exhibit the same behaviour.

Thoughts?
thommy
 
Posts: 1
Joined: 06 May 2014, 14:31

Re: Volume control; Linear or logarithmic?

Postby ACX » 06 May 2014, 20:22

Hi thommy,
are you using hardware mixer, right? If yes, I confirm you that the issue is caused by the different way to control the volume: MPD uses a linear one, instead the hardware volume usually use a logarithmic one. I say usually because all the interfaces I tried have logarithmic volume control, but I can't say if some others work with linear one. You can see this behaviour throttling the volume knob the UI and in the meanwhile seeing how it behaves in alsamixer.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1693
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Volume control; Linear or logarithmic?

Postby Fin » 20 Aug 2014, 08:43

Fin
 
Posts: 13
Joined: 17 Aug 2014, 09:25

Re: Volume control; Linear or logarithmic?

Postby ACX » 20 Aug 2014, 11:25

Hi Fin,
we were thinking about binding the volume knob in the RuneUI to the real volume range (and its integer steps) when using the hardware mixer. I think it's the only way to have a real and accurate control of the volume using all the 216 steps available by I2C control (40-255). To do that we have to bypass MPD volume control and implement a parallel one via amixer commands. We also should display the knob with the new range (not 0-100 anymore, but 40-255, or 0-216), although this could be counterintuitive at the beginning.

Now I'm out of home but tonight I will try the -M option in person. Thank you for the suggestion!
User avatar
ACX
RuneAudio co-founder
 
Posts: 1693
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Volume control; Linear or logarithmic?

Postby ACX » 22 Aug 2014, 15:57

User avatar
ACX
RuneAudio co-founder
 
Posts: 1693
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Volume control; Linear or logarithmic?

Postby Fin » 22 Aug 2014, 16:16

Fin
 
Posts: 13
Joined: 17 Aug 2014, 09:25

Re: Volume control; Linear or logarithmic?

Postby gswg » 24 Aug 2014, 18:35

My understanding is that applications (MPD included) should ask for the audio card's range, max and min. Then based on this should damp any volume scale to the specific hardware's range.

The PCM5122 (as used on the Pi-DAC) can go from -103.5db to 23db. We have limited it to +4db at 100% on Alsa but not sure what other cards will do here - that all makes it very difficult for apps like RuneAudio.

Maybe it's worth bypassing MPD for volume completely and just doing the right thing via ALSA calls?

Happy to help with whatever I can do here as it will benefit all of us in the long term.

Gordon@iqaudio.com
gswg
 
Posts: 55
Joined: 21 Jan 2014, 21:04
Location: Glasgow

Re: R: Volume control; Linear or logarithmic?

Postby ACX » 24 Aug 2014, 18:55

User avatar
ACX
RuneAudio co-founder
 
Posts: 1693
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: Volume control; Linear or logarithmic?

Postby Fin » 31 Aug 2014, 03:14

It's a shame that it seems to be either a bug or at the least a shortcoming of the volume control baked into MPD. When googling I came across a bug tracking page for MPD, and I didn't see anything listed to indicate it was even on the radar unfortunately. It would be unwise to hold your breath, waiting for an improvement!

I feel it would still be worth remapping the volume control in the RuneUI interface, as for the majority of users this is what they will be using to control RuneAudio with. I know in my case I haven't used a MPD client, I just have a shortcut to the web interface on the iPad, android phone, and my desktop PC.

I think in the long term, I'm going to add a rotary encoder and control the volume that way as well. Gordon, I saw the code you've shared to do so, hopefully my ebay buys come in soon and I can get it working OK. Thank you for sharing the code!
Fin
 
Posts: 13
Joined: 17 Aug 2014, 09:25

Re: Volume control; Linear or logarithmic?

Postby gearhead » 12 May 2015, 03:47

Is there any update on this? I have a 5122 and am in the same boat. Is there a workaround for this?

Keith
gearhead
 
Posts: 101
Joined: 25 Nov 2014, 06:04

support RuneAudio Donate with PayPal

Next

Return to Bug report

Who is online

Users browsing this forum: No registered users and 2 guests