From 3f8bde125434ac8b80015661f15df7dadb7ae625 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Wed, 27 Jul 2022 10:53:43 +0200 Subject: [PATCH] vbox6: don't call blocking 'read()' to start audio recording Fixes #4580 --- repos/ports/ports/virtualbox6.hash | 2 +- .../ports/src/virtualbox6/patches/audio.patch | 27 +++++++++++++++++++ repos/ports/src/virtualbox6/patches/series | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 repos/ports/src/virtualbox6/patches/audio.patch diff --git a/repos/ports/ports/virtualbox6.hash b/repos/ports/ports/virtualbox6.hash index d2c1ce40bc..9fe7342901 100644 --- a/repos/ports/ports/virtualbox6.hash +++ b/repos/ports/ports/virtualbox6.hash @@ -1 +1 @@ -db7d6d9b9ab32c34fcfb371dfc9e100b208ee982 +b59f4f8ca00b96a40a93f736676f5b4e830cbd01 diff --git a/repos/ports/src/virtualbox6/patches/audio.patch b/repos/ports/src/virtualbox6/patches/audio.patch new file mode 100644 index 0000000000..e9bb749269 --- /dev/null +++ b/repos/ports/src/virtualbox6/patches/audio.patch @@ -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; + } diff --git a/repos/ports/src/virtualbox6/patches/series b/repos/ports/src/virtualbox6/patches/series index 5534551873..01f24ee894 100644 --- a/repos/ports/src/virtualbox6/patches/series +++ b/repos/ports/src/virtualbox6/patches/series @@ -9,3 +9,4 @@ rttimer.patch devsvga.patch shaderlib.patch svga.patch +audio.patch