vbox6: don't call blocking 'read()' to start audio recording

Fixes #4580
This commit is contained in:
Christian Prochaska 2022-07-27 10:53:43 +02:00 committed by Christian Helmuth
parent bda276f498
commit 3f8bde1254
3 changed files with 29 additions and 1 deletions

View File

@ -1 +1 @@
db7d6d9b9ab32c34fcfb371dfc9e100b208ee982 b59f4f8ca00b96a40a93f736676f5b4e830cbd01

View File

@ -0,0 +1,27 @@
diff --git a/src/virtualbox6/src/VBox/Devices/Audio/DrvHostAudioOss.cpp b/src/virtualbox6/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
index d67f2bb..ea99bee 100644
--- a/src/virtualbox6/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
+++ b/src/virtualbox6/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
@@ -836,6 +836,13 @@ static DECLCALLBACK(uint32_t) drvHstAudOssHA_StreamGetReadable(PPDMIHOSTAUDIO pI
AssertMsgStmt(cbRet <= cbBuf, ("fragsize*fragments: %d, cbBuf=%#x\n", cbRet, cbBuf), 0);
}
+ /*
+ * On Genode the 'SNDCTL_DSP_SETTRIGGER' command should have started
+ * the recording. If no recording data arrives because of some error
+ * on the path (for example a crashed driver), the 'read()' call in
+ * the following section would block the VM, which is not desired.
+ */
+#if 0
/*
* HACK ALERT! To force the stream to start recording, we read a frame
* here if we get back that there are zero bytes available
@@ -854,7 +861,7 @@ static DECLCALLBACK(uint32_t) drvHstAudOssHA_StreamGetReadable(PPDMIHOSTAUDIO pI
RT_NOREF(cbRead);
LogFunc(("Dummy read for '%s' returns %zd (errno=%d)\n", pStreamOSS->Cfg.szName, cbRead, errno));
}
-
+#endif
Log4Func(("returns %#x (%u) [cbBuf=%#x]\n", cbRet, cbRet, cbBuf));
return cbRet;
}

View File

@ -9,3 +9,4 @@ rttimer.patch
devsvga.patch devsvga.patch
shaderlib.patch shaderlib.patch
svga.patch svga.patch
audio.patch