Index: include/libroar/cdrom.h
===================================================================
--- include/libroar/cdrom.h	(revision 5241)
+++ include/libroar/cdrom.h	(revision 5289)
@@ -52,4 +52,5 @@
  int fh;
  int stream;
+ int mixer;
  pid_t player;
  char device[ROAR_CDROM_MAX_DEVLEN];
@@ -63,5 +64,5 @@
 };
 
-int roar_cdrom_open (struct roar_connection * con, struct roar_cdrom * cdrom, const char * device);
+int roar_cdrom_open (struct roar_connection * con, struct roar_cdrom * cdrom, const char * device, int mixer);
 int roar_cdrom_close(struct roar_cdrom * cdrom);
 int roar_cdrom_stop (struct roar_cdrom * cdrom);
Index: include/libroar/simple.h
===================================================================
--- include/libroar/simple.h	(revision 5226)
+++ include/libroar/simple.h	(revision 5289)
@@ -42,9 +42,7 @@
 int roar_simple_connect2(struct roar_connection * con, const char * server, const char * name, int flags, uint_least32_t timeout);
 
-int roar_simple_stream_obj  (struct roar_stream * s, int rate, int channels, int bits, int codec, const char * server, int dir, const char * name) _LIBROAR_ATTR_DEPRECATED;
+int roar_simple_new_stream_attachexeced_obj (struct roar_connection * con, struct roar_stream * s, uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec, int dir, int mixer);
 
-int roar_simple_new_stream_attachexeced_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir);
-
-int roar_simple_new_stream_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir) _LIBROAR_ATTR_DEPRECATED;
+int roar_simple_new_stream_obj (struct roar_connection * con, struct roar_stream * s, uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec, int dir, int mixer) _LIBROAR_ATTR_DEPRECATED;
 
 int roar_simple_play_file(const char * file, const char * server, const char * name);
Index: include/libroar/vio.h
===================================================================
--- include/libroar/vio.h	(revision 5278)
+++ include/libroar/vio.h	(revision 5289)
@@ -87,11 +87,13 @@
 int     roar_vio_open_socket_listen(struct roar_vio_calls * calls, int type, const char * host, int port) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL;
 
-int     roar_vio_simple_stream (struct roar_vio_calls * calls, int rate, int channels, int bits, int codec,
-                                                               const char * server, int dir, const char * name);
+int     roar_vio_simple_stream (struct roar_vio_calls * calls,
+                                uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec,
+                                const char * server, int dir, const char * name, int mixer);
 
 int     roar_vio_simple_new_stream_obj (struct roar_vio_calls * calls,
                                         struct roar_connection * con,
                                         struct roar_stream * s,
-                                        int rate, int channels, int bits, int codec, int dir);
+                                        uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec,
+                                        int dir, int mixer);
 
 // possible VIOs:
Index: libroar/cdrom.c
===================================================================
--- libroar/cdrom.c	(revision 5241)
+++ libroar/cdrom.c	(revision 5289)
@@ -109,5 +109,5 @@
 }
 
-int roar_cdrom_open (struct roar_connection * con, struct roar_cdrom * cdrom, const char * device) {
+int roar_cdrom_open (struct roar_connection * con, struct roar_cdrom * cdrom, const char * device, int mixer) {
 #ifdef ROAR_HAVE_CDROM
  int flags;
@@ -127,4 +127,5 @@
 
  cdrom->con        = con; // we do not care here if it is set or not as we can operate in local only mode
+ cdrom->mixer      = mixer;
 
  cdrom->stream     = -1;
@@ -229,5 +230,5 @@
  if ( cdrom->play_local ) {
 
-  if ( roar_vio_simple_new_stream_obj(&vio, cdrom->con, stream, ROAR_CDROM_STREAMINFO, ROAR_DIR_PLAY) == -1 ) {
+  if ( roar_vio_simple_new_stream_obj(&vio, cdrom->con, stream, ROAR_CDROM_STREAMINFO, ROAR_DIR_PLAY, cdrom->mixer) == -1 ) {
    return -1;
   }
Index: libroar/simple.c
===================================================================
--- libroar/simple.c	(revision 5238)
+++ libroar/simple.c	(revision 5289)
@@ -36,4 +36,6 @@
 #include "libroar.h"
 
+static int roar_simple_stream_obj  (struct roar_stream * s, uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec, const char * server, int dir, const char * name, int mixer) _LIBROAR_ATTR_DEPRECATED;
+
 int roar_simple_connect (struct roar_connection * con, const char * server, const char * name) {
  return roar_simple_connect2(con, server, name, 0, 0);
@@ -62,5 +64,5 @@
 }
 
-int roar_simple_stream_obj  (struct roar_stream * s, int rate, int channels, int bits, int codec, const char * server, int dir, const char * name) {
+static int roar_simple_stream_obj  (struct roar_stream * s, uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec, const char * server, int dir, const char * name, int mixer) {
  struct roar_connection con;
  int ret;
@@ -82,5 +84,5 @@
  }
 
- if ( roar_stream_connect(&con, s, dir, -1) == -1 ) {
+ if ( roar_stream_connect(&con, s, dir, mixer) == -1 ) {
   safe_error = roar_error;
   roar_disconnect(&con);
@@ -115,9 +117,9 @@
 }
 
-int roar_simple_new_stream_attachexeced_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir) {
+int roar_simple_new_stream_attachexeced_obj (struct roar_connection * con, struct roar_stream * s, uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec, int dir, int mixer) {
  int fh;
 
  if ( (fh = roar_simple_stream_obj(s, rate, channels, bits, codec, NULL /* server, we hope this is ok here... */,
-                                   dir, "libroar temp stream")) == -1 )
+                                   dir, "libroar temp stream", mixer)) == -1 )
   return -1;
 
@@ -134,5 +136,5 @@
 }
 
-int roar_simple_new_stream_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir) {
+int roar_simple_new_stream_obj (struct roar_connection * con, struct roar_stream * s, uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec, int dir, int mixer) {
  struct roar_libroar_config * config = roar_libroar_get_config();
  char file[80] = {0};
@@ -171,5 +173,5 @@
  if ( config != NULL ) {
   if ( config->workaround.workarounds & ROAR_LIBROAR_CONFIG_WAS_USE_EXECED ) {
-   return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir);
+   return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir, mixer);
   }
  }
@@ -254,5 +256,5 @@
  }
 
- if ( roar_stream_connect(con, s, dir, -1) == -1 ) {
+ if ( roar_stream_connect(con, s, dir, mixer) == -1 ) {
   return -1;
  }
@@ -281,5 +283,5 @@
      return -1;
 
-    return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir);
+    return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir, mixer);
    }
 
@@ -310,5 +312,5 @@
       return -1;
 
-     return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir);
+     return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir, mixer);
     } else { // seems like we have a positive reply. So we retry the listen socket:
      FD_ZERO(&fds);
@@ -323,5 +325,5 @@
         return -1;
 
-       return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir);
+       return roar_simple_new_stream_attachexeced_obj(con, s, rate, channels, bits, codec, dir, mixer);
       }
      }
Index: libroar/vio_stream.c
===================================================================
--- libroar/vio_stream.c	(revision 5278)
+++ libroar/vio_stream.c	(revision 5289)
@@ -94,6 +94,7 @@
 }
 
-int     roar_vio_simple_stream (struct roar_vio_calls * calls, int rate, int channels, int bits, int codec,
-                                                               const char * server, int dir, const char * name) {
+int     roar_vio_simple_stream (struct roar_vio_calls * calls,
+                                uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec,
+                                const char * server, int dir, const char * name, int mixer) {
  struct roar_connection * con = NULL;
  struct roar_stream       stream;
@@ -121,5 +122,5 @@
  }
 
- if ( roar_stream_connect(con, &stream, dir, -1) == -1 ) {
+ if ( roar_stream_connect(con, &stream, dir, mixer) == -1 ) {
   err = roar_error;
   roar_disconnect(con);
@@ -159,5 +160,6 @@
                                         struct roar_connection * con,
                                         struct roar_stream * s,
-                                        int rate, int channels, int bits, int codec, int dir) {
+                                        uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec,
+                                        int dir, int mixer) {
  struct roar_stream stream;
  int fh;
@@ -174,5 +176,5 @@
 
  roar_libroar_nowarn();
- if ( (fh = roar_simple_new_stream_obj(con, s, rate, channels, bits, codec, dir)) == -1 ) {
+ if ( (fh = roar_simple_new_stream_obj(con, s, rate, channels, bits, codec, dir, mixer)) == -1 ) {
   roar_libroar_warn();
   ROAR_DBG("roar_vio_simple_new_stream_obj(*) = -1");
Index: libroar/vs.c
===================================================================
--- libroar/vs.c	(revision 5270)
+++ libroar/vs.c	(revision 5289)
@@ -338,5 +338,5 @@
  ret = roar_vio_simple_new_stream_obj(&(vss->vio), vss->con, &(vss->stream),
                                       info->rate, info->channels, info->bits, info->codec,
-                                      dir
+                                      dir, vss->mixerid
                                      );
 
@@ -351,17 +351,12 @@
  }
 
- if ( roar_stream_get_info(vss->con, &(vss->stream), &sinfo) != -1 ) {
-  // TODO: fix this:
-  // as we currently do not support to select mixer we just check if we hit the
-  // right one.
-  if ( vss->mixerid != -1 && vss->mixerid != sinfo.mixer ) {
-   _seterr(ROAR_ERROR_INVAL); // TODO: should we maybe use a diffrent value?
-   roar_vio_close(vss->vio_ptr);
-   return -1;
-  }
-
-  vss->mixerid = sinfo.mixer;
+ if ( vss->mixerid != -1 ) {
+  if ( roar_stream_get_info(vss->con, &(vss->stream), &sinfo) != -1 ) {
+   vss->mixerid = sinfo.mixer;
+  }
+ }
+
+ if ( vss->mixerid != -1 )
   _roar_vs_find_first_prim(vss);
- }
 
  vss->flags |= FLAG_STREAM;
Index: libroareio/driver_roar.c
===================================================================
--- libroareio/driver_roar.c	(revision 5270)
+++ libroareio/driver_roar.c	(revision 5289)
@@ -27,7 +27,14 @@
 #include "driver.h"
 
-int roar_cdriver_roar(struct roar_vio_calls * calls, const char * name, const char * dev, struct roar_audio_info * info, int dir) {
+#define MIXER_ID -1
+
+int roar_cdriver_roar(struct roar_vio_calls * calls,
+                      const char * name, const char * dev,
+                      struct roar_audio_info * info, int dir) {
  (void)name;
- return roar_vio_simple_stream(calls, info->rate, info->channels, info->bits, info->codec, dev, dir, "libroareio client");
+
+ return roar_vio_simple_stream(calls,
+                               info->rate, info->channels, info->bits, info->codec,
+                               dev, dir, "libroareio client", MIXER_ID);
 }
 
Index: libroaresd/esdstream.c
===================================================================
--- libroaresd/esdstream.c	(revision 5258)
+++ libroaresd/esdstream.c	(revision 5289)
@@ -72,5 +72,5 @@
  }
 
- if ( roar_vio_simple_stream(&calls, rate, channels, bits, codec, host, dir, name) == -1 )
+ if ( roar_vio_simple_stream(&calls, rate, channels, bits, codec, host, dir, name, -1) == -1 )
   return -1;
 
Index: libroaross/libroaross.c
===================================================================
--- libroaross/libroaross.c	(revision 5236)
+++ libroaross/libroaross.c	(revision 5289)
@@ -827,5 +827,6 @@
                                      handle->stream.info.bits,
                                      handle->stream.info.codec,
-                                     handle->stream_dir
+                                     handle->stream_dir,
+                                     -1 /* TODO: Find better way to select mixer ID. */
                                     ) == -1 )
   return -1;
Index: libroarpulse/stream.c
===================================================================
--- libroarpulse/stream.c	(revision 5270)
+++ libroarpulse/stream.c	(revision 5289)
@@ -329,5 +329,5 @@
                                      s->stream.info.rate, s->stream.info.channels,
                                      s->stream.info.bits, s->stream.info.codec,
-                                     s->stream.dir) == -1 ) {
+                                     s->stream.dir, -1 /* TODO: FIXME: set to requested mixer */ ) == -1 ) {
   pa_stream_set_state(s, PA_STREAM_FAILED);
   return -1;
Index: libroarrsound/libroarrsound.c
===================================================================
--- libroarrsound/libroarrsound.c	(revision 5238)
+++ libroarrsound/libroarrsound.c	(revision 5289)
@@ -341,5 +341,5 @@
 
  if ( roar_vio_simple_new_stream_obj(&(self->vio), &(self->con), &(self->stream),
-                                     self->rsound.rate, self->rsound.channels, bits, codec, ROAR_DIR_PLAY) == -1 )
+                                     self->rsound.rate, self->rsound.channels, bits, codec, ROAR_DIR_PLAY, -1) == -1 )
   return -1;
 
Index: libroarsndio/stream.c
===================================================================
--- libroarsndio/stream.c	(revision 4708)
+++ libroarsndio/stream.c	(revision 5289)
@@ -104,5 +104,5 @@
 
  if ( roar_vio_simple_new_stream_obj(&(hdl->svio), &(hdl->con), &(hdl->stream),
-                                     _i(rate), _i(channels), _i(bits), _i(codec), hdl->dir) == -1 )
+                                     _i(rate), _i(channels), _i(bits), _i(codec), hdl->dir, -1) == -1 )
   return 0;
 
Index: libroaryiff/audiocd.c
===================================================================
--- libroaryiff/audiocd.c	(revision 4708)
+++ libroaryiff/audiocd.c	(revision 5289)
@@ -56,5 +56,5 @@
 
  if ( ! _g_roaryiff_cdrom.is_open ) {
-  if ( roar_cdrom_open(&rcon, _g_roaryiff_cdrom.cdrom, NULL) == -1 )
+  if ( roar_cdrom_open(&rcon, _g_roaryiff_cdrom.cdrom, NULL, -1) == -1 )
    return -1;
  }
Index: plugins/xmms/roar.c
===================================================================
--- plugins/xmms/roar.c	(revision 5236)
+++ plugins/xmms/roar.c	(revision 5289)
@@ -152,5 +152,5 @@
 
  if ( roar_vio_simple_new_stream_obj(&(g_inst.vio), &(g_inst.con), &(g_inst.stream),
-                                     rate, nch, bits, codec, ROAR_DIR_PLAY) == -1 ) {
+                                     rate, nch, bits, codec, ROAR_DIR_PLAY, -1) == -1 ) {
   roar_disconnect(&(g_inst.con));
   g_inst.state |= STATE_CONNECTED;
Index: roarclients/roarfilt.c
===================================================================
--- roarclients/roarfilt.c	(revision 5180)
+++ roarclients/roarfilt.c	(revision 5289)
@@ -244,5 +244,5 @@
  if ( roar_vio_simple_stream(&svio,
                              info.rate, info.channels, info.bits, info.codec,
-                             server, ROAR_DIR_FILTER, "roarfilt") == -1 ) {
+                             server, ROAR_DIR_FILTER, "roarfilt", -1) == -1 ) {
   fprintf(stderr, "Error: can not start playback\n");
   return 1;
Index: roarclients/roarinterconnect.c
===================================================================
--- roarclients/roarinterconnect.c	(revision 5238)
+++ roarclients/roarinterconnect.c	(revision 5289)
@@ -322,5 +322,5 @@
        return 2;
     }
-    if ( roar_vio_simple_stream(&vio, rate, channels, bits, codec, remote, tmp, CLIENT_NAME) == -1 ) {
+    if ( roar_vio_simple_stream(&vio, rate, channels, bits, codec, remote, tmp, CLIENT_NAME, -1) == -1 ) {
      fprintf(stderr, "Error: can not open RoarAudio stream to %s: %s\n", remote, roar_error2str(roar_error));
      return 2;
Index: roarclients/roarlight.c
===================================================================
--- roarclients/roarlight.c	(revision 4914)
+++ roarclients/roarlight.c	(revision 5289)
@@ -35,4 +35,5 @@
 
  printf("  --server    SERVER    - Set server hostname\n"
+        "  --mixer     MIXERID   - ID of the light mixer to use\n"
         "  --help                - Show this help\n"
        );
@@ -46,5 +47,5 @@
 }
 
-int cmd_set (CONVAR, char * arg) {
+int cmd_set (CONVAR, char * arg, const int mixer) {
  char * next = arg;
  char * k, * v;
@@ -80,5 +81,5 @@
  if ( roar_vio_simple_new_stream_obj(&vio, con, NULL,
                                      ROAR_RATE_DEFAULT, ROAR_CHANNELS_DEFAULT, ROAR_BITS_DEFAULT,
-                                     ROAR_CODEC_ROARDMX, ROAR_DIR_LIGHT_IN) == -1 )
+                                     ROAR_CODEC_ROARDMX, ROAR_DIR_LIGHT_IN, mixer) == -1 )
   return -1;
 
@@ -94,8 +95,9 @@
 
 int main (int argc, char * argv[]) {
+ struct roar_connection con;
+ int    mixer = -1; // -1 = Default
  char * server   = NULL;
  char * k;
  int    i;
- struct roar_connection con;
 
  for (i = 1; i < argc; i++) {
@@ -104,4 +106,6 @@
   if ( !strcmp(k, "--server") || !strcmp(k, "-s") ) {
    server = argv[++i];
+  } else if ( !strcmp(k, "--mixer") ) {
+   mixer = atoi(argv[++i]);
   } else if ( !strcmp(k, "--codec") ) {
 
@@ -142,5 +146,5 @@
   } else if ( !strcmp(k, "set") ) {
    i++;
-   if ( cmd_set(&con, argv[i]) == -1 ) {
+   if ( cmd_set(&con, argv[i], mixer) == -1 ) {
     fprintf(stderr, "Error: can not set channels\n");
    } else {
Index: roarclients/roarphone.c
===================================================================
--- roarclients/roarphone.c	(revision 4883)
+++ roarclients/roarphone.c	(revision 5289)
@@ -168,5 +168,5 @@
  if ( (fh = roar_vio_simple_new_stream_obj(vio, &(g_cons.con), &(g_cons.stream),
                                            info->rate, info->channels, info->bits, info->codec,
-                                           ROAR_DIR_BIDIR
+                                           ROAR_DIR_BIDIR, -1
                                           )) == -1 )
   return -1;
Index: roarclients/roarvumeter.c
===================================================================
--- roarclients/roarvumeter.c	(revision 5179)
+++ roarclients/roarvumeter.c	(revision 5289)
@@ -220,5 +220,5 @@
  }
 
- if ( roar_vio_simple_new_stream_obj(&stream, &con, &s, rate, channels, bits, codec, ROAR_DIR_MONITOR) == -1) {
+ if ( roar_vio_simple_new_stream_obj(&stream, &con, &s, rate, channels, bits, codec, ROAR_DIR_MONITOR, -1) == -1) {
   fprintf(stderr, "Error: can not start monetoring\n");
   return 1;
Index: roard/driver_roar.c
===================================================================
--- roard/driver_roar.c	(revision 5162)
+++ roard/driver_roar.c	(revision 5289)
@@ -26,4 +26,6 @@
 #include "roard.h"
 
+#define MIXER_ID -1
+
 int driver_roar_open_vio(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream) {
  int dir = ROAR_DIR_PLAY;
@@ -46,10 +48,10 @@
  }
 
- if ( roar_vio_simple_stream(inst, info->rate, info->channels, info->bits, info->codec, device, dir, "roard") == -1 ) {
+ if ( roar_vio_simple_stream(inst, info->rate, info->channels, info->bits, info->codec, device, dir, "roard", MIXER_ID) == -1 ) {
   if ( streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF) ) {
    if ( roar_profile2info(info, "default") == -1 )
     return -1;
 
-   if ( roar_vio_simple_stream(inst, info->rate, info->channels, info->bits, info->codec, device, dir, "roard") == -1 ) {
+   if ( roar_vio_simple_stream(inst, info->rate, info->channels, info->bits, info->codec, device, dir, "roard", MIXER_ID) == -1 ) {
     return -1;
    }
Index: roard/sources.c
===================================================================
--- roard/sources.c	(revision 5278)
+++ roard/sources.c	(revision 5289)
@@ -463,5 +463,5 @@
 
  if ( roar_vio_simple_stream(&(ss->vio), s->info.rate, s->info.channels, s->info.bits, s->info.codec,
-                             device, ROAR_DIR_MONITOR, "roard") == -1 )
+                             device, ROAR_DIR_MONITOR, "roard", -1) == -1 )
   return -1;
 
