VirtualBox

Changeset 89191 in vbox for trunk


Ignore:
Timestamp:
May 19, 2021 11:52:08 PM (4 years ago)
Author:
vboxsync
Message:

DrvAudio: Slimmed down the DRVAUDIO structure a little in preparation of locking changes (sketched). bugref:9890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r89184 r89191  
    151151    uintptr_t               uMagic;
    152152
    153     /** List entry in DRVAUDIO::lstStreams. */
     153    /** List entry in DRVAUDIO::LstStreams. */
    154154    RTLISTNODE              ListEntry;
    155155
     
    304304        char             szPathOut[RTPATH_MAX];
    305305    } Dbg;
    306 } DRVAUDIOCFG, *PDRVAUDIOCFG;
     306} DRVAUDIOCFG;
     307/** Pointer to tweakable audio configuration. */
     308typedef DRVAUDIOCFG *PDRVAUDIOCFG;
     309/** Pointer to const tweakable audio configuration. */
     310typedef DRVAUDIOCFG const *PCDRVAUDIOCFG;
     311
    307312
    308313/**
     
    313318typedef struct DRVAUDIO
    314319{
    315     /** Friendly name of the driver. */
    316     char                    szName[64];
    317     /** Critical section for serializing access.
    318      * @todo r=bird: This needs to be split up and introduce stream-level locking so
    319      *       that different AIO threads can work in parallel (e.g. input &
    320      *       output, or two output streams).  Maybe put a critect in
    321      *       PDMAUDIOSTREAM? */
     320    /** Critical section for protecting:
     321     *      - LstStreams
     322     *      - In.fEnabled
     323     *      - In.cStreamsFree
     324     *      - Out.fEnabled
     325     *      - Out.cStreamsFree
     326     */
    322327    RTCRITSECT              CritSect;
    323     /** Shutdown indicator. */
    324     bool                    fTerminate;
     328    /** List of audio streams (DRVAUDIOSTREAM). */
     329    RTLISTANCHOR            LstStreams;
     330    struct
     331    {
     332        /** Whether this driver's input streams are enabled or not.
     333         *  This flag overrides all the attached stream statuses. */
     334        bool                fEnabled;
     335        /** Max. number of free input streams.
     336         *  UINT32_MAX for unlimited streams. */
     337        uint32_t            cStreamsFree;
     338    } In;
     339    struct
     340    {
     341        /** Whether this driver's output streams are enabled or not.
     342         *  This flag overrides all the attached stream statuses. */
     343        bool                fEnabled;
     344        /** Max. number of free output streams.
     345         *  UINT32_MAX for unlimited streams. */
     346        uint32_t            cStreamsFree;
     347    } Out;
     348
     349    /** Audio configuration settings retrieved from the backend.
     350     * The szName field is used for the DriverName config value till we get the
     351     * authoritative name from the backend (only for logging). */
     352    PDMAUDIOBACKENDCFG      BackendCfg;
    325353    /** Our audio connector interface. */
    326354    PDMIAUDIOCONNECTOR      IAudioConnector;
     
    331359    /** Pointer to audio driver below us. */
    332360    PPDMIHOSTAUDIO          pHostDrvAudio;
    333     /** List of audio streams (DRVAUDIOSTREAM). */
    334     RTLISTANCHOR            lstStreams;
    335     /** Audio configuration settings retrieved from the backend. */
    336     PDMAUDIOBACKENDCFG      BackendCfg;
    337     struct
    338     {
    339         /** Whether this driver's input streams are enabled or not.
    340          *  This flag overrides all the attached stream statuses. */
    341         bool                fEnabled;
    342         /** Max. number of free input streams.
    343          *  UINT32_MAX for unlimited streams. */
    344         uint32_t            cStreamsFree;
    345         /** The driver's input confguration (tweakable via CFGM). */
    346         DRVAUDIOCFG         Cfg;
    347     } In;
    348     struct
    349     {
    350         /** Whether this driver's output streams are enabled or not.
    351          *  This flag overrides all the attached stream statuses. */
    352         bool                fEnabled;
    353         /** Max. number of free output streams.
    354          *  UINT32_MAX for unlimited streams. */
    355         uint32_t            cStreamsFree;
    356         /** The driver's output confguration (tweakable via CFGM). */
    357         DRVAUDIOCFG         Cfg;
    358         /** Number of times underruns triggered re-(pre-)buffering. */
    359         STAMCOUNTER         StatsReBuffering;
    360     } Out;
    361361
    362362    /** Request pool if the backend needs it for async stream creation. */
    363363    RTREQPOOL               hReqPool;
    364 
    365 #ifdef VBOX_WITH_AUDIO_ENUM
    366     /** Handle to the timer for delayed re-enumeration of backend devices. */
    367     TMTIMERHANDLE           hEnumTimer;
    368     /** Unique name for the the disable-iteration timer.  */
    369     char                    szEnumTimerName[24];
    370 #endif
    371364
    372365#ifdef VBOX_WITH_STATISTICS
     
    381374    } Stats;
    382375#endif
     376
     377#ifdef VBOX_WITH_AUDIO_ENUM
     378    /** Handle to the timer for delayed re-enumeration of backend devices. */
     379    TMTIMERHANDLE           hEnumTimer;
     380    /** Unique name for the the disable-iteration timer.  */
     381    char                    szEnumTimerName[24];
     382#endif
     383
     384    /** Input audio configuration values (static). */
     385    DRVAUDIOCFG             CfgIn;
     386    /** Output audio configuration values (static). */
     387    DRVAUDIOCFG             CfgOut;
    383388} DRVAUDIO;
    384389/** Pointer to the instance data of an audio driver. */
    385390typedef DRVAUDIO *PDRVAUDIO;
     391/** Pointer to const instance data of an audio driver. */
     392typedef DRVAUDIO const *PCDRVAUDIO;
    386393
    387394
     
    700707        {
    701708            if (fLog)
    702                 LogRel(("Audio: Found %RU16 devices for driver '%s'\n", DevEnum.cDevices, pThis->szName));
     709                LogRel(("Audio: Found %RU16 devices for driver '%s'\n", DevEnum.cDevices, pThis->BackendCfg.szName));
    703710
    704711            PPDMAUDIOHOSTDEV pDev;
     
    724731        {
    725732            if (fLog)
    726                 LogRel(("Audio: Device enumeration for driver '%s' failed with %Rrc\n", pThis->szName, rc));
     733                LogRel(("Audio: Device enumeration for driver '%s' failed with %Rrc\n", pThis->BackendCfg.szName, rc));
    727734            /* Not fatal. */
    728735        }
     
    733740
    734741        if (fLog)
    735             LogRel2(("Audio: Host driver '%s' does not support audio device enumeration, skipping\n", pThis->szName));
     742            LogRel2(("Audio: Host driver '%s' does not support audio device enumeration, skipping\n", pThis->BackendCfg.szName));
    736743    }
    737744
     
    775782    {
    776783        LogRel(("Audio: %s %s for driver '%s'\n",
    777                 fEnable ? "Enabling" : "Disabling", enmDir == PDMAUDIODIR_IN ? "input" : "output", pThis->szName));
     784                fEnable ? "Enabling" : "Disabling", enmDir == PDMAUDIODIR_IN ? "input" : "output", pThis->BackendCfg.szName));
    778785
    779786        /*
     
    793800         */
    794801        PDRVAUDIOSTREAM pStreamEx;
    795         RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
     802        RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
    796803        {
    797804            if (pStreamEx->Core.enmDir == enmDir)
     
    977984 * @param   pszName     Stream name to use when logging warnings and errors.
    978985 */
    979 static int drvAudioStreamAdjustConfig(PDRVAUDIO pThis, PPDMAUDIOSTREAMCFG pCfgReq, const char *pszName)
     986static int drvAudioStreamAdjustConfig(PCDRVAUDIO pThis, PPDMAUDIOSTREAMCFG pCfgReq, const char *pszName)
    980987{
    981988    /* Get the right configuration for the stream to be created. */
    982     PDRVAUDIOCFG pDrvCfg = pCfgReq->enmDir == PDMAUDIODIR_IN ? &pThis->In.Cfg : &pThis->Out.Cfg;
     989    PCDRVAUDIOCFG pDrvCfg = pCfgReq->enmDir == PDMAUDIODIR_IN ? &pThis->CfgIn: &pThis->CfgOut;
    983990
    984991    /* Fill in the tweakable parameters into the requested host configuration.
     
    17731780                    bool fDone = true;
    17741781                    PDRVAUDIOSTREAM pIt;
    1775                     RTListForEach(&pThis->lstStreams, pIt, DRVAUDIOSTREAM, ListEntry)
     1782                    RTListForEach(&pThis->LstStreams, pIt, DRVAUDIOSTREAM, ListEntry)
    17761783                    {
    17771784                        if (strcmp(pIt->Core.szName, pStreamEx->Core.szName) == 0)
     
    18151822                 * We're good.
    18161823                 */
    1817                 RTListAppend(&pThis->lstStreams, &pStreamEx->ListEntry);
     1824                RTListAppend(&pThis->LstStreams, &pStreamEx->ListEntry);
    18181825                STAM_COUNTER_INC(&pThis->Stats.TotalStreamsCreated);
    18191826                *ppStream = &pStreamEx->Core;
     
    18241831                if (pCfgHost->enmDir == PDMAUDIODIR_IN)
    18251832                {
    1826                     if (pThis->In.Cfg.Dbg.fEnabled)
     1833                    if (pThis->CfgIn.Dbg.fEnabled)
    18271834                    {
    1828                         AudioHlpFileCreateAndOpen(&pStreamEx->In.Dbg.pFileCaptureNonInterleaved, pThis->In.Cfg.Dbg.szPathOut,
     1835                        AudioHlpFileCreateAndOpen(&pStreamEx->In.Dbg.pFileCaptureNonInterleaved, pThis->CfgIn.Dbg.szPathOut,
    18291836                                                  "DrvAudioCapNonInt", pThis->pDrvIns->iInstance, &pStreamEx->Host.Cfg.Props);
    1830                         AudioHlpFileCreateAndOpen(&pStreamEx->In.Dbg.pFileStreamRead, pThis->In.Cfg.Dbg.szPathOut,
     1837                        AudioHlpFileCreateAndOpen(&pStreamEx->In.Dbg.pFileStreamRead, pThis->CfgIn.Dbg.szPathOut,
    18311838                                                  "DrvAudioRead", pThis->pDrvIns->iInstance, &pStreamEx->Host.Cfg.Props);
    18321839                    }
     
    18341841                else /* Out */
    18351842                {
    1836                     if (pThis->Out.Cfg.Dbg.fEnabled)
     1843                    if (pThis->CfgOut.Dbg.fEnabled)
    18371844                    {
    1838                         AudioHlpFileCreateAndOpen(&pStreamEx->Out.Dbg.pFilePlayNonInterleaved, pThis->Out.Cfg.Dbg.szPathOut,
     1845                        AudioHlpFileCreateAndOpen(&pStreamEx->Out.Dbg.pFilePlayNonInterleaved, pThis->CfgOut.Dbg.szPathOut,
    18391846                                                  "DrvAudioPlayNonInt", pThis->pDrvIns->iInstance, &pStreamEx->Host.Cfg.Props);
    1840                         AudioHlpFileCreateAndOpen(&pStreamEx->Out.Dbg.pFileStreamWrite, pThis->Out.Cfg.Dbg.szPathOut,
     1847                        AudioHlpFileCreateAndOpen(&pStreamEx->Out.Dbg.pFileStreamWrite, pThis->CfgOut.Dbg.szPathOut,
    18411848                                                  "DrvAudioWrite", pThis->pDrvIns->iInstance, &pStreamEx->Host.Cfg.Props);
    18421849                    }
     
    19761983    if (pStreamEx->Core.enmDir == PDMAUDIODIR_IN)
    19771984    {
    1978         if (pThis->In.Cfg.Dbg.fEnabled)
     1985        if (pThis->CfgIn.Dbg.fEnabled)
    19791986        {
    19801987            AudioHlpFileDestroy(pStreamEx->In.Dbg.pFileCaptureNonInterleaved);
     
    19881995    {
    19891996        Assert(pStreamEx->Core.enmDir == PDMAUDIODIR_OUT);
    1990         if (pThis->Out.Cfg.Dbg.fEnabled)
     1997        if (pThis->CfgOut.Dbg.fEnabled)
    19911998        {
    19921999            AudioHlpFileDestroy(pStreamEx->Out.Dbg.pFilePlayNonInterleaved);
     
    32173224                {
    32183225                    if (fDisabled)
    3219                         LogRel(("Audio: Input for driver '%s' has been disabled, returning silence\n", pThis->szName));
     3226                        LogRel(("Audio: Input for driver '%s' has been disabled, returning silence\n", pThis->BackendCfg.szName));
    32203227                    else
    32213228                        LogRel(("Audio: Warning: Input for stream '%s' of driver '%s' not ready (current input status is %s), returning silence\n",
    3222                                 pStreamEx->Core.szName, pThis->szName, PDMHostAudioStreamStateGetName(enmBackendState) ));
     3229                                pStreamEx->Core.szName, pThis->BackendCfg.szName, PDMHostAudioStreamStateGetName(enmBackendState) ));
    32233230
    32243231                    pStreamEx->Core.fWarningsShown |= PDMAUDIOSTREAM_WARN_FLAGS_DISABLED;
     
    35363543            }
    35373544
    3538             if (!pThis->Out.Cfg.Dbg.fEnabled || RT_FAILURE(rc))
     3545            if (!pThis->CfgOut.Dbg.fEnabled || RT_FAILURE(rc))
    35393546            { /* likely */ }
    35403547            else
     
    36283635            if (cfReadTotal)
    36293636            {
    3630                 if (pThis->In.Cfg.Dbg.fEnabled)
     3637                if (pThis->CfgIn.Dbg.fEnabled)
    36313638                    AudioHlpFileWrite(pStreamEx->In.Dbg.pFileStreamRead,
    36323639                                      pvBuf, AUDIOMIXBUF_F2B(&pStreamEx->Guest.MixBuf, cfReadTotal), 0 /* fFlags */);
     
    37343741        }
    37353742
    3736         if (pThis->In.Cfg.Dbg.fEnabled)
     3743        if (pThis->CfgIn.Dbg.fEnabled)
    37373744            AudioHlpFileWrite(pStreamEx->In.Dbg.pFileCaptureNonInterleaved, abChunk, cbCaptured, 0 /* fFlags */);
    37383745
     
    40394046    PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IHostAudioPort);
    40404047    AssertReturnVoid(enmDir == PDMAUDIODIR_IN || enmDir == PDMAUDIODIR_OUT);
    4041     LogRel(("Audio: The %s device for %s is changing.\n", enmDir == PDMAUDIODIR_IN ? "input" : "output", pThis->szName));
     4048    LogRel(("Audio: The %s device for %s is changing.\n", enmDir == PDMAUDIODIR_IN ? "input" : "output", pThis->BackendCfg.szName));
    40424049
    40434050    RTCritSectEnter(&pThis->CritSect);
    40444051    PDRVAUDIOSTREAM pStreamEx;
    4045     RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
     4052    RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
    40464053    {
    40474054        if (pStreamEx->Core.enmDir == enmDir)
     
    42194226{
    42204227    PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IHostAudioPort);
    4221     LogRel(("Audio: Device configuration of driver '%s' has changed\n", pThis->szName));
     4228    LogRel(("Audio: Device configuration of driver '%s' has changed\n", pThis->BackendCfg.szName));
    42224229
    42234230#ifdef RT_OS_DARWIN /** @todo Remove legacy behaviour: */
     
    42254232    /* Mark all host streams to re-initialize. */
    42264233    PDRVAUDIOSTREAM pStreamEx;
    4227     RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
     4234    RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
    42284235    {
    42294236        drvAudioStreamMarkNeedReInit(pStreamEx, __PRETTY_FUNCTION__);
     
    42894296         */
    42904297        PDRVAUDIOSTREAM pStreamEx;
    4291         RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
     4298        RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
    42924299        {
    42934300            drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE);
     
    43214328    AssertRC(rc);
    43224329
    4323     LogFunc(("%s (detached %p, hReqPool=%p)\n", pThis->szName, pThis->pHostDrvAudio, pThis->hReqPool));
     4330    LogFunc(("%s (detached %p, hReqPool=%p)\n", pThis->BackendCfg.szName, pThis->pHostDrvAudio, pThis->hReqPool));
    43244331
    43254332    /*
     
    43834390    /*
    43844391     * Get the backend configuration.
    4385      */
    4386     int rc = pIHostDrvAudio->pfnGetConfig(pIHostDrvAudio, &pThis->BackendCfg);
    4387     if (RT_FAILURE(rc))
    4388     {
    4389         LogRel(("Audio: Getting configuration for driver '%s' failed with %Rrc\n", pThis->szName, rc));
     4392     * Note! Take care not to wipe the DriverName config value on failure.
     4393     */
     4394    PDMAUDIOBACKENDCFG BackendCfg;
     4395    RT_ZERO(BackendCfg);
     4396    int rc = pIHostDrvAudio->pfnGetConfig(pIHostDrvAudio, &BackendCfg);
     4397    if (RT_SUCCESS(rc))
     4398    {
     4399        if (LogIsEnabled() && strcmp(BackendCfg.szName, pThis->BackendCfg.szName) != 0)
     4400            LogFunc(("BackendCfg.szName: '%s' -> '%s'\n", pThis->BackendCfg.szName, BackendCfg.szName));
     4401        pThis->BackendCfg       = BackendCfg;
     4402        pThis->In.cStreamsFree  = BackendCfg.cMaxStreamsIn;
     4403        pThis->Out.cStreamsFree = BackendCfg.cMaxStreamsOut;
     4404
     4405        LogFlowFunc(("cStreamsFreeIn=%RU8, cStreamsFreeOut=%RU8\n", pThis->In.cStreamsFree, pThis->Out.cStreamsFree));
     4406    }
     4407    else
     4408    {
     4409        LogRel(("Audio: Getting configuration for driver '%s' failed with %Rrc\n", pThis->BackendCfg.szName, rc));
    43904410        return VERR_AUDIO_BACKEND_INIT_FAILED;
    43914411    }
    43924412
    4393     pThis->In.cStreamsFree  = pThis->BackendCfg.cMaxStreamsIn;
    4394     pThis->Out.cStreamsFree = pThis->BackendCfg.cMaxStreamsOut;
    4395 
    4396     LogFlowFunc(("cStreamsFreeIn=%RU8, cStreamsFreeOut=%RU8\n", pThis->In.cStreamsFree, pThis->Out.cStreamsFree));
    4397 
    43984413    LogRel2(("Audio: Host driver '%s' supports %RU32 input streams and %RU32 output streams at once.\n",
    4399              pThis->szName, pThis->In.cStreamsFree, pThis->Out.cStreamsFree));
     4414             pThis->BackendCfg.szName, pThis->In.cStreamsFree, pThis->Out.cStreamsFree));
    44004415
    44014416#ifdef VBOX_WITH_AUDIO_ENUM
     
    44864501        else
    44874502        {
    4488             LogRel(("Audio: Failed to query interface for underlying host driver '%s'\n", pThis->szName));
     4503            LogRel(("Audio: Failed to query interface for underlying host driver '%s'\n", pThis->BackendCfg.szName));
    44894504            rc = PDMDRV_SET_ERROR(pThis->pDrvIns, VERR_PDM_MISSING_INTERFACE_BELOW,
    44904505                                  N_("The host audio driver does not implement PDMIHOSTAUDIO!"));
     
    45064521        /* Complain: */
    45074522        LogRel(("DrvAudio: Host audio driver '%s' init failed with %Rrc. Switching to the NULL driver for now.\n",
    4508                 pThis->szName, rc));
     4523                pThis->BackendCfg.szName, rc));
    45094524        PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "HostAudioNotResponding",
    45104525                                   N_("Host audio backend (%s) initialization has failed. Selecting the NULL audio backend with the consequence that no sound is audible"),
    4511                                    pThis->szName);
     4526                                   pThis->BackendCfg.szName);
    45124527
    45134528        /* Replace with null audio: */
    45144529        pThis->pHostDrvAudio = (PPDMIHOSTAUDIO)&g_DrvHostAudioNull;
    4515         RTStrCopy(pThis->szName, sizeof(pThis->szName), "NULL");
     4530        RTStrCopy(pThis->BackendCfg.szName, sizeof(pThis->BackendCfg.szName), "NULL");
    45164531        rc = drvAudioHostInit(pThis);
    45174532        AssertRC(rc);
    45184533    }
    45194534
    4520     LogFunc(("[%s] rc=%Rrc\n", pThis->szName, rc));
     4535    LogFunc(("[%s] rc=%Rrc\n", pThis->BackendCfg.szName, rc));
    45214536    return rc;
    45224537}
     
    45334548    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    45344549    PDRVAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIO);
    4535     LogFunc(("%s\n", pThis->szName));
     4550    LogFunc(("%s\n", pThis->BackendCfg.szName));
    45364551
    45374552    int rc = RTCritSectEnter(&pThis->CritSect);
     
    45634578    {
    45644579        PDRVAUDIOSTREAM pStreamEx;
    4565         RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
     4580        RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
    45664581        {
    45674582            drvAudioStreamControlInternal(pThis, pStreamEx, enmCmd);
     
    46264641
    46274642    PDRVAUDIOSTREAM pStreamEx, pStreamExNext;
    4628     RTListForEachSafe(&pThis->lstStreams, pStreamEx, pStreamExNext, DRVAUDIOSTREAM, ListEntry)
     4643    RTListForEachSafe(&pThis->LstStreams, pStreamEx, pStreamExNext, DRVAUDIOSTREAM, ListEntry)
    46294644    {
    46304645        int rc = drvAudioStreamUninitInternal(pThis, pStreamEx);
     
    46374652
    46384653    /* Sanity. */
    4639     Assert(RTListIsEmpty(&pThis->lstStreams));
     4654    Assert(RTListIsEmpty(&pThis->LstStreams));
    46404655
    46414656    if (RTCritSectIsInitialized(&pThis->CritSect))
     
    46484663    }
    46494664
    4650     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Out.StatsReBuffering);
    46514665#ifdef VBOX_WITH_STATISTICS
    46524666    PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalStreamsActive);
     
    46824696     * Basic instance init.
    46834697     */
    4684     RTListInit(&pThis->lstStreams);
     4698    RTListInit(&pThis->LstStreams);
    46854699    pThis->hReqPool = NIL_RTREQPOOL;
    46864700
     
    47134727                                  "In|Out");
    47144728
    4715     int rc = CFGMR3QueryStringDef(pCfg, "DriverName", pThis->szName, sizeof(pThis->szName), "Untitled");
     4729    int rc = CFGMR3QueryStringDef(pCfg, "DriverName", pThis->BackendCfg.szName, sizeof(pThis->BackendCfg.szName), "Untitled");
    47164730    AssertLogRelRCReturn(rc, rc);
    47174731
     
    47244738
    47254739    /* Debug stuff (same for both directions). */
    4726     rc = CFGMR3QueryBoolDef(pCfg, "DebugEnabled", &pThis->In.Cfg.Dbg.fEnabled, false);
     4740    rc = CFGMR3QueryBoolDef(pCfg, "DebugEnabled", &pThis->CfgIn.Dbg.fEnabled, false);
    47274741    AssertLogRelRCReturn(rc, rc);
    47284742
    4729     rc = CFGMR3QueryStringDef(pCfg, "DebugPathOut", pThis->In.Cfg.Dbg.szPathOut, sizeof(pThis->In.Cfg.Dbg.szPathOut), "");
     4743    rc = CFGMR3QueryStringDef(pCfg, "DebugPathOut", pThis->CfgIn.Dbg.szPathOut, sizeof(pThis->CfgIn.Dbg.szPathOut), "");
    47304744    AssertLogRelRCReturn(rc, rc);
    4731     if (pThis->In.Cfg.Dbg.szPathOut[0] == '\0')
    4732     {
    4733         rc = RTPathTemp(pThis->In.Cfg.Dbg.szPathOut, sizeof(pThis->In.Cfg.Dbg.szPathOut));
     4745    if (pThis->CfgIn.Dbg.szPathOut[0] == '\0')
     4746    {
     4747        rc = RTPathTemp(pThis->CfgIn.Dbg.szPathOut, sizeof(pThis->CfgIn.Dbg.szPathOut));
    47344748        if (RT_FAILURE(rc))
    47354749        {
    47364750            LogRel(("Audio: Warning! Failed to retrieve temporary directory: %Rrc - disabling debugging.\n", rc));
    4737             pThis->In.Cfg.Dbg.szPathOut[0] = '\0';
    4738             pThis->In.Cfg.Dbg.fEnabled = false;
    4739         }
    4740     }
    4741     if (pThis->In.Cfg.Dbg.fEnabled)
    4742         LogRel(("Audio: Debugging for driver '%s' enabled (audio data written to '%s')\n", pThis->szName, pThis->In.Cfg.Dbg.szPathOut));
     4751            pThis->CfgIn.Dbg.szPathOut[0] = '\0';
     4752            pThis->CfgIn.Dbg.fEnabled = false;
     4753        }
     4754    }
     4755    if (pThis->CfgIn.Dbg.fEnabled)
     4756        LogRel(("Audio: Debugging for driver '%s' enabled (audio data written to '%s')\n",
     4757                pThis->BackendCfg.szName, pThis->CfgIn.Dbg.szPathOut));
    47434758
    47444759    /* Copy debug setup to the output direction. */
    4745     pThis->Out.Cfg.Dbg = pThis->In.Cfg.Dbg;
    4746 
    4747     LogRel2(("Audio: Verbose logging for driver '%s' is probably enabled too.\n", pThis->szName));
     4760    pThis->CfgOut.Dbg = pThis->CfgIn.Dbg;
     4761
     4762    LogRel2(("Audio: Verbose logging for driver '%s' is probably enabled too.\n", pThis->BackendCfg.szName));
    47484763    /* This ^^^^^^^ is the *WRONG* place for that kind of statement. Verbose logging might only be enabled for DrvAudio. */
    47494764    LogRel2(("Audio: Initial status for driver '%s' is: input is %s, output is %s\n",
    4750              pThis->szName, pThis->In.fEnabled ? "enabled" : "disabled", pThis->Out.fEnabled ? "enabled" : "disabled"));
     4765             pThis->BackendCfg.szName, pThis->In.fEnabled ? "enabled" : "disabled", pThis->Out.fEnabled ? "enabled" : "disabled"));
    47514766
    47524767    /*
     
    47574772    {
    47584773        char         szNm[48];
    4759         PDRVAUDIOCFG pAudioCfg = iDir == 0 ? &pThis->In.Cfg : &pThis->Out.Cfg;
     4774        PDRVAUDIOCFG pAudioCfg = iDir == 0 ? &pThis->CfgIn : &pThis->CfgOut;
    47604775        const char  *pszDir    = iDir == 0 ? "In"           : "Out";
    47614776
     
    48404855    AssertRCReturn(rc, rc);
    48414856
    4842     pThis->fTerminate                           = false;
    48434857    pThis->pDrvIns                              = pDrvIns;
    48444858    /* IBase. */
     
    48744888     * Statistics.
    48754889     */
    4876     PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Out.StatsReBuffering, "OutputReBuffering",
    4877                               STAMUNIT_COUNT, "Number of times the output stream was re-buffered after starting.");
    4878 
    48794890#ifdef VBOX_WITH_STATISTICS
    48804891    PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalStreamsActive,   "TotalStreamsActive",
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette