Index: roard/include/sources.h
===================================================================
--- roard/include/sources.h	(revision 4708)
+++ roard/include/sources.h	(revision 4807)
@@ -64,4 +64,6 @@
 int sources_add_roar (char * driver, char * device, char * container, char * options, int primary);
 
+int sources_add_radionoise (int stream, char * device, int fh, char * driver);
+
 #ifndef ROAR_WITHOUT_DCOMP_CDRIVER
 int sources_add_cdriver (int stream   , char * device, int fh, char * driver);
Index: roard/sources.c
===================================================================
--- roard/sources.c	(revision 4708)
+++ roard/sources.c	(revision 4807)
@@ -40,4 +40,5 @@
  {"oss",  "OSS CDriver",                 "/dev/audio",     SRC_FLAG_NONE,  ROAR_SUBSYS_WAVEFORM, NULL, sources_add_cdriver},
 #endif
+ {"radionoise", "Noise source at -102dB", NULL,            SRC_FLAG_NONE, ROAR_SUBSYS_WAVEFORM, NULL, sources_add_radionoise},
  {NULL, NULL, NULL, SRC_FLAG_NONE, 0, NULL, NULL} // EOL
 };
@@ -52,6 +53,6 @@
  char subsys[7] = "      ";
 
- printf("  Source   Flag Subsys - Description (devices)\n");
- printf("------------------------------------------------------\n");
+ printf("  Source    Flag Subsys - Description (devices)\n");
+ printf("-------------------------------------------------------\n");
 
  for (i = 0; g_source[i].name != NULL; i++) {
@@ -71,10 +72,19 @@
    subsys[5] = 'X';
 
-  printf("  %-9s %c%c%c %6s - %s (devices: %s)\n", g_source[i].name,
-                g_source[i].flags & SRC_FLAG_FHSEC      ? 's' : ' ',
-                g_source[i].old_open != NULL            ? 'S' : ' ',
-                g_source[i].new_open != NULL            ? 'N' : ' ',
-                subsys,
-                g_source[i].desc, g_source[i].devices);
+  if ( g_source[i].devices != NULL ) {
+   printf("  %-10s %c%c%c %6s - %s (devices: %s)\n", g_source[i].name,
+                 g_source[i].flags & SRC_FLAG_FHSEC      ? 's' : ' ',
+                 g_source[i].old_open != NULL            ? 'S' : ' ',
+                 g_source[i].new_open != NULL            ? 'N' : ' ',
+                 subsys,
+                 g_source[i].desc, g_source[i].devices);
+  } else {
+   printf("  %-9s %c%c%c %6s - %s\n", g_source[i].name,
+                 g_source[i].flags & SRC_FLAG_FHSEC      ? 's' : ' ',
+                 g_source[i].old_open != NULL            ? 'S' : ' ',
+                 g_source[i].new_open != NULL            ? 'N' : ' ',
+                 subsys,
+                 g_source[i].desc);
+  }
  }
 }
@@ -137,5 +147,9 @@
  }
 
- streams_get(stream, &ss);
+ if ( streams_get(stream, &ss) == -1 ) {
+  streams_delete(stream);
+  return -1;
+ }
+
  s = ROAR_STREAM(ss);
 
@@ -441,5 +455,6 @@
   return -1;
 
- streams_get(stream, &ss);
+ if ( streams_get(stream, &ss) == -1 )
+  return -1;
 
  if ( !strncmp(driver, "cdriver:", 8) )
@@ -455,4 +470,65 @@
 #endif
 
+static ssize_t sources_radionoise_read (struct roar_vio_calls * vio, void *buf, size_t count) {
+ int32_t * pcm = buf;
+ int16_t noise;
+ size_t len, i;
+
+ ROAR_DBG("sources_radionoise_read(vio=%p, buf=%p, count=%llu) = 0", vio, buf, (long long unsigned int)count);
+
+ // ensure size is a multiple of 4.
+ count -= count & 0x03LLU;
+
+ if ( count == 0 )
+  return 0;
+
+ if ( buf == NULL )
+  return -1;
+
+ roar_random_gen_nonce(buf, count);
+
+ len = count / 4;
+
+ for (i = 0; i < len; i++) {
+  noise  = pcm[i] & 0xFFFF;
+  pcm[i] = ((int32_t)noise << 16) >> 17;
+ }
+
+ ROAR_DBG("sources_radionoise_read(vio=%p, buf=%p, count=?) = %llu", vio, buf, (long long unsigned int)count);
+ return count;
+}
+
+static int     sources_radionoise_return_zero (struct roar_vio_calls * vio) {
+ (void)vio;
+
+ ROAR_DBG("sources_radionoise_return_zero(vio=%p) = 0", vio);
+
+ return 0;
+}
+
+int sources_add_radionoise (int stream, char * device, int fh, char * driver) {
+ struct roar_stream_server * ss;
+ struct roar_audio_info    * info;
+
+ if ( fh > -1 )
+  return -1;
+
+ if ( streams_get(stream, &ss) == -1 )
+  return -1;
+
+ info = &(ROAR_STREAM(ss)->info);
+
+ info->codec = ROAR_CODEC_DEFAULT;
+ info->bits  = 32;
+
+ memset(&(ss->vio), 0, sizeof(struct roar_vio_calls));
+ ss->vio.read     = sources_radionoise_read;
+ 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;
+
+ return streams_set_fh(stream, -2);
+}
+
 #endif
 
