VirtualBox

Changeset 87586 in vbox


Ignore:
Timestamp:
Feb 3, 2021 4:44:18 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142615
Message:

Audio/HDA: Reverted r142614 (committed too much). ticketoem2ref:36

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

Legend:

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

    r87585 r87586  
    938938               pStream->szName, DrvAudioHlpAudDirToStr(pStream->enmDir)));
    939939
    940     /*AssertMsg(DrvAudioHlpBytesIsAligned(cbBuf, &pStream->Guest.Cfg.Props),
    941               ("Stream '%s' got a non-frame-aligned write (%RU32 bytes)\n", pStream->szName, cbBuf));*/
     940    AssertMsg(DrvAudioHlpBytesIsAligned(cbBuf, &pStream->Guest.Cfg.Props),
     941              ("Stream '%s' got a non-frame-aligned write (%RU32 bytes)\n", pStream->szName, cbBuf));
    942942
    943943    uint32_t cbWrittenTotal = 0;
     
    10041004            || !cfGstWritten)
    10051005        {
     1006            AssertMsgFailed(("[%s] Write failed: cbToWrite=%RU32, cfWritten=%RU32, rc=%Rrc\n",
     1007                             pStream->szName, cbToWrite, cfGstWritten, rc));
    10061008            break;
    10071009        }
     
    23322334#define QUERY_CONFIG(a_InOut) \
    23332335    /* PCM stuff. */ \
    2334     CFGMR3QueryU8Def (pNode, "xPCMSampleBit"         #a_InOut, &pCfg->Props.cbSample,  0); \
    2335     CFGMR3QueryU32Def(pNode, "xPCMSampleHz"          #a_InOut, &pCfg->Props.uHz,       0); \
    2336     CFGMR3QueryU8Def (pNode, "xPCMSampleSigned"      #a_InOut, &pCfg->uSigned,         UINT8_MAX /* No custom value set */); \
    2337     CFGMR3QueryU8Def (pNode, "xPCMSampleSwapEndian"  #a_InOut, &pCfg->uSwapEndian,     UINT8_MAX /* No custom value set */); \
    2338     CFGMR3QueryU8Def (pNode, "xPCMSampleChannels"    #a_InOut, &pCfg->Props.cChannels, 0); \
     2336    CFGMR3QueryU8Def (pNode, "PCMSampleBit"         #a_InOut, &pCfg->Props.cbSample,  0); \
     2337    CFGMR3QueryU32Def(pNode, "PCMSampleHz"          #a_InOut, &pCfg->Props.uHz,       0); \
     2338    CFGMR3QueryU8Def (pNode, "PCMSampleSigned"      #a_InOut, &pCfg->uSigned,         UINT8_MAX /* No custom value set */); \
     2339    CFGMR3QueryU8Def (pNode, "PCMSampleSwapEndian"  #a_InOut, &pCfg->uSwapEndian,     UINT8_MAX /* No custom value set */); \
     2340    CFGMR3QueryU8Def (pNode, "PCMSampleChannels"    #a_InOut, &pCfg->Props.cChannels, 0); \
    23392341    \
    23402342    /* Buffering stuff. */ \
    2341     CFGMR3QueryU32Def(pNode, "xPeriodSizeMs"         #a_InOut, &pCfg->uPeriodSizeMs, 0); \
    2342     CFGMR3QueryU32Def(pNode, "xBufferSizeMs"         #a_InOut, &pCfg->uBufferSizeMs, 0); \
    2343     CFGMR3QueryU32Def(pNode, "xPreBufferSizeMs"      #a_InOut, &pCfg->uPreBufSizeMs, UINT32_MAX /* No custom value set */);
     2343    CFGMR3QueryU32Def(pNode, "PeriodSizeMs"         #a_InOut, &pCfg->uPeriodSizeMs, 0); \
     2344    CFGMR3QueryU32Def(pNode, "BufferSizeMs"         #a_InOut, &pCfg->uBufferSizeMs, 0); \
     2345    CFGMR3QueryU32Def(pNode, "PreBufferSizeMs"      #a_InOut, &pCfg->uPreBufSizeMs, UINT32_MAX /* No custom value set */);
    23442346
    23452347    if (enmDir == PDMAUDIODIR_IN)
  • trunk/src/VBox/Devices/Audio/HDAStream.cpp

    r87585 r87586  
    2929#include <VBox/vmm/pdmdev.h>
    3030#include <VBox/vmm/pdmaudioifs.h>
     31
     32#include <math.h> /* Needed for roundl(). */
    3133
    3234#include "DrvAudio.h"
     
    546548                const double cTicksPerByte = cTicksPerHz / (double)pStreamShared->State.cbTransferChunk;
    547549
    548 #define HDA_ROUND_NEAREST(a_X) ((a_X) >= 0 ? (uint32_t)((a_X) + 0.5) : (uint32_t)((a_X) - 0.5)) /** @todo r=andy Do we have rounding in IPRT? */
    549 
    550550                /* Calculate the timer ticks per byte for this stream. */
    551                 pStreamShared->State.cTicksPerByte = HDA_ROUND_NEAREST(cTicksPerByte);
     551                pStreamShared->State.cTicksPerByte = roundl(cTicksPerByte); /** @todo r=andy Do we have rounding in IPRT? */
    552552                Assert(pStreamShared->State.cTicksPerByte);
    553553
     
    555555
    556556                /* Calculate timer ticks per transfer. */
    557                 pStreamShared->State.cTransferTicks = HDA_ROUND_NEAREST(cTransferTicks);
     557                pStreamShared->State.cTransferTicks = roundl(cTransferTicks);
    558558                Assert(pStreamShared->State.cTransferTicks);
    559 
    560 #undef HDA_ROUND_NEAREST
    561559
    562560                LogRel2(("HDA: Stream #%RU8 is using %uHz device timer (%RU64 virtual ticks / Hz), stream Hz=%RU32, "
     
    21122110
    21132111#endif /* IN_RING3 */
     2112
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette