Index: ChangeLog
===================================================================
--- ChangeLog	(revision 5275)
+++ ChangeLog	(revision 5276)
@@ -1,4 +1,4 @@
 v. 1.0beta0 - ?
-	* Updated API (SONAME change) (Closes: #184, #185, #128)
+	* Updated API (SONAME change) (Closes: #184, #185, #128, #135)
 	* Do not set errno to zero in ogg_vorbis codec filter (Closes: #191)
 	* Updated data types for struct roar_audio_info (Closes: #189)
Index: include/libroar/vio.h
===================================================================
--- include/libroar/vio.h	(revision 5260)
+++ include/libroar/vio.h	(revision 5276)
@@ -53,5 +53,5 @@
  ssize_t (*write   )(struct roar_vio_calls * vio, void *buf, size_t count);
  off_t   (*lseek   )(struct roar_vio_calls * vio, off_t offset, int whence);
- int     (*nonblock)(struct roar_vio_calls * vio, int state);
+// int     (*nonblock)(struct roar_vio_calls * vio, int state);
  int     (*sync    )(struct roar_vio_calls * vio);
  int     (*ctl     )(struct roar_vio_calls * vio, int cmd, void * data);
@@ -104,5 +104,4 @@
 ssize_t roar_vio_basic_write   (struct roar_vio_calls * vio, void *buf, size_t count);
 off_t   roar_vio_basic_lseek   (struct roar_vio_calls * vio, off_t offset, int whence);
-int     roar_vio_basic_nonblock(struct roar_vio_calls * vio, int state);
 int     roar_vio_basic_sync    (struct roar_vio_calls * vio);
 int     roar_vio_basic_ctl     (struct roar_vio_calls * vio, int cmd, void * data);
@@ -120,5 +119,4 @@
 ssize_t roar_vio_pass_write   (struct roar_vio_calls * vio, void *buf, size_t count);
 off_t   roar_vio_pass_lseek   (struct roar_vio_calls * vio, off_t offset, int whence);
-int     roar_vio_pass_nonblock(struct roar_vio_calls * vio, int state);
 int     roar_vio_pass_sync    (struct roar_vio_calls * vio);
 int     roar_vio_pass_ctl     (struct roar_vio_calls * vio, int cmd, void * data);
Index: include/libroar/vio_ctl.h
===================================================================
--- include/libroar/vio_ctl.h	(revision 4902)
+++ include/libroar/vio_ctl.h	(revision 5276)
@@ -99,5 +99,7 @@
 #define ROAR_VIO_CTL_GET_USERPASS        (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0194)
 #define ROAR_VIO_CTL_SET_USERPASS        (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0194)
-// NOTE: continue with 0x01A0 from here.
+
+// Implement roar_vio_nonblock()...
+#define ROAR_VIO_CTL_NONBLOCK            (ROAR_VIO_CTL_GENERIC|0x01A0) /* roar_vio_nonblock(), int */
 
 // get or set data format used for read and write calls, see below
Index: include/libroar/vio_winsock.h
===================================================================
--- include/libroar/vio_winsock.h	(revision 4708)
+++ include/libroar/vio_winsock.h	(revision 5276)
@@ -42,5 +42,4 @@
 ssize_t roar_vio_winsock_read    (struct roar_vio_calls * vio, void *buf, size_t count);
 ssize_t roar_vio_winsock_write   (struct roar_vio_calls * vio, void *buf, size_t count);
-int     roar_vio_winsock_nonblock(struct roar_vio_calls * vio, int state);
 int     roar_vio_winsock_sync    (struct roar_vio_calls * vio);
 int     roar_vio_winsock_ctl     (struct roar_vio_calls * vio, int cmd, void * data);
Index: libroar/vio.c
===================================================================
--- libroar/vio.c	(revision 5270)
+++ libroar/vio.c	(revision 5276)
@@ -65,5 +65,4 @@
  calls->write    = roar_vio_basic_write;
  calls->lseek    = roar_vio_basic_lseek;
- calls->nonblock = roar_vio_basic_nonblock;
  calls->sync     = roar_vio_basic_sync;
  calls->ctl      = roar_vio_basic_ctl;
@@ -179,6 +178,4 @@
 
 int     roar_vio_nonblock(struct roar_vio_calls * vio, int state) {
- int ret;
-
  ROAR_DBG("roar_vio_nonblock(vio=%p, state=%i) = ?", vio, state);
 
@@ -188,14 +185,5 @@
  }
 
- if ( vio->nonblock == NULL ) {
-  roar_err_set(ROAR_ERROR_NOSYS);
-  return -1;
- }
-
- roar_err_clear_all();
- ret = vio->nonblock(vio, state);
- roar_err_update();
-
- return ret;
+ return roar_vio_ctl(vio, ROAR_VIO_CTL_NONBLOCK, &state);
 }
 
@@ -346,5 +334,4 @@
  calls->read     = roar_vio_winsock_read;
  calls->write    = roar_vio_winsock_write;
- calls->nonblock = roar_vio_winsock_nonblock;
  calls->sync     = roar_vio_winsock_sync;
  calls->ctl      = roar_vio_winsock_ctl;
@@ -414,16 +401,4 @@
  return -1;
 #endif
-}
-
-int     roar_vio_basic_nonblock(struct roar_vio_calls * vio, int state) {
- if ( roar_socket_nonblock(roar_vio_get_fh(vio), state) == -1 )
-  return -1;
-
- if ( state == ROAR_SOCKET_NONBLOCK )
-  return 0;
-
- roar_vio_sync(vio);
-
- return 0;
 }
 
@@ -666,4 +641,14 @@
    break;
 #endif
+  case ROAR_VIO_CTL_NONBLOCK:
+    if ( roar_socket_nonblock(roar_vio_get_fh(vio), *(int*)data) == -1 )
+     return -1;
+
+    if ( *(int*)data == ROAR_SOCKET_NONBLOCK )
+     return 0;
+
+    roar_vio_sync(vio);
+    return 0;
+   break;
  }
 
@@ -713,5 +698,4 @@
  calls->write    = roar_vio_pass_write;
  calls->lseek    = roar_vio_pass_lseek;
- calls->nonblock = roar_vio_pass_nonblock;
  calls->sync     = roar_vio_pass_sync;
  calls->ctl      = roar_vio_pass_ctl;
@@ -733,8 +717,4 @@
 off_t   roar_vio_pass_lseek(struct roar_vio_calls * vio, off_t offset, int whence) {
  return roar_vio_lseek((struct roar_vio_calls *) vio->inst, offset, whence);
-}
-
-int     roar_vio_pass_nonblock(struct roar_vio_calls * vio, int state) {
- return roar_vio_nonblock((struct roar_vio_calls *) vio->inst, state);
 }
 
Index: libroar/vio_buffer.c
===================================================================
--- libroar/vio_buffer.c	(revision 4708)
+++ libroar/vio_buffer.c	(revision 5276)
@@ -63,5 +63,4 @@
  calls->close    = roar_vio_buffer_close;
  calls->write    = roar_vio_buffer_write;
- calls->nonblock = roar_vio_buffer_nonblock;
  calls->ctl      = roar_vio_buffer_ctl;
  calls->sync     = roar_vio_buffer_sync;
@@ -327,4 +326,11 @@
     return 0;
    break;
+  case ROAR_VIO_CTL_NONBLOCK:
+    if ( self->use_re ) {
+     return roar_vio_ctl(&(self->re_vio), ROAR_VIO_CTL_NONBLOCK, data);
+    } else {
+     return roar_vio_ctl(self->backend, ROAR_VIO_CTL_NONBLOCK, data);
+    }
+   break;
  }
 
@@ -342,13 +348,3 @@
 }
 
-int     roar_vio_buffer_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_vio_buffer * self = vio->inst;
-
- if ( self->use_re ) {
-  return roar_vio_nonblock(&(self->re_vio), state);
- } else {
-  return roar_vio_nonblock(self->backend, state);
- }
-}
-
 //ll
Index: libroar/vio_buffer_store.c
===================================================================
--- libroar/vio_buffer_store.c	(revision 4708)
+++ libroar/vio_buffer_store.c	(revision 5276)
@@ -56,5 +56,4 @@
  calls->inst     = self;
  calls->close    = roar_vio_buffer_store_close;
- calls->nonblock = roar_vio_buffer_store_nonblock;
  calls->sync     = roar_vio_buffer_store_sync;
  calls->ctl      = roar_vio_buffer_store_ctl;
@@ -138,8 +137,4 @@
 }
 
-int     roar_vio_buffer_store_nonblock(struct roar_vio_calls * vio, int state) {
- return 0; // if we are in nonblock or not is the same for us.
-}
-
 int     roar_vio_buffer_store_sync    (struct roar_vio_calls * vio) {
  return 0; // we are always sync.
@@ -160,4 +155,7 @@
     return 0;
    break;
+  case ROAR_VIO_CTL_NONBLOCK:
+    return 0; // if we are in nonblock or not is the same for us.
+   break;
  }
 
Index: libroar/vio_cmd.c
===================================================================
--- libroar/vio_cmd.c	(revision 5111)
+++ libroar/vio_cmd.c	(revision 5276)
@@ -80,5 +80,4 @@
  calls->read     = roar_vio_cmd_read;
  calls->write    = roar_vio_cmd_write;
- calls->nonblock = roar_vio_cmd_nonblock;
  calls->sync     = roar_vio_cmd_sync;
  calls->ctl      = roar_vio_cmd_ctl;
@@ -514,19 +513,7 @@
 }
 
-int     roar_vio_cmd_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_vio_cmd_state * self = (struct roar_vio_cmd_state *)vio->inst;
-
- self->options |= ROAR_VIO_CMD_OPTS_NONBLOCK;
-
- if ( state == ROAR_SOCKET_BLOCK )
-  self->options -= ROAR_VIO_CMD_OPTS_NONBLOCK;
-
- _LIBROAR_IGNORE_RET(roar_vio_nonblock(self->next, state)); // this should help, but may not nessessery.
-
- return 0;
-}
-
 int     roar_vio_cmd_sync    (struct roar_vio_calls * vio) {
  struct roar_vio_cmd_state * state = (struct roar_vio_cmd_state *)vio->inst;
+ int newblock = ROAR_SOCKET_BLOCK;
  int oldblock;
  int ret = 0;
@@ -534,5 +521,5 @@
  oldblock = state->options & ROAR_VIO_CMD_OPTS_NONBLOCK ? ROAR_SOCKET_NONBLOCK : ROAR_SOCKET_BLOCK;
 
- if ( roar_vio_cmd_nonblock(vio, ROAR_SOCKET_BLOCK) == -1 )
+ if ( roar_vio_cmd_ctl(vio, ROAR_VIO_CTL_NONBLOCK, &newblock) == -1 )
   return -1;
 
@@ -543,5 +530,5 @@
   ret = -1;
 
- if ( roar_vio_cmd_nonblock(vio, oldblock) == -1 )
+ if ( roar_vio_cmd_ctl(vio, ROAR_VIO_CTL_NONBLOCK, &oldblock) == -1 )
   return -1;
 
@@ -586,4 +573,12 @@
     return -1;
    break;
+  case ROAR_VIO_CTL_NONBLOCK:
+    state->options |= ROAR_VIO_CMD_OPTS_NONBLOCK;
+
+    if ( *(int*)data == ROAR_SOCKET_BLOCK )
+     state->options -= ROAR_VIO_CMD_OPTS_NONBLOCK;
+
+    _LIBROAR_IGNORE_RET(roar_vio_ctl(state->next, cmd, data)); // this should help, but may not necessarily.
+   break;
   default:
     return -1;
Index: libroar/vio_jumbo.c
===================================================================
--- libroar/vio_jumbo.c	(revision 5270)
+++ libroar/vio_jumbo.c	(revision 5276)
@@ -58,5 +58,4 @@
  calls->write    = roar_vio_jumbo_write;
  calls->lseek    = roar_vio_jumbo_lseek;
- calls->nonblock = roar_vio_jumbo_nonblock;
  calls->sync     = roar_vio_jumbo_sync;
  calls->ctl      = roar_vio_jumbo_ctl;
@@ -130,10 +129,4 @@
 }
 
-int     roar_vio_jumbo_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_vio_jumbo * self = vio->inst;
-
- return roar_vio_nonblock(self->backend, state);
-}
-
 int     roar_vio_jumbo_sync    (struct roar_vio_calls * vio) {
  struct roar_vio_jumbo * self = vio->inst;
@@ -156,4 +149,13 @@
 
 int     roar_vio_jumbo_ctl     (struct roar_vio_calls * vio, int cmd, void * data) {
+ struct roar_vio_jumbo * self = vio->inst;
+
+ switch (cmd) {
+  case ROAR_VIO_CTL_NONBLOCK:
+    return roar_vio_ctl(self->backend, cmd, data);
+   break;
+ }
+
+ roar_err_set(ROAR_ERROR_BADRQC);
  return -1;
 }
Index: libroar/vio_misc.c
===================================================================
--- libroar/vio_misc.c	(revision 5270)
+++ libroar/vio_misc.c	(revision 5276)
@@ -59,16 +59,4 @@
 }
 
-static int     roar_vio_misc_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_vio_misc * self = vio->inst;
-
- if ( self->support_nonblocking )
-  return 0;
-
- if ( state == ROAR_SOCKET_BLOCK )
-  return 0;
-
- return -1;
-}
-
 static int     roar_vio_misc_sync    (struct roar_vio_calls * vio) {
  (void)vio;
@@ -94,4 +82,13 @@
     return 0;
    break;
+  case ROAR_VIO_CTL_NONBLOCK:
+    if ( self->support_nonblocking )
+     return 0;
+
+    if ( *(int*)data == ROAR_SOCKET_BLOCK )
+     return 0;
+
+    return -1;
+   break; 
  }
 
@@ -112,5 +109,4 @@
  calls->write    = roar_vio_misc_write;
  calls->lseek    = roar_vio_misc_lseek;
- calls->nonblock = roar_vio_misc_nonblock;
  calls->sync     = roar_vio_misc_sync;
  calls->ctl      = roar_vio_misc_ctl;
Index: libroar/vio_pipe.c
===================================================================
--- libroar/vio_pipe.c	(revision 5270)
+++ libroar/vio_pipe.c	(revision 5276)
@@ -119,4 +119,6 @@
 #ifndef ROAR_WITHOUT_VIO_PIPE
 int roar_vio_pipe_init (struct roar_vio_calls * s,  struct roar_vio_pipe * self, int flags) {
+ int nonblock = ROAR_SOCKET_NONBLOCK;
+
  if ( s == NULL || self == NULL )
   return -1;
@@ -127,5 +129,4 @@
  s->read     = roar_vio_pipe_read;
  s->write    = roar_vio_pipe_write;
- s->nonblock = roar_vio_pipe_nonblock;
  s->sync     = roar_vio_pipe_sync;
 
@@ -133,5 +134,5 @@
 
  if ( flags & O_NONBLOCK ) {
-  roar_vio_pipe_nonblock(s, ROAR_SOCKET_NONBLOCK);
+  roar_vio_pipe_ctl(s, ROAR_VIO_CTL_NONBLOCK, &nonblock);
  }
 
@@ -187,29 +188,4 @@
 }
 
-int     roar_vio_pipe_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_vio_pipe * self;
-
- if ( vio == NULL )
-  return -1;
-
- if ( (self = (struct roar_vio_pipe *)vio->inst) == NULL )
-  return -1;
-
- switch (self->type) {
-  case ROAR_VIO_PIPE_TYPE_PIPE:
-    if ( roar_socket_nonblock(self->b.p[ROAR_VIO_PIPE_S(self,vio)*2], state) == -1 )
-     return -1;
-    return roar_socket_nonblock(self->b.p[(ROAR_VIO_PIPE_SR(self,vio)*2)+1], state);
-   break;
-#ifdef ROAR_HAVE_UNIX
-  case ROAR_VIO_PIPE_TYPE_SOCKET:
-    return roar_socket_nonblock(self->b.p[ROAR_VIO_PIPE_S(self,vio)], state);
-   break;
-#endif
- }
-
- return -1;
-}
-
 int     roar_vio_pipe_sync    (struct roar_vio_calls * vio) {
  // we may add fdatasync() calls here depending on the type
@@ -276,4 +252,18 @@
        return 0;
       break;
+    }
+   break;
+  case ROAR_VIO_CTL_NONBLOCK:
+    switch (self->type) {
+     case ROAR_VIO_PIPE_TYPE_PIPE:
+       if ( roar_socket_nonblock(self->b.p[ROAR_VIO_PIPE_S(self,vio)*2], *(int*)data) == -1 )
+        return -1;
+       return roar_socket_nonblock(self->b.p[(ROAR_VIO_PIPE_SR(self,vio)*2)+1], *(int*)data);
+      break;
+#ifdef ROAR_HAVE_UNIX
+     case ROAR_VIO_PIPE_TYPE_SOCKET:
+       return roar_socket_nonblock(self->b.p[ROAR_VIO_PIPE_S(self,vio)], *(int*)data);
+      break;
+#endif
     }
    break;
Index: libroar/vio_proto.c
===================================================================
--- libroar/vio_proto.c	(revision 5254)
+++ libroar/vio_proto.c	(revision 5276)
@@ -121,5 +121,4 @@
  calls->write    = roar_vio_proto_write;
 // calls->lseek    = roar_vio_proto_lseek; // TODO: this is currently not supported
- calls->nonblock = roar_vio_proto_nonblock;
  calls->sync     = roar_vio_proto_sync;
  calls->ctl      = roar_vio_proto_ctl;
@@ -232,13 +231,4 @@
 // TODO: this is currently not implemented as this is hard to implement with buffers:
 off_t   roar_vio_proto_lseek   (struct roar_vio_calls * vio, off_t offset, int whence);
-
-int     roar_vio_proto_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_vio_proto * self = vio->inst;
-
- /* we can simply use the next layer's nonblock as all we do in addtion *
-  * to call there functions are our buffers which do not block normaly  */
-
- return roar_vio_nonblock(self->next, state);
-}
 
 int     roar_vio_proto_sync    (struct roar_vio_calls * vio) {
Index: libroar/vio_rtp.c
===================================================================
--- libroar/vio_rtp.c	(revision 5111)
+++ libroar/vio_rtp.c	(revision 5276)
@@ -115,5 +115,4 @@
  calls->write              = roar_vio_rtp_write;
 // calls->lseek              = roar_vio_rtp_lseek;
- calls->nonblock           = roar_vio_rtp_nonblock;
  calls->sync               = roar_vio_rtp_sync;
  calls->ctl                = roar_vio_rtp_ctl;
@@ -316,12 +315,4 @@
 off_t   roar_vio_rtp_lseek   (struct roar_vio_calls * vio, off_t offset, int whence);
 
-int     roar_vio_rtp_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_rtp_inst * self = vio->inst;
-
- ROAR_DBG("roar_vio_rtp_nonblock(vio=%p, state=%i) = ?", vio, state);
-
- return roar_vio_nonblock(self->vio, state);
-}
-
 int     roar_vio_rtp_sync    (struct roar_vio_calls * vio) {
  struct roar_rtp_inst * self = vio->inst;
Index: libroar/vio_stack.c
===================================================================
--- libroar/vio_stack.c	(revision 4975)
+++ libroar/vio_stack.c	(revision 5276)
@@ -65,5 +65,4 @@
  calls->write    = roar_vio_stack_write;
  calls->lseek    = roar_vio_stack_lseek;
- calls->nonblock = roar_vio_stack_nonblock;
  calls->sync     = roar_vio_stack_sync;
 
@@ -184,17 +183,4 @@
 }
 
-int     roar_vio_stack_nonblock(struct roar_vio_calls * vio, int state) {
- if ( vio == NULL )
-  return -1;
-
- if ( vio->inst == NULL )
-  return -1;
-
- if ( ((struct roar_vio_stack*)(vio->inst))->cur == NULL )
-  return -1;
-
- return roar_vio_nonblock(((struct roar_vio_stack*)(vio->inst))->cur, state);
-}
-
 int     roar_vio_stack_sync    (struct roar_vio_calls * vio) {
  if ( vio == NULL )
Index: libroar/vio_stdvios.c
===================================================================
--- libroar/vio_stdvios.c	(revision 4708)
+++ libroar/vio_stdvios.c	(revision 5276)
@@ -43,5 +43,4 @@
    .write    = roar_vio_basic_write,
    .lseek    = roar_vio_basic_lseek,
-   .nonblock = roar_vio_basic_nonblock,
    .sync     = roar_vio_basic_sync,
    .ctl      = roar_vio_basic_ctl,
@@ -54,5 +53,4 @@
    .write    = roar_vio_basic_write,
    .lseek    = roar_vio_basic_lseek,
-   .nonblock = roar_vio_basic_nonblock,
    .sync     = roar_vio_basic_sync,
    .ctl      = roar_vio_basic_ctl,
@@ -65,5 +63,4 @@
    .write    = roar_vio_basic_write,
    .lseek    = roar_vio_basic_lseek,
-   .nonblock = roar_vio_basic_nonblock,
    .sync     = roar_vio_basic_sync,
    .ctl      = roar_vio_basic_ctl,
Index: libroar/vio_stream.c
===================================================================
--- libroar/vio_stream.c	(revision 5238)
+++ libroar/vio_stream.c	(revision 5276)
@@ -47,7 +47,4 @@
  return roar_vio_lseek(roar_get_connection_vio2(vio->inst), offset, whence);
 }
-static int     _vio_stream_nonblock(struct roar_vio_calls * vio, int state) {
- return roar_vio_nonblock(roar_get_connection_vio2(vio->inst), state);
-}
 static int     _vio_stream_sync    (struct roar_vio_calls * vio) {
  return roar_vio_sync(roar_get_connection_vio2(vio->inst));
@@ -81,4 +78,7 @@
     roar_err_set(ROAR_ERROR_NOTSUP);
     return -1;
+   break;
+  case ROAR_VIO_CTL_NONBLOCK:
+    return roar_vio_ctl(roar_get_connection_vio2(vio->inst), ROAR_VIO_CTL_NONBLOCK, data);
    break;
  }
@@ -143,5 +143,4 @@
  calls->write      = _vio_stream_write;
  calls->lseek      = _vio_stream_lseek;
- calls->nonblock   = _vio_stream_nonblock;
  calls->sync       = _vio_stream_sync;
  calls->ctl        = _vio_stream_ctl;
Index: libroar/vio_winsock.c
===================================================================
--- libroar/vio_winsock.c	(revision 4708)
+++ libroar/vio_winsock.c	(revision 5276)
@@ -45,7 +45,4 @@
 }
 
-int     roar_vio_winsock_nonblock(struct roar_vio_calls * vio, int state) {
- return -1;
-}
 int     roar_vio_winsock_sync    (struct roar_vio_calls * vio) {
  return 0;
@@ -123,4 +120,5 @@
  }
 
+ roar_err_set(ROAR_ERROR_BADRQC);
  return -1;
 }
Index: libroar/vio_zlib.c
===================================================================
--- libroar/vio_zlib.c	(revision 5270)
+++ libroar/vio_zlib.c	(revision 5276)
@@ -435,9 +435,4 @@
 }
 
-static int     roar_vio_zlib_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_vio_gzip * self = vio->inst;
- return roar_vio_nonblock(self->next, state);
-}
-
 static int     roar_vio_zlib_sync    (struct roar_vio_calls * vio) {
  struct roar_vio_gzip * self = vio->inst;
@@ -483,4 +478,7 @@
     return -1;
    break;
+  case ROAR_VIO_CTL_NONBLOCK:
+    return roar_vio_ctl(self->next, cmd, data);
+   break;
   default:
     roar_err_set(ROAR_ERROR_BADRQC);
@@ -545,5 +543,4 @@
  calls->write      = roar_vio_zlib_write;
  calls->lseek      = roar_vio_zlib_lseek;
- calls->nonblock   = roar_vio_zlib_nonblock;
  calls->sync       = roar_vio_zlib_sync;
  calls->ctl        = roar_vio_zlib_ctl;
Index: roard/container_framework.c
===================================================================
--- roard/container_framework.c	(revision 4957)
+++ roard/container_framework.c	(revision 5276)
@@ -198,5 +198,4 @@
 
 off_t   cont_fw_lseek   (struct roar_vio_calls * vio, off_t offset, int whence);
-int     cont_fw_nonblock(struct roar_vio_calls * vio, int state);
 
 int     cont_fw_sync    (struct roar_vio_calls * vio) {
@@ -245,5 +244,4 @@
  vio->write    = cont_pvio_write;
  vio->lseek    = cont_pvio_lseek;
- vio->nonblock = cont_pvio_nonblock;
  vio->sync     = cont_pvio_sync;
  vio->ctl      = cont_pvio_ctl;
@@ -264,8 +262,4 @@
 off_t   cont_pvio_lseek   (struct roar_vio_calls * vio, off_t offset, int whence) {
  return roar_vio_lseek(&(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream->vio), offset, whence);
-}
-
-int     cont_pvio_nonblock(struct roar_vio_calls * vio, int state) {
- return roar_vio_nonblock(&(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream->vio), state);
 }
 
Index: roard/driver.c
===================================================================
--- roard/driver.c	(revision 5274)
+++ roard/driver.c	(revision 5276)
@@ -317,10 +317,18 @@
 #endif
 
-int  driver_dummy_nonblock(struct roar_vio_calls * vio, int state) {
- if ( state == ROAR_SOCKET_BLOCK )
-  return 0;
-
- roar_err_set(ROAR_ERROR_NOTSUP);
- return -1;
+int  driver_dummy_ctl(struct roar_vio_calls * vio, int cmd, void * data) {
+ switch (cmd) {
+  case ROAR_VIO_CTL_NONBLOCK:
+    if ( *(const int*)data == ROAR_SOCKET_BLOCK )
+     return 0;
+
+    roar_err_set(ROAR_ERROR_NOTSUP);
+    return -1;
+   break;
+  default:
+    roar_err_set(ROAR_ERROR_BADRQC);
+    return -1;
+   break;
+ }
 }
 
Index: roard/driver_alsa.c
===================================================================
--- roard/driver_alsa.c	(revision 5012)
+++ roard/driver_alsa.c	(revision 5276)
@@ -231,5 +231,4 @@
  inst->sync     = driver_alsa_sync;
  inst->ctl      = driver_alsa_ctl;
- inst->nonblock = driver_dummy_nonblock;
 
  ROAR_DBG("driver_alsa_open_vio(inst=%p, device='%s', info=%p, fh=%i, sstream=%p) = 0", inst, device, info, fh, sstream);
@@ -333,31 +332,39 @@
  switch (cmd) {
   case ROAR_VIO_CTL_GET_DELAY:
-   if ( snd_pcm_delay(device->handle, &alsa_delay) < 0 )
+    if ( snd_pcm_delay(device->handle, &alsa_delay) < 0 )
+     return -1;
+    else {
+     *(uint_least32_t *)data = snd_pcm_frames_to_bytes(device->handle, alsa_delay);
+     ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_GET_DELAY(0x%.8x), data=%p): %i bytes.", vio, cmd, data, (int)(*(uint_least32_t*)data));
+    }
+   break;
+
+  case ROAR_VIO_CTL_SET_SSTREAMID:
+    device->ssid = *(int *)data;
+    ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_SET_SSTREAMID(0x%.8x), data=%p): ssid=%i", vio, cmd, data, device->ssid);
+   break;
+
+  case ROAR_VIO_CTL_SET_SSTREAM:
+    device->sstream = data;
+    ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_SET_SSTREAM(0x%.8x), data=%p): sstream=%p", vio, cmd, data, device->sstream);
+   break;
+
+  case ROAR_VIO_CTL_GET_AUINFO:
+    ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_GET_AUINFO(0x%.8x), data=%p) = ?", vio, cmd, data);
+    memcpy(data, &(device->info), sizeof(struct roar_audio_info));
+   break;
+
+  case ROAR_VIO_CTL_SET_AUINFO:
+    ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_SET_AUINFO(0x%.8x), data=%p) = ?", vio, cmd, data);
+    memcpy(&(device->info), data, sizeof(struct roar_audio_info));
+    return driver_alsa_reopen_device(device);
+   break;
+
+  case ROAR_VIO_CTL_NONBLOCK:
+    if ( *(int*)data == ROAR_SOCKET_BLOCK )
+     return 0;
+    roar_err_set(ROAR_ERROR_NOTSUP);
     return -1;
-   else {
-    *(uint_least32_t *)data = snd_pcm_frames_to_bytes(device->handle, alsa_delay);
-    ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_GET_DELAY(0x%.8x), data=%p): %i bytes.", vio, cmd, data, (int)(*(uint_least32_t*)data));
-   }
-   break;
-
-  case ROAR_VIO_CTL_SET_SSTREAMID:
-   device->ssid = *(int *)data;
-   ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_SET_SSTREAMID(0x%.8x), data=%p): ssid=%i", vio, cmd, data, device->ssid);
-   break;
-
-  case ROAR_VIO_CTL_SET_SSTREAM:
-   device->sstream = data;
-   ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_SET_SSTREAM(0x%.8x), data=%p): sstream=%p", vio, cmd, data, device->sstream);
-   break;
-
-  case ROAR_VIO_CTL_GET_AUINFO:
-   ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_GET_AUINFO(0x%.8x), data=%p) = ?", vio, cmd, data);
-   memcpy(data, &(device->info), sizeof(struct roar_audio_info));
-   break;
-
-  case ROAR_VIO_CTL_SET_AUINFO:
-   ROAR_DBG("driver_alsa_ctl(vio=%p, cmd=ROAR_VIO_CTL_SET_AUINFO(0x%.8x), data=%p) = ?", vio, cmd, data);
-   memcpy(&(device->info), data, sizeof(struct roar_audio_info));
-   return driver_alsa_reopen_device(device);
+   break;
 
   default:
Index: roard/driver_ao.c
===================================================================
--- roard/driver_ao.c	(revision 5056)
+++ roard/driver_ao.c	(revision 5276)
@@ -134,5 +134,5 @@
  inst->write    = driver_ao_write;
  inst->close    = driver_ao_close;
- inst->nonblock = driver_dummy_nonblock;
+ inst->ctl      = driver_dummy_ctl;
 
  return 0;
Index: roard/driver_artsc.c
===================================================================
--- roard/driver_artsc.c	(revision 5108)
+++ roard/driver_artsc.c	(revision 5276)
@@ -124,5 +124,4 @@
  inst->close    = driver_artsc_close;
  inst->ctl      = driver_artsc_ctl;
- inst->nonblock = driver_artsc_nonblock;
 
  ROAR_DBG("driver_artsc_open_vio(*) = 0");
@@ -155,24 +154,4 @@
 
  return driver_artsc_init_shutdown(SHUTDOWN);
-}
-
-int     driver_artsc_nonblock(struct roar_vio_calls * vio, int state) {
- struct roar_artsc * self = vio->inst;
- int ret;
-
- switch (state) {
-  case ROAR_SOCKET_NONBLOCK:
-    ret = arts_stream_set(self->stream, ARTS_P_BLOCKING, 0);
-    if ( ret == 0 )
-     return 0;
-   break;
-  case ROAR_SOCKET_BLOCK:
-    ret = arts_stream_set(self->stream, ARTS_P_BLOCKING, 1);
-    if ( ret == 1 )
-     return 0;
-   break;
- }
-
- return -1;
 }
 
@@ -206,4 +185,20 @@
 
     return 0;
+  case ROAR_VIO_CTL_NONBLOCK:
+    switch (*(int*)data) {
+     case ROAR_SOCKET_NONBLOCK:
+       ret = arts_stream_set(self->stream, ARTS_P_BLOCKING, 0);
+       if ( ret == 0 )
+        return 0;
+       return -1;
+      break;
+     case ROAR_SOCKET_BLOCK:
+       ret = arts_stream_set(self->stream, ARTS_P_BLOCKING, 1);
+       if ( ret == 1 )
+        return 0;
+       return -1;
+      break;
+    }
+   break;
   default:
     return -1;
Index: roard/driver_jack.c
===================================================================
--- roard/driver_jack.c	(revision 5259)
+++ roard/driver_jack.c	(revision 5276)
@@ -65,5 +65,4 @@
  inst->write    = driver_jack_write;
  inst->lseek    = NULL; // no seeking on this device
- inst->nonblock = driver_jack_nonblock;
  inst->sync     = driver_jack_sync;
  inst->ctl      = driver_jack_ctl;
@@ -157,13 +156,4 @@
 }
 
-int     driver_jack_nonblock(struct roar_vio_calls * vio, int state) {
- struct driver_jack * self = vio->inst;
- // control if read and write calls should block untill all data is read or written.
- // state could be:
- //  ROAR_SOCKET_BLOCK    - Block untill the data is read or written
- //  ROAR_SOCKET_NONBLOCK - Return as soon as possible
- return -1;
-}
-
 int     driver_jack_sync    (struct roar_vio_calls * vio) {
  struct driver_jack * self = vio->inst;
@@ -200,32 +190,38 @@
     return 0;
    break;
-   case ROAR_VIO_CTL_GET_AUINFO:
-   case ROAR_VIO_CTL_SET_AUINFO:
+  case ROAR_VIO_CTL_NONBLOCK:
+ // control if read and write calls should block untill all data is read or written.
+ // state is in *(int*)data and could be:
+ //  ROAR_SOCKET_BLOCK    - Block untill the data is read or written
+ //  ROAR_SOCKET_NONBLOCK - Return as soon as possible
+   break;
+  case ROAR_VIO_CTL_GET_AUINFO:
+  case ROAR_VIO_CTL_SET_AUINFO:
     // get or set audio info, data is a struct roar_audio_info*.
     return -1;
    break;
-   case ROAR_VIO_CTL_GET_DBLKSIZE:
-   case ROAR_VIO_CTL_SET_DBLKSIZE:
+  case ROAR_VIO_CTL_GET_DBLKSIZE:
+  case ROAR_VIO_CTL_SET_DBLKSIZE:
      // get or set block size used, data is uint_least32_t*, number of bytes.
     return -1;
    break;
-   case ROAR_VIO_CTL_GET_DBLOCKS:
-   case ROAR_VIO_CTL_SET_DBLOCKS:
+  case ROAR_VIO_CTL_GET_DBLOCKS:
+  case ROAR_VIO_CTL_SET_DBLOCKS:
      // get or set number of blocks used, data is uint_least32_t*.
     return -1;
    break;
-   case ROAR_VIO_CTL_SET_SSTREAM:
+  case ROAR_VIO_CTL_SET_SSTREAM:
     // set server stream object for this stream, data is struct roar_stream_server*
     return -1;
    break;
-   case ROAR_VIO_CTL_SET_SSTREAMID:
+  case ROAR_VIO_CTL_SET_SSTREAMID:
     // set stream ID for this stream, data is int*
     return -1;
    break;
-   case ROAR_VIO_CTL_SET_VOLUME:
+  case ROAR_VIO_CTL_SET_VOLUME:
     // set volume for this device, data is struct roar_mixer_settings*
     return -1;
    break;
-   case ROAR_VIO_CTL_GET_DELAY:
+  case ROAR_VIO_CTL_GET_DELAY:
     // get delay of this stream, data is uint_least32_t*, in bytes
     // there is more about delay. please ask.
Index: roard/driver_oss.c
===================================================================
--- roard/driver_oss.c	(revision 5055)
+++ roard/driver_oss.c	(revision 5276)
@@ -38,5 +38,4 @@
  vio->write    = driver_oss_write;
  vio->read     = driver_oss_read;
- vio->nonblock = driver_oss_nonblock;
  vio->sync     = driver_oss_sync;
  vio->ctl      = driver_oss_ctl;
@@ -448,24 +447,4 @@
 }
 
-int     driver_oss_nonblock(struct roar_vio_calls * vio, int state) {
- ROAR_DBG("driver_oss_nonblock(vio=%p, state=%i) = ?", vio, state);
-
- if ( roar_socket_nonblock(_get(vio,fh), state) == -1 ) {
-  ROAR_DBG("driver_oss_nonblock(vio=%p, state=%i) = -1", vio, state);
-  return -1;
- }
-
- if ( state == ROAR_SOCKET_NONBLOCK ) {
-  ROAR_DBG("driver_oss_nonblock(vio=%p, state=%i) = 0", vio, state);
-  return 0;
- }
-
- roar_vio_sync(vio);
-
- ROAR_DBG("driver_oss_nonblock(vio=%p, state=%i) = 0", vio, state);
-
- return 0;
-}
-
 int driver_oss_sync(struct roar_vio_calls * vio) {
 #ifdef SNDCTL_DSP_SYNC
@@ -558,4 +537,15 @@
    break;
 #endif
+  case ROAR_VIO_CTL_NONBLOCK:
+    if ( roar_socket_nonblock(_get(vio,fh), *(int*)data) == -1 ) {
+     return -1;
+    }
+
+    if ( *(int*)data == ROAR_SOCKET_NONBLOCK ) {
+     return 0;
+    }
+
+    roar_vio_sync(vio);
+   break;
   default:
    return -1;
Index: roard/driver_portaudio.c
===================================================================
--- roard/driver_portaudio.c	(revision 5134)
+++ roard/driver_portaudio.c	(revision 5276)
@@ -124,5 +124,5 @@
  inst->close = driver_portaudio_close;
  inst->write = driver_portaudio_write;
- inst->nonblock = driver_dummy_nonblock;
+ inst->ctl   = driver_dummy_ctl;
 
  Pa_Initialize();
Index: roard/driver_pulsesimple.c
===================================================================
--- roard/driver_pulsesimple.c	(revision 5056)
+++ roard/driver_pulsesimple.c	(revision 5276)
@@ -127,5 +127,4 @@
  inst->sync     = driver_pulsesimple_sync;
  inst->ctl      = driver_pulsesimple_ctl;
- inst->nonblock = driver_dummy_nonblock;
 
  return 0;
@@ -167,4 +166,14 @@
  ROAR_DBG("driver_pulsesimple_ctl(vio=%p) = ?", vio);
 
+ switch (cmd) {
+  case ROAR_VIO_CTL_NONBLOCK:
+    if ( *(int*)data == ROAR_SOCKET_BLOCK )
+     return 0;
+    roar_err_set(ROAR_ERROR_NOTSUP);
+    return -1;
+   break;
+ }
+
+ roar_err_set(ROAR_ERROR_NOSYS);
  return -1;
 }
Index: roard/driver_pwmled.c
===================================================================
--- roard/driver_pwmled.c	(revision 4957)
+++ roard/driver_pwmled.c	(revision 5276)
@@ -62,5 +62,4 @@
  inst->write    = driver_pwmled_write;
  inst->lseek    = NULL;
- inst->nonblock = NULL;
  inst->sync     = NULL;
  inst->ctl      = driver_pwmled_ctl;
Index: roard/driver_rsound.c
===================================================================
--- roard/driver_rsound.c	(revision 5107)
+++ roard/driver_rsound.c	(revision 5276)
@@ -171,5 +171,5 @@
  inst->close    = driver_rsound_close;
  inst->write    = driver_rsound_write;
- inst->nonblock = driver_dummy_nonblock;
+ inst->ctl      = driver_dummy_ctl;
 
  return 0;
Index: roard/driver_shout.c
===================================================================
--- roard/driver_shout.c	(revision 5012)
+++ roard/driver_shout.c	(revision 5276)
@@ -202,5 +202,5 @@
  inst->write    = driver_shout_write;
  inst->close    = driver_shout_close;
- inst->nonblock = driver_dummy_nonblock;
+ inst->ctl      = driver_dummy_ctl;
 
  return 0;
Index: roard/driver_sndio.c
===================================================================
--- roard/driver_sndio.c	(revision 5105)
+++ roard/driver_sndio.c	(revision 5276)
@@ -265,4 +265,10 @@
     return sio_setvol(self->shandle, d) == 0 ? -1 : 0;
    break;
+  case ROAR_VIO_CTL_NONBLOCK:
+    if ( *(int*)data == ROAR_SOCKET_BLOCK )
+     return 0;
+    roar_err_set(ROAR_ERROR_NOTSUP);
+    return -1;
+   break;
   default:
     return -1;
Index: roard/driver_sysclock.c
===================================================================
--- roard/driver_sysclock.c	(revision 5012)
+++ roard/driver_sysclock.c	(revision 5276)
@@ -42,6 +42,6 @@
  inst->inst     = self;
  inst->close    = driver_sysclock_close;
- inst->nonblock = driver_dummy_nonblock;
  inst->write    = driver_sysclock_write;
+ inst->ctl      = driver_dummy_ctl;
 
  self->bps      = roar_info2bitspersec(info)/8;
Index: roard/driver_wmm.c
===================================================================
--- roard/driver_wmm.c	(revision 5062)
+++ roard/driver_wmm.c	(revision 5276)
@@ -191,5 +191,5 @@
  inst->close    = driver_wmm_close_vio;
  inst->write    = driver_wmm_write;
- inst->nonblock = driver_dummy_nonblock;
+ inst->ctl      = driver_dummy_ctl;
 
  info->codec = ROAR_CODEC_PCM_S_LE;
Index: roard/include/driver.h
===================================================================
--- roard/include/driver.h	(revision 5245)
+++ roard/include/driver.h	(revision 5276)
@@ -159,5 +159,5 @@
 #endif
 
-int  driver_dummy_nonblock(struct roar_vio_calls * vio, int state);
+int  driver_dummy_ctl(struct roar_vio_calls * vio, int cmd, void * data);
 
 #endif
Index: roard/include/driver_oss.h
===================================================================
--- roard/include/driver_oss.h	(revision 4815)
+++ roard/include/driver_oss.h	(revision 5276)
@@ -46,5 +46,4 @@
 ssize_t driver_oss_write    (struct roar_vio_calls * vio, void *buf, size_t count);
 ssize_t driver_oss_read     (struct roar_vio_calls * vio, void *buf, size_t count);
-int     driver_oss_nonblock (struct roar_vio_calls * vio, int state);
 int     driver_oss_close_vio(struct roar_vio_calls * vio);
 int     driver_oss_reopen_device(struct driver_oss * self);
Index: roard/include/midi.h
===================================================================
--- roard/include/midi.h	(revision 5194)
+++ roard/include/midi.h	(revision 5276)
@@ -174,4 +174,5 @@
 // dummys:
 int     midi_vio_set_dummy(int stream);
+int     midi_vio_ctl(struct roar_vio_calls * vio, int cmd, void * data);
 int     midi_vio_ok(struct roar_vio_calls * vio, ...);
 
Index: roard/midi.c
===================================================================
--- roard/midi.c	(revision 5210)
+++ roard/midi.c	(revision 5276)
@@ -1058,7 +1058,6 @@
  ss->vio.write    = NULL;
  ss->vio.lseek    = NULL;
- ss->vio.nonblock = (int (*)(struct roar_vio_calls * vio, int state))midi_vio_ok;
  ss->vio.sync     = (int (*)(struct roar_vio_calls * vio))midi_vio_ok;
- ss->vio.ctl      = NULL;
+ ss->vio.ctl      = midi_vio_ctl;
  ss->vio.close    = (int (*)(struct roar_vio_calls * vio))midi_vio_ok;
 
@@ -1066,4 +1065,10 @@
 }
 
+int midi_vio_ctl(struct roar_vio_calls * vio, int cmd, void * data) {
+ if ( cmd == ROAR_VIO_CTL_NONBLOCK )
+  return 0;
+ return -1;
+}
+
 int     midi_vio_ok(struct roar_vio_calls * vio, ...) {
  return 0;
Index: roard/sources.c
===================================================================
--- roard/sources.c	(revision 5246)
+++ roard/sources.c	(revision 5276)
@@ -418,4 +418,12 @@
 }
 
+static int  sources_radionoise_ctl(struct roar_vio_calls * vio, int cmd, void * data) {
+ if ( cmd == ROAR_VIO_CTL_NONBLOCK )
+  return 0;
+
+ roar_err_set(ROAR_ERROR_BADRQC);
+ return -1;
+}
+
 int sources_add_radionoise (int stream, const char * device, int fh, const char * driver) {
  struct roar_stream_server * ss;
@@ -437,5 +445,5 @@
  ss->vio.close    = sources_radionoise_return_zero;
  ss->vio.sync     = sources_radionoise_return_zero;
- ss->vio.nonblock = (int (*)(struct roar_vio_calls * vio, int state))sources_radionoise_return_zero;
+ ss->vio.ctl      = sources_radionoise_ctl;
 
  return streams_set_fh(stream, -2);
