VirtualBox

Changeset 61332 in vbox


Ignore:
Timestamp:
May 31, 2016 1:23:20 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107627
Message:

Audio: Update.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r61320 r61332  
    35923592 else ifeq ($(VBOX_SOLARIS_VERSION),511)
    35933593  # OSS audio support for Solaris
    3594   VBOX_WITH_SOLARIS_OSS := $(if-expr $(VBOX_SOLARIS_11_VERSION) >= 115,1,)
     3594  VBOX_WITH_OSS := $(if-expr $(VBOX_SOLARIS_11_VERSION) >= 115,1,)
    35953595 endif
    35963596
  • trunk/include/VBox/err.h

    r61317 r61332  
    27482748#define VERR_AUDIO_NO_FREE_INPUT_STREAMS            (-6601)
    27492749/** No free output streams.  */
    2750 #define VERR_AUDIO_NO_FREE_OUTPUT_STREAMS           (-6603)
     2750#define VERR_AUDIO_NO_FREE_OUTPUT_STREAMS           (-6602)
    27512751/** Pending stream disable operation in progress.  */
    2752 #define VERR_AUDIO_STREAM_PENDING_DISABLE           (-6604)
     2752#define VERR_AUDIO_STREAM_PENDING_DISABLE           (-6603)
    27532753/** @} */
    27542754
  • trunk/src/VBox/Devices/Audio/DevSB16.cpp

    r61322 r61332  
    318318    PVM pVM = PDMDevHlpGetVM(pThis->pDevInsR3);
    319319    PCFGMNODE pRoot = CFGMR3GetRoot(pVM);
    320     PCFGMNODE pDev0 = CFGMR3GetChild(pRoot, "Devices/SB16/0/");
     320    PCFGMNODE pDev0 = CFGMR3GetChild(pRoot, "Devices/sb16/0/");
    321321
    322322    /* Remove LUN branch. */
     
    452452    RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node)
    453453    {
     454        if (!pDrv->Out.pStream)
     455            continue;
     456
    454457        int rc2 = pDrv->pConnector->pfnStreamControl(pDrv->pConnector, pDrv->Out.pStream,
    455458                                                     hold == 1 ? PDMAUDIOSTREAMCMD_ENABLE : PDMAUDIOSTREAMCMD_DISABLE);
     
    17751778    {
    17761779        PPDMAUDIOSTREAM pStream = pDrv->Out.pStream;
     1780        if (!pStream)
     1781            continue;
    17771782
    17781783        PDMAUDIOSTRMSTS strmSts = pDrv->pConnector->pfnStreamGetStatus(pDrv->pConnector, pStream);
     
    23272332
    23282333        /** @todo No input streams available for SB16 yet. */
    2329         /* Note: Only query the whole backend status here, as we don't have multiple streams to check for. */
    2330         bool fValidOut = pCon->pfnGetStatus(pCon, PDMAUDIODIR_OUT) == PDMAUDIOBACKENDSTS_RUNNING;
     2334        bool fValidOut = pCon->pfnStreamGetStatus(pCon, pDrv->Out.pStream) & PDMAUDIOSTRMSTS_FLAG_INITIALIZED;
    23312335        if (!fValidOut)
    23322336        {
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r61320 r61332  
    254254{
    255255    AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
    256     AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
     256
     257    if (!pStream)
     258        return VINF_SUCCESS;
    257259
    258260    PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
     
    337339        return VINF_SUCCESS;
    338340
     341    AssertPtr(pThis->pHostDrvAudio);
    339342    AssertMsg(pHstStream->enmCtx == PDMAUDIOSTREAMCTX_HOST,
    340343              ("Stream '%s' is not a host stream and therefore has no backend\n", pHstStream->szName));
     
    450453{
    451454    AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
    452     AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
    453455    AssertPtrReturn(pvBuf,      VERR_INVALID_POINTER);
    454456    /* pcbWritten is optional. */
     
    456458    PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
    457459
    458     if (!cbBuf)
     460    if (   !pStream
     461        || !cbBuf)
    459462    {
    460463        if (pcbWritten)
     
    676679{
    677680    AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
    678     AssertPtrReturn(pStream,    VERR_INVALID_POINTER);
    679681    /* pcData is optional. */
     682
     683    if (!pStream)
     684        return VINF_SUCCESS;
    680685
    681686    PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
     
    13321337{
    13331338    AssertPtrReturn(pCfgHandle, VERR_INVALID_POINTER);
    1334     AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
     1339    AssertPtrReturn(pDrvIns,    VERR_INVALID_POINTER);
    13351340
    13361341    PDRVAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIO);
     
    13651370
    13661371    if (!pStream)
    1367         return VERR_NOT_AVAILABLE;
     1372    {
     1373        if (pcbRead)
     1374            *pcbRead = 0;
     1375        return VINF_SUCCESS;
     1376    }
    13681377
    13691378    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
     
    16191628            {
    16201629                LogFlowFunc(("Maximum number of host output streams reached\n"));
    1621                 RC_BREAK(VERR_NO_MORE_HANDLES); /** @todo Fudge! */
     1630                RC_BREAK(VERR_AUDIO_NO_FREE_OUTPUT_STREAMS);
    16221631            }
    16231632
     
    18731882        return VINF_SUCCESS;
    18741883
    1875     int rc = VINF_SUCCESS;
    1876 
    1877     LogFlowFunc(("%s: fStatus=0x%x\n", pHstStream->szName, pHstStream->fStatus));
    1878 
     1884    AssertPtr(pThis->pHostDrvAudio);
    18791885    AssertMsg(pHstStream->enmCtx == PDMAUDIOSTREAMCTX_HOST,
    18801886              ("Stream '%s' is not a host stream and therefore has no backend\n", pHstStream->szName));
     1887
     1888    int rc = VINF_SUCCESS;
     1889
     1890    LogFlowFunc(("%s: fStatus=0x%x\n", pHstStream->szName, pHstStream->fStatus));
    18811891
    18821892    if (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_INITIALIZED)
     
    19201930
    19211931    int rc = drvAudioStreamControlInternal(pThis, pGstStream, PDMAUDIOSTREAMCMD_DISABLE);
    1922     if (RT_SUCCESS(rc))
     1932    if (   RT_SUCCESS(rc)
     1933        && pThis->pHostDrvAudio)
     1934    {
    19231935        rc = drvAudioStreamControlInternalBackend(pThis, pHstStream, PDMAUDIOSTREAMCMD_DISABLE);
     1936    }
    19241937
    19251938    if (RT_SUCCESS(rc))
  • trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp

    r61320 r61332  
    14321432    NOREF(pStream);
    14331433
    1434     return (PDMAUDIOSTRMSTS_FLAG_INITIALIZED | PDMAUDIOSTRMSTS_FLAG_ENABLED);
     1434    PDMAUDIOSTRMSTS strmSts =   PDMAUDIOSTRMSTS_FLAG_INITIALIZED
     1435                              | PDMAUDIOSTRMSTS_FLAG_ENABLED;
     1436
     1437    if (pStream->enmDir == PDMAUDIODIR_IN)
     1438    {
     1439
     1440    }
     1441    else
     1442    {
     1443        PALSAAUDIOSTREAMOUT pStreamOut = (PALSAAUDIOSTREAMOUT)pStream;
     1444
     1445        snd_pcm_sframes_t cAvail;
     1446        int rc2 = alsaStreamGetAvail(pStreamOut->phPCM, &cAvail);
     1447        if (   RT_SUCCESS(rc2)
     1448            && cAvail >= 1024) /** @todo !!! HACK ALERT !!! Use bufsize. */
     1449        {
     1450            LogFlowFunc(("cAvail=%ld\n", cAvail));
     1451            strmSts |= PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE;
     1452        }
     1453    }
     1454
     1455    return strmSts;
    14351456}
    14361457
  • trunk/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp

    r61320 r61332  
    10611061    NOREF(pStream);
    10621062
    1063     return (PDMAUDIOSTRMSTS_FLAG_INITIALIZED | PDMAUDIOSTRMSTS_FLAG_ENABLED);
    1064 }
    1065 
     1063    PDMAUDIOSTRMSTS strmSts =   PDMAUDIOSTRMSTS_FLAG_INITIALIZED
     1064                              | PDMAUDIOSTRMSTS_FLAG_ENABLED;
     1065
     1066    strmSts |=   pStream->enmDir == PDMAUDIODIR_IN
     1067               ? PDMAUDIOSTRMSTS_FLAG_DATA_READABLE
     1068               : PDMAUDIOSTRMSTS_FLAG_DATA_WRITABLE;
     1069
     1070    return strmSts;
     1071}
    10661072/**
    10671073 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
  • trunk/src/VBox/Devices/Makefile.kmk

    r61320 r61332  
    589589  ifdef VBOX_WITH_OSS
    590590   VBoxDD_DEFS    += VBOX_WITH_OSS
    591    VBoxDD_SOURCES  += \
     591   VBoxDD_SOURCES += \
    592592        Audio/DrvHostOSSAudio.cpp
    593593  endif
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r61056 r61332  
    123123        $(if $(VBOX_WITH_ADDITIONS_AUTOUPDATE_UI),VBOX_WITH_ADDITIONS_AUTOUPDATE_UI) \
    124124        $(if $(VBOX_WITH_UPDATE_REQUEST),VBOX_WITH_UPDATE_REQUEST) \
     125        $(if $(VBOX_WITH_OSS),VBOX_WITH_OSS) \
    125126        $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA) \
    126127        $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE) \
    127         $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS) \
    128128        $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000) \
    129129        $(if $(VBOX_WITH_NETFLT)$(eq $(KBUILD_TARGET),freebsd),VBOX_WITH_NETFLT) \
  • trunk/src/VBox/Main/Makefile.kmk

    r61157 r61332  
    55
    66#
    7 # Copyright (C) 2004-2015 Oracle Corporation
     7# Copyright (C) 2004-2016 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    271271        $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
    272272        $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
     273        $(if $(VBOX_WITH_OSS),VBOX_WITH_OSS,) \
    273274        $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
    274275        $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
     276        $(if $(VBOX_WITH_VRDE_AUDIO),VBOX_WITH_VRDE_AUDIO,) \
    275277        $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
    276         $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
    277278        $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
    278279        $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
     
    640641        VBOX_COM_INPROC \
    641642        $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
     643        $(if $(VBOX_WITH_OSS),VBOX_WITH_OSS,) \
    642644        $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
    643645        $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
    644646        $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
    645         $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
    646647        $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
    647648        $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
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