VirtualBox

Changeset 68376 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 10, 2017 4:16:01 PM (7 years ago)
Author:
vboxsync
Message:

Audio/DrvHostALSAAudio.cpp: Fixed recording by actually doing a snd_pcm_start() after preparing the device. This never has been the case and only worked by coincidence before (as snd_pcm_readi() internally starts the device if never done so).

Location:
trunk/src/VBox/Devices/Audio
Files:
3 edited

Legend:

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

    r68272 r68376  
    921921    }
    922922
     923    LogFunc(("cFrames=%ld, rc=%Rrc\n", framesAvail, rc));
    923924    return rc;
    924925}
     
    957958static int drvHostALSAAudioStreamCtl(snd_pcm_t *phPCM, bool fPause)
    958959{
     960    int rc = VINF_SUCCESS;
     961
    959962    int err;
    960963    if (fPause)
     
    964967        {
    965968            LogRel(("ALSA: Error stopping stream %p: %s\n", phPCM, snd_strerror(err)));
    966             return VERR_ACCESS_DENIED;
     969            rc = VERR_ACCESS_DENIED; /** @todo Find a better rc. */
    967970        }
    968971    }
     
    973976        {
    974977            LogRel(("ALSA: Error preparing stream %p: %s\n", phPCM, snd_strerror(err)));
    975             return VERR_ACCESS_DENIED;
    976         }
    977     }
    978 
    979     return VINF_SUCCESS;
     978            rc = VERR_ACCESS_DENIED; /** @todo Find a better rc. */
     979        }
     980        else
     981        {
     982            err = snd_pcm_start(phPCM);
     983            if (err < 0)
     984            {
     985                LogRel(("ALSA: Error starting stream %p: %s\n", phPCM, snd_strerror(err)));
     986                rc = VERR_ACCESS_DENIED; /** @todo Find a better rc. */
     987            }
     988        }
     989    }
     990
     991    return rc;
    980992}
    981993
  • trunk/src/VBox/Devices/Audio/alsa_mangling.h

    r61523 r68376  
    66
    77/*
    8  * Copyright (C) 2013-2016 Oracle Corporation
     8 * Copyright (C) 2013-2017 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4545#define snd_pcm_readi                           ALSA_MANGLER(snd_pcm_readi)
    4646#define snd_strerror                            ALSA_MANGLER(snd_strerror)
     47#define snd_pcm_start                           ALSA_MANGLER(snd_pcm_start)
    4748#define snd_pcm_drop                            ALSA_MANGLER(snd_pcm_drop)
    4849#define snd_pcm_resume                          ALSA_MANGLER(snd_pcm_resume)
  • trunk/src/VBox/Devices/Audio/alsa_stubs.c

    r64632 r68376  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    8989           (pcm, buffer, size))
    9090PROXY_STUB(snd_strerror, const char *, (int errnum), (errnum))
     91PROXY_STUB(snd_pcm_start, int, (snd_pcm_t *pcm), (pcm))
    9192PROXY_STUB(snd_pcm_drop, int, (snd_pcm_t *pcm), (pcm))
    9293PROXY_STUB(snd_pcm_resume, int, (snd_pcm_t *pcm), (pcm))
     
    154155    ELEMENT(snd_pcm_readi),
    155156    ELEMENT(snd_strerror),
     157    ELEMENT(snd_pcm_start),
    156158    ELEMENT(snd_pcm_drop),
    157159    ELEMENT(snd_pcm_resume),
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