Closed Bug 1362312 Opened 9 years ago Closed 5 months ago

Sound volume controls use wrong scale

Categories

(Core :: Audio/Video: cubeb, defect, P4)

53 Branch
Unspecified
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: petr.tuma, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0 Build ID: 20170420084331 Steps to reproduce: Open a page that plays sound, e.g. http://play.spotify.com or http://www.youtube.com. In parallel, open a volume control application that displays actual system volume, such as pavucontrol on Linux with PulseAudio. In Firefox, use the volume slider in the page to control volume, and observe the system volume changes. Actual results: The volume scales used by the system volume control application and by Firefox are different (linear vs logarithmic). When the volume slider in Firefox is set to about 50%, the system volume slider in PulseAudio indicates a volume of about 80%. Getting a 50% volume on the system volume slider requires pushing the volume slider in Firefox to about one fifth of the range or less. As a result, the volume control slider in Firefox is difficult to use, because for most of its range, the actual system volume does not change much, and useful volume ranges actually occupy only a small part of the slider displayed by Firefox. This could be Linux and PulseAudio specific. I assume it is not specific to particular web pages, at least YouTube and Spotify both behave in similar way. Expected results: Setting the volume to e.g. 50% in Firefox should set the volume to 50% in system volume control, etc.
Component: Untriaged → Audio/Video
OS: Unspecified → Linux
Product: Firefox → Core
Component: Audio/Video → Audio/Video: Playback
It seems like browsers don't need to be linear https://dev.w3.org/html5/spec-preview/media-elements.html#dom-media-volume Judging by ear on Windows, 80% volume is the same across Firefox, Edge and Chrome. Pulse Audio uses logarithmic volume http://0pointer.de/lennart/projects/pulseaudio/doxygen/volume.html I suspect that this is one of those cases where there isn't one clear right answer.
Component: Audio/Video: Playback → Audio/Video: cubeb
Priority: -- → P3
Mass change P3->P4 to align with new Mozilla triage process.
Priority: P3 → P4

Linear vs logarithmic is subjective, both to personal tastes and to different audio situations. Either is fine as a default, but perhaps an option in about:config would be warranted for audiophiles who care to use to set their preferences.

Severity: normal → S3

(In reply to Drew DeVault from comment #3)

Linear vs logarithmic is subjective, both to personal tastes and to different audio situations. Either is fine as a default, but perhaps an option in about:config would be warranted for audiophiles who care to use to set their preferences.

It is not audiophiles who care, it is anyone who wants to play video quietly. The minimum it is possible to get the volume as it stands on Linux is about 20%. There is one pixel between that and zero.

Note this is a Linux-specific bug: on Windows, Firefox behaves correctly. (Don't know about Mac). Even if it is subjective (which I do not agree with), it doesn't make sense to have deliberately inconsistent behaviour across platforms.

I've been running with the above patch since I submitted it three years ago, but not had any feedback.

We no longer use the PulseAudio volume APIs. Volume is handled internally, and the volume controls presented to the user via the PulseAudio UI are untouched.

Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Resolution: --- → WORKSFORME
Duplicate of this bug: 2052553
You need to log in before you can comment on or make changes to this bug.