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 645708 - when audio server isn't available don't show microphone
when audio server isn't available don't show microphone
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Bastien Nocera
gnome-shell-maint
Depends on:
Blocks: 657077
 
 
Reported: 2011-03-26 03:42 UTC by William Jon McCann
Modified: 2011-08-25 22:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
VolumeStatus: hide when PulseAudio is not available (3.74 KB, patch)
2011-03-26 17:04 UTC, Giovanni Campagna
none Details | Review
GnomeVolumeControl: track PulseAudio connection state and expose it (13.99 KB, patch)
2011-03-28 14:14 UTC, Giovanni Campagna
none Details | Review
VolumeStatus: track PulseAudio state and hide when disconnected (1.79 KB, patch)
2011-03-28 14:15 UTC, Giovanni Campagna
committed Details | Review
GnomeVolumeControl: track PulseAudio connection state and expose it (14.03 KB, patch)
2011-08-18 12:38 UTC, Giovanni Campagna
none Details | Review
GnomeVolumeControl: track PulseAudio connection state and expose it (7.36 KB, patch)
2011-08-18 12:51 UTC, Giovanni Campagna
committed Details | Review
Update volume-control applet for GVC API changes. (2.18 KB, patch)
2011-08-18 13:04 UTC, Giovanni Campagna
committed Details | Review

Description William Jon McCann 2011-03-26 03:42:35 UTC
I just tried to disable pulseaudio to work around a hang.  I noticed this had a strange side effect of adding a microphone slider to the sound menu.

Also, the sliders pretend like they can change the levels when they can't.  We should probably indicate that to the user by making them insensitive at least.  For 3.2 maybe we can show a message too.
Comment 1 Giovanni Campagna 2011-03-26 17:04:00 UTC
Created attachment 184302 [details] [review]
VolumeStatus: hide when PulseAudio is not available

When connection to pulseaudio fails or goes down, hide the volume
indicator and associated menu.
Comment 2 Owen Taylor 2011-03-27 22:04:35 UTC
I don't think this is a priority issue for 3.0 - it only comes up in the case where PulseAudio is misconfigured; I think we should wait for 3.0.1 for this fix.

The patch looks reasonable. My only question is that it appears to me that in the case where any of the individual requests - pa_context_get_server_info(), etc, fail that we emit neither 'ready' nor 'failed' will emitted.

But I'd like Bastien to review this (set to accepted-commit-after-freeze if you like it), and also he should probably look if this needs to be merged back to the GVC orginal sources.
Comment 3 Bastien Nocera 2011-03-28 00:24:04 UTC
Patch looks good to me, but I wonder whether a property and using a g_object_notify() to replace the "ready"/"not ready" signals would be enough. Or even re-using this single signal renamed as "status-changed" with a "gboolean ready" member.

I would also need similar patches to the gvc-applet and gvc panel as well.
Comment 4 Giovanni Campagna 2011-03-28 14:14:35 UTC
Created attachment 184456 [details] [review]
GnomeVolumeControl: track PulseAudio connection state and expose it

Adds get_state() and ::state-changed signals, that replace connecting
and ready, as well as providing indication of when the object was closed
or the connection to PulseAudio failed.

I did not make it a realy GObject property because I didn't want to add
all the glib-mkenums infrastructure. Can rework if you think it is cleaner.
Most of the patch are whitespace changes, as I tried to keep everything
aligned as it was before. If you prefer to have useful git blame, I'll remove
those changes.
I will prepare a patch for gnome-control-center and gnome-volume-control-applet
as soon as this is approved.
Comment 5 Giovanni Campagna 2011-03-28 14:15:40 UTC
Created attachment 184457 [details] [review]
VolumeStatus: track PulseAudio state and hide when disconnected

Only show the menu when the associated GvcMixerControl is ready, as
the connection can fail or PulseAudio may not be installed.
Comment 6 Giovanni Campagna 2011-06-14 19:23:58 UTC
Ping?
Comment 7 Bastien Nocera 2011-08-03 14:44:31 UTC
Review of attachment 184456 [details] [review]:

Loads of unrelated line changes making the patch too busy. The code itself looks fine.

::: src/gvc/gvc-mixer-control.c
@@ +61,3 @@
+        int                   n_outstanding;
+        guint                 reconnect_id;
+        GvcMixerControlState  state;

You're only adding _one_ line. I'd rather have it not aligned and the patch be readable. Simply add it at the bottom of the struct so it doesn't look too out of place, or leave it on the same line).

::: src/gvc/gvc-mixer-control.h
@@ +55,3 @@
         GObjectClass            parent_class;
 
+        void (*state_changed)          (GvcMixerControl      *control,

A single line change.

@@ +77,3 @@
+gboolean             gvc_mixer_control_open                (GvcMixerControl *control);
+gboolean             gvc_mixer_control_close               (GvcMixerControl *control);
+GvcMixerControlState gvc_mixer_control_get_state           (GvcMixerControl *control);

Again, a single line change.
Comment 8 Bastien Nocera 2011-08-03 14:50:03 UTC
Can't comment on the gnome-shell patch, looks correct.

I'd still need to have the patches for the control-center panel, panel applet and gnome-settings-daemon (eg. I want the cut'n'paste code to be committed first to its original location in gnome-control-center).
Comment 9 Giovanni Campagna 2011-08-18 12:38:20 UTC
Created attachment 194124 [details] [review]
GnomeVolumeControl: track PulseAudio connection state and expose it

Adds get_state() and ::state-changed signals, that replace connecting
and ready, as well as providing indication of when the object was closed
or the connection to PulseAudio failed.

Patch against gnome-control-center
Comment 10 Giovanni Campagna 2011-08-18 12:51:55 UTC
Created attachment 194125 [details] [review]
GnomeVolumeControl: track PulseAudio connection state and expose it

Adds get_state() and ::state-changed signals, that replace connecting
and ready, as well as providing indication of when the object was closed
or the connection to PulseAudio failed.

Patch without without whitespace changes.
Comment 11 Giovanni Campagna 2011-08-18 13:04:37 UTC
Created attachment 194129 [details] [review]
Update volume-control applet for GVC API changes.

"ready" and "connecting" signals were replaced by a single
"state-changed".
Comment 12 Owen Taylor 2011-08-25 14:42:20 UTC
Review of attachment 184457 [details] [review]:

If the rest of the patches are right, this looks good to commit to me

::: js/ui/status/volume.js
@@ +110,3 @@
+            this.actor.show();
+        } else
+            this.actor.hide();

If one branche of an if has {}, so should the other - this looks ugly
Comment 13 Bastien Nocera 2011-08-25 14:49:43 UTC
Looks fine to me.
Comment 14 Owen Taylor 2011-08-25 18:58:16 UTC
Review of attachment 194125 [details] [review]:

Bastien said on IRC this looks good
Comment 15 Giovanni Campagna 2011-08-25 21:37:06 UTC
Comment on attachment 184457 [details] [review]
VolumeStatus: track PulseAudio state and hide when disconnected

Attachment 184457 [details] pushed as a64e0e1 - VolumeStatus: track PulseAudio state and hide when disconnected
Attachment 194125 [details] pushed as 270e82e - GnomeVolumeControl: track PulseAudio connection state and expose it

Waiting approval on the sound applet before committing to gnome-control-center
Comment 16 Giovanni Campagna 2011-08-25 22:59:34 UTC
Attachment 194125 [details] pushed as a57f32a - GnomeVolumeControl: track PulseAudio connection state and expose it
Attachment 194129 [details] pushed as 1488246 - Update volume-control applet for GVC API changes.