Go to file
Hui Wang dbfbacc957 mixer-control: set max_volume to PA_VOLUME_NORM if no valid volume
Reproducers:
1. After a fresh install of Ubuntu 20.04, open a gnome-terminal
and press the Tab key, the system will output a bell notification
sound. Open gnome-control-center and check the sound page,
the output volume of 'System Sounds' is at 0, but the notification
sound is still output at max volume.

2. After a fresh install of Ubuntu 20.04, open gnome-control-center
directly, change to the sound page, the output volume of
'System Sounds' is at its max level. Click any 'Alert Sound' button
at the bottom of the page, the sound is output at max volume but
the UI slider for the output volume of 'System Sounds' changes to 0.
The notification sound can however still could be heard at max volume.

After a fresh install of the system, there is no saved entry for
"sink-input-by-media-role:event" in PulseAudio's module-stream-restore,
so libgvc will create a pa_ext_stream_restore_info in the
_pa_ext_stream_restore_read_cb(). When a notification sound stream
is sent to PA, PA will create an entry with name of
"sink-input-by-media-role:event" and save it to the database, but
volume_valid is false until gnome calls pa_ext_stream_restore_write().

So if users open the gnome-control-center before
pa_ext_stream_restore_write() is called, although there is an entry
named "sink-input-by-media-role:event" in the module-stream-restore,
the volume is not valid in that entry, and calling
pa_cvolume_max (&info->volume) will returns 0.

In this case, libgvc reports the max_volume is 0, but in PulseAudio,
the stream/sink-input volume is max (pa_sink_input_new() of the
sink-input.c).

Check if info->volume.channels is 0, which would mean the volume is
not valid in the entry, and set max_volume to PA_VOLUME_NORM like
_pa_ext_stream_restore_read_cb() does in this case.

Below is the PA log about the stream entry without a valid volume:
E: [pulseaudio] module-stream-restore.c: name=sink-input-by-media-role:event
E: [pulseaudio] module-stream-restore.c: device=(null) no
E: [pulseaudio] module-stream-restore.c: channel_map=(invalid)
E: [pulseaudio] module-stream-restore.c: volume=(invalid) no
E: [pulseaudio] module-stream-restore.c: mute=no no
2023-07-24 11:58:35 +02:00
.gitlab-ci ci: Use meson for CI build 2019-11-22 19:37:31 +01:00
.gitignore build: ignore .dirstamp file 2020-04-09 13:53:36 +00:00
.gitlab-ci.yml ci: Build with clang as well 2023-07-18 16:34:32 +02:00
gvc-channel-map-private.h Initial import 2012-10-19 20:00:25 +02:00
gvc-channel-map.c channel-map: Don't specify default c_marshaller 2023-07-18 15:52:10 +00:00
gvc-channel-map.h Initial import 2012-10-19 20:00:25 +02:00
gvc-mixer-card-private.h Initial import 2012-10-19 20:00:25 +02:00
gvc-mixer-card.c mixer-card: Improve GObject properties gunk a bit 2023-07-18 15:52:10 +00:00
gvc-mixer-card.h Add a GIcon accessor for GvcMixerUIDevices 2013-02-18 14:39:54 +01:00
gvc-mixer-control-private.h Initial import 2012-10-19 20:00:25 +02:00
gvc-mixer-control.c mixer-control: set max_volume to PA_VOLUME_NORM if no valid volume 2023-07-24 11:58:35 +02:00
gvc-mixer-control.h gvc: Add "what did you plug in" support API 2016-01-17 18:34:07 -02:00
gvc-mixer-event-role.c event-role: Improve GObject properties gunk a bit 2023-07-18 15:52:10 +00:00
gvc-mixer-event-role.h Initial import 2012-10-19 20:00:25 +02:00
gvc-mixer-sink-input.c avoid deprecated g_type_class_add_private 2018-09-09 00:02:41 +03:00
gvc-mixer-sink-input.h Fix introspection support 2012-10-19 20:00:47 +02:00
gvc-mixer-sink.c avoid deprecated g_type_class_add_private 2018-09-09 00:02:41 +03:00
gvc-mixer-sink.h Fix introspection support 2012-10-19 20:00:47 +02:00
gvc-mixer-source-output.c avoid deprecated g_type_class_add_private 2018-09-09 00:02:41 +03:00
gvc-mixer-source-output.h Fix introspection support 2012-10-19 20:00:47 +02:00
gvc-mixer-source.c avoid deprecated g_type_class_add_private 2018-09-09 00:02:41 +03:00
gvc-mixer-source.h Fix introspection support 2012-10-19 20:00:47 +02:00
gvc-mixer-stream-private.h Initial import 2012-10-19 20:00:25 +02:00
gvc-mixer-stream.c mixer-stream: Improve GObject properties gunk a bit 2023-07-18 15:52:10 +00:00
gvc-mixer-stream.h mixer-control: Expose stream state 2019-11-23 02:42:51 +01:00
gvc-mixer-ui-device.c mixer-ui-device: Improve GObject properties gunk a bit 2023-07-18 15:52:10 +00:00
gvc-mixer-ui-device.h gvc-mixer-ui-device: make stream-id unsigned int 2015-09-09 14:14:15 +03:00
gvc-pulseaudio-fake.h build: Don't limit pulseaudio-fake header to introspection 2019-11-23 02:42:51 +01:00
libgnome-volume-control.doap Comment invalid <category> in DOAP file to pass git pre-receive hook 2018-12-16 01:22:53 +01:00
meson_options.txt build: Rename build options 2018-01-30 13:15:36 +01:00
meson.build build: Bump pulseaudio dependency 2020-04-09 12:14:25 +02:00
README.md README: Add README 2018-09-07 15:31:39 +02:00
test-audio-device-selection.c test-audio-device-selection: fix -Wdiscarded-qualifiers warnings 2020-04-09 13:53:36 +00:00

libgnome-volume-control

libgnome-volume-control is a copy library that's supposed to be used as a git sub-module. If your project uses some of libgnome-volume-control's strings in a user-facing manner, don't forget to add those files to your POTFILES.in for translation.

Projects using libgnome-volume-control