VirtualBox

Ignore:
Timestamp:
May 4, 2021 9:04:51 AM (4 years ago)
Author:
vboxsync
Message:

Audio/SB16: Fixed audio when restoring from a saved state and output DMA was already running. bugref:9890

File:
1 edited

Legend:

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

    r88849 r88854  
    27092709    int32_t s32Tmp;
    27102710    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);
    2711     pStream->HwCfgRuntime.uIrq = s32Tmp;
     2711    pStream->HwCfgRuntime.uIrq = s32Tmp;                        /* IRQ. */
    27122712    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);
    2713     pStream->HwCfgRuntime.uDmaChanLow = s32Tmp;
     2713    pStream->HwCfgRuntime.uDmaChanLow = s32Tmp;                 /* Low (8-bit) DMA channel. */
    27142714    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);
    2715     pStream->HwCfgRuntime.uDmaChanHigh = s32Tmp;
    2716     pHlp->pfnSSMGetS32(pSSM, &s32Tmp); /* Port */
     2715    pStream->HwCfgRuntime.uDmaChanHigh = s32Tmp;                /* High (16-bit) DMA channel. */
     2716    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);                          /* Used I/O port. */
    27172717    pStream->HwCfgRuntime.uPort = s32Tmp;
    2718     pHlp->pfnSSMGetS32(pSSM, &s32Tmp); /* Ver */
     2718    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);                          /* DSP version running. */
    27192719    pStream->HwCfgRuntime.uVer  = s32Tmp;
    27202720    pHlp->pfnSSMGetS32(pSSM, &pThis->dsp_in_idx);
    27212721    pHlp->pfnSSMGetS32(pSSM, &pThis->dsp_out_data_len);
    2722     pHlp->pfnSSMGetS32(pSSM, &s32Tmp); /* Channels */
     2722    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);                          /* Output stream: Numer of channels. */
    27232723    pStream->Cfg.Props.cChannelsX = (uint8_t)s32Tmp;
    2724     pHlp->pfnSSMGetS32(pSSM, &s32Tmp); /* Signed */
     2724    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);                          /* Output stream: Signed format bit. */
    27252725    pStream->Cfg.Props.fSigned    = s32Tmp == 0 ? false : true;
    27262726    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);
    2727     pStream->Cfg.Props.cbSampleX  = s32Tmp / 8; /* Convert bits to bytes. */
    2728     pHlp->pfnSSMSkip  (pSSM, sizeof(int32_t));  /* Legacy; was PDMAUDIOFMT, unused now. */
     2727    pStream->Cfg.Props.cbSampleX  = s32Tmp / 8;                 /* Convert bits to bytes. */
     2728    pHlp->pfnSSMSkip  (pSSM, sizeof(int32_t));                  /* Legacy; was PDMAUDIOFMT, unused now. */
    27292729    pHlp->pfnSSMGetS32(pSSM, &pStream->dma_auto);
    27302730    pHlp->pfnSSMGetS32(pSSM, &pThis->aStreams[SB16_IDX_OUT].cbDmaBlockSize);
     
    27322732    pHlp->pfnSSMGetS32(pSSM, &s32Tmp); pStream->Cfg.Props.uHz = s32Tmp;
    27332733    pHlp->pfnSSMGetS32(pSSM, &pStream->time_const);
    2734     pHlp->pfnSSMSkip  (pSSM, sizeof(int32_t));  /* Legacy; was speaker (on / off) for output stream. */
     2734    pHlp->pfnSSMSkip  (pSSM, sizeof(int32_t));                  /* Legacy; was speaker (on / off) for output stream. */
    27352735    pHlp->pfnSSMGetS32(pSSM, &pThis->dsp_in_needed_bytes);
    27362736    pHlp->pfnSSMGetS32(pSSM, &pThis->cmd);
    2737     pHlp->pfnSSMGetS32(pSSM, &pStream->fDmaUseHigh);
     2737    pHlp->pfnSSMGetS32(pSSM, &pStream->fDmaUseHigh);            /* Output stream: Whether to use the high or low DMA channel. */
    27382738    pHlp->pfnSSMGetS32(pSSM, &pThis->highspeed);
    27392739    pHlp->pfnSSMGetS32(pSSM, &pStream->can_write);
     
    27432743    pHlp->pfnSSMGetU8 (pSSM, &pThis->csp_value);
    27442744    pHlp->pfnSSMGetU8 (pSSM, &pThis->csp_mode);
    2745     pHlp->pfnSSMGetU8 (pSSM, &pThis->csp_param);   /* Bug compatible! */
     2745    pHlp->pfnSSMGetU8 (pSSM, &pThis->csp_param);                /* Bug compatible! */
    27462746    pHlp->pfnSSMGetMem(pSSM, pThis->csp_regs, 256);
    27472747    pHlp->pfnSSMGetU8 (pSSM, &pThis->csp_index);
     
    27572757    pHlp->pfnSSMGetS32(pSSM, &pThis->nzero);
    27582758    pHlp->pfnSSMGetS32(pSSM, &pStream->cbDmaLeft);
    2759     pHlp->pfnSSMGetS32(pSSM, &s32Tmp);
    2760     pStream->State.fEnabled = s32Tmp == 0 ? false: true;
    2761     pHlp->pfnSSMSkip  (pSSM, sizeof(int32_t)); /* Legacy; was the output stream's current bitrate (in bytes). */
    2762     pHlp->pfnSSMSkip  (pSSM, sizeof(int32_t)); /* Legacy; was the output stream's DMA block alignment. */
     2759    pHlp->pfnSSMGetS32(pSSM, &s32Tmp);                          /* Output stream: DMA currently running bit. */
     2760    const bool fStreamEnabled = s32Tmp == 0 ? false: true;
     2761    pHlp->pfnSSMSkip  (pSSM, sizeof(int32_t));                  /* Legacy; was the output stream's current bitrate (in bytes). */
     2762    pHlp->pfnSSMSkip  (pSSM, sizeof(int32_t));                  /* Legacy; was the output stream's DMA block alignment. */
    27632763
    27642764    int32_t mixer_nreg = 0;
     
    27692769    AssertRCReturn(rc, rc);
    27702770
    2771     if (pStream->State.fEnabled)
     2771    if (fStreamEnabled)
    27722772        sb16StreamControl(pDevIns, pThis, pStream, true /* fRun */);
    27732773
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