Index: /trunk/src/VBox/Devices/Audio/ossaudio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/ossaudio.c	(revision 355)
+++ /trunk/src/VBox/Devices/Audio/ossaudio.c	(revision 356)
@@ -99,4 +99,5 @@
 }
 
+#ifndef VBOX
 static void GCC_FMT_ATTR (3, 4) oss_logerr2 (
     int err,
@@ -116,4 +117,5 @@
     AUD_log (AUDIO_CAP, "Reason: %s\n", strerror (err));
 }
+#endif
 
 static void oss_anal_close (int *fdp)
@@ -222,8 +224,16 @@
     fd = open (dspname, (in ? O_RDONLY : O_WRONLY) | O_NONBLOCK);
     if (-1 == fd) {
+#ifndef VBOX
         oss_logerr2 (errno, typ, "Failed to open `%s'\n", dspname);
-        LogRel(("Audio/OSS: Failed to open '%s' as %s\n", dspname, typ));
+#else
+        LogRel(("Audio/OSS: Failed to open %s for %s (%s)\n",
+                 dspname, typ, strerror(errno)));
+#endif
         return -1;
     }
+
+#ifdef VBOX
+    LogRel(("Audio/OSS: Successfully opened %s for %s\n", dspname, typ));
+#endif
 
     freq = req->freq;
@@ -232,21 +242,39 @@
 
     if (ioctl (fd, SNDCTL_DSP_SAMPLESIZE, &fmt)) {
+#ifndef VBOX
         oss_logerr2 (errno, typ, "Failed to set sample size %d\n", req->fmt);
+#else
+        LogRel(("Audio/OSS: Failed to set sample size %d (%s)\n",
+                 req->fmt, strerror(errno)));
+#endif
         goto err;
     }
 
     if (ioctl (fd, SNDCTL_DSP_CHANNELS, &nchannels)) {
+#ifndef VBOX
         oss_logerr2 (errno, typ, "Failed to set number of channels %d\n",
                      req->nchannels);
+#else
+        LogRel(("Audio/OSS: Failed to set nchannels=%d (%s)\n",
+                 req->nchannels, strerror(errno)));
+#endif
         goto err;
     }
 
     if (ioctl (fd, SNDCTL_DSP_SPEED, &freq)) {
+#ifndef VBOX
         oss_logerr2 (errno, typ, "Failed to set frequency %d\n", req->freq);
+#else
+        LogRel(("Audio/OSS: Failed to set freq=%dHZ\n", req->freq, strerror(errno)));
+#endif
         goto err;
     }
 
     if (ioctl (fd, SNDCTL_DSP_NONBLOCK)) {
+#ifndef VBOX
         oss_logerr2 (errno, typ, "Failed to set non-blocking mode\n");
+#else
+        LogRel(("Audio/OSS: Failed to set non-blocking mode (%s)\n", strerror(errno)));
+#endif
         goto err;
     }
@@ -254,11 +282,20 @@
     mmmmssss = (req->nfrags << 16) | lsbindex (req->fragsize);
     if (ioctl (fd, SNDCTL_DSP_SETFRAGMENT, &mmmmssss)) {
+#ifndef VBOX
         oss_logerr2 (errno, typ, "Failed to set buffer length (%d, %d)\n",
                      req->nfrags, req->fragsize);
+#else
+        LogRel(("Audio/OSS: Failed to set buffer_length=%d,%d (%s)\n",
+                req->nfrags, req->fragsize, strerror(errno)));
+#endif
         goto err;
     }
 
     if (ioctl (fd, in ? SNDCTL_DSP_GETISPACE : SNDCTL_DSP_GETOSPACE, &abinfo)) {
+#ifndef VBOX
         oss_logerr2 (errno, typ, "Failed to get buffer length\n");
+#else
+        LogRel(("Audio/OSS: Failed to get buffer length (%s)\n", strerror(errno)));
+#endif
         goto err;
     }
@@ -289,4 +326,8 @@
  err:
     oss_anal_close (&fd);
+#ifdef VBOX
+    LogRel(("Audio/OSS: Closed %s for %s\n",
+            in ? conf.devpath_in : conf.devpath_out, in ? "ADC" : "DAC"));
+#endif
     return -1;
 }
@@ -440,4 +481,7 @@
     ldebug ("oss_fini\n");
     oss_anal_close (&oss->fd);
+#ifdef VBOX
+    LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out));
+#endif
 
     if (oss->pcm_buf) {
@@ -485,4 +529,7 @@
     if (err) {
         oss_anal_close (&fd);
+#ifdef VBOX
+    LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out));
+#endif
         return -1;
     }
@@ -563,4 +610,7 @@
                 );
             oss_anal_close (&fd);
+#ifdef VBOX
+    LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out));
+#endif
             return -1;
         }
@@ -636,4 +686,7 @@
     if (err) {
         oss_anal_close (&fd);
+#ifdef VBOX
+    LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in));
+#endif
         return -1;
     }
@@ -659,4 +712,7 @@
                hw->samples, 1 << hw->info.shift);
         oss_anal_close (&fd);
+#ifdef VBOX
+    LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in));
+#endif
         return -1;
     }
@@ -671,4 +727,7 @@
 
     oss_anal_close (&oss->fd);
+#ifdef VBOX
+    LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in));
+#endif
 
     if (oss->pcm_buf) {
