[alsa-devel] [LAD] FIxed alsa-tools' envy24control missing peak level meters and "Reset Peaks"

Niels Mayer nielsmayer at gmail.com
Fri Jul 16 09:13:17 CEST 2010

On Tue, Jul 13, 2010 at 3:46 PM, Tim E. Real <termtech at rogers.com> wrote:
> But nothing was ever done about the slider markings.
> Having them go from 0 to 164 is not really helpful.
> It's not clear where the 0dB mark is.
> At the very least a 0dB mark should be added.
> Uh, do you feel like taking a stab at this?
> IIRC it would be a bit tricky because you have to look up
>  the corresponding values in the IC data sheets, I think.

This makes sense... I was thinking of a simple ruler with a 0dB label
at 127 and a + dB label  above and a - dB label below.

Some thoughts on further usability improvements to envy24control:

(1)  In "alsamixer" the snd-ice1712-card's input levels are
represented by (versus envy24control's value):
100% (163) -> ADC [dB gain: 18.00]
78%   (127) -> ADC [dB gain: 0.00]
1%     (001) -> ADC [dB gain: -63.00]
0%    (000) -> ADC [dB gain: mute]
Mixers like envy24control, kmix, alsamixergui, gst-mixer, etc, are a
lot less useful than they could be because they just present sliders.
At least envy24control gives numeric values,  -- which is essential if
you want to know stereo channels are balenced, or what unity-gain
levels are for inputs.

In "alsamixer", the snd-ice1712-card's output levels are represented
by (versus envy24control value):
100%  (127)  -> DAC [dB gain: 0.00]
1%      (001)  -> DAC [dB gain: -63.00]
0%      (000) -> DAC [dB gain: mute]

As this is a separate issue from the meters, it makes sense to do the
changes to the "Analog Volume" panel of envy24control as a separate

(2) The "0-96" sliders, feeding the digital mixer, need better
labeling and mappings too: The "96" actually being "-96dB" and only
valid for 16 bit depths. On the other hand, alsamixer is showing the
24 bit dB values, even when 16 bits are being used:

100% (0)  -> H/W Multi [dB gain: 0.00, ...]
1%    (95) -> H/W Multi [dB gain: -142.50,...]
0%    (96) -> H/W Multi [dB gain: -144.00,...]

Worse than the labelling, but associated -- the scaling: Right now the
digital mixer's input sliders all have linear response -- which wastes
the lower half of the slider and makes setting levels difficult
because all the "action" is near the top. If you use an external MIDI
controller for the mixer, you can use this existing option:
	-M, --midienhanced	Use an enhanced mapping from midi controller to db slider
However this does not apply to the GUI controller, which stays linear.

Clearly the GUIs digital mixer controls also need a logarithmic scale
(perhaps as default settings); matching that, each mixer input's
meters also need to have their scale expressed "logarithmically" so as
to provide, for example 50% of the display resolution for 0 to -20dB,
and remaining 50% for -20dB to -96dB/-144dB.

Alongside the numbers indicating the 0 to -96db L or R gain on each
mixer input channel, I would also add the current  peak value held in
the meters in dB, which would be based on hardware metering level
"0xFF" representing 0db, and hardware meter level "0x01" representing
all but the last of the 9 MSB's being 0 (per
http://alsa.cybermirror.org/manuals/icensemble/envy24.pdf: "Peak data
derived from the absolute value of 9 msb. 00h * min - FFh max volume.
Reading the register resets the meter to 00h."

Other missing features:

(3) Due to the hardware metering employed by envy24control, the peak
meters don't actually detect "clipping" ; rather, they just detect
"full scale" as 255. Is there a hardware clipped indicator on the
ice1712? It doesn't make sense to turn on a big red "clipped" light
for 0dB output, so the current peak-meters are "subtle," and just
indicate that a peak occurred at the given level... And color-code the
peak towards red as it reaches 255.

(4) The "IEC958 Input Status" isn't presented, even though it's
available and working, e.g from the command-line,. with SPDIF input
going to the Delta66 soundcard:
gnulem-176-~> amixer -c M66 cget numid=50,iface=MIXER,name='Delta
IEC958 Input Status'
numid=50,iface=MIXER,name='Delta IEC958 Input Status'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
And without any SPDIF input:
gnulem-177-~> amixer -c M66 cget numid=50,iface=MIXER,name='Delta
IEC958 Input Status'
numid=50,iface=MIXER,name='Delta IEC958 Input Status'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off

Perhaps this isn't available in envy24control because it has differing
levels of support across envy24-based cards? I only have a Delta66's
and a Terratec  Dmx6Fire 24/96 for testing, and both support the SPDIF
input status.

-- Niels

PS: ALSA tip of the day. To read ice1712's hardware level-meter values
from the command line:
"amixer -c M66 cget iface=PCM,name='Multi Track Peak',numid=45"
: values=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,198,255,198

More information about the Alsa-devel mailing list