After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 581915 - Please allow only discrete volume levels depending on pa_sink::n_volume_steps
Please allow only discrete volume levels depending on pa_sink::n_volume_steps
Status: RESOLVED OBSOLETE
Product: gnome-control-center
Classification: Core
Component: Sound
unspecified
Other All
: Normal normal
: ---
Assigned To: Control center sound maintainer(s)
gnome media maintainers
Depends on: 582752
Blocks:
 
 
Reported: 2009-05-08 18:04 UTC by Lennart Poettering
Modified: 2021-06-09 16:06 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
gvc-n-volumes-start.patch (6.10 KB, patch)
2009-05-15 10:46 UTC, Bastien Nocera
needs-work Details | Review

Description Lennart Poettering 2009-05-08 18:04:52 UTC
Please describe the problem:
PA exports in pa_sink::n_volume_steps how many discrete volume steps are actually supported by a device. For devices where we have dB information for this will always be 65537 and doesn't matter much, but for devices like BT headsets an cheap USB sound cards we don't have that information and the supported volume steps can be very small (8 or so). It would be good if this could be reflected in the sliders, so that only those discrete points are actually selectable.

n_volume_steps stores how many steps are supported between 0 and PA_VOLUME_NORM. If this value is e.g. 4 the four volume levels are calculated like this:

PA_VOLUME_NORM*x/(4-1) for x in 0..3. i.e. 0, 21845, 43690, 65536

Or more general: PA_VOLUME_NORM*x/(m-1) for x in 0..m-1



Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Bastien Nocera 2009-05-09 01:35:30 UTC
Should we only use the b_volume_steps if the sink or source doesn't have dB info, or in all cases?
Comment 2 Lennart Poettering 2009-05-09 02:01:20 UTC
n_volume_steps is always valid. It is safe to use that in any case.

Oh, dunno what I was smoking before, m is of course the same as n_volume_steps, so we can just write this like this:

PA_VOLUME_NORM*x/(n_volume_steps-1) for x in 0..n_volume_steps-1
Comment 3 Bastien Nocera 2009-05-15 10:46:16 UTC
Created attachment 134697 [details] [review]
gvc-n-volumes-start.patch

To make discreet values work, we should modify update_slider_position(), and make the various steps work similarly to the marks.
Comment 4 Bastien Nocera 2010-11-10 13:16:22 UTC
Mass move to gnome-control-center.
Comment 5 Bastien Nocera 2012-08-24 17:21:01 UTC
Mass reassign, sorry for the noise.
Comment 6 André Klapper 2021-06-09 16:06:35 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new bug report at
  https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/

Thank you for your understanding and your help.