レナート   Wunschkonzert, Ponyhof und Abenteuerspielplatz   ﻟﻴﻨﺎﺭﺕ

Tue, 10 Feb 2009

Writing Volume Control UIs is Hard

Writing modern volume control UIs (i.e. 'mixer tools') is much harder to get right than it might appear at first. Because that is the way it is I've put together a rough guide what to keep in mind when writing them for PulseAudio. Originally just intended to be a bit of help for the gnome-volume-control guys I believe this could be an interesting read for other people as well.

It touches a lot of topics: volumes in general, how to present them, what to present, base volumes, flat volumes, what to do about multichannel volumes, controlling clients, controlling cards, handling default devices, saving/restoring volumes/devices, sound event sliders, how to monitor PCM and more.

So make sure to give it at least a quick peek! If you plan to write a volume control for ncurses or KDE (hint, hint!) even more so, it's a must read.

Maybe this might also help illustrating why I think that abstracting volume control interfaces inside of abstraction layers such as Phonon or GStreamer is doomed to fail, and just not even worth the try.

And now, without further ado I give you 'Writing Volume Control UIs'.

posted at: 21:03 | path: /projects | permanent link to this entry | 11 comments


Posted by Markus at Tue Feb 10 22:21:46 2009
I saw the perfect volume controls in BeOS 5.0. No need for original research. It's either inferior or the result is the same as BeOS.
Sorry to say this, but Be Inc had the features of PulseAudio 10 years (or more) ago.

Posted by ethana2 at Tue Feb 10 23:12:16 2009
Per-sink volume needs to be able to be taken up to 400 or 500% maximum.  My mom has to use external speakers with her laptop not because of the weakness of her integrated speakers but because of the deficiencies of Ubuntu's sound controls.

Posted by Milo Casagrande at Tue Feb 10 23:30:47 2009
Thanks for sharing that wiki page, it really helps us even translating PulseAudio and audio related software/applet. We had some problem trying to figure out how to render "sink" in a better and clearer way, but it wasn't that easy 'cause looks like it's used with different meaning. If I may, form a translator POV, may I suggest to try to use a more common term like "output" when it's used only as "sink" and not as "sink input"? It would probably be clearer also to other people. sink looks too a technical term for me.

Cheers.

Posted by Zeeshan Ali (Khattak) at Wed Feb 11 00:00:22 2009
Maybe this might also help illustrating why I think that abstracting volume control interfaces inside of abstraction layers such as Phonon or GStreamer is doomed to fail, and just not even worth the try.

Shattering commonly-held believes again, are we? :) Don't you ever learn? :P

Posted by Alan at Wed Feb 11 01:58:04 2009
why not just use gnome-volume-manager?

eh, no, wait a second ...
:P

silly technical jargon has infected me, and to my own surprise I thought of hard disk volume before I thought sound volume.  bah!  (i even complained at the time that gvm was a confusing name, and now to think of it first)

so much tricky jargon... a difficult task indeed.

Posted by hron84 at Wed Feb 11 09:34:51 2009
Thanks a share. Now, i know what a hell the 'sink' :-)

Posted by Luca Ferretti at Wed Feb 11 23:09:54 2009
I agree with Milo, "sink" is a techninal term, shouldn't be exposed in end user interface.

May I suggest
- An output device
+ An output device (note: use "Output", not "Sink" for user visible strings)

- An input device
+ An input device (note: use "Input", not "Source" for user visible strings)

Posted by Lennart at Wed Feb 11 23:19:38 2009
Luca Ferretti: of which UI are you talking?

Posted by Luca Ferretti at Sat Feb 14 20:04:53 2009
Somethink like http://code.google.com/p/gnome-pulse-applet/wiki/Screenshots

:D

On user visible stuff, sink don't seems so good IMHO.

Posted by capture volume at Sat Mar 7 05:48:29 2009
I: alsa-source.c: Volume ranges from 0 to 15.
I: alsa-source.c: Volume ranges from 0.00 dB to 22.50 dB.
I: alsa-source.c: Fixing base volume to -22.50 dB


what is the meaning of Fixing base volume to -22.50dB

overall range of pulse softvolume + ac97 record gain is -48dB <-> 22.5dB

AC97 2.x specification


5.7.7  Record Gain Registers (Index 1Ch and 1Eh)
Reg  Name  D15  D14  D13  D12 D11 D10  D9  D8  D7  D6  D5  D4  D3  D2  D1  D0  Default
1Ch  Record Gain  Mute  X  X  X  GL3 GL2  GL1  GL0  X  X  X  X  GR3 GR2 GR1  GR0  8000h
1Eh  Record Gain Mic  Mute  X  X  X  X  X  X  X  X  X  X  X  GM3 GM2 GM1  GM0  8000h
1Ch is for the stereo input and 1Eh is for the optional dedicated mic channel. Each step corresponds to 1.5 dB.
22.5dB corresponds to 0F0Fh and 000Fh respectively. The MSB of the register is the mute bit. When this bit is set
to 1 the level for that channel(s) is set at -&#8734; dB.
The default value is 8000h, which corresponds to 0 dB gain with mute on.

Posted by Gregg Warren at Sun Jan 17 20:35:19 2010
I've worked as a custom machine design/builder for specialty production machines for years.  I've read many of the flames on PA and have experienced some frustration myself.  Recently read an article on how home theater sellers are having trouble with returns because the tech and gadgetry have exceeded "average" customer know-how in setup.  Simple thought... simple terminology (ie: "input-output"), detailed help pages with pictographs if necessary, baseball bat to enforce that thought with distro developers.  Great work, need to link it better with the "average user".  Understand your frustration.

Leave a Comment:

Your Name:


Your E-mail (optional):


Comment:


As a protection against comment spam, please type the following number into the field on the right:
Secret Number Image

Please note that this is neither a support forum nor a bug tracker! Support questions or bug reports posted here will be ignored and not responded to!


It should be obvious but in case it isn't: the opinions reflected here are my own. They are not the views of my employer, or Ronald McDonald, or anyone else.

Please note that I take the liberty to delete any comments posted here that I deem inappropriate, off-topic, or insulting. And I excercise this liberty quite agressively. So yes, if you comment here, I might censor you. If you don't want to be censored your are welcome to comment on your own blog instead.


Lennart Poettering <mzoybt (at) 0pointer (dot) net>
Syndicated on Planet GNOME, Planet Fedora, planet.freedesktop.org, Planet Debian Upstream. feed RSS 0.91, RSS 2.0
Archives: 2005, 2006, 2007, 2008, 2009, 2010, 2011

Valid XHTML 1.0 Strict!   Valid CSS!