Volume Control

Summary

Make volume control intuitive and easy to use.

Owner

Current status

Targeted release: Fedora 11

Last updated: 2009-04-11

Percentage of completion: 100%

A lot of the necessary infrastructure work in PulseAudio has been done. E.g. it is possible to associate metadata with audio streams, and classify them according to roles (event, music, phone, ...). The PulseAudio version that we ship in F11 supports "flat volumes".

At the Sound BoF at GUADEC this year, the plans for the UI aspects of this feature were discussed in some detail: http://mail.gnome.org/archives/gnome-multimedia/2008-July/msg00001.html

Rawhide now contains changes made upstream to use libcanberra in gnome-media for sound events configuration, and thus support the Freedesktop sound theme specification. This means that there should not be any hard requirements on esound anywhere in the stack, except in deprecated functions in some libraries.

The new sound capplet has landed in rawhide with gnome-media-2.25.3. The mixer applet has been turned into a status icon. Metacity plays the alert sound from the sound theme instead of the dreaded system bell.

Detailed Description

With the use of PulseAudio by default, it makes sense to no longer expose the unintuitive plethora of volume controls and channels that alsa exports, and which is currently reflected 1-1 in the gnome volume control tools (gnome-volume-control and mixer applet). PulseAudio already ships with a volume control app, pavucontrol, that is packaged for Fedora (but not installed by default).

Graphical mixers (such as the volume applet, the mixer, and the multimedia keys handler) will be restricted to modifying PulseAudio's default output's mixer (which could be aggregated outputs).

The control-center's sound setup tools should react to hardware hotplug (Bluetooth headsets/headphones, USB sound cards and webcams with microphones).

The control-center will also allow basic microphone checking and input level control.

The control-center should allow tweaking of multi-inputs/outputs policies (play music to all devices, play only to headphones, etc.)

The mixer applet will be turned into a status icon, to avoid a number of problems with the applet (may not have one, may have more than one, may have one even if there is no hardware,...)

Below is Lennarts detailed explanation of the PulseAudio logic for handling mixers:

PA expects that the hw mixer is properly initialized by default, so that PCM output works at a "reasonable volume level" and everything else is muted. Also, for input mic PCM recording should work at a "reasonable level" and everything else is muted. Getting to this point requires that the database in /lib/alsa/init/* that alsa uses for this is populated. See alsactl_init(7) for more information.

PA tries to identify a master mixer track and if that doesn't exist a PCM mixer track in the alsa mixer that is exposed to the user.

If the ALSA mixer track exposes dB information, PA extends the hw mixer in software so that we always support the same dB range regardless of the limitations of the hw and that we always support per-channel volumes even when the hw doesn't support this.

If the mixer track does not expose dB information, PA won't extend the hw mixer range in software but will only expose volume controls with per-channel volumes and at least 4 levels of volume.

If the hw mixer doesn't support dB information and doesn't have at least 4 levels of volume or doesn't do per-channel volumes then we will ignore the hw volume control and instead do it in software.

PA will save and restore the volume of each device possibly overwriting what ALSA itself saves and restores. There are three reasons for this: ALSA does not save the volume automatically on hot-unplug. We extend the volume range in software and hence need to store more information that ALSA will save/restore. I believe that volumes are a per-user setting, and not a per-system setting.

Upcoming PA versions support "flat volumes" (and we enable this by default). That will basically collapse the stream volume and device volume into one (only supported for volume controls with dB info). This follows what Vista does: the device volume is always the maximum volume of all streams playing on it.

Benefit to Fedora

The multimedia experience of Fedora users is improved by an easily understandable and much more flexible volume control model.

Scope

Affected modules are:

kernel (ALSA) which should trim the number of user visible hardware channels

PulseAudio to allow supporting features in the front-ends

gst-plugins-pulse should support setting application specific volumes (see Bug #448924) DONE

gnome-volume-control will need application audio tracks support DONE

gnome-settings-daemon needs changes to make the media keys control PulseAudio volume DONE

gnome-applets will loose the mixer applet. It will be replaced by a NullApplet, to make existing panel configurations work without warnings. DONE

gnome-control-center changes to tie in with the necessary configuration options DONE

Media apps (totem, rhythmbox,...) should use the gstreamer playbin2 element to get per-stream volume support for their private volume controls, or use pulsesink directly to modify the stream volume, rather than the internal volume element. DONE (for Rhythmbox and Totem)

(for Rhythmbox and Totem) metacity should be changed to play the themed alert sound instead of the system bell DONE

User Experience

Michael is playing music using his computer's sound card/builtin speakers. But he wants more oompf, and plugs in USB speakers. The same sound starts blurting out of both sets of speakers

Michael realises that his builtin speakers are too teeny anyway, so wants to only play sound effects at a low volume on them, and keep on playing music through the bigger USB speakers. If the USB speakers were to come unplugged, the sound would go back to the internal speakers. Replugging them would get them their music back.

Tobias launches an audio chat (via Ekiga or Skype) with his agent, using the builtin microphone and speakers on his laptop, but wants more privacy. He switches on his Bluetooth headset, and automatically gets sound input and output to that device for his chat. (Note, he could be plugging in a USB headset).

Maeby is playing loud music on her headphones at night. When she tries to grab a banana, the headphone jack gets unplugged. The music automatically pauses so as to avoid making a lot of noise through the normal speakers. (Note that a similar problem could happen with USB headphones, or a Bluetooth headset running out of battery).

George-Michael's music is covered by sound effects. He likes the sound effects, but they're just too loud compared to his music. He reduces the sound effects' volume, without it affecting his music.

Screenshots:

related screenshots for [Windows Vista] (thanks Bryan!), and [MacOS X]

Additional mockups by Bryan Clark for the volume control with [one device] and [multiple devices]

How To Test

To test this, you need to have gnome-media and pulseaudio installed.

Check that you have a speaker icon in the notification area. (Assuming you have a sound card, that is. If you have no sound card, you should not get a speaker icon).

Run something that makes noise (e.g. rhythmbox, Applications ➝ Sound & Video ➝ Rhythmbox Music Player), and verify that changing the volume via the popup applies immediately. Also check that muting works, and unmuting restores the previous volume.

Run something that records sound (e.g. gnome-sound-recorder, Applications ➝ Sound & Video ➝ Sound Recorder), and verify that a microphon icon appears in the notification area when you start recording. Verify that you can control the recording level, and mute and unmute the microphone using the popup on that icon and its context menu. Stop the recording and verify that the icon disappears.

Open the sound preferences (System ➝ Preferences ➝ Sound). Go to the Sound Effects tab and test that you can control event sound volume, the overall sound theme, and the alert sounds.

On the Input tab, test that the input level display works, and that the input volume control is effective.

On the Output tab, test that the balance slider applies its changes immediately.

Verify that the Applications tab show several playing applications correctly with their icons, and that it allows you to control their relative volume

Check that the overall output volume is also controlled by the media volume keys, and that the on screen display works.

Dependencies

PulseAudio changes to provide necessary metadata on streams. This is all present in F10

PulseAudio support for flat volumes. This is present in PulseAudio 0.9.15 in rawhide.

GTK+ support for scroll events, etc. on status icons. This is present in 2.15 in rawhide

Contingency Plan

Front-end changes would be backed out.

Documentation

The Sound Preferences section of the GNOME user guide has been rewritten to reflect the new UI, patch in http://bugzilla.gnome.org/show_bug.cgi?id=474629

Release Notes

The volume control and sound user interfaces have been rewritten to make them more intuitive and easy to use. As a consequence, there is no volume control applet anymore. If your panel is configured to contain a volume control applet, it will be ignored. Instead, a volume control status icon will automatically appear in the notification area when appropriate.

Known issues include the use of non-default recording profiles. If the sound input you want to use is not enabled with the default profile configuration, you'll need to use pavucontrol to select it. Integration is planned for this in Fedora 12.