diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioOss.cpp b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioOss.cpp --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioOss.cpp @@ -0,0 +1,52 @@ +--- ./src/VBox/Devices/Audio/DrvHostAudioOss.cpp.orig 2022-02-20 08:57:20.835126000 -0600 ++++ ./src/VBox/Devices/Audio/DrvHostAudioOss.cpp 2022-02-20 09:53:04.940588000 -0600 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -112,9 +113,9 @@ + * Global Variables * + *********************************************************************************************************************************/ + /** The path to the output OSS device. */ +-static char g_szPathOutputDev[] = "/dev/dsp"; ++static const char *g_szPathOutputDev = "/dev/dsp"; + /** The path to the input OSS device. */ +-static char g_szPathInputDev[] = "/dev/dsp"; ++static const char *g_szPathInputDev = "/dev/dsp"; + + + +@@ -191,7 +192,7 @@ + pBackendCfg->cMaxStreamsIn = 0; + pBackendCfg->cMaxStreamsOut = 0; + +- int hFile = open("/dev/dsp", O_WRONLY | O_NONBLOCK, 0); ++ int hFile = open(g_szPathOutputDev, O_WRONLY | O_NONBLOCK, 0); + if (hFile == -1) + { + /* Try opening the mixing device instead. */ +@@ -929,6 +930,7 @@ + RT_NOREF(pCfg, fFlags); + PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); + PDRVHSTAUDOSS pThis = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDOSS); ++ const char *devDsp; + LogRel(("Audio: Initializing OSS driver\n")); + + /* +@@ -959,6 +961,12 @@ + pThis->IHostAudio.pfnStreamPlay = drvHstAudOssHA_StreamPlay; + pThis->IHostAudio.pfnStreamGetReadable = drvHstAudOssHA_StreamGetReadable; + pThis->IHostAudio.pfnStreamCapture = drvHstAudOssHA_StreamCapture; ++ devDsp = getenv("VBOX_OSS_INPUT_DEVICE"); ++ if (devDsp != NULL) ++ g_szPathInputDev = devDsp; ++ devDsp = getenv("VBOX_OSS_OUTPUT_DEVICE"); ++ if (devDsp != NULL) ++ g_szPathOutputDev = devDsp; + + return VINF_SUCCESS; + }