[pulseaudio-discuss] limits on maximum device volume?

CJ van den Berg cj at vdbonline.com
Wed Apr 29 02:57:25 PDT 2009


On Wed, Apr 29, 2009 at 12:21:23AM +0200, Lennart Poettering wrote:
> On Tue, 28.04.09 14:43, pl bossart (bossart.nospam at gmail.com) wrote:
> > I wasn't really addressing the difference between sink and stream
> > volume. Your answer on which volumes are saved when was extremely
> > interesting and educational, but my concern was: 'how do I prevent the
> > user from setting a volume (stream or sink) that is too high when
> > he/she plays with the sliders. I understand some people want to boost
> > their volume of their poorly mastered tracks, but for most products
> > you want to avoid being too loud. I think there's even a EU directive
> > that the sound cannot be louder than xx dB for mobile devices.
> > Likewise iPods provide a means to lock the max volume. How would we go
> > about that in a PulseAudio/ALSA context.
> 
> Ah, I see. dB in this case refers to SPL or something like that I
> guess?
> 
> Hmm, in ALSA the dB scales are only very vaguely defined, there is no
> established reference level for the sliders. On the inner volume
> sliders 0dB usually means 'no attenuation/amplification compared to
> the previous element`. On the outer ones 0dB can however mean
> everything. On my USB speakers 0dB is max amplification. On many other
> drivers the reference level is some specific 'standard' voltage, and
> on others a different 'standard' voltage.
> 
> What we'd need is some way that we can determine the SPL from the
> mixer settings and the actual signal. That's a bit hard if we don't
> even know which reference level those mixer dB values use. In
> addition, the SPL depends on the speakers too, I guess.

That’s way overkill. I don’t think the EU directive is important in
any way. That’s something hardware manufacturers have to worry about.

What would be useful though would be an option to limit the output level
based on actual stream data. That would allow you to crank up the volume
during the quiet parts of a film and not risk blowing your ears when the
shooting starts.
 
> If we had the replay gain logic in PA I mentioned then we'd have an
> easy way to query the 'loudness' of a specific stream. What's left to
> do then is adding an ALSA API to query the reference level of a mixer
> element (if it is known) or how it translates to dB SPL.
> 
> The actual policy module would then be easy to write. 

Also, overkill IMHO. I would just drop the stream level to compensate when
the measured 'loudness' crosses a user set threshold.

All you really need is a single check box that says "Limit perceived
output volume" and then trigger at -1dB or so of the sink volume level.

The hard part is the replay gain logic.

-- 
CJ van den Berg

mailto:cj at vdbonline.com
  xmpp:cj at vdbonline.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20090429/9ad18b68/attachment.pgp>


More information about the pulseaudio-discuss mailing list