VirtualBox

Changeset 102612 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Dec 15, 2023 12:36:51 PM (12 months ago)
Author:
vboxsync
Message:

Audio/WAS: Attempt to fix crashes when invalidating the cached audio interfaces of the device entry configurations. This is needed when the audio interface becomes invalid on a host device switch. Extended logging a bit. ​bugref:10503

File:
1 edited

Legend:

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

    r102596 r102612  
    815815 * Invalidates device cache entry configurations.
    816816 *
     817 * This is needed in order to not run into deadlocks when trying to release a stale device interface
     818 * via Release().
     819 *
    817820 * @param   pThis       The WASAPI host audio driver instance data.
    818821 * @param   pDevEntry   The device entry to invalidate.
     
    841844    PDRVHOSTAUDIOWASCACHEDEVCFG pDevCfg, pDevCfgNext;
    842845    RTListForEachSafe(&pDevEntry->ConfigList, pDevCfg, pDevCfgNext, DRVHOSTAUDIOWASCACHEDEVCFG, ListEntry)
    843     {
    844846        drvHostAudioWasCacheDestroyDevConfig(pThis, pDevCfg);
    845     }
    846847
    847848    uint32_t cDevRefs = 0;
     
    12621263                if (pIDevice != pDevEntry->pIDevice)
    12631264                {
    1264                     Log2Func(("Cache hit for device '%ls': Stale interface (new: %p, old: %p)\n",
     1265                    LogRel2(("WasAPI: Cache hit for device '%ls': Stale interface (new: %p, old: %p)\n",
    12651266                              pDevEntry->wszDevId, pIDevice, pDevEntry->pIDevice));
    12661267
     
    12751276                }
    12761277
     1278                LogRel2(("WasAPI: Cache hit for device '%ls' (%p)\n", pwszDevId, pIDevice));
     1279
    12771280                CoTaskMemFree(pwszDevId);
    1278                 Log8Func(("Cache hit for device '%ls': %p\n", pDevEntry->wszDevId, pDevEntry));
     1281                pwszDevId = NULL;
     1282
    12791283                return drvHostAudioWasCacheLookupOrCreateConfig(pThis, pDevEntry, pCfgReq, fOnWorker, ppDevCfg);
    12801284            }
     
    12821286        RTCritSectLeave(&pThis->CritSectCache);
    12831287
    1284         if (pDevEntry)
    1285             Log8Func(("Cache miss for device '%ls': %p\n", pDevEntry->wszDevId, pDevEntry));
     1288        LogRel2(("WasAPI: Cache miss for device '%ls' (%p)\n", pwszDevId, pIDevice));
    12861289
    12871290        /*
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