PDA

View Full Version : Volume control



jeffbarish
2008-12-03, 09:58
Using the CLI, it is possible to set the volume to real numbers between 0 and 100. Is there documentation anywhere on what the numbers mean? For example, do they represent uniform steps in db's?

peterw
2008-12-03, 12:37
Using the CLI, it is possible to set the volume to real numbers between 0 and 100.
Yes. You want the 'mixer volume' command. Arguments can be absolute (mixer volume 50) or relative (mixer volume +10, mixer volume -5, etc.).


Is there documentation anywhere on what the numbers mean? For example, do they represent uniform steps in db's?

You may want to look at the Perl source (in Slim/Player?). Squeezecenter tells players how much attenuation to apply (combination of 'volume', 'preamp gain', and replay gain). For most players, volume levels 1-100 represent uniform steps, ((100 - N) * -0.5) dB gain for the volume component of the attenuation. The volume curve for the Boom is more complex. I don't know if there are Perl or CLI APIs for accessing the current composite (volume + preamp + replaygain) or simple volume attenuation levels in dB.

mooblie
2008-12-05, 07:21
Using the CLI, it is possible to set the volume to real numbers between 0 and 100. Is there documentation anywhere on what the numbers mean? For example, do they represent uniform steps in db's?

No, the numbers from 0 to 100 do NOT represent uniform steps in decibels - I wish they did!

I measured and plotted this in this thread (post #7) (http://forums.slimdevices.com/showthread.php?t=29992), but my call for a plug-in or software fix to change this got no response. :-(

The problem, simply stated, as I see (hear?) it, is that "the volume changes are the lower end are too coarse, and at the top end: too fine."

radish
2008-12-05, 08:56
I looked at your chart, and to be honest it looks exactly as I'd expect. The general rule of thumb as I understand it is that a doubling in perceived loudness is equivalent to an increase of around 10db. If I had the volume control at 20 and changed it to 40, I'd logically expect the sound to be "twice as loud" - which means the SPL would have to go up by 10dB. Looking at your measured values, that's pretty much exactly what happens (~-18 to -10). Likewise going from 30 to 60 should also be a change of 10 (and it is also actually about 8). If the response followed your linear scale, 20-40 would double the loudness, but so would 40-60 and 60-80. That doesn't make sense to me - going from 60% to 80% (and it is a scale from 0-100 so I'd guess most people perceive it as a percentage) shouldn't double the loudness. Your comment that "not much happens as you drop from 100>40, output drops from 0 to -10dB" seems misleading, because that drop of -10dB is close to a halving in loudness - which seems appropriate for the scale change of 100>40.

mooblie
2008-12-05, 09:11
With respect, I can't really agree with your analysis of perceived loudness or your conclusions.

Using your numbers: going from 20 to 40 (twenty steps up) is about +8dB ... fine. Going from 40 to 60 (another twenty steps up) SHOULD be the same (+8dB), but it's not, it's only about +4dB.

Again, using your own chosen figures to illustrate: going from 100 to 40 (sixty steps down) is about -10dB ... fine. But the NEXT -10db change comes from going from 40 to 15 (just twenty five steps down).

I actually think it should double in loudness (10dB change) for each, say, twenty steps - which would give the 50dB dynamic range with 100 steps available (the "Preferred Response?" straight line shown). This is a fundamentally different conclusion from yours.

Aside from the figures: do you not find this yourself: the perceived volume changes are large at the quiet end, and small at the loud end?

radish
2008-12-05, 09:48
With respect, I can't really agree with your analysis of perceived loudness or your conclusions.

Using your numbers: going from 20 to 40 (twenty steps up) is about +8dB ... fine. Going from 40 to 60 (another twenty steps up) SHOULD be the same (+8dB).

Why? 60 is not 2x40 it's 1.5x40, so a level of 60 should be "one and a half times as loud" as a level of 40. If I didn't know anything about perceived loudness and dB scales I'd assume that 0 is "silent" and 100 is "loudest", thus 50 should be "half as loud as maximum", which is around -10dB. Likewise 25 should be "a quarter of maximum" which is around -20dB. Clearly the numbers you've measured are indicating -8 and -16 rather than -10 and -20 but the relationship is the same.



I actually think it should double in loudness for each, say, twenty steps
Well you're welcome to want that, and what you propose would certainly achieve it, I'm just challenging your implied assertion that the current situation is "wrong" in some way. For a 0-100 scale with no displayed unit I think it makes perfect sense - the implication is that it's a linear scale from 0-100% of maximum perceived loudness.



Aside from the figures: do you not find this yourself: the perceived volume changes are large at the quiet end, and small at the loud end?
Sure, but I can't say it bothers me. And to be clear, I wouldn't object to it being changed, I can adjust to holding down the remote button a little longer or shorter time :) I just don't see any need to change it, as it's behaving is a completely logical manner to me.

mooblie
2008-12-05, 10:03
Well, we'll have to agree to differ on the lin/log relationship in operation here on this one and whether SB volume is logical. :-)

I'm not chasing some academic point here, I actually find it very inconvenient that on one of my SBs, with a sensitive amp connected to it, I have to use the very low end of the volume range, and it jumps in large steps as I struggle to adjust it in the 0-20 volume region, which covers a 32dB range (whereas on my other SB, on a less sensitive amp, there is comparatively little difference between 80-100, covering only about 3dB - one tenth the span).

You're absolutely right of course, it only means holding down the volume up/down button for a longer/shorter time, but it's an inconvenience that could be so easily fixed.

Ben Sandee
2008-12-05, 10:11
On Fri, Dec 5, 2008 at 11:03 AM, mooblie
<mooblie.3jygib1228496701 (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> Well, we'll have to agree to differ on this one. :-)

FWIW there was a significant change to the volume curve for SB2+
devices several years ago. You might want to search for the
discussion of that change. As you've demonstrated, there's always
going to be someone who would like the curve to be different.

At this point in the product lifecycle, a change of any real substance
would likely bring in a torrent of "why did you change that?!" and
"give me an option to switch back!" or whatever.

If the underlying volume curve logic were in the server then it could
be altered by anyone, possibly through a plugin. As it stands it is a
device firmware feature so we're somewhat limited. One feature that
could be implemented would be to modify where the 1-11 scale in the
web UI map to the 1-100 in the player UI. This has been requested
before and I think it would be doable in software via a patch or a
plugin.

Ben

mooblie
2008-12-05, 10:18
Hmm. Thanks Ben - shame. OK: NOT "so easily fixed" then as I glibly suggested - I guess there's little appetite for firmware changes unless absolutely necessary?

Ben Sandee
2008-12-05, 11:19
On Fri, Dec 5, 2008 at 11:18 AM, mooblie
<mooblie.3jyh7b1228497601 (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> Hmm. Thanks Ben - shame. OK: NOT "so easily fixed" then as I glibly
> suggested - I guess there's little appetite for firmware changes unless
> absolutely necessary?

I think a change like that is mostly a matter of priorities because a
select few people have all three of: 1) the firmware source, 2) the
expensive devkit, 3) the expertise to work in that embedded
environment. Even then, there might not be room in the firmware to
allow something like customizable volume curves, even if it were a
highly-requested feature.

Ben

Phil Leigh
2008-12-05, 11:21
hmmm... every volume control I've ever encountered has deployed a log response, since that is how perceived loudness/our ears work. If you think the volume adjustment is too coarse at low levels with a sensitive amp, just insert an analogue attenuator betwixt SB and amp. That's the standard fix for this problem in every other context.

peterw
2008-12-05, 12:12
It IS supposed to be pretty regular steps: 0.5 dB/step for SB2, and for Boom, 1.5 dB/step at volumes 1-25, and 0.5 dB/step above that.

Here's the SB2/SB3/Classic source code:
http://svn.slimdevices.com/7.3/trunk/server/Slim/Player/Squeezebox2.pm?revision=24173&view=markup
Here's the Boom source code:
http://svn.slimdevices.com/7.3/trunk/server/Slim/Player/Boom.pm?revision=23831&view=markup

The main source code is in the Squeezebox2 file -- the Boom code inherits that and merely redefines the volume-to-dB mapping. When you look at the output, they're sending similar "fixed" values for similar dB settings -- SB2's volume 1 is -49.01 dB, which maps to firmware fixed volume step 232; Boom volume 17 is nearly the same, -48.84 dB, firmware step 237. Both send the the max step value, 65536, at volume 100/0 dB, and 61952 at volume 99, ~-0.5 dB.

Below is the map of volume levels to supposed dB gain. If you're not measuring something like this from your Squeezebox outputs with appropriate test material (0 dB white noise??) and equipment, please file a ticket at bugs.slimdevices.com. And feel free to make (and share!) a patch that resolves the issue if you can map firmware "fixed" volume levels to dB better than the current code.

Oh, it also looks like a plugin should be able to get the current "volume" attenuation in dB programatically, by using $client->getVolumeParameters() $client->getVolume();



1 = -49.01 (SB2) -72.52 (Boom)
2 = -48.51 (SB2) -71.04 (Boom)
3 = -48.02 (SB2) -69.56 (Boom)
4 = -47.52 (SB2) -68.08 (Boom)
5 = -47.03 (SB2) -66.60 (Boom)
6 = -46.53 (SB2) -65.12 (Boom)
7 = -46.04 (SB2) -63.64 (Boom)
8 = -45.54 (SB2) -62.16 (Boom)
9 = -45.05 (SB2) -60.68 (Boom)
10 = -44.55 (SB2) -59.20 (Boom)
11 = -44.06 (SB2) -57.72 (Boom)
12 = -43.56 (SB2) -56.24 (Boom)
13 = -43.07 (SB2) -54.76 (Boom)
14 = -42.57 (SB2) -53.28 (Boom)
15 = -42.08 (SB2) -51.80 (Boom)
16 = -41.58 (SB2) -50.32 (Boom)
17 = -41.09 (SB2) -48.84 (Boom)
18 = -40.59 (SB2) -47.36 (Boom)
19 = -40.10 (SB2) -45.88 (Boom)
20 = -39.60 (SB2) -44.40 (Boom)
21 = -39.11 (SB2) -42.92 (Boom)
22 = -38.61 (SB2) -41.44 (Boom)
23 = -38.12 (SB2) -39.96 (Boom)
24 = -37.62 (SB2) -38.48 (Boom)
25 = -37.13 (SB2) -37.00 (Boom)
26 = -36.63 (SB2) -36.51 (Boom)
27 = -36.14 (SB2) -36.01 (Boom)
28 = -35.64 (SB2) -35.52 (Boom)
29 = -35.15 (SB2) -35.03 (Boom)
30 = -34.65 (SB2) -34.53 (Boom)
31 = -34.16 (SB2) -34.04 (Boom)
32 = -33.66 (SB2) -33.55 (Boom)
33 = -33.17 (SB2) -33.05 (Boom)
34 = -32.67 (SB2) -32.56 (Boom)
35 = -32.18 (SB2) -32.07 (Boom)
36 = -31.68 (SB2) -31.57 (Boom)
37 = -31.19 (SB2) -31.08 (Boom)
38 = -30.69 (SB2) -30.59 (Boom)
39 = -30.20 (SB2) -30.09 (Boom)
40 = -29.70 (SB2) -29.60 (Boom)
41 = -29.21 (SB2) -29.11 (Boom)
42 = -28.71 (SB2) -28.61 (Boom)
43 = -28.22 (SB2) -28.12 (Boom)
44 = -27.72 (SB2) -27.63 (Boom)
45 = -27.23 (SB2) -27.13 (Boom)
46 = -26.73 (SB2) -26.64 (Boom)
47 = -26.24 (SB2) -26.15 (Boom)
48 = -25.74 (SB2) -25.65 (Boom)
49 = -25.25 (SB2) -25.16 (Boom)
50 = -24.75 (SB2) -24.67 (Boom)
51 = -24.26 (SB2) -24.17 (Boom)
52 = -23.76 (SB2) -23.68 (Boom)
53 = -23.27 (SB2) -23.19 (Boom)
54 = -22.77 (SB2) -22.69 (Boom)
55 = -22.28 (SB2) -22.20 (Boom)
56 = -21.78 (SB2) -21.71 (Boom)
57 = -21.29 (SB2) -21.21 (Boom)
58 = -20.79 (SB2) -20.72 (Boom)
59 = -20.30 (SB2) -20.23 (Boom)
60 = -19.80 (SB2) -19.73 (Boom)
61 = -19.31 (SB2) -19.24 (Boom)
62 = -18.81 (SB2) -18.75 (Boom)
63 = -18.32 (SB2) -18.25 (Boom)
64 = -17.82 (SB2) -17.76 (Boom)
65 = -17.33 (SB2) -17.27 (Boom)
66 = -16.83 (SB2) -16.77 (Boom)
67 = -16.34 (SB2) -16.28 (Boom)
68 = -15.84 (SB2) -15.79 (Boom)
69 = -15.35 (SB2) -15.29 (Boom)
70 = -14.85 (SB2) -14.80 (Boom)
71 = -14.36 (SB2) -14.31 (Boom)
72 = -13.86 (SB2) -13.81 (Boom)
73 = -13.37 (SB2) -13.32 (Boom)
74 = -12.87 (SB2) -12.83 (Boom)
75 = -12.38 (SB2) -12.33 (Boom)
76 = -11.88 (SB2) -11.84 (Boom)
77 = -11.39 (SB2) -11.35 (Boom)
78 = -10.89 (SB2) -10.85 (Boom)
79 = -10.40 (SB2) -10.36 (Boom)
80 = -9.90 (SB2) -9.87 (Boom)
81 = -9.41 (SB2) -9.37 (Boom)
82 = -8.91 (SB2) -8.88 (Boom)
83 = -8.42 (SB2) -8.39 (Boom)
84 = -7.92 (SB2) -7.89 (Boom)
85 = -7.43 (SB2) -7.40 (Boom)

86 = -6.93 (SB2) -6.91 (Boom)
87 = -6.44 (SB2) -6.41 (Boom)
88 = -5.94 (SB2) -5.92 (Boom)
89 = -5.45 (SB2) -5.43 (Boom)
90 = -4.95 (SB2) -4.93 (Boom)
91 = -4.46 (SB2) -4.44 (Boom)
92 = -3.96 (SB2) -3.95 (Boom)
93 = -3.47 (SB2) -3.45 (Boom)
94 = -2.97 (SB2) -2.96 (Boom)
95 = -2.48 (SB2) -2.47 (Boom)
96 = -1.98 (SB2) -1.97 (Boom)
97 = -1.49 (SB2) -1.48 (Boom)
98 = -0.99 (SB2) -0.99 (Boom)
99 = -0.50 (SB2) -0.49 (Boom)
100 = 0.00 (SB2) 0.00 (Boom)

mooblie
2008-12-05, 12:50
In that case, Peter, it's a bug. I've plotted the measured output (blue), compared to your theoretical figures (red) below.

Your theoretical figures are exactly what I'd suspected and hoped for - perfectly linear (on a log/lin scale) with 0.5dB per "volume step". I've raised bug 10228 (http://bugs.slimdevices.com/show_bug.cgi?id=10228).

mooblie
2008-12-05, 13:19
hmmm... every volume control I've ever encountered has deployed a log response, since that is how perceived loudness/our ears work.

Agreed. That's my understanding - but the SB2 (erroneously) doesn't currently have a log response.


If you think the volume adjustment is too coarse at low levels with a sensitive amp, just insert an analogue attenuator betwixt SB and amp. That's the standard fix for this problem in every other context.

Agreed too. This need for an attenuator is what alerted me to measure this "incorrect" characteristic in the first place.

Ben Sandee
2008-12-05, 15:15
On Fri, Dec 5, 2008 at 11:11 AM, Ben Sandee <tbsandee (AT) gmail (DOT) com> wrote:
>
> If the underlying volume curve logic were in the server then it could
> be altered by anyone, possibly through a plugin. As it stands it is a
> device firmware feature so we're somewhat limited. One feature that
> could be implemented would be to modify where the 1-11 scale in the
> web UI map to the 1-100 in the player UI. This has been requested
> before and I think it would be doable in software via a patch or a
> plugin.

Mea culpa, everything I wrote above is just wrong. It may have been
right at one time but happily it no longer is.

Ben

mooblie
2008-12-07, 14:32
After raising a bug about this, I was asked, reasonably enough, to just retest with current SC version 7.3. So, I did that - and the volume response has already been fixed! - see attachment.

It now runs (correctly, I believe) in 0.5dB steps down from 100 down to 1 (i.e. with output gain from 0 to -50dB) - following the correct linear path on a log/lin plot. (The final value of 0 = mute.) It now provides the fine control necessary when running the SB2/3 into a sensitive amp at very low volumes e.g. for background music.

Sorry to have wasted everybody's time for reporting my testing of obsolete software! And thanks to the team who responded to the bug so quickly!

JadeMonkee
2008-12-07, 21:38
So when was this fixed? Only in v7.3, or earlier?

mooblie
2008-12-08, 02:27
Don't exactly know, but somewhere between 7.2.1 and 7.3.