GNOME Bugzilla – Bug 528299
Multiple GstMixerTracks with the same label cause problems for GNOME Volume Control
Last modified: 2008-06-26 06:03:44 UTC
Background I am trying to fix bug #528050. The problem is that gnome-volume-control needs to store persistent references to a system's GstMixerTracks. It currently uses a string key based on the values of the following tuple: (GstMixer->device-name, GstMixer->factory->long_name, GstMixerTrack->label) Actually, it uses the GstMixerTrack's "untranslated-label" property, falling back to "label" if it is NULL. The Problem My new laptop has six problematic GstMixerTracks. The first three have a label of "Capture", "Capture 1" and "Capture 2", but they all share the same untranslated label property of "Capture". The next three all have the same label and untranslated label: "Input Source" So, my question is: is gnome-volume-control correct to use these properties as a key to uniquely identify a GstMixerTrack?
Created attachment 109345 [details] [review] fix duplicate untranslated-label in GstAlsaMixerTrack This patch adds the index number to the untranslated-label property of GstAlsaMixerTrack.
Created attachment 109348 [details] [review] fix duplicate label and untranslated-label in GstAlsaMixerOptions This patch does the same for GstAlsaMixerOptions.
Looks good IMHO, will commit after base is unfrozen again.
+ /* FIXME: translate this? */ + if (dupecount == 0) { + label = g_strdup (alsa_name); + } else { + label = g_strdup_printf ("%s %d", alsa_name, dupecount); + } That breaks the translations (and the default visible tracks) in gnome-volume-control itself. You'd need to keep the same "untranslated-label" property, and add an "index" property for gnome-volume-control to manipulate, and present to the user properly. And you should use snd_mixer_selem_get_index(), so you don't need to change the prototype of the functions: http://www.alsa-project.org/alsa-doc/alsa-lib/group___simple_mixer.html#g3443fbb62c125c88009097e7fafe214f
Ok, and this won't tie the interface of the GstMixerTrack class to the way alsa works too closely?
Created attachment 113224 [details] [review] add index property to GetAlsaMixerTrack & GstAlsaMixerOptions First try at adding an 'index' property to GstAlsaMixerTrack and GstAlsaMixerOptions.
I should probably make the index property unsigned.
Looks good to me but the index property should really be unsigned I guess. Committed with this change: 2008-06-26 Sebastian Dröge <sebastian.droege@collabora.co.uk> Patch by: Sam Morris <sam at robots dot org to uk> * gst-libs/gst/interfaces/mixertrack.c: (gst_mixer_track_class_init), (gst_mixer_track_get_property), (gst_mixer_track_set_property): API: Add "index" property to GstMixerTrack to differantiate between multiple mixer tracks with the same label. * ext/alsa/gstalsamixeroptions.c: (gst_alsa_mixer_options_new): * ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_new): Set the "index" property of GstMixerTrack to the index given by ALSA. Fixes bug #528299.