From Fedora Project Wiki
fp-wiki>ImportUser
(Imported from MoinMoin)
 
m (Removing QA category)
 
(63 intermediate revisions by 6 users not shown)
Line 1: Line 1:
= Volume Control =
= Volume Control =


== Summary ==


 
Make volume control intuitive and easy to use.
== Summary ==


== Owner ==
== Owner ==
* Name: LennartPoettering
* Name: [[LennartPoettering | Lennart Poettering]], [[BastienNocera | Bastien Nocera]], [[JonMccann | William Jon McCann]]
* Email addresses: '''FOLLOW THE LINK'''


== Current status ==
== Current status ==
* Targeted release:
* Targeted release: [[Releases/11 | Fedora 11]]
* Last updated: 2007-10-17
* Last updated: 2009-04-11
* Percentage of completion: 0%
* 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 ==
== Detailed Description ==


With the use of Pulse''''''Audio by default, it makes sense to no longer expose the unintuitive plethora of
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
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). Pulse''''''Audio already ships with a 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).
control app, pavucontrol, that is packaged for Fedora (but not installed by default).


The changes that we want to implement for volume control in Fedora 9 are:
* 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).
* Give pavucontrol a face-lift to bring the user interface up to par with the rest of desktop, and replace gnome-volume-control with it
* The control-center's sound setup tools should react to hardware hotplug (Bluetooth headsets/headphones, USB sound cards and webcams with microphones).
* Write a replacement for the mixer applet that directly exposes the PA volume concepts. While there is no detailed design for this yet, here are some key ideas:
* The control-center will also allow basic microphone checking and input level control.
* Display one slider per active device, with indented additional sliders for active streams on each device
* The control-center should allow tweaking of multi-inputs/outputs policies (play music to all devices, play only to headphones, etc.)
* Maybe we also want a mute button, and some smart snapping for tying stream volume to device volume
* 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,...)
* Devices and streams will be identified by icon and name
* Maybe it should be possible to activate an application by clicking on the icon next to its stream
* Advanced features like control of individual channels (left/right or 5-1) or moving of streams between devices will be left to out. They are available through pavucontrol.


Bryan Clark collected some inspirational [http://www.gnome.org/~clarkbw/designs/volume%20control/vista/ screenshots] .
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 ==
== Benefit to Fedora ==
Line 39: Line 60:
== Scope ==
== Scope ==


Requires changes to pavucontrol, possibly also to Pulse''''''Audio itself.
Affected modules are:
Requires a replacement mixer applet to be written.
* 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 #[[rhbug:448924|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)
* metacity should be changed to play the themed alert sound instead of the system bell '''DONE'''


== Test Plan ==
== User Experience ==


* Verify that pavucontrol is in the default install instead of gnome-volume-control, and the mixer applet on the panel is the new one.
* 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


* Verify that pavucontrol and the new mixer applet allow to control the volume of streams and devices; also make sure that feedback works correctly (ie changing the volume in the mixer applet should be reflected in a concurrently running pavucontrol, and vice versa)
* 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.


* Verify that volume settings are remembered across logouts and reboots
* 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).


== User Experience ==
* 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:
 
[[Image:Screenshot-Sound_Preferences.png| Sound preferences, first tab]]
 
[[Image:Screenshot-Sound_Preferences-1.png| Sound preferences, second tab]]
 
[[Image:Screenshot-Sound_Preferences-2.png| Sound preferences, third tab]]
 
[[Image:Screenshot-Sound_Preferences-3.png| Sound preferences, last tab]]
 
[[Image:Statusicon.png| Status icons]]
 
* related screenshots for [[http://www.gnome.org/~clarkbw/designs/volume%20control/vista/ Windows Vista]] (thanks Bryan!), and [[http://people.redhat.com/bnocera/pavucontrol/ MacOS X]]
* Additional mockups by Bryan Clark for the volume control with [[http://www.gnome.org/~clarkbw/designs/volume%20control/vcontrol.svg one device]] and [[http://www.gnome.org/~clarkbw/designs/volume%20control/multiple-devices.svg 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 ==
== 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 ==
== Contingency Plan ==


Stay with gnome-volume-control and the old mixer applet. No changes, no improvements.
Front-end changes would be backed out.


== Documentation ==
== 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 ==
== Release Notes ==


== Comments ==
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.
 
== Comments and Discussion ==


* How does this relate to non-ALSA mixers such as the HW volume controls on thinkpads? - BillNottingham
* See [[Talk:Features/VolumeControl]]
* There are already patches to make the thinkpad mixer a normal ALSA mixer. And Takashi intends to merge the Thinkpad mixer track directly into the normal sound card mixer, i.e. a mixer with two Master mixer tracks of which one is controlled via the thinkpad hw controls in addition to sw. Then, we would just use the thinkpad mixer for our volume control and set the master and PCM tracks of the soundchip to 0 db. And everything is fine! - LennartPoettering
* I have created workaround for GNOME to run pavucontrol instead of gnome-volume-control. Requires renaming g-v-c executable by adding ".real" suffix. It is gnome-wm script based. [http://wklej.org/id/36af88379f The script] and [http://www.wklej.org/id/9dc55ee2d5 the schema] to add to g-v-c.schemas. - JakubRusinek


----
----
[[Category:ProposedFeature]]
 
[[Category:FeatureAcceptedF11]]

Latest revision as of 17:36, 17 April 2009

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)
  • 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:

Sound preferences, first tab

Sound preferences, second tab

Sound preferences, third tab

Sound preferences, last tab

Status icons

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.

Comments and Discussion