Index: include/libroar/stream.h
===================================================================
--- include/libroar/stream.h	(revision 3538)
+++ include/libroar/stream.h	(revision 3630)
@@ -76,4 +76,17 @@
 #define ROAR_STREAMSTATE_CLOSING    4
 
+// PA currently defines: video, music, game, event, phone, animation, production, a11y
+// RA includes         : YES    YES    YES   YES    YES    NO         NO          NO
+
+#define ROAR_ROLE_UNKNOWN          -1
+#define ROAR_ROLE_NONE              0
+#define ROAR_ROLE_MUSIC             1
+#define ROAR_ROLE_VIDEO             2
+#define ROAR_ROLE_GAME              3
+#define ROAR_ROLE_EVENT             4
+#define ROAR_ROLE_BEEP              5
+#define ROAR_ROLE_PHONE             6
+#define ROAR_ROLE_BACKGROUND_MUSIC  7
+
 struct roar_stream_info {
  int block_size;
@@ -86,4 +99,5 @@
  int state;
  int mixer;
+ int role;
 };
 
@@ -134,4 +148,7 @@
 char * roar_streamstate2str(int streamstate);
 
+int    roar_str2role  (char * role);
+char * roar_role2str  (int    role);
+
 #endif
 
Index: libroar/stream.c
===================================================================
--- libroar/stream.c	(revision 3540)
+++ libroar/stream.c	(revision 3630)
@@ -394,4 +394,5 @@
  memset(info, 0, sizeof(struct roar_stream_info));
  info->mixer = -1;
+ info->role  = ROAR_ROLE_UNKNOWN;
 
  info->block_size     = data[2];
@@ -419,4 +420,10 @@
  } else {
   info->mixer         = data[10];
+ }
+
+ if ( m.datalen < 12*2 ) {
+  return 0;
+ } else {
+  info->role          = data[11];
  }
 
@@ -858,3 +865,40 @@
 }
 
+struct {
+ int    role;
+ char * name;
+} _libroar_role[] = {
+ {ROAR_ROLE_UNKNOWN,          "unknown"         },
+ {ROAR_ROLE_NONE,             "none"            },
+ {ROAR_ROLE_MUSIC,            "music"           },
+ {ROAR_ROLE_VIDEO,            "video"           },
+ {ROAR_ROLE_GAME,             "game"            },
+ {ROAR_ROLE_EVENT,            "event"           },
+ {ROAR_ROLE_BEEP,             "beep"            },
+ {ROAR_ROLE_PHONE,            "phone"           },
+ {ROAR_ROLE_BACKGROUND_MUSIC, "background music"},
+ {ROAR_ROLE_BACKGROUND_MUSIC, "background_music"}, // alias
+ {-1, NULL}
+};
+
+int    roar_str2role  (char * role) {
+ int i;
+
+ for (i = 0; _libroar_role[i].name != NULL; i++)
+  if ( !strcasecmp(_libroar_role[i].name, role) )
+   return _libroar_role[i].role;
+
+ return ROAR_ROLE_UNKNOWN;
+}
+
+char * roar_role2str  (int    role) {
+ int i;
+
+ for (i = 0; _libroar_role[i].name != NULL; i++)
+  if ( _libroar_role[i].role == role )
+   return _libroar_role[i].name;
+
+ return "unknown";
+}
+
 //ll
Index: roarclients/roarctl.c
===================================================================
--- roarclients/roarctl.c	(revision 3560)
+++ roarclients/roarctl.c	(revision 3630)
@@ -384,4 +384,7 @@
      printf("Stream state          : %s\n",   roar_streamstate2str(info.state));
 
+    if ( g_verbose > 1 )
+     printf("Stream role           : %s\n",   roar_role2str(info.role));
+
     *flags = 0;
     if ( info.flags & ROAR_FLAG_PRIMARY )
Index: roard/beep.c
===================================================================
--- roard/beep.c	(revision 3582)
+++ roard/beep.c	(revision 3630)
@@ -165,4 +165,9 @@
  }
 
+ if ( streams_set_role(stream, ROAR_ROLE_BEEP) == -1 ) {
+  streams_delete(stream);
+  return -1;
+ }
+
  if ( (buf = beep_fill_buffer(beep, &(s->info))) == NULL ) {
   streams_delete(stream);
Index: roard/include/streams.h
===================================================================
--- roard/include/streams.h	(revision 3542)
+++ roard/include/streams.h	(revision 3630)
@@ -91,4 +91,5 @@
  int mixer_stream;
  struct roardsp_chanmap chanmap;
+ int role;
 } * g_streams[ROAR_STREAMS_MAX];
 
@@ -110,4 +111,6 @@
 int streams_set_mixer_stream(int id, int mixer);
 int streams_get_mixer_stream(int id, int mixer);
+
+int streams_set_role   (int id, int role);
 
 int streams_get_subsys (int id);
Index: roard/req.c
===================================================================
--- roard/req.c	(revision 3575)
+++ roard/req.c	(revision 3630)
@@ -596,5 +596,5 @@
     audio_info = &(s->info);
 
-    mes->datalen = 2*11;
+    mes->datalen = 2*12;
 
     d[ 2] = ROAR_OUTPUT_CALC_OUTBUFSIZE(audio_info);
@@ -607,4 +607,5 @@
     d[ 9] = (ss->flags & 0xFFFF0000) >> 16;
     d[10] = ss->mixer_stream;
+    d[11] = ss->role;
 
     ROAR_DBG("req_on_get_stream_para(*): ss->driver_id=%i", ss->driver_id);
Index: roard/streams.c
===================================================================
--- roard/streams.c	(revision 3557)
+++ roard/streams.c	(revision 3630)
@@ -107,4 +107,5 @@
    s->prethru         = NULL;
    s->mixer_stream    = -1;
+   s->role            = ROAR_ROLE_UNKNOWN;
 
    s->mixer.scale     = 65535;
@@ -376,4 +377,17 @@
 }
 
+int streams_set_role   (int id, int role) {
+ struct roar_stream_server * ss;
+
+ _CHECK_SID(id);
+
+ if ( (ss = g_streams[id]) == NULL )
+  return -1;
+
+ ss->role = role;
+
+ return 0;
+}
+
 int streams_get_subsys (int id) {
  struct roar_stream_server * ss;
