mirror of
https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
synced 2024-11-23 01:10:40 -05:00
dbfbacc957
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 |
||
---|---|---|
.gitlab-ci | ||
.gitignore | ||
.gitlab-ci.yml | ||
gvc-channel-map-private.h | ||
gvc-channel-map.c | ||
gvc-channel-map.h | ||
gvc-mixer-card-private.h | ||
gvc-mixer-card.c | ||
gvc-mixer-card.h | ||
gvc-mixer-control-private.h | ||
gvc-mixer-control.c | ||
gvc-mixer-control.h | ||
gvc-mixer-event-role.c | ||
gvc-mixer-event-role.h | ||
gvc-mixer-sink-input.c | ||
gvc-mixer-sink-input.h | ||
gvc-mixer-sink.c | ||
gvc-mixer-sink.h | ||
gvc-mixer-source-output.c | ||
gvc-mixer-source-output.h | ||
gvc-mixer-source.c | ||
gvc-mixer-source.h | ||
gvc-mixer-stream-private.h | ||
gvc-mixer-stream.c | ||
gvc-mixer-stream.h | ||
gvc-mixer-ui-device.c | ||
gvc-mixer-ui-device.h | ||
gvc-pulseaudio-fake.h | ||
libgnome-volume-control.doap | ||
meson_options.txt | ||
meson.build | ||
README.md | ||
test-audio-device-selection.c |
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.