Index: ext/alsa/gstalsadeviceprobe.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsadeviceprobe.c,v
retrieving revision 1.1
diff -u -r1.1 gstalsadeviceprobe.c
--- ext/alsa/gstalsadeviceprobe.c	14 Dec 2005 17:58:48 -0000	1.1
+++ ext/alsa/gstalsadeviceprobe.c	17 May 2006 20:06:24 -0000
@@ -88,7 +88,7 @@
 }
 
 static void
-gst_alsa_add_device_list (GstAlsaDeviceProbeData * probe_data,
+gst_alsa_set_device_list (GstAlsaDeviceProbeData * probe_data,
     snd_pcm_stream_t stream)
 {
   snd_ctl_t *handle;
@@ -104,6 +104,14 @@
   snd_pcm_info_alloca (&pcminfo);
   card = -1;
 
+	/* Empty list */
+  GList *item = probe_data->devices;
+  for (item = probe_data->devices; item != NULL; item = item->next) {
+		g_free(item->data);
+    g_list_remove_all (probe_data->devices, item);
+  }
+  probe_data->devices = item;
+
   if (snd_card_next (&card) < 0 || card < 0) {
     /* no soundcard found */
     return;
@@ -155,7 +163,7 @@
 gst_alsa_probe_devices (GstElementClass * klass,
     GstAlsaDeviceProbeData * probe_data, gboolean check)
 {
-  static gboolean init = FALSE;
+  gboolean init = FALSE;
 
   /* I'm pretty sure ALSA has a good way to do this. However, their cool
    * auto-generated documentation is pretty much useless if you try to
@@ -174,7 +182,7 @@
         mode = SND_PCM_STREAM_PLAYBACK;
     }
 
-    gst_alsa_add_device_list (probe_data, mode);
+    gst_alsa_set_device_list (probe_data, mode);
 
     init = TRUE;
   }
Index: ext/alsa/gstalsasink.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsasink.c,v
retrieving revision 1.68
diff -u -r1.68 gstalsasink.c
--- ext/alsa/gstalsasink.c	28 Apr 2006 19:08:34 -0000	1.68
+++ ext/alsa/gstalsasink.c	17 May 2006 20:06:24 -0000
@@ -53,6 +53,7 @@
 
 #include "gstalsa.h"
 #include "gstalsasink.h"
+#include "gstalsadeviceprobe.h"
 
 #include <gst/gst-i18n-plugin.h>
 #include <gst/audio/multichannel.h>
@@ -74,9 +75,26 @@
   PROP_DEVICE_NAME
 };
 
+static void gst_alsasink_init_interfaces (GType type);
+
+GST_BOILERPLATE_FULL (GstAlsaSink, gst_alsasink,
+    GstAudioSink, GST_TYPE_AUDIO_SINK, gst_alsasink_init_interfaces)
+
+/*
+static gboolean
+  gst_alsasink_interface_supported (GstAlsaSink * this,
+    GType interface_type)
+{
+  if (interface_type == GST_TYPE_MIXER) {
+    return gst_alsasrc_mixer_supported (this, interface_type);
+  }
+
+  g_return_val_if_reached (FALSE);
+}
+*/
+
 static void gst_alsasink_base_init (gpointer g_class);
 static void gst_alsasink_class_init (GstAlsaSinkClass * klass);
-static void gst_alsasink_init (GstAlsaSink * alsasink);
 static void gst_alsasink_dispose (GObject * object);
 static void gst_alsasink_finalise (GObject * object);
 static void gst_alsasink_set_property (GObject * object,
@@ -131,34 +149,6 @@
         "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 8 ]")
     );
 
-static GstElementClass *parent_class = NULL;
-
-GType
-gst_alsasink_get_type (void)
-{
-  static GType alsasink_type = 0;
-
-  if (!alsasink_type) {
-    static const GTypeInfo alsasink_info = {
-      sizeof (GstAlsaSinkClass),
-      gst_alsasink_base_init,
-      NULL,
-      (GClassInitFunc) gst_alsasink_class_init,
-      NULL,
-      NULL,
-      sizeof (GstAlsaSink),
-      0,
-      (GInstanceInitFunc) gst_alsasink_init,
-    };
-
-    alsasink_type =
-        g_type_register_static (GST_TYPE_AUDIO_SINK, "GstAlsaSink",
-        &alsasink_info, 0);
-  }
-
-  return alsasink_type;
-}
-
 static void
 gst_alsasink_dispose (GObject * object)
 {
@@ -177,6 +167,14 @@
 }
 
 static void
+gst_alsasink_init_interfaces (GType type)
+{
+  gst_alsa_type_add_device_property_probe_interface (type,
+      G_STRUCT_OFFSET (GstAlsaSinkClass, device_probe_data),
+      PROP_DEVICE);
+}
+
+static void
 gst_alsasink_base_init (gpointer g_class)
 {
   GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
@@ -186,6 +184,7 @@
   gst_element_class_add_pad_template (element_class,
       gst_static_pad_template_get (&alsasink_sink_factory));
 }
+
 static void
 gst_alsasink_class_init (GstAlsaSinkClass * klass)
 {
@@ -282,7 +281,7 @@
 static snd_output_t *output = NULL;
 
 static void
-gst_alsasink_init (GstAlsaSink * alsasink)
+gst_alsasink_init (GstAlsaSink * alsasink, GstAlsaSinkClass * g_class)
 {
   GST_DEBUG_OBJECT (alsasink, "initializing alsasink");
 
Index: ext/alsa/gstalsasink.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsasink.h,v
retrieving revision 1.12
diff -u -r1.12 gstalsasink.h
--- ext/alsa/gstalsasink.h	1 Mar 2006 18:25:18 -0000	1.12
+++ ext/alsa/gstalsasink.h	17 May 2006 20:06:24 -0000
@@ -26,6 +26,7 @@
 #include <gst/gst.h>
 #include <gst/audio/gstaudiosink.h>
 #include <alsa/asoundlib.h>
+#include "gstalsadeviceprobe.h"
 
 G_BEGIN_DECLS
 
@@ -75,6 +76,8 @@
 
 struct _GstAlsaSinkClass {
   GstAudioSinkClass parent_class;
+
+  GstAlsaDeviceProbeData   device_probe_data;
 };
 
 GType gst_alsasink_get_type(void);
Index: ext/alsa/gstalsasrc.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsasrc.c,v
retrieving revision 1.35
diff -u -r1.35 gstalsasrc.c
--- ext/alsa/gstalsasrc.c	28 Apr 2006 19:46:35 -0000	1.35
+++ ext/alsa/gstalsasrc.c	17 May 2006 20:06:25 -0000
@@ -52,6 +52,7 @@
 #include <alsa/asoundlib.h>
 
 #include "gstalsasrc.h"
+#include "gstalsadeviceprobe.h"
 
 #include <gst/gst-i18n-plugin.h>
 
@@ -72,11 +73,24 @@
   PROP_DEVICE_NAME,
 };
 
-GST_BOILERPLATE_WITH_INTERFACE (GstAlsaSrc, gst_alsasrc, GstAudioSrc,
-    GST_TYPE_AUDIO_SRC, GstMixer, GST_TYPE_MIXER, gst_alsasrc_mixer);
+static void gst_alsasrc_init_interfaces (GType type);
+
+GST_BOILERPLATE_FULL (GstAlsaSrc, gst_alsasrc,
+    GstAudioSrc, GST_TYPE_AUDIO_SRC, gst_alsasrc_init_interfaces)
 
 GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaSrc, gst_alsasrc_mixer);
 
+static gboolean
+  gst_alsasrc_interface_supported (GstAlsaSrc * this,
+    GType interface_type)
+{
+  if (interface_type == GST_TYPE_MIXER) {
+    return gst_alsasrc_mixer_supported (this, interface_type);
+  }
+
+  g_return_val_if_reached (FALSE);
+}
+
 static void gst_alsasrc_dispose (GObject * object);
 static void gst_alsasrc_set_property (GObject * object,
     guint prop_id, const GValue * value, GParamSpec * pspec);
@@ -130,6 +144,35 @@
 }
 
 static void
+gst_implements_interface_init (GstImplementsInterfaceClass * klass)
+{
+  klass->supported = (gpointer) gst_alsasrc_interface_supported;
+}
+
+static void
+gst_alsasrc_init_interfaces (GType type)
+{
+  static const GInterfaceInfo implements_iface_info = {
+    (GInterfaceInitFunc) gst_implements_interface_init,
+    NULL,
+    NULL,
+  };
+  static const GInterfaceInfo mixer_iface_info = {
+    (GInterfaceInitFunc) gst_alsasrc_mixer_interface_init,
+    NULL,
+    NULL,
+  };
+
+  g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE,
+      &implements_iface_info);
+  g_type_add_interface_static (type, GST_TYPE_MIXER, &mixer_iface_info);
+
+  gst_alsa_type_add_device_property_probe_interface (type,
+      G_STRUCT_OFFSET (GstAlsaSrcClass, device_probe_data),
+      PROP_DEVICE);
+}
+
+static void
 gst_alsasrc_base_init (gpointer g_class)
 {
   GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
Index: ext/alsa/gstalsasrc.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsasrc.h,v
retrieving revision 1.10
diff -u -r1.10 gstalsasrc.h
--- ext/alsa/gstalsasrc.h	1 Mar 2006 18:25:18 -0000	1.10
+++ ext/alsa/gstalsasrc.h	17 May 2006 20:06:25 -0000
@@ -26,6 +26,7 @@
 #include <gst/audio/gstaudiosrc.h>
 #include "gstalsa.h"
 #include "gstalsamixer.h"
+#include "gstalsadeviceprobe.h"
 
 G_BEGIN_DECLS
 
@@ -68,6 +69,8 @@
 
 struct _GstAlsaSrcClass {
   GstAudioSrcClass parent_class;
+
+  GstAlsaDeviceProbeData   device_probe_data;
 };
 
 GType gst_alsasrc_get_type(void);
