VirtualBox

Changeset 64333 in vbox for trunk


Ignore:
Timestamp:
Oct 20, 2016 2:23:29 PM (8 years ago)
Author:
vboxsync
Message:

Audio: Match to 5.1 in terms of functionality by disabling backend-independent device enumeration and disabling generic backend callback support for now.

Location:
trunk/src/VBox/Devices
Files:
8 edited

Legend:

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

    r63863 r64333  
    425425#ifndef VBOX_DEVICE_STRUCT_TESTCASE
    426426
    427 #if 0 /* unused */
    428427static void ichac97DestroyIn(PAC97STATE pThis, PDMAUDIORECSOURCE enmRecSource);
    429428static void ichac97DestroyOut(PAC97STATE pThis);
    430 #endif
    431429DECLINLINE(PAC97STREAM) ichac97GetStreamFromID(PAC97STATE pThis, uint32_t uID);
    432430static int ichac97StreamInit(PAC97STREAM pStream, uint8_t u8Strm);
     
    679677    LogFlowFuncEnter();
    680678
    681     ichac97StreamInit(&pThis->StreamLineIn, AC97SOUNDSOURCE_PI_INDEX);
    682     ichac97StreamInit(&pThis->StreamMicIn,  AC97SOUNDSOURCE_MC_INDEX);
    683     ichac97StreamInit(&pThis->StreamOut,    AC97SOUNDSOURCE_PO_INDEX);
    684 
    685     return VINF_SUCCESS;
     679    int rc = ichac97StreamInit    (&pThis->StreamLineIn, AC97SOUNDSOURCE_PI_INDEX);
     680    if (RT_SUCCESS(rc))
     681        rc = ichac97StreamInit    (&pThis->StreamMicIn,  AC97SOUNDSOURCE_MC_INDEX);
     682        if (RT_SUCCESS(rc))
     683            rc = ichac97StreamInit(&pThis->StreamOut,    AC97SOUNDSOURCE_PO_INDEX);
     684
     685    /* Open all streams with the current AC'97 mixer settings. */
     686    if (RT_SUCCESS(rc))
     687    {
     688        rc = ichac97StreamOpen        (pThis, &pThis->StreamLineIn);
     689        if (RT_SUCCESS(rc))
     690            rc = ichac97StreamOpen    (pThis, &pThis->StreamMicIn);
     691            if (RT_SUCCESS(rc))
     692                rc = ichac97StreamOpen(pThis, &pThis->StreamOut);
     693    }
     694
     695    LogFlowFunc(("Returning %Rrc\n", rc));
     696    return rc;
     697}
     698
     699static void ichac97StreamsDestroy(PAC97STATE pThis)
     700{
     701    LogFlowFuncEnter();
     702
     703    ichac97DestroyIn(pThis, PDMAUDIORECSOURCE_LINE);
     704    ichac97DestroyIn(pThis, PDMAUDIORECSOURCE_MIC);
     705    ichac97DestroyOut(pThis);
     706
     707    ichac97StreamDestroy(&pThis->StreamLineIn);
     708    ichac97StreamDestroy(&pThis->StreamMicIn);
     709    ichac97StreamDestroy(&pThis->StreamOut);
    686710}
    687711
     
    713737}
    714738
    715 #if 0 /* unused */
    716739static void ichac97DestroyIn(PAC97STATE pThis, PDMAUDIORECSOURCE enmRecSource)
    717740{
     
    763786        if (pDrv->Out.pMixStrm)
    764787        {
    765             AudioMixerSinkRemoveStream(pThis->pSinkOutput, pDrv->Out.pMixStrm);
     788            AudioMixerSinkRemoveStream(pThis->pSinkOut, pDrv->Out.pMixStrm);
    766789            AudioMixerStreamDestroy(pDrv->Out.pMixStrm);
    767790
     
    770793    }
    771794}
    772 #endif
    773795
    774796static int ichac97CreateIn(PAC97STATE pThis,
     
    14121434
    14131435#ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
    1414 #if 0
    1415 static int ichac97TimerStart(PAC97STATE pThis)
    1416 {
    1417     /*int rc = RTCritSectEnter(&pThis->csTimer);
    1418     if (RT_SUCCESS(rc))*/
    1419     {
    1420         AssertPtr(pThis->pTimer);
    1421 
    1422         const bool fIsActive = TMTimerIsActive(pThis->pTimer);
    1423 
    1424         LogFunc(("cStreamsActive=%RU8, fIsActive=%RTbool\n", pThis->cStreamsActive, fIsActive));
    1425 
    1426         if (!fIsActive) /* Timer not started yet? */
    1427         {
    1428             LogFunc(("Starting timer\n"));
    1429             LogRel3(("AC97: Starting timer\n"));
    1430 
    1431             /* Update current time timestamp. */
    1432             pThis->uTimerTS = TMTimerGet(pThis->pTimer);
    1433 
    1434             /* Fire off timer. */
    1435             TMTimerSet(pThis->pTimer, TMTimerGet(pThis->pTimer) + pThis->cTimerTicks);
    1436         }
    1437 
    1438         /*int rc2 = RTCritSectLeave(&pThis->csTimer);
    1439         if (RT_SUCCESS(rc))
    1440             rc = rc2;*/
    1441     }
    1442 
    1443     return 0;
    1444 }
    1445 #endif
    14461436
    14471437static void ichac97TimerMaybeStart(PAC97STATE pThis)
     
    25492539    LogFlowFuncEnter();
    25502540
    2551     ichac97StreamDestroy(&pThis->StreamLineIn);
    2552     ichac97StreamDestroy(&pThis->StreamMicIn);
    2553     ichac97StreamDestroy(&pThis->StreamOut);
     2541    ichac97StreamsDestroy(pThis);
    25542542
    25552543    PAC97DRIVER pDrv, pDrvNext;
     
    29012889
    29022890    if (RT_SUCCESS(rc))
     2891    {
    29032892        ichac97StreamsInit(pThis);
    29042893
    2905 # ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
     2894#ifdef VBOX_WITH_AUDIO_AC97_ONETIME_INIT
     2895        PAC97DRIVER pDrv;
     2896        RTListForEach(&pThis->lstDrv, pDrv, AC97DRIVER, Node)
     2897        {
     2898            /*
     2899             * Only primary drivers are critical for the VM to run. Everything else
     2900             * might not worth showing an own error message box in the GUI.
     2901             */
     2902            if (!(pDrv->Flags & PDMAUDIODRVFLAGS_PRIMARY))
     2903                continue;
     2904
     2905            PPDMIAUDIOCONNECTOR pCon = pDrv->pConnector;
     2906            AssertPtr(pCon);
     2907
     2908            bool fValidLineIn = AudioMixerStreamIsValid(pDrv->LineIn.pMixStrm);
     2909            bool fValidMicIn  = AudioMixerStreamIsValid(pDrv->MicIn.pMixStrm);
     2910            bool fValidOut    = AudioMixerStreamIsValid(pDrv->Out.pMixStrm);
     2911
     2912            if (    !fValidLineIn
     2913                 && !fValidMicIn
     2914                 && !fValidOut)
     2915            {
     2916                LogRel(("AC97: Falling back to NULL backend (no sound audible)\n"));
     2917
     2918                /* Destroy the streams before re-attaching the NULL driver. */
     2919                ichac97StreamsDestroy(pThis);
     2920
     2921                ichac97Reset(pDevIns);
     2922                ichac97Reattach(pThis, pDrv, pDrv->uLUN, "NullAudio");
     2923
     2924                ichac97StreamsInit(pThis);
     2925
     2926                PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
     2927                    N_("No audio devices could be opened. Selecting the NULL audio backend "
     2928                       "with the consequence that no sound is audible"));
     2929            }
     2930            else
     2931            {
     2932                bool fWarn = false;
     2933
     2934                PDMAUDIOBACKENDCFG backendCfg;
     2935                int rc2 = pCon->pfnGetConfig(pCon, &backendCfg);
     2936                if (RT_SUCCESS(rc2))
     2937                {
     2938                    if (backendCfg.cMaxStreamsIn)
     2939                    {
     2940                        /* If the audio backend supports two or more input streams at once,
     2941                         * warn if one of our two inputs (microphone-in and line-in) failed to initialize. */
     2942                        if (backendCfg.cMaxStreamsIn >= 2)
     2943                            fWarn = !fValidLineIn || !fValidMicIn;
     2944                        /* If the audio backend only supports one input stream at once (e.g. pure ALSA, and
     2945                         * *not* ALSA via PulseAudio plugin!), only warn if both of our inputs failed to initialize.
     2946                         * One of the two simply is not in use then. */
     2947                        else if (backendCfg.cMaxStreamsIn == 1)
     2948                            fWarn = !fValidLineIn && !fValidMicIn;
     2949                        /* Don't warn if our backend is not able of supporting any input streams at all. */
     2950                    }
     2951
     2952                    if (   !fWarn
     2953                        && backendCfg.cMaxStreamsOut)
     2954                    {
     2955                        fWarn = !fValidOut;
     2956                    }
     2957                }
     2958                else
     2959                {
     2960                    LogRel(("AC97: Unable to retrieve audio backend configuration for LUN #%RU8, rc=%Rrc\n", pDrv->uLUN, rc2));
     2961                    fWarn = true;
     2962                }
     2963
     2964                if (fWarn)
     2965                {
     2966                    char   szMissingStreams[255] = "";
     2967                    size_t len = 0;
     2968                    if (!fValidLineIn)
     2969                    {
     2970                        LogRel(("AC97: WARNING: Unable to open PCM line input for LUN #%RU8!\n", pDrv->uLUN));
     2971                        len = RTStrPrintf(szMissingStreams, sizeof(szMissingStreams), "PCM Input");
     2972                    }
     2973                    if (!fValidMicIn)
     2974                    {
     2975                        LogRel(("AC97: WARNING: Unable to open PCM microphone input for LUN #%RU8!\n", pDrv->uLUN));
     2976                        len += RTStrPrintf(szMissingStreams + len,
     2977                                           sizeof(szMissingStreams) - len, len ? ", PCM Microphone" : "PCM Microphone");
     2978                    }
     2979                    if (!fValidOut)
     2980                    {
     2981                        LogRel(("AC97: WARNING: Unable to open PCM output for LUN #%RU8!\n", pDrv->uLUN));
     2982                        len += RTStrPrintf(szMissingStreams + len,
     2983                                           sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output");
     2984                    }
     2985
     2986                    PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
     2987                                               N_("Some AC'97 audio streams (%s) could not be opened. Guest applications generating audio "
     2988                                                  "output or depending on audio input may hang. Make sure your host audio device "
     2989                                                  "is working properly. Check the logfile for error messages of the audio "
     2990                                                  "subsystem"), szMissingStreams);
     2991                }
     2992            }
     2993        }
     2994#endif /* VBOX_WITH_AUDIO_AC97_ONETIME_INIT */
     2995    }
     2996
     2997#ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS
    29062998    if (RT_SUCCESS(rc))
    29072999    {
     
    29223014        }
    29233015    }
    2924 # else /* !VBOX_WITH_AUDIO_AC97_CALLBACKS */
     3016#else /* !VBOX_WITH_AUDIO_AC97_CALLBACKS */
    29253017    if (RT_SUCCESS(rc))
    29263018    {
     
    29523044        }
    29533045    }
    2954 # endif /* VBOX_WITH_AUDIO_AC97_CALLBACKS */
    2955 
    2956 # ifdef VBOX_WITH_STATISTICS
     3046#endif /* VBOX_WITH_AUDIO_AC97_CALLBACKS */
     3047
     3048#ifdef VBOX_WITH_STATISTICS
    29573049    if (RT_SUCCESS(rc))
    29583050    {
     
    29643056        PDMDevHlpSTAMRegister(pDevIns, &pThis->StatBytesWritten,     STAMTYPE_COUNTER, "/Devices/AC97/BytesWritten",      STAMUNIT_BYTES,          "Bytes written to AC97 emulation.");
    29653057    }
    2966 # endif
     3058#endif
    29673059
    29683060    LogFlowFuncLeaveRC(rc);
  • trunk/src/VBox/Devices/Audio/DevIchHda.cpp

    r64049 r64333  
    5757#define VBOX_WITH_INTEL_HDA
    5858
    59 #ifdef DEBUG_andy
    6059/*
    6160 * HDA_DEBUG_DUMP_PCM_DATA enables dumping the raw PCM data
     
    6362 * to your needs before using this!
    6463 */
    65 # define HDA_DEBUG_DUMP_PCM_DATA
     64//#define HDA_DEBUG_DUMP_PCM_DATA
     65#ifdef HDA_DEBUG_DUMP_PCM_DATA
    6666# ifdef RT_OS_WINDOWS
    6767#  define HDA_DEBUG_DUMP_PCM_DATA_PATH "c:\\temp\\"
     
    6969#  define HDA_DEBUG_DUMP_PCM_DATA_PATH "/tmp/"
    7070# endif
    71 
    72 /* Enables experimental support for separate mic-in handling.
    73    Do not enable this yet for regular builds, as this needs more testing first! */
    74 //# define VBOX_WITH_HDA_MIC_IN
    7571#endif
    7672
     
    9995#define BIRD_THINKS_CORBRP_IS_MOSTLY_RO
    10096
    101 /* Make sure that interleaving streams support is enabled if the 5.1 code is being used. */
    102 #if defined (VBOX_WITH_HDA_51_SURROUND) && !defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT)
    103 # define VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT
     97/* Make sure that interleaving streams support is enabled if the 5.1 surround code is being used. */
     98#if defined (VBOX_WITH_AUDIO_HDA_51_SURROUND) && !defined(VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT)
     99# define VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT
    104100#endif
    105101
     
    753749    /** Mixer stream for line input. */
    754750    HDAMIXERSTREAM                     LineIn;
    755 #ifdef VBOX_WITH_HDA_MIC_IN
     751#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    756752    /** Mixer stream for mic input. */
    757753    HDAMIXERSTREAM                     MicIn;
     
    759755    /** Mixer stream for front output. */
    760756    HDAMIXERSTREAM                     Front;
    761 #ifdef VBOX_WITH_HDA_51_SURROUND
     757#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    762758    /** Mixer stream for center/LFE output. */
    763759    HDAMIXERSTREAM                     CenterLFE;
     
    847843    /** HDA sink for (front) output. */
    848844    HDAMIXERSINK                       SinkFront;
    849 #ifdef VBOX_WITH_HDA_51_SURROUND
     845#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    850846    /** HDA sink for center / LFE output. */
    851847    HDAMIXERSINK                       SinkCenterLFE;
     
    855851    /** HDA mixer sink for line input. */
    856852    HDAMIXERSINK                       SinkLineIn;
    857 #ifdef VBOX_WITH_HDA_MIC_IN
     853#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    858854    /** Audio mixer sink for microphone input. */
    859855    HDAMIXERSINK                       SinkMicIn;
     
    19051901}
    19061902
    1907 # if defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND)
     1903# if defined(VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_AUDIO_HDA_51_SURROUND)
    19081904static int hdaStreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf)
    19091905{
     
    19531949    return VINF_SUCCESS;
    19541950}
    1955 # endif /* defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) */
     1951# endif /* defined(VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_AUDIO_HDA_51_SURROUND) */
    19561952
    19571953# if 0 /** @todo hdaStreamChannelAdvance is unused */
     
    19971993}
    19981994
    1999 # if defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND)
     1995# if defined(VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_AUDIO_HDA_51_SURROUND)
    20001996
    20011997static int hdaStreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void *pvData, size_t *pcbData)
     
    20192015}
    20202016
    2021 # endif /* defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) */
     2017# endif /* defined(VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_AUDIO_HDA_51_SURROUND) */
    20222018
    20232019# if 0 /* currently unused */
     
    26692665
    26702666    bool fUseFront = true; /* Always use front out by default. */
    2671 #ifdef VBOX_WITH_HDA_51_SURROUND
     2667#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    26722668    bool fUseRear;
    26732669    bool fUseCenter;
     
    27162712        }
    27172713    }
    2718 #else /* !VBOX_WITH_HDA_51_SURROUND */
     2714#else /* !VBOX_WITH_AUDIO_HDA_51_SURROUND */
    27192715    /* Only support mono or stereo channels. */
    27202716    if (   pCfg->cChannels != 1 /* Mono */
     
    27492745        }
    27502746
    2751 #ifdef VBOX_WITH_HDA_51_SURROUND
     2747#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    27522748        if (   RT_SUCCESS(rc)
    27532749            && (fUseCenter || fUseLFE))
     
    27732769                rc = hdaCodecAddStream(pThis->pCodec, PDMAUDIOMIXERCTL_REAR, pCfg);
    27742770        }
    2775 #endif /* VBOX_WITH_HDA_51_SURROUND */
     2771#endif /* VBOX_WITH_AUDIO_HDA_51_SURROUND */
    27762772
    27772773    } while (0);
     
    28012797            break;
    28022798        }
    2803 #ifdef VBOX_WITH_HDA_MIC_IN
     2799#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    28042800        case PDMAUDIORECSOURCE_MIC:
    28052801        {
     
    28492845    {
    28502846        case PDMAUDIODIR_IN:
    2851 # ifdef VBOX_WITH_HDA_MIC_IN
     2847# ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    28522848#  error "Implement me!"
    28532849# else
     
    33773373    {
    33783374        pMapping->cChannels = pCfg->cChannels;
    3379 #ifdef VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT
     3375#ifdef VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT
    33803376        pMapping->enmLayout = PDMAUDIOSTREAMLAYOUT_INTERLEAVED;
    33813377#else
     
    36743670        if (cbBuf >= hdaStreamGetFIFOW(pThis, pStream))
    36753671        {
    3676 #if defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND)
     3672#if defined(VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_AUDIO_HDA_51_SURROUND)
    36773673            PHDASTREAMMAPPING pMapping            = &pStream->State.Mapping;
    36783674#endif
    36793675
    36803676            /** @todo Which channel is which? */
    3681 #ifdef VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT
     3677#ifdef VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT
    36823678            PPDMAUDIOSTREAMCHANNEL pChanFront     = &pMapping->paChannels[0];
    36833679#endif
    3684 #ifdef VBOX_WITH_HDA_51_SURROUND
     3680#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    36853681            PPDMAUDIOSTREAMCHANNEL pChanCenterLFE = &pMapping->paChannels[2]; /** @todo FIX! */
    36863682            PPDMAUDIOSTREAMCHANNEL pChanRear      = &pMapping->paChannels[4]; /** @todo FIX! */
     
    36903686            void  *pvDataFront = NULL;
    36913687            size_t cbDataFront;
    3692 #ifdef VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT
     3688#ifdef VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT
    36933689            rc2 = hdaStreamChannelExtract(pChanFront, pvBuf, cbBuf);
    36943690            AssertRC(rc2);
     
    37013697            cbDataFront = cbBuf;
    37023698#endif
    3703 #ifdef VBOX_WITH_HDA_51_SURROUND
     3699#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    37043700            void  *pvDataCenterLFE;
    37053701            size_t cbDataCenterLFE;
     
    37243720                                      NULL /* pcbWritten */);
    37253721            AssertRC(rc2);
    3726 #ifdef VBOX_WITH_HDA_51_SURROUND
     3722#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    37273723            rc2 = AudioMixerSinkWrite(pThis->SinkCenterLFE,      AUDMIXOP_COPY, pvDataCenterLFE, cbDataCenterLFE,
    37283724                                      NULL /* pcbWritten */);
     
    37333729#endif
    37343730
    3735 #ifdef VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT
     3731#ifdef VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT
    37363732            hdaStreamChannelReleaseData(&pChanFront->Data);
    37373733#endif
    3738 #ifdef VBOX_WITH_HDA_51_SURROUND
     3734#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    37393735            hdaStreamChannelReleaseData(&pChanCenterLFE->Data);
    37403736            hdaStreamChannelReleaseData(&pChanRear->Data);
     
    38033799            pSink = &pThis->SinkFront;
    38043800            break;
    3805 #ifdef VBOX_WITH_HDA_51_SURROUND
     3801#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    38063802        case PDMAUDIOMIXERCTL_CENTER_LFE:
    38073803            pSink = &pThis->SinkCenterLFE;
     
    38143810            pSink = &pThis->SinkLineIn;
    38153811            break;
    3816 #ifdef VBOX_WITH_HDA_MIC_IN
     3812#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    38173813        case PDMAUDIOMIXERCTL_MIC_IN:
    38183814            pSink = &pThis->SinkMicIn;
     
    38703866                    pStream = &pDrv->LineIn;
    38713867                    break;
    3872 #ifdef VBOX_WITH_HDA_MIC_IN
     3868#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    38733869                case PDMAUDIORECSOURCE_MIC:
    38743870                    pStream = &pDrv->MicIn;
     
    38893885                    pStream = &pDrv->Front;
    38903886                    break;
    3891 #ifdef VBOX_WITH_HDA_51_SURROUND
     3887#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    38923888                case PDMAUDIOPLAYBACKDEST_CENTER_LFE:
    38933889                    pStream = &pDrv->CenterLFE;
     
    40013997                    pDrv->LineIn.pMixStrm = NULL;
    40023998                    break;
    4003 #ifdef VBOX_WITH_HDA_MIC_IN
     3999#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    40044000                case PDMAUDIOMIXERCTL_MIC_IN:
    40054001                    pMixStream = pDrv->MicIn.pMixStrm;
     
    40144010                    pDrv->Front.pMixStrm = NULL;
    40154011                    break;
    4016 #ifdef VBOX_WITH_HDA_51_SURROUND
     4012#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    40174013                case PDMAUDIOMIXERCTL_CENTER_LFE:
    40184014                    pMixStream = pDrv->CenterLFE.pMixStrm;
     
    41984194
    41994195    PHDASTREAM pStreamLineIn  = hdaGetStreamFromSink(pThis, &pThis->SinkLineIn);
    4200 #ifdef VBOX_WITH_HDA_MIC_IN
     4196#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    42014197    PHDASTREAM pStreamMicIn   = hdaGetStreamFromSink(pThis, &pThis->SinkMicIn);
    42024198#endif
    42034199    PHDASTREAM pStreamFront   = hdaGetStreamFromSink(pThis, &pThis->SinkFront);
    4204 #ifdef VBOX_WITH_HDA_51_SURROUND
     4200#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    42054201    /** @todo See note below. */
    42064202#endif
     
    42184214    }
    42194215
    4220 #ifdef VBOX_WITH_HDA_MIC_IN
     4216#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    42214217    rc = AudioMixerSinkUpdate(pThis->SinkMicIn.pMixSink);
    42224218    if (RT_SUCCESS(rc))
     
    42314227#endif
    42324228
    4233 #ifdef VBOX_WITH_HDA_51_SURROUND
     4229#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    42344230    rc = AudioMixerSinkUpdate(pThis->SinkCenterLFE.pMixSink);
    42354231    if (RT_SUCCESS(rc))
     
    55235519     */
    55245520    AudioMixerSinkCtl(pThis->SinkFront.pMixSink,     AUDMIXSINKCMD_DISABLE);
    5525 # ifdef VBOX_WITH_HDA_MIC_IN
     5521# ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    55265522    AudioMixerSinkCtl(pThis->SinkMicIn.pMixSink,     AUDMIXSINKCMD_DISABLE);
    55275523# endif
    55285524    AudioMixerSinkCtl(pThis->SinkLineIn.pMixSink,    AUDMIXSINKCMD_DISABLE);
    5529 # ifdef VBOX_WITH_HDA_51_SURROUND
     5525# ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    55305526    AudioMixerSinkCtl(pThis->SinkCenterLFE.pMixSink, AUDMIXSINKCMD_DISABLE);
    55315527    AudioMixerSinkCtl(pThis->SinkRear.pMixSink,      AUDMIXSINKCMD_DISABLE);
     
    55395535     * These stream numbers can be changed by the guest dynamically lateron.
    55405536     */
    5541 #ifdef VBOX_WITH_HDA_MIC_IN
     5537#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    55425538    hdaMixerSetStream(pThis, PDMAUDIOMIXERCTL_MIC_IN    , 1 /* SD0 */, 0 /* Channel */);
    55435539#endif
     
    55455541
    55465542    hdaMixerSetStream(pThis, PDMAUDIOMIXERCTL_FRONT     , 5 /* SD4 */, 0 /* Channel */);
    5547 #ifdef VBOX_WITH_HDA_51_SURROUND
     5543#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    55485544    hdaMixerSetStream(pThis, PDMAUDIOMIXERCTL_CENTER_LFE, 5 /* SD4 */, 0 /* Channel */);
    55495545    hdaMixerSetStream(pThis, PDMAUDIOMIXERCTL_REAR      , 5 /* SD4 */, 0 /* Channel */);
     
    59935989             * Add mixer output sinks.
    59945990             */
    5995 #ifdef VBOX_WITH_HDA_51_SURROUND
     5991#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    59965992            rc = AudioMixerCreateSink(pThis->pMixer, "[Playback] Front",
    59975993                                      AUDMIXSINKDIR_OUTPUT, &pThis->SinkFront.pMixSink);
     
    60146010                                      AUDMIXSINKDIR_INPUT, &pThis->SinkLineIn.pMixSink);
    60156011            AssertRC(rc);
    6016 #ifdef VBOX_WITH_HDA_MIC_IN
     6012#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    60176013            rc = AudioMixerCreateSink(pThis->pMixer, "[Recording] Microphone In",
    60186014                                      AUDMIXSINKDIR_INPUT, &pThis->SinkMicIn.pMixSink);
     
    60656061            AssertRC(rc);
    60666062        }
     6063
     6064#ifdef VBOX_WITH_AUDIO_HDA_ONETIME_INIT
     6065        /*
     6066         * Initialize the driver chain.
     6067         */
     6068        PHDADRIVER pDrv;
     6069        RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node)
     6070        {
     6071            /*
     6072             * Only primary drivers are critical for the VM to run. Everything else
     6073             * might not worth showing an own error message box in the GUI.
     6074             */
     6075            if (!(pDrv->Flags & PDMAUDIODRVFLAGS_PRIMARY))
     6076                continue;
     6077
     6078            PPDMIAUDIOCONNECTOR pCon = pDrv->pConnector;
     6079            AssertPtr(pCon);
     6080
     6081            bool fValidLineIn = AudioMixerStreamIsValid(pDrv->LineIn.pMixStrm);
     6082# ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
     6083            bool fValidMicIn  = AudioMixerStreamIsValid(pDrv->MicIn.pMixStrm);
     6084# endif
     6085            bool fValidOut    = AudioMixerStreamIsValid(pDrv->Front.pMixStrm);
     6086# ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
     6087            /** @todo Anything to do here? */
     6088# endif
     6089
     6090            if (    !fValidLineIn
     6091# ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
     6092                 && !fValidMicIn
     6093# endif
     6094                 && !fValidOut)
     6095            {
     6096                LogRel(("HDA: Falling back to NULL backend (no sound audible)\n"));
     6097
     6098                hdaReset(pDevIns);
     6099                hdaReattach(pThis, pDrv, pDrv->uLUN, "NullAudio");
     6100
     6101                PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
     6102                    N_("No audio devices could be opened. Selecting the NULL audio backend "
     6103                       "with the consequence that no sound is audible"));
     6104            }
     6105            else
     6106            {
     6107                bool fWarn = false;
     6108
     6109                PDMAUDIOBACKENDCFG backendCfg;
     6110                int rc2 = pCon->pfnGetConfig(pCon, &backendCfg);
     6111                if (RT_SUCCESS(rc2))
     6112                {
     6113                    if (backendCfg.cMaxStreamsIn)
     6114                    {
     6115# ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
     6116                        /* If the audio backend supports two or more input streams at once,
     6117                         * warn if one of our two inputs (microphone-in and line-in) failed to initialize. */
     6118                        if (backendCfg.cMaxStreamsIn >= 2)
     6119                            fWarn = !fValidLineIn || !fValidMicIn;
     6120                        /* If the audio backend only supports one input stream at once (e.g. pure ALSA, and
     6121                         * *not* ALSA via PulseAudio plugin!), only warn if both of our inputs failed to initialize.
     6122                         * One of the two simply is not in use then. */
     6123                        else if (backendCfg.cMaxStreamsIn == 1)
     6124                            fWarn = !fValidLineIn && !fValidMicIn;
     6125                        /* Don't warn if our backend is not able of supporting any input streams at all. */
     6126# else /* !VBOX_WITH_AUDIO_HDA_MIC_IN */
     6127                        /* We only have line-in as input source. */
     6128                        fWarn = !fValidLineIn;
     6129# endif /* VBOX_WITH_AUDIO_HDA_MIC_IN */
     6130                    }
     6131
     6132                    if (   !fWarn
     6133                        && backendCfg.cMaxStreamsOut)
     6134                    {
     6135                        fWarn = !fValidOut;
     6136                    }
     6137                }
     6138                else
     6139                {
     6140                    LogRel(("HDA: Unable to retrieve audio backend configuration for LUN #%RU8, rc=%Rrc\n", pDrv->uLUN, rc2));
     6141                    fWarn = true;
     6142                }
     6143
     6144                if (fWarn)
     6145                {
     6146                    char   szMissingStreams[255];
     6147                    size_t len = 0;
     6148                    if (!fValidLineIn)
     6149                    {
     6150                        LogRel(("HDA: WARNING: Unable to open PCM line input for LUN #%RU8!\n", pDrv->uLUN));
     6151                        len = RTStrPrintf(szMissingStreams, sizeof(szMissingStreams), "PCM Input");
     6152                    }
     6153# ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
     6154                    if (!fValidMicIn)
     6155                    {
     6156                        LogRel(("HDA: WARNING: Unable to open PCM microphone input for LUN #%RU8!\n", pDrv->uLUN));
     6157                        len += RTStrPrintf(szMissingStreams + len,
     6158                                           sizeof(szMissingStreams) - len, len ? ", PCM Microphone" : "PCM Microphone");
     6159                    }
     6160# endif /* VBOX_WITH_AUDIO_HDA_MIC_IN */
     6161                    if (!fValidOut)
     6162                    {
     6163                        LogRel(("HDA: WARNING: Unable to open PCM output for LUN #%RU8!\n", pDrv->uLUN));
     6164                        len += RTStrPrintf(szMissingStreams + len,
     6165                                           sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output");
     6166                    }
     6167
     6168                    PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
     6169                                               N_("Some HDA audio streams (%s) could not be opened. Guest applications generating audio "
     6170                                                  "output or depending on audio input may hang. Make sure your host audio device "
     6171                                                  "is working properly. Check the logfile for error messages of the audio "
     6172                                                  "subsystem"), szMissingStreams);
     6173                }
     6174            }
     6175        }
     6176#endif /* VBOX_WITH_AUDIO_HDA_ONETIME_INIT */
    60676177    }
    60686178
  • trunk/src/VBox/Devices/Audio/DevIchHdaCodec.cpp

    r63562 r64333  
    23602360            /* Propagate to the controller. */
    23612361            pThis->pfnMixerSetStream(pThis->pHDAState, PDMAUDIOMIXERCTL_FRONT,      uSD, uChannel);
    2362 #ifdef VBOX_WITH_HDA_51_SURROUND
     2362#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    23632363            pThis->pfnMixerSetStream(pThis->pHDAState, PDMAUDIOMIXERCTL_CENTER_LFE, uSD, uChannel);
    23642364            pThis->pfnMixerSetStream(pThis->pHDAState, PDMAUDIOMIXERCTL_REAR,       uSD, uChannel);
     
    23682368        {
    23692369            pThis->pfnMixerSetStream(pThis->pHDAState, PDMAUDIOMIXERCTL_LINE_IN,    uSD, uChannel);
    2370 #ifdef VBOX_WITH_HDA_MIC_IN
     2370#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    23712371            pThis->pfnMixerSetStream(pThis->pHDAState, PDMAUDIOMIXERCTL_MIC_IN,     uSD, uChannel);
    23722372#endif
     
    30243024        case PDMAUDIOMIXERCTL_VOLUME_MASTER:
    30253025        case PDMAUDIOMIXERCTL_FRONT:
    3026 #ifdef VBOX_WITH_HDA_51_SURROUND
     3026#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    30273027        case PDMAUDIOMIXERCTL_CENTER_LFE:
    30283028        case PDMAUDIOMIXERCTL_REAR:
     
    30323032        }
    30333033        case PDMAUDIOMIXERCTL_LINE_IN:
    3034 #ifdef VBOX_WITH_HDA_MIC_IN
     3034#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    30353035        case PDMAUDIOMIXERCTL_MIC_IN:
    30363036#endif
     
    31533153    int rc2 = hdaCodecRemoveStream(pThis, PDMAUDIOMIXERCTL_FRONT);
    31543154    AssertRC(rc2);
    3155 #ifdef VBOX_WITH_HDA_51_SURROUND
     3155#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    31563156    rc2 = hdaCodecRemoveStream(pThis, PDMAUDIOMIXERCTL_CENTER_LFE);
    31573157    AssertRC(rc2);
     
    31603160#endif
    31613161
    3162 #ifdef VBOX_WITH_HDA_MIC_IN
     3162#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    31633163    rc2 = hdaCodecRemoveStream(pThis, PDMAUDIOMIXERCTL_MIC_IN);
    31643164    AssertRC(rc2);
     
    32383238            LogRel2(("HDA: Failed to add front output stream: %Rrc\n", rc2));
    32393239
    3240 #ifdef VBOX_WITH_HDA_51_SURROUND
     3240#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
    32413241        /* Center / LFE. */
    32423242        RTStrPrintf(strmCfg.szName, RT_ELEMENTS(strmCfg.szName), "Center / LFE");
     
    32603260        strmCfg.enmDir = PDMAUDIODIR_IN;
    32613261
    3262 #ifdef VBOX_WITH_HDA_MIC_IN
     3262#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    32633263        RTStrPrintf(strmCfg.szName, RT_ELEMENTS(strmCfg.szName), "Microphone In");
    32643264        strmCfg.DestSource.Source = PDMAUDIORECSOURCE_MIC;
     
    32893289    hdaCodecToAudVolume(pThis, &pThis->paNodes[pThis->u8DacLineOut].dac.B_params,       PDMAUDIOMIXERCTL_FRONT);
    32903290    hdaCodecToAudVolume(pThis, &pThis->paNodes[pThis->u8AdcVolsLineIn].adcvol.B_params, PDMAUDIOMIXERCTL_LINE_IN);
    3291 #ifdef VBOX_WITH_HDA_MIC_IN
     3291#ifdef VBOX_WITH_AUDIO_HDA_MIC_IN
    32923292    #error "Implement mic-in support!"
    32933293#endif
  • trunk/src/VBox/Devices/Audio/DevSB16.cpp

    r63737 r64333  
    24192419
    24202420    sb16ResetLegacy(pThis);
     2421
     2422#ifdef VBOX_WITH_AUDIO_SB16_ONETIME_INIT
     2423    PSB16DRIVER pDrv;
     2424    RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)
     2425    {
     2426        /*
     2427         * Only primary drivers are critical for the VM to run. Everything else
     2428         * might not worth showing an own error message box in the GUI.
     2429         */
     2430        if (!(pDrv->Flags & PDMAUDIODRVFLAGS_PRIMARY))
     2431            continue;
     2432
     2433        PPDMIAUDIOCONNECTOR pCon = pDrv->pConnector;
     2434        AssertPtr(pCon);
     2435
     2436        /** @todo No input streams available for SB16 yet. */
     2437        bool fValidOut = pCon->pfnStreamGetStatus(pCon, pDrv->Out.pStream) & PDMAUDIOSTRMSTS_FLAG_INITIALIZED;
     2438        if (!fValidOut)
     2439        {
     2440            LogRel(("SB16: Falling back to NULL backend (no sound audible)\n"));
     2441
     2442            sb16ResetLegacy(pThis);
     2443            sb16Reattach(pThis, pDrv, pDrv->uLUN, "NullAudio");
     2444
     2445            PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
     2446                N_("No audio devices could be opened. Selecting the NULL audio backend "
     2447                   "with the consequence that no sound is audible"));
     2448        }
     2449    }
     2450#endif
    24212451
    24222452#ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r64050 r64333  
    4141#include "AudioMixBuffer.h"
    4242
     43#ifdef VBOX_WITH_AUDIO_ENUM
    4344static int drvAudioDevicesEnumerateInternal(PDRVAUDIO pThis, bool fLog, PPDMAUDIODEVICEENUM pDevEnum);
     45#endif
    4446
    4547static DECLCALLBACK(int) drvAudioStreamDestroy(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream);
     
    622624}
    623625
     626#ifdef VBOX_WITH_AUDIO_CALLBACKS
    624627/**
    625628 * Schedules a re-initialization of all current audio streams.
     
    640643        pHstStream->fStatus |= PDMAUDIOSTRMSTS_FLAG_PENDING_REINIT;
    641644
     645# ifdef VBOX_WITH_AUDIO_ENUM
    642646    /* Re-enumerate all host devices as soon as possible. */
    643647    pThis->fEnumerateDevices = true;
     648# endif
    644649
    645650    return VINF_SUCCESS;
    646651}
     652#endif /* VBOX_WITH_AUDIO_CALLBACKS */
    647653
    648654/**
     
    928934    if (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_PENDING_REINIT)
    929935    {
     936#ifdef VBOX_WITH_AUDIO_ENUM
    930937        if (pThis->fEnumerateDevices)
    931938        {
     
    935942            pThis->fEnumerateDevices = false;
    936943        }
     944#endif /* VBOX_WITH_AUDIO_ENUM */
    937945
    938946        /* Remove the pending re-init flag in any case, regardless whether the actual re-initialization succeeded
     
    14631471#endif /* VBOX_WITH_AUDIO_CALLBACKS */
    14641472
     1473#ifdef VBOX_WITH_AUDIO_ENUM
    14651474/**
    14661475 * Enumerates all host audio devices.
     
    15301539    return rc;
    15311540}
     1541#endif /* VBOX_WITH_AUDIO_ENUM */
    15321542
    15331543/**
     
    15791589             RT_MIN(64, pThis->cStreamsFreeIn), RT_MIN(64, pThis->cStreamsFreeOut)));
    15801590
     1591#ifdef VBOX_WITH_AUDIO_ENUM
    15811592    int rc2 = drvAudioDevicesEnumerateInternal(pThis, true /* fLog */, NULL /* pDevEnum */);
     1593    AssertRC(rc2);
     1594
     1595    RT_NOREF(rc2);
    15821596    /* Ignore rc. */
     1597#endif
    15831598
    15841599#ifdef VBOX_WITH_AUDIO_CALLBACKS
     
    15881603    if (pThis->pHostDrvAudio->pfnSetCallback)
    15891604    {
    1590         rc2 = pThis->pHostDrvAudio->pfnSetCallback(pThis->pHostDrvAudio, drvAudioBackendCallback);
     1605        int rc2 = pThis->pHostDrvAudio->pfnSetCallback(pThis->pHostDrvAudio, drvAudioBackendCallback);
    15911606        if (RT_FAILURE(rc2))
    15921607             LogRel(("Audio: Error registering backend callback, rc=%Rrc\n", rc2));
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r63743 r64333  
    118118     *  UINT32_MAX for unlimited streams. */
    119119    uint32_t                cStreamsFreeOut;
     120#ifdef VBOX_WITH_AUDIO_ENUM
    120121    /** Flag indicating to perform an (re-)enumeration of the host audio devices. */
    121122    bool                    fEnumerateDevices;
     123#endif
    122124    /** Audio configuration settings retrieved from the backend. */
    123125    PDMAUDIOBACKENDCFG      BackendCfg;
     
    167169PPDMAUDIODEVICEENUM DrvAudioHlpDeviceEnumDup(PPDMAUDIODEVICEENUM pDevEnm);
    168170int DrvAudioHlpDeviceEnumCopy(PPDMAUDIODEVICEENUM pDstDevEnm, PPDMAUDIODEVICEENUM pSrcDevEnm);
     171int DrvAudioHlpDeviceEnumCopyEx(PPDMAUDIODEVICEENUM pDstDevEnm, PPDMAUDIODEVICEENUM pSrcDevEnm, PDMAUDIODIR enmUsage, bool fCopyUserData);
    169172PPDMAUDIODEVICE DrvAudioHlpDeviceEnumGetDefaultDevice(PPDMAUDIODEVICEENUM pDevEnm, PDMAUDIODIR enmDir);
    170173void DrvAudioHlpDeviceEnumPrint(const char *pszDesc, PPDMAUDIODEVICEENUM pDevEnm);
  • trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp

    r64314 r64333  
    220220}
    221221
    222 #ifndef VBOX_WITH_AUDIO_CA_QUEUES
     222#ifndef VBOX_WITH_AUDIO_CALLBACKS
    223223static int coreAudioASBDToStreamCfg(AudioStreamBasicDescription *pASBD, PPDMAUDIOSTREAMCFG pCfg)
    224224{
     
    256256    return rc;
    257257}
    258 
     258#endif /* !VBOX_WITH_AUDIO_CALLBACKS */
     259
     260#ifndef VBOX_WITH_AUDIO_CA_QUEUES
    259261static OSStatus coreAudioSetFrameBufferSize(AudioDeviceID deviceID, bool fInput, UInt32 cReqSize, UInt32 *pcActSize)
    260262{
     
    538540static OSStatus coreAudioPlaybackCb(void *pvUser, AudioUnitRenderActionFlags *pActionFlags, const AudioTimeStamp *pAudioTS, UInt32 uBusID, UInt32 cFrames, AudioBufferList* pBufData);
    539541#else
     542static int coreAudioStreamInitQueue(PCOREAUDIOSTREAM pCAStream, PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq);
    540543static void coreAudioInputQueueCb(void *pvUser, AudioQueueRef audioQueue, AudioQueueBufferRef audioBuffer, const AudioTimeStamp *pAudioTS, UInt32 cPacketDesc, const AudioStreamPacketDescription *paPacketDesc);
    541544static void coreAudioOutputQueueCb(void *pvUser, AudioQueueRef audioQueue, AudioQueueBufferRef audioBuffer);
     
    10281031
    10291032
    1030 #if 0
    1031 static int coreAudioDeviceInit(PPDMAUDIODEVICE pDev, PDRVHOSTCOREAUDIO pDrv, PDMAUDIODIR enmUsage, AudioDeviceID deviceID)
    1032 {
    1033     AssertPtrReturn(pDev, VERR_INVALID_POINTER);
    1034 
    1035     PCOREAUDIODEVICEDATA pData = (PCOREAUDIODEVICEDATA)pDev->pvData;
    1036     AssertPtrReturn(pData, VERR_INVALID_POINTER);
    1037 
    1038     /* Init common parameters. */
    1039     pDev->enmUsage   = enmUsage;
    1040 
    1041     /* Init Core Audio-specifics. */
    1042     pData->deviceID  = deviceID;
    1043     pData->pDrv      = pDrv;
    1044 
    1045     RTListInit(&pData->lstStreams);
    1046 
    1047     return VINF_SUCCESS;
    1048 }
    1049 #endif
    1050 
    1051 
    10521033/**
    10531034 * Initializes a Core Audio-specific device data structure.
     
    13191300    return rc;
    13201301}
    1321 #endif /* VBOX_WITH_AUDIO_CALLBACKS */
     1302#endif /* !VBOX_WITH_AUDIO_CALLBACKS */
    13221303
    13231304#ifdef VBOX_WITH_AUDIO_CA_CONVERTER
     
    30032984    RT_NOREF(cAddresses, properties, pvUser);
    30042985
    3005 #ifdef DEBUG
    30062986    PPDMAUDIODEVICE pDev = (PPDMAUDIODEVICE)pvUser;
    30072987    AssertPtr(pDev);
    30082988
    30092989    LogFlowFunc(("propertyID=%u, nAddresses=%u, pDev=%p\n", propertyID, cAddresses, pDev));
    3010 #endif
    30112990
    30122991    switch (propertyID)
     
    30243003            int rc2 = coreAudioDevicePropagateStatus(pDev, COREAUDIOSTATUS_REINIT);
    30253004            AssertRC(rc2);
     3005#else
     3006            RT_NOREF(pDev);
    30263007#endif
    30273008            break;
  • trunk/src/VBox/Devices/Makefile.kmk

    r64240 r64333  
    550550
    551551 if 0 # Not stable yet.
    552   VBoxDD_DEFS += VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT
    553   VBoxDD_DEFS += VBOX_WITH_HDA_51_SURROUND
    554  endif
    555 
    556  # Enable generic callback support.
    557  VBoxDD_DEFS  += VBOX_WITH_AUDIO_CALLBACKS
     552  # Enable microphone-in support for HDA. Otherwise only line-in is supported.
     553  VBoxDD_DEFS += VBOX_WITH_AUDIO_HDA_MIC_IN
     554
     555  # Enable interleavig streams support for HDA. Needed for 5.1 surround support.
     556  VBoxDD_DEFS += VBOX_WITH_AUDIO_HDA_INTERLEAVING_STREAMS_SUPPORT
     557
     558  # Enable 5.1 surround support (Front, Center/LFE, Rear) for HDA.
     559  # Without this, only stereo output (Front) is supported.
     560  VBoxDD_DEFS += VBOX_WITH_AUDIO_HDA_51_SURROUND
     561 endif
     562
     563 # Enable backend-independent device enumeration support.
     564 #VBoxDD_DEFS  += VBOX_WITH_AUDIO_ENUM
     565
     566 # Enable backend callback support.
     567 #VBoxDD_DEFS  += VBOX_WITH_AUDIO_CALLBACKS
    558568
    559569 # Enable Audio Queues implementation for macOS hosts (Core Audio backend).
    560570 VBoxDD_DEFS.darwin += VBOX_WITH_AUDIO_CA_QUEUES
     571
     572 # Enable one-time audio stream initialization at device creation (VM startup) instead
     573 # of creating the stream when needed at some later point in time.
     574 #
     575 # This was the default behavior ever since.
     576 VBoxDD_DEFS  += VBOX_WITH_AUDIO_SB16_ONETIME_INIT
     577 VBoxDD_DEFS  += VBOX_WITH_AUDIO_AC97_ONETIME_INIT
     578 VBoxDD_DEFS  += VBOX_WITH_AUDIO_HDA_ONETIME_INIT
    561579
    562580 # Not yet enabled: Callbacks for the device emulation to let the backends
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