Changeset 69956 in vbox
- Timestamp:
- Dec 6, 2017 12:28:48 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r69686 r69956 148 148 */ 149 149 150 #ifndef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH 151 # ifdef RT_OS_WINDOWS 152 # define VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "c:\\temp\\" 153 # else 154 # define VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "/tmp/" 155 # endif 156 #endif 157 150 158 /** PDM audio driver instance flags. */ 151 159 typedef uint32_t PDMAUDIODRVFLAGS; -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r69119 r69956 138 138 # endif /* unused */ 139 139 140 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA141 140 static char *drvAudioDbgGetFileNameA(PDRVAUDIO pThis, const char *pszPath, const char *pszSuffix); 142 141 static void drvAudioDbgPCMDelete(PDRVAUDIO pThis, const char *pszPath, const char *pszSuffix); 143 142 static void drvAudioDbgPCMDump(PDRVAUDIO pThis, const char *pszPath, const char *pszSuffix, const void *pvData, size_t cbData); 144 #endif145 143 146 144 #ifdef LOG_ENABLED … … 967 965 } 968 966 969 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 970 drvAudioDbgPCMDump(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "StreamWrite.pcm", pvBuf, cbBuf); 971 #endif 967 if (pThis->fDebugEnabled) 968 drvAudioDbgPCMDump(pThis, pThis->szDebugPathOut, "StreamWrite.pcm", pvBuf, cbBuf); 972 969 973 970 #ifdef VBOX_WITH_STATISTICS … … 1336 1333 } 1337 1334 1338 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 1339 drvAudioDbgPCMDump(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "PlayNonInterleaved.pcm", 1340 auBuf, cbPlayed); 1341 #endif 1335 if (pThis->fDebugEnabled) 1336 drvAudioDbgPCMDump(pThis, pThis->szDebugPathOut, "PlayNonInterleaved.pcm", auBuf, cbPlayed); 1337 1342 1338 AssertMsg(cbPlayed <= cbRead, ("Played more than available (%RU32 available but got %RU32)\n", cbRead, cbPlayed)); 1343 1339 #if 0 /** @todo Also handle mono channels. Needs fixing */ … … 1639 1635 else if (cbCaptured) 1640 1636 { 1641 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 1642 drvAudioDbgPCMDump(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "CaptureNonInterleaved.pcm", 1643 auBuf, cbCaptured); 1644 #endif 1637 if (pThis->fDebugEnabled) 1638 drvAudioDbgPCMDump(pThis, pThis->szDebugPathOut, "CaptureNonInterleaved.pcm", auBuf, cbCaptured); 1639 1645 1640 Assert(cbCaptured <= cbBuf); 1646 1641 if (cbCaptured > cbBuf) /* Paranoia. */ … … 2095 2090 #endif /* VBOX_WITH_AUDIO_ENUM */ 2096 2091 2097 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA2098 2092 /** 2099 2093 * Returns an unique file name for this given audio connector instance. … … 2167 2161 RTStrFree(pszFileName); 2168 2162 } 2169 #endif /* VBOX_AUDIO_DEBUG_DUMP_PCM_DATA */2170 2163 2171 2164 /** … … 2301 2294 2302 2295 /* By default we don't enable anything if wrongly / not set-up. */ 2303 pThis->In.fEnabled = false; 2304 pThis->Out.fEnabled = false; 2305 2306 uint64_t u64Temp; 2307 rc2 = CFGMR3QueryInteger(pCfgHandle, "InputEnabled", &u64Temp); 2308 if (RT_SUCCESS(rc2)) 2309 pThis->In.fEnabled = RT_BOOL(u64Temp); 2310 2311 rc2 = CFGMR3QueryInteger(pCfgHandle, "OutputEnabled", &u64Temp); 2312 if (RT_SUCCESS(rc2)) 2313 pThis->Out.fEnabled = RT_BOOL(u64Temp); 2296 CFGMR3QueryBoolDef(pCfgHandle, "InputEnabled", &pThis->In.fEnabled, false); 2297 CFGMR3QueryBoolDef(pCfgHandle, "OutputEnabled", &pThis->Out.fEnabled, false); 2298 2299 CFGMR3QueryBoolDef(pCfgHandle, "DebugEnabled", &pThis->fDebugEnabled, false); 2300 rc2 = CFGMR3QueryString(pCfgHandle, "DebugPathOut", pThis->szDebugPathOut, sizeof(pThis->szDebugPathOut)); 2301 if (RT_FAILURE(rc2)) 2302 RTStrPrintf(pThis->szDebugPathOut, sizeof(pThis->szDebugPathOut), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); 2303 2304 if (pThis->fDebugEnabled) 2305 LogRel(("Audio: Debugging enabled (audio data written to '%s')\n", pThis->szDebugPathOut)); 2314 2306 2315 2307 LogRel2(("Audio: Initial status for driver '%s': Input is %s, output is %s\n", … … 2407 2399 if (cReadTotal) 2408 2400 { 2409 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 2410 drvAudioDbgPCMDump(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "StreamRead.pcm",2411 pvBuf, AUDIOMIXBUF_F2B(&pGstStream->MixBuf, cReadTotal));2412 #endif 2401 if (pThis->fDebugEnabled) 2402 drvAudioDbgPCMDump(pThis, pThis->szDebugPathOut, "StreamRead.pcm", 2403 pvBuf, AUDIOMIXBUF_F2B(&pGstStream->MixBuf, cReadTotal)); 2404 2413 2405 AudioMixBufFinish(&pGstStream->MixBuf, cReadTotal); 2414 2406 … … 3361 3353 #endif 3362 3354 3363 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 3364 drvAudioDbgPCMDelete(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "StreamRead.pcm"); 3365 drvAudioDbgPCMDelete(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "StreamWrite.pcm"); 3366 drvAudioDbgPCMDelete(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "PlayNonInterleaved.pcm"); 3367 drvAudioDbgPCMDelete(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "CaptureNonInterleaved.pcm"); 3368 #endif 3355 if (pThis->fDebugEnabled) 3356 { 3357 drvAudioDbgPCMDelete(pThis, pThis->szDebugPathOut, "StreamRead.pcm"); 3358 drvAudioDbgPCMDelete(pThis, pThis->szDebugPathOut, "StreamWrite.pcm"); 3359 drvAudioDbgPCMDelete(pThis, pThis->szDebugPathOut, "PlayNonInterleaved.pcm"); 3360 drvAudioDbgPCMDelete(pThis, pThis->szDebugPathOut, "CaptureNonInterleaved.pcm"); 3361 } 3369 3362 } 3370 3363 -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r69119 r69956 29 29 #include <VBox/vmm/pdm.h> 30 30 #include <VBox/vmm/pdmaudioifs.h> 31 32 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA33 # ifdef RT_OS_WINDOWS34 # define VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "c:\\temp\\"35 # else36 # define VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "/tmp/"37 # endif38 #endif39 31 40 32 typedef enum … … 115 107 DRVAUDIOSTATS Stats; 116 108 #endif 109 /** Whether audio debugging is enabled or not. */ 110 bool fDebugEnabled; 111 /** Where to store the debugging files. 112 * Defaults to VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH if not set. */ 113 char szDebugPathOut[RTPATH_MAX + 1]; 117 114 struct 118 115 { -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r69054 r69956 72 72 #include <VBox/param.h> 73 73 #include <VBox/vmm/pdmapi.h> /* For PDMR3DriverAttach/PDMR3DriverDetach. */ 74 #include <VBox/vmm/pdmaudioifs.h> 74 75 #include <VBox/vmm/pdmusb.h> /* For PDMR3UsbCreateEmulatedDevice. */ 75 76 #include <VBox/vmm/pdmdev.h> /* For PDMAPICMODE enum. */ … … 2906 2907 } 2907 2908 2909 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/Debug/Enabled", &strTmp); 2910 bool fDebugEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1"); 2911 2912 Utf8Str strDebugPathOut; 2913 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/Debug/PathOut", &strDebugPathOut); 2914 if (strDebugPathOut.isEmpty()) 2915 strDebugPathOut = VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH; 2916 2908 2917 /* 2909 2918 * The audio driver. … … 2980 2989 uint8_t u8AudioLUN = 0; 2981 2990 2991 BOOL fAudioEnabledIn = FALSE; 2992 hrc = audioAdapter->COMGETTER(EnabledIn)(&fAudioEnabledIn); H(); 2993 BOOL fAudioEnabledOut = FALSE; 2994 hrc = audioAdapter->COMGETTER(EnabledOut)(&fAudioEnabledOut); H(); 2995 2982 2996 CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%RU8", u8AudioLUN++); 2983 2997 InsertConfigString(pLunL0, "Driver", "AUDIO"); 2984 2998 InsertConfigNode(pLunL0, "Config", &pCfg); 2985 2999 2986 InsertConfigString(pCfg, "DriverName", strAudioDriver.c_str()); 2987 2988 BOOL fAudioEnabledIn = FALSE; 2989 hrc = audioAdapter->COMGETTER(EnabledIn)(&fAudioEnabledIn); H(); 3000 InsertConfigString (pCfg, "DriverName", strAudioDriver.c_str()); 2990 3001 InsertConfigInteger(pCfg, "InputEnabled", fAudioEnabledIn); 2991 2992 BOOL fAudioEnabledOut = FALSE;2993 hrc = audioAdapter->COMGETTER(EnabledOut)(&fAudioEnabledOut); H();2994 3002 InsertConfigInteger(pCfg, "OutputEnabled", fAudioEnabledOut); 3003 InsertConfigInteger(pCfg, "DebugEnabled", fDebugEnabled); 3004 InsertConfigString (pCfg, "DebugPathOut", strDebugPathOut); 2995 3005 2996 3006 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); … … 3014 3024 InsertConfigInteger(pCfg, "InputEnabled", fAudioEnabledIn); 3015 3025 InsertConfigInteger(pCfg, "OutputEnabled", fAudioEnabledOut); 3026 InsertConfigInteger(pCfg, "DebugEnabled", fDebugEnabled); 3027 InsertConfigString (pCfg, "DebugPathOut", strDebugPathOut); 3016 3028 3017 3029 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); … … 3036 3048 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/Debug/Enabled", &strTmp); 3037 3049 3038 if (!strTmp.isEmpty()) 3039 { 3040 LogRel(("Audio: Debugging enabled\n")); 3041 3050 if (fDebugEnabled) 3051 { 3042 3052 #ifdef VBOX_WITH_AUDIO_DEBUG 3043 3053 /* … … 3050 3060 InsertConfigInteger(pCfg, "InputEnabled", fAudioEnabledIn); 3051 3061 InsertConfigInteger(pCfg, "OutputEnabled", fAudioEnabledOut); 3062 InsertConfigInteger(pCfg, "DebugEnabled", fDebugEnabled); 3063 InsertConfigString (pCfg, "DebugPathOut", strDebugPathOut); 3052 3064 3053 3065 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); … … 3085 3097 InsertConfigInteger(pCfg, "InputEnabled", fAudioEnabledIn); 3086 3098 InsertConfigInteger(pCfg, "OutputEnabled", fAudioEnabledOut); 3099 InsertConfigInteger(pCfg, "DebugEnabled", fDebugEnabled); 3100 InsertConfigString (pCfg, "DebugPathOut", strDebugPathOut); 3087 3101 3088 3102 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1);
Note:
See TracChangeset
for help on using the changeset viewer.