VirtualBox

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


Ignore:
Timestamp:
Feb 13, 2018 11:18:31 AM (7 years ago)
Author:
vboxsync
Message:

Audio/DrvHostPulseAudio.cpp: Added support for distinguishing input / output streams to the PulseAudio mixer controls, making it easier what to control in the mixer when multiple VMs are running.

File:
1 edited

Legend:

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

    r69118 r70994  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9494     *  Specify UINT32_MAX for unlimited logging. */
    9595    uint32_t              cLogErrors;
     96    /** The stream (base) name; needed for distinguishing
     97     *  streams in the PulseAudio mixer controls if multiple
     98     *  VMs are running at the same time. */
     99    char                  szStreamName[64];
    96100} DRVHOSTPULSEAUDIO, *PDRVHOSTPULSEAUDIO;
    97101
     
    758762             pStreamPA->BufAttr.tlength, pStreamPA->BufAttr.maxlength, pStreamPA->BufAttr.minreq));
    759763
     764    Assert(pCfgReq->enmDir == PDMAUDIODIR_OUT);
     765
     766    char szName[256];
     767    RTStrPrintf2(szName, sizeof(szName),  "VirtualBox %s [%s]",
     768                 DrvAudioHlpPlaybackDstToStr(pCfgReq->DestSource.Dest), pThis->szStreamName);
     769
    760770    /* Note that the struct BufAttr is updated to the obtained values after this call! */
    761     int rc = paStreamOpen(pThis, pStreamPA, false /* fIn */, "PulseAudio (Out)");
     771    int rc = paStreamOpen(pThis, pStreamPA, false /* fIn */, szName);
    762772    if (RT_FAILURE(rc))
    763773        return rc;
     
    800810    pStreamPA->BufAttr.maxlength   = (pStreamPA->BufAttr.fragsize * 3) / 2;
    801811
     812    Assert(pCfgReq->enmDir == PDMAUDIODIR_IN);
     813
     814    char szName[256];
     815    RTStrPrintf2(szName, sizeof(szName),  "VirtualBox %s [%s]",
     816                 DrvAudioHlpRecSrcToStr(pCfgReq->DestSource.Source), pThis->szStreamName);
     817
    802818    /* Note: Other members of BufAttr are ignored for record streams. */
    803     int rc = paStreamOpen(pThis, pStreamPA, true /* fIn */, "PulseAudio (In)");
     819    int rc = paStreamOpen(pThis, pStreamPA, true /* fIn */, szName);
    804820    if (RT_FAILURE(rc))
    805821        return rc;
     
    15771593
    15781594
    1579 
    15801595/**
    15811596 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus}
     
    16641679    /* IHostAudio */
    16651680    PDMAUDIO_IHOSTAUDIO_CALLBACKS(drvHostPulseAudio);
     1681
     1682    int rc2 = CFGMR3QueryString(pCfg, "StreamName", pThis->szStreamName, sizeof(pThis->szStreamName));
     1683    AssertMsgRCReturn(rc2, ("Confguration error: No/bad \"StreamName\" value, rc=%Rrc\n", rc2), rc2);
    16661684
    16671685    return VINF_SUCCESS;
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