Index: libroaresd/esdbasic.c
===================================================================
--- libroaresd/esdbasic.c	(revision 4708)
+++ libroaresd/esdbasic.c	(revision 5226)
@@ -71,5 +71,17 @@
 /* closes fd, previously obtained by esd_open */
 int esd_close( int esd ) {
- return roar_simple_close(esd);
+ struct roar_vio_calls vio;
+
+ if ( roar_vio_open_fh_socket(&vio, esd) == -1 ) {
+  roar_err_update();
+  return -1;
+ }
+
+ if ( roar_vio_close(&vio) == -1 ) {
+  roar_err_update();
+  return -1;
+ }
+
+ return 0;
 }
 
Index: libroaresd/esdctl.c
===================================================================
--- libroaresd/esdctl.c	(revision 4975)
+++ libroaresd/esdctl.c	(revision 5226)
@@ -367,5 +367,10 @@
 /* see if the server is in stnaby, autostandby, etc */
 esd_standby_mode_t esd_get_standby_mode( int esd ) {
- return roar_simple_get_standby(esd);
+ struct roar_connection con;
+
+ if ( roar_connect_fh(&con, esd) == -1 )
+  return -1;
+
+ return roar_get_standby(&con);
 }
 
Index: libroaresd/esdstream.c
===================================================================
--- libroaresd/esdstream.c	(revision 4978)
+++ libroaresd/esdstream.c	(revision 5226)
@@ -50,9 +50,10 @@
 /* open a socket for playing, monitoring, or recording as a stream */
 /* the *_fallback functions try to open /dev/dsp if there's no EsounD */
-int esd_play_stream( esd_format_t format, int rate,
-                     const char *host, const char *name ) {
+
+static int libroaresd_stream(esd_format_t format, int rate, const char *host, const char *name, int dir) {
  int channels;
  int bits;
  int codec = ROAR_CODEC_DEFAULT;
+ struct roar_stream     s;
 
  if ( (format & ESD_BITS16) ) {
@@ -69,5 +70,10 @@
  }
 
- return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_PLAY, (char*) name);
+ return roar_simple_stream_obj(&s, rate, channels, bits, codec, (char*)host, dir, (char*)name);
+}
+
+int esd_play_stream( esd_format_t format, int rate,
+                     const char *host, const char *name ) {
+ return libroaresd_stream(format, rate, host, name, ROAR_DIR_PLAY);
 }
 
@@ -87,48 +93,10 @@
 int esd_monitor_stream( esd_format_t format, int rate,
                         const char *host, const char *name ) {
- int channels;
- int bits;
- int codec = ROAR_CODEC_DEFAULT;
-
- ROAR_DBG("esd_monitor_stream(format=%x, rate=%i, host='%s', name='%s') = ?", format, rate, host, name);
-
- if ( (format & ESD_BITS16) ) {
-  bits  = 16;
- } else {
-  bits  = 8;
-  codec = CODEC_DEF_8BIT;
- }
-
- if ( (format & ESD_MONO) ) {
-  channels = 1;
- } else {
-  channels = 2;
- }
-
- return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_MONITOR, (char*)name);
+ return libroaresd_stream(format, rate, host, name, ROAR_DIR_MONITOR);
 }
 /* int esd_monitor_stream_fallback( esd_format_t format, int rate ); */
 int esd_record_stream( esd_format_t format, int rate,
                        const char *host, const char *name ) {
- int channels;
- int bits;
- int codec = ROAR_CODEC_DEFAULT;
-
- ROAR_DBG("esd_record_stream(format=%x, rate=%i, host='%s', name='%s') = ?", format, rate, host, name);
-
- if ( (format & ESD_BITS16) ) {
-  bits  = 16;
- } else {
-  bits  = 8;
-  codec = CODEC_DEF_8BIT;
- }
-
- if ( (format & ESD_MONO) ) {
-  channels = 1;
- } else {
-  channels = 2;
- }
-
- return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_RECORD, (char*)name);
+ return libroaresd_stream(format, rate, host, name, ROAR_DIR_RECORD);
 }
 int esd_record_stream_fallback( esd_format_t format, int rate,
@@ -144,22 +112,5 @@
 int esd_filter_stream( esd_format_t format, int rate,
                        const char *host, const char *name ) {
- int channels;
- int bits;
- int codec = ROAR_CODEC_DEFAULT;
-
- if ( (format & ESD_BITS16) ) {
-  bits  = 16;
- } else {
-  bits  = 8;
-  codec = CODEC_DEF_8BIT;
- }
-
- if ( (format & ESD_MONO) ) {
-  channels = 1;
- } else {
-  channels = 2;
- }
-
- return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_FILTER, (char*)name);
+ return libroaresd_stream(format, rate, host, name, ROAR_DIR_FILTER);
 }
 
