VirtualBox

Changeset 82319 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Dec 2, 2019 12:30:24 PM (5 years ago)
Author:
vboxsync
Message:

DevHDA,DevIchAc97: Use devhlp for CFGMR3 functions. Don't pass empty DebugPathOut to devices (ConsoleImpl2.cpp). bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r82252 r82319  
    28432843        if (fAudioEnabled)
    28442844        {
    2845             Utf8Str strAudioDevice;
    2846 
    2847             AudioControllerType_T audioController;
    2848             hrc = audioAdapter->COMGETTER(AudioController)(&audioController);               H();
    2849             AudioCodecType_T audioCodec;
    2850             hrc = audioAdapter->COMGETTER(AudioCodec)(&audioCodec);                         H();
     2845            AudioControllerType_T enmAudioController;
     2846            hrc = audioAdapter->COMGETTER(AudioController)(&enmAudioController);            H();
     2847            AudioCodecType_T enmAudioCodec;
     2848            hrc = audioAdapter->COMGETTER(AudioCodec)(&enmAudioCodec);                      H();
    28512849
    28522850            GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/Audio/Debug/Enabled", &strTmp);
    2853             const uint64_t fDebugEnabled = (strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1")) ? 1 : 0;
     2851            const bool fDebugEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1");
    28542852
    28552853            Utf8Str strDebugPathOut;
     
    28592857             *        without duplicating (more) code. */
    28602858
    2861             switch (audioController)
     2859            const char *pszAudioDevice;
     2860            switch (enmAudioController)
    28622861            {
    28632862                case AudioControllerType_AC97:
    28642863                {
    28652864                    /* ICH AC'97. */
    2866                     strAudioDevice = "ichac97";
    2867 
    2868                     InsertConfigNode   (pDevices, strAudioDevice.c_str(),  &pDev);
    2869                     InsertConfigNode   (pDev,     "0",                     &pInst);
    2870                     InsertConfigInteger(pInst,    "Trusted",               1); /* boolean */
    2871                     hrc = pBusMgr->assignPCIDevice(strAudioDevice.c_str(), pInst);          H();
    2872                     InsertConfigNode   (pInst,    "Config",                &pCfg);
    2873                     switch (audioCodec)
     2865                    pszAudioDevice = "ichac97";
     2866
     2867                    InsertConfigNode(pDevices,      pszAudioDevice,         &pDev);
     2868                    InsertConfigNode(pDev,          "0",                    &pInst);
     2869                    InsertConfigInteger(pInst,      "Trusted",              1); /* boolean */
     2870                    hrc = pBusMgr->assignPCIDevice(pszAudioDevice, pInst);              H();
     2871                    InsertConfigNode(pInst,         "Config",               &pCfg);
     2872                    switch (enmAudioCodec)
    28742873                    {
    28752874                        case AudioCodecType_STAC9700:
    2876                             InsertConfigString(pCfg,   "Codec", "STAC9700");
     2875                            InsertConfigString(pCfg, "Codec",              "STAC9700");
    28772876                            break;
    28782877                        case AudioCodecType_AD1980:
    2879                             InsertConfigString(pCfg,   "Codec", "AD1980");
     2878                            InsertConfigString(pCfg, "Codec",              "AD1980");
    28802879                            break;
    28812880                        default: AssertFailedBreak();
    28822881                    }
    2883                     InsertConfigInteger(pCfg, "DebugEnabled", fDebugEnabled);
    2884                     InsertConfigString (pCfg, "DebugPathOut", strDebugPathOut);
     2882                    InsertConfigInteger(pCfg,       "DebugEnabled",         fDebugEnabled);
     2883                    if (strDebugPathOut.isNotEmpty())
     2884                        InsertConfigString(pCfg,    "DebugPathOut",         strDebugPathOut);
    28852885                    break;
    28862886                }
     
    28882888                {
    28892889                    /* Legacy SoundBlaster16. */
    2890                     strAudioDevice = "sb16";
    2891 
    2892                     InsertConfigNode   (pDevices, strAudioDevice.c_str(), &pDev);
    2893                     InsertConfigNode   (pDev,     "0", &pInst);
    2894                     InsertConfigInteger(pInst,    "Trusted",              1); /* boolean */
    2895                     InsertConfigNode   (pInst,    "Config",               &pCfg);
    2896                     InsertConfigInteger(pCfg,     "IRQ",                  5);
    2897                     InsertConfigInteger(pCfg,     "DMA",                  1);
    2898                     InsertConfigInteger(pCfg,     "DMA16",                5);
    2899                     InsertConfigInteger(pCfg,     "Port",                 0x220);
    2900                     InsertConfigInteger(pCfg,     "Version",              0x0405);
     2890                    pszAudioDevice = "sb16";
     2891
     2892                    InsertConfigNode(pDevices,      pszAudioDevice,        &pDev);
     2893                    InsertConfigNode(pDev,          "0", &pInst);
     2894                    InsertConfigInteger(pInst,      "Trusted",              1); /* boolean */
     2895                    InsertConfigNode(pInst,         "Config",               &pCfg);
     2896                    InsertConfigInteger(pCfg,       "IRQ",                  5);
     2897                    InsertConfigInteger(pCfg,       "DMA",                  1);
     2898                    InsertConfigInteger(pCfg,       "DMA16",                5);
     2899                    InsertConfigInteger(pCfg,       "Port",                 0x220);
     2900                    InsertConfigInteger(pCfg,       "Version",              0x0405);
    29012901                    break;
    29022902                }
     
    29042904                {
    29052905                    /* Intel HD Audio. */
    2906                     strAudioDevice = "hda";
    2907 
    2908                     InsertConfigNode   (pDevices, strAudioDevice.c_str(),  &pDev);
    2909                     InsertConfigNode   (pDev,     "0",                     &pInst);
    2910                     InsertConfigInteger(pInst,    "Trusted",               1); /* boolean */
    2911                     hrc = pBusMgr->assignPCIDevice(strAudioDevice.c_str(), pInst);          H();
    2912                     InsertConfigNode   (pInst,    "Config",                &pCfg);
    2913                     InsertConfigInteger(pCfg,     "DebugEnabled",          fDebugEnabled);
    2914                     InsertConfigString (pCfg,     "DebugPathOut",          strDebugPathOut);
     2906                    pszAudioDevice = "hda";
     2907
     2908                    InsertConfigNode(pDevices,      pszAudioDevice,         &pDev);
     2909                    InsertConfigNode(pDev,          "0",                    &pInst);
     2910                    InsertConfigInteger(pInst,      "Trusted",              1); /* boolean */
     2911                    hrc = pBusMgr->assignPCIDevice(pszAudioDevice, pInst);              H();
     2912                    InsertConfigNode(pInst,         "Config",               &pCfg);
     2913                    InsertConfigInteger(pCfg,       "DebugEnabled",         fDebugEnabled);
     2914                    if (strDebugPathOut.isNotEmpty())
     2915                        InsertConfigString(pCfg,    "DebugPathOut",         strDebugPathOut);
    29152916                    break;
    29162917                }
     
    30163017            InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uAudioLUN);
    30173018            InsertConfigString(pLunL0, "Driver", "AUDIO");
    3018             AudioDriverCfg DrvCfgVRDE(strAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVRDE");
     3019            AudioDriverCfg DrvCfgVRDE(pszAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVRDE");
    30193020            rc = mAudioVRDE->InitializeConfig(&DrvCfgVRDE);
    30203021            if (RT_SUCCESS(rc))
     
    30263027            InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uAudioLUN);
    30273028            InsertConfigString(pLunL0, "Driver", "AUDIO");
    3028             AudioDriverCfg DrvCfgVideoRec(strAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVideoRec");
     3029            AudioDriverCfg DrvCfgVideoRec(pszAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVideoRec");
    30293030            rc = Recording.mAudioRec->InitializeConfig(&DrvCfgVideoRec);
    30303031            if (RT_SUCCESS(rc))
     
    30443045                 * Tweak the logging groups.
    30453046                 */
    3046                 Utf8Str strLogGroups = "drv_host_audio.e.l.l2.l3.f+" \
    3047                                        "drv_audio.e.l.l2.l3.f+" \
    3048                                        "audio_mixer.e.l.l2.l3.f+" \
    3049                                        "dev_hda_codec.e.l.l2.l3.f+" \
    3050                                        "dev_hda.e.l.l2.l3.f+" \
    3051                                        "dev_ac97.e.l.l2.l3.f+" \
     3047                Utf8Str strLogGroups = "drv_host_audio.e.l.l2.l3.f+"
     3048                                       "drv_audio.e.l.l2.l3.f+"
     3049                                       "audio_mixer.e.l.l2.l3.f+"
     3050                                       "dev_hda_codec.e.l.l2.l3.f+"
     3051                                       "dev_hda.e.l.l2.l3.f+"
     3052                                       "dev_ac97.e.l.l2.l3.f+"
    30523053                                       "dev_sb16.e.l.l2.l3.f";
    30533054
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