Index: /trunk/src/VBox/Devices/Audio/alsaaudio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/alsaaudio.c	(revision 40843)
+++ /trunk/src/VBox/Devices/Audio/alsaaudio.c	(revision 40844)
@@ -1135,28 +1135,28 @@
 
 static struct audio_option alsa_options[] = {
-    {"DAC_SIZE_IN_USEC", AUD_OPT_BOOL, &conf.size_in_usec_out,
+    {"DACSizeInUsec", AUD_OPT_BOOL, &conf.size_in_usec_out,
      "DAC period/buffer size in microseconds (otherwise in frames)", NULL, 0},
-    {"DAC_PERIOD_SIZE", AUD_OPT_INT, &conf.period_size_out,
+    {"DACPeriodSize", AUD_OPT_INT, &conf.period_size_out,
      "DAC period size", &conf.period_size_out_overriden, 0},
-    {"DAC_BUFFER_SIZE", AUD_OPT_INT, &conf.buffer_size_out,
+    {"DACBufferSize", AUD_OPT_INT, &conf.buffer_size_out,
      "DAC buffer size", &conf.buffer_size_out_overriden, 0},
 
-    {"ADC_SIZE_IN_USEC", AUD_OPT_BOOL, &conf.size_in_usec_in,
+    {"ADCSizeInUsec", AUD_OPT_BOOL, &conf.size_in_usec_in,
      "ADC period/buffer size in microseconds (otherwise in frames)", NULL, 0},
-    {"ADC_PERIOD_SIZE", AUD_OPT_INT, &conf.period_size_in,
+    {"ADCPeriodSize", AUD_OPT_INT, &conf.period_size_in,
      "ADC period size", &conf.period_size_in_overriden, 0},
-    {"ADC_BUFFER_SIZE", AUD_OPT_INT, &conf.buffer_size_in,
+    {"ADCBufferSize", AUD_OPT_INT, &conf.buffer_size_in,
      "ADC buffer size", &conf.buffer_size_in_overriden, 0},
 
-    {"THRESHOLD", AUD_OPT_INT, &conf.threshold,
+    {"Threshold", AUD_OPT_INT, &conf.threshold,
      "(undocumented)", NULL, 0},
 
-    {"DAC_DEV", AUD_OPT_STR, &conf.pcm_name_out,
+    {"DACDev", AUD_OPT_STR, &conf.pcm_name_out,
      "DAC device name (for instance dmix)", NULL, 0},
 
-    {"ADC_DEV", AUD_OPT_STR, &conf.pcm_name_in,
+    {"ADCDev", AUD_OPT_STR, &conf.pcm_name_in,
      "ADC device name", NULL, 0},
 
-    {"VERBOSE", AUD_OPT_BOOL, &conf.verbose,
+    {"Verbose", AUD_OPT_BOOL, &conf.verbose,
      "Behave in a more verbose way", NULL, 0},
 
Index: /trunk/src/VBox/Devices/Audio/audio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/audio.c	(revision 40843)
+++ /trunk/src/VBox/Devices/Audio/audio.c	(revision 40844)
@@ -362,39 +362,62 @@
 }
 
-static audfmt_e audio_get_conf_fmt (const char *envname,
+static audfmt_e audio_get_conf_fmt (PCFGMNODE pCfgHandle, const char *envname,
                                     audfmt_e defval,
                                     int *defaultp)
 {
-    const char *var = getenv (envname);
-    if (!var) {
+    char *var = NULL;
+    int rc;
+
+    if(pCfgHandle == NULL || envname == NULL) {
         *defaultp = 1;
         return defval;
     }
-    return audio_string_to_audfmt (var, defval, defaultp);
-}
-
-static int audio_get_conf_int (const char *key, int defval, int *defaultp)
-{
-    int val;
-    char *strval;
-
-    strval = getenv (key);
-    if (strval) {
-        *defaultp = 0;
-        val = atoi (strval);
-        return val;
-    }
-    else {
+
+    rc = CFGMR3QueryStringAlloc(pCfgHandle, envname, &var);
+    if (RT_FAILURE (rc)) {
         *defaultp = 1;
         return defval;
     }
-}
-
-static const char *audio_get_conf_str (const char *key,
+    return audio_string_to_audfmt (var, defval, defaultp);
+}
+
+static int audio_get_conf_int (PCFGMNODE  pCfgHandle, const char *key, int defval, int *defaultp)
+{
+    int rc;
+    uint64_t u64Data = 0;
+    if(pCfgHandle == NULL || key == NULL) {
+        *defaultp = 1;
+        return defval;
+    }
+
+    *defaultp = 0;
+    rc = CFGMR3QueryInteger(pCfgHandle, key, &u64Data);
+    if (RT_FAILURE (rc))
+    {
+        *defaultp = 1;
+        return defval;
+
+    }
+    else
+    {
+        LogFlow(("%s, Value = %d\n", key, u64Data));
+        *defaultp = 0;
+        return u64Data;
+    }
+}
+
+static const char *audio_get_conf_str (PCFGMNODE  pCfgHandle, const char *key,
                                        const char *defval,
                                        int *defaultp)
 {
-    const char *val = getenv (key);
-    if (!val) {
+    char *val = NULL;
+    int rc;
+    if(pCfgHandle == NULL || key == NULL) {
+        *defaultp = 1;
+        return defval;
+    }
+
+    rc = CFGMR3QueryStringAlloc(pCfgHandle, key, &val);
+    if (RT_FAILURE (rc)) {
         *defaultp = 1;
         return defval;
@@ -428,10 +451,10 @@
 }
 
-static void audio_process_options (const char *prefix,
+static void audio_process_options (PCFGMNODE pCfgHandle, const char *prefix,
                                    struct audio_option *opt)
 {
-    char *optname;
-    const char vbox_prefix[] = "VBOX_";
-    size_t preflen;
+    int def;
+    PCFGMNODE pCfgChildHandle = NULL;
+    PCFGMNODE pCfgChildChildHandle = NULL;
 
     if (audio_bug (AUDIO_FUNC, !prefix)) {
@@ -445,10 +468,35 @@
     }
 
-    preflen = strlen (prefix);
+   /* if pCfgHandle is NULL, let NULL be passed to get int and get string functions..
+    * The getter function will return default values.
+    */
+   if(pCfgHandle != NULL) {
+       /* If its audio general setting, need to traverse to one child node.
+        * /Devices/ihac97/0/LUN#0/Config/Audio
+        */
+       if(!strncmp(prefix, "AUDIO", 5)) {
+            pCfgChildHandle = CFGMR3GetFirstChild(pCfgHandle);
+            if(pCfgChildHandle) {
+                pCfgHandle = pCfgChildHandle;
+            }
+        }
+        else
+        {
+            /* If its driver specific configuration , then need to traverse two level deep child
+             * child nodes. for eg. in case of DirectSoundConfiguration item
+             * /Devices/ihac97/0/LUN#0/Config/Audio/DirectSoundConfig
+             */
+            pCfgChildHandle = CFGMR3GetFirstChild(pCfgHandle);
+            if (pCfgChildHandle) {
+                pCfgChildChildHandle = CFGMR3GetFirstChild(pCfgChildHandle);
+                if(pCfgChildChildHandle) {
+                   pCfgHandle = pCfgChildChildHandle;
+                }
+            }
+        }
+   }
+
 
     for (; opt->name; opt++) {
-        size_t len, i;
-        int def;
-
         if (!opt->valp) {
             dolog ("Option value pointer for `%s' is not set\n",
@@ -456,25 +504,4 @@
             continue;
         }
-
-        len = strlen (opt->name);
-        /* len of opt->name + len of prefix + size of vbox_prefix
-         * (includes trailing zero) + zero + underscore (on behalf of
-         * sizeof) */
-        optname = qemu_malloc (len + preflen + sizeof (vbox_prefix) + 1);
-        if (!optname) {
-            dolog ("Could not allocate memory for option name `%s'\n",
-                   opt->name);
-            continue;
-        }
-
-        strcpy (optname, vbox_prefix);
-
-        /* copy while upcasing, including trailing zero */
-        for (i = 0; i <= preflen; ++i) {
-            optname[i + sizeof (vbox_prefix) - 1] = toupper (prefix[i]);
-        }
-        strcat (optname, "_");
-        strcat (optname, opt->name);
-
         def = 1;
         switch (opt->tag) {
@@ -483,5 +510,5 @@
             {
                 int *intp = opt->valp;
-                *intp = audio_get_conf_int (optname, *intp, &def);
+                *intp =   audio_get_conf_int(pCfgHandle, opt->name, *intp, &def);
             }
             break;
@@ -490,5 +517,5 @@
             {
                 audfmt_e *fmtp = opt->valp;
-                *fmtp = audio_get_conf_fmt (optname, *fmtp, &def);
+                *fmtp = audio_get_conf_fmt (pCfgHandle, opt->name, *fmtp, &def);
             }
             break;
@@ -497,5 +524,5 @@
             {
                 const char **strp = opt->valp;
-                *strp = audio_get_conf_str (optname, *strp, &def);
+                *strp = audio_get_conf_str (pCfgHandle, opt->name, *strp, &def);
             }
             break;
@@ -503,5 +530,5 @@
         default:
             dolog ("Bad value tag for option `%s' - %d\n",
-                   optname, opt->tag);
+                   opt->name, opt->tag);
             break;
         }
@@ -511,5 +538,4 @@
         }
         *opt->overridenp = !def;
-        qemu_free (optname);
     }
 }
@@ -1505,37 +1531,37 @@
 static struct audio_option audio_options[] = {
     /* DAC */
-    {"DAC_FIXED_SETTINGS", AUD_OPT_BOOL, &conf.fixed_out.enabled,
+    {"DACFixedSettings", AUD_OPT_BOOL, &conf.fixed_out.enabled,
      "Use fixed settings for host DAC", NULL, 0},
 
-    {"DAC_FIXED_FREQ", AUD_OPT_INT, &conf.fixed_out.settings.freq,
+    {"DACFixedFreq", AUD_OPT_INT, &conf.fixed_out.settings.freq,
      "Frequency for fixed host DAC", NULL, 0},
 
-    {"DAC_FIXED_FMT", AUD_OPT_FMT, &conf.fixed_out.settings.fmt,
+    {"DACFixedFmt", AUD_OPT_FMT, &conf.fixed_out.settings.fmt,
      "Format for fixed host DAC", NULL, 0},
 
-    {"DAC_FIXED_CHANNELS", AUD_OPT_INT, &conf.fixed_out.settings.nchannels,
+    {"DACFixedChannels", AUD_OPT_INT, &conf.fixed_out.settings.nchannels,
      "Number of channels for fixed DAC (1 - mono, 2 - stereo)", NULL, 0},
 
-    {"DAC_VOICES", AUD_OPT_INT, &conf.fixed_out.nb_voices,
+    {"DACVoices", AUD_OPT_INT, &conf.fixed_out.nb_voices,
      "Number of voices for DAC", NULL, 0},
 
     /* ADC */
-    {"ADC_FIXED_SETTINGS", AUD_OPT_BOOL, &conf.fixed_in.enabled,
+    {"ADCFixedSettings", AUD_OPT_BOOL, &conf.fixed_in.enabled,
      "Use fixed settings for host ADC", NULL, 0},
 
-    {"ADC_FIXED_FREQ", AUD_OPT_INT, &conf.fixed_in.settings.freq,
+    {"ADCFixedFreq", AUD_OPT_INT, &conf.fixed_in.settings.freq,
      "Frequency for fixed host ADC", NULL, 0},
 
-    {"ADC_FIXED_FMT", AUD_OPT_FMT, &conf.fixed_in.settings.fmt,
+    {"ADCFixedFmt", AUD_OPT_FMT, &conf.fixed_in.settings.fmt,
      "Format for fixed host ADC", NULL, 0},
 
-    {"ADC_FIXED_CHANNELS", AUD_OPT_INT, &conf.fixed_in.settings.nchannels,
+    {"ADCFixedChannels", AUD_OPT_INT, &conf.fixed_in.settings.nchannels,
      "Number of channels for fixed ADC (1 - mono, 2 - stereo)", NULL, 0},
 
-    {"ADC_VOICES", AUD_OPT_INT, &conf.fixed_in.nb_voices,
+    {"ADCVoices", AUD_OPT_INT, &conf.fixed_in.nb_voices,
      "Number of voices for ADC", NULL, 0},
 
     /* Misc */
-    {"TIMER_FREQ", AUD_OPT_INT, &conf.period.hz,
+    {"TimreFreq", AUD_OPT_INT, &conf.period.hz,
      "Timer frequency in Hz (0 - use lowest possible)", NULL, 0},
 
@@ -1546,8 +1572,8 @@
 };
 
-static int audio_driver_init (AudioState *s, struct audio_driver *drv)
+static int audio_driver_init (PCFGMNODE pCfgHandle, AudioState *s, struct audio_driver *drv)
 {
     if (drv->options) {
-        audio_process_options (drv->name, drv->options);
+        audio_process_options (pCfgHandle, drv->name, drv->options);
     }
     s->drv_opaque = drv->init ();
@@ -1639,5 +1665,5 @@
 }
 
-static int AUD_init (PPDMDRVINS pDrvIns, const char *drvname)
+static int AUD_init (PCFGMNODE pCfgHandle, PPDMDRVINS pDrvIns, const char *drvname)
 {
     size_t i;
@@ -1655,5 +1681,5 @@
         return rc;
 
-    audio_process_options ("AUDIO", audio_options);
+    audio_process_options (pCfgHandle, "AUDIO", audio_options);
 
     s->nb_hw_voices_out = conf.fixed_out.nb_voices;
@@ -1679,5 +1705,5 @@
         for (i = 0; i < sizeof (drvtab) / sizeof (drvtab[0]); i++) {
             if (!strcmp (drvname, drvtab[i]->name)) {
-                done = !audio_driver_init (s, drvtab[i]);
+                done = !audio_driver_init (pCfgHandle, s, drvtab[i]);
                 found = 1;
                 break;
@@ -1696,5 +1722,5 @@
                        drvname, drvtab[i]->name));
                 drvname = drvtab[i]->name;
-                done = !audio_driver_init (s, drvtab[i]);
+                done = !audio_driver_init (pCfgHandle, s, drvtab[i]);
             }
         }
@@ -1702,5 +1728,5 @@
 
     if (!done) {
-        done = !audio_driver_init (s, &no_audio_driver);
+        done = !audio_driver_init (pCfgHandle, s, &no_audio_driver);
         if (!done) {
             dolog ("Could not initialize audio subsystem\n");
@@ -1747,5 +1773,5 @@
 
     LogRel(("Audio: Using NULL audio driver\n"));
-    return audio_driver_init (s, &no_audio_driver);
+    return audio_driver_init (NULL, s, &no_audio_driver);
 }
 
@@ -2048,5 +2074,5 @@
         audio_streamname = NULL;
 
-    rc = AUD_init (pDrvIns, drvname);
+    rc = AUD_init (pCfgHandle, pDrvIns, drvname);
     if (RT_FAILURE (rc))
         return rc;
Index: /trunk/src/VBox/Devices/Audio/coreaudio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/coreaudio.c	(revision 40843)
+++ /trunk/src/VBox/Devices/Audio/coreaudio.c	(revision 40844)
@@ -2140,7 +2140,7 @@
 static struct audio_option coreaudio_options[] =
 {
-    {"OUTPUT_DEVICE_UID", AUD_OPT_STR, &conf.pszOutputDeviceUID,
+    {"OutputDeviceUID", AUD_OPT_STR, &conf.pszOutputDeviceUID,
      "UID of the output device to use", NULL, 0},
-    {"INPUT_DEVICE_UID", AUD_OPT_STR, &conf.pszInputDeviceUID,
+    {"InputDeviceUID", AUD_OPT_STR, &conf.pszInputDeviceUID,
      "UID of the input device to use", NULL, 0},
     {NULL, 0, NULL, NULL, NULL, 0}
Index: /trunk/src/VBox/Devices/Audio/dsoundaudio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/dsoundaudio.c	(revision 40843)
+++ /trunk/src/VBox/Devices/Audio/dsoundaudio.c	(revision 40844)
@@ -1109,23 +1109,23 @@
 
 static struct audio_option dsound_options[] = {
-    {"LOCK_RETRIES", AUD_OPT_INT, &conf.lock_retries,
+    {"LockRetries", AUD_OPT_INT, &conf.lock_retries,
      "Number of times to attempt locking the buffer", NULL, 0},
-    {"RESTOURE_RETRIES", AUD_OPT_INT, &conf.restore_retries,
+    {"RestoreRetries", AUD_OPT_INT, &conf.restore_retries,
      "Number of times to attempt restoring the buffer", NULL, 0},
-    {"GETSTATUS_RETRIES", AUD_OPT_INT, &conf.getstatus_retries,
+    {"GetStatusRetries", AUD_OPT_INT, &conf.getstatus_retries,
      "Number of times to attempt getting status of the buffer", NULL, 0},
-    {"SET_PRIMARY", AUD_OPT_BOOL, &conf.set_primary,
+    {"SetPrimary", AUD_OPT_BOOL, &conf.set_primary,
      "Set the parameters of primary buffer", NULL, 0},
-    {"LATENCY_MILLIS", AUD_OPT_INT, &conf.latency_millis,
+    {"LatencyMillis", AUD_OPT_INT, &conf.latency_millis,
      "(undocumented)", NULL, 0},
-    {"PRIMARY_FREQ", AUD_OPT_INT, &conf.settings.freq,
+    {"PrimaryFreq", AUD_OPT_INT, &conf.settings.freq,
      "Primary buffer frequency", NULL, 0},
-    {"PRIMARY_CHANNELS", AUD_OPT_INT, &conf.settings.nchannels,
+    {"PrimaryChannels", AUD_OPT_INT, &conf.settings.nchannels,
      "Primary buffer number of channels (1 - mono, 2 - stereo)", NULL, 0},
-    {"PRIMARY_FMT", AUD_OPT_FMT, &conf.settings.fmt,
+    {"PrimaryFmt", AUD_OPT_FMT, &conf.settings.fmt,
      "Primary buffer format", NULL, 0},
-    {"BUFSIZE_OUT", AUD_OPT_INT, &conf.bufsize_out,
+    {"BufsizeOut", AUD_OPT_INT, &conf.bufsize_out,
      "(undocumented)", NULL, 0},
-    {"BUFSIZE_IN", AUD_OPT_INT, &conf.bufsize_in,
+    {"BufsizeIn", AUD_OPT_INT, &conf.bufsize_in,
      "(undocumented)", NULL, 0},
     {NULL, 0, NULL, NULL, NULL, 0}
Index: /trunk/src/VBox/Devices/Audio/ossaudio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/ossaudio.c	(revision 40843)
+++ /trunk/src/VBox/Devices/Audio/ossaudio.c	(revision 40844)
@@ -852,17 +852,17 @@
 
 static struct audio_option oss_options[] = {
-    {"FRAGSIZE", AUD_OPT_INT, &conf.fragsize,
+    {"Fragsize", AUD_OPT_INT, &conf.fragsize,
      "Fragment size in bytes", NULL, 0},
-    {"NFRAGS", AUD_OPT_INT, &conf.nfrags,
+    {"NFrags", AUD_OPT_INT, &conf.nfrags,
      "Number of fragments", NULL, 0},
 #ifndef RT_OS_L4
-    {"MMAP", AUD_OPT_BOOL, &conf.try_mmap,
+    {"MMap", AUD_OPT_BOOL, &conf.try_mmap,
      "Try using memory mapped access", NULL, 0},
 #endif
-    {"DAC_DEV", AUD_OPT_STR, &conf.devpath_out,
+    {"DACDev", AUD_OPT_STR, &conf.devpath_out,
      "Path to DAC device", NULL, 0},
-    {"ADC_DEV", AUD_OPT_STR, &conf.devpath_in,
+    {"ADCDev", AUD_OPT_STR, &conf.devpath_in,
      "Path to ADC device", NULL, 0},
-    {"DEBUG", AUD_OPT_BOOL, &conf.debug,
+    {"Debug", AUD_OPT_BOOL, &conf.debug,
      "Turn on some debugging messages", NULL, 0},
     {NULL, 0, NULL, NULL, NULL, 0}
Index: /trunk/src/VBox/Devices/Audio/solaudio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/solaudio.c	(revision 40843)
+++ /trunk/src/VBox/Devices/Audio/solaudio.c	(revision 40844)
@@ -844,5 +844,5 @@
 static struct audio_option solaudio_options[] =
 {
-    {"PLAY_BUFFER_SIZE", AUD_OPT_INT, &conf.cbPlayBuffer,
+    {"PlayBufferSize", AUD_OPT_INT, &conf.cbPlayBuffer,
      "Size of the buffer in bytes", NULL, 0},
 #if 0
