VirtualBox

Changeset 98333 in vbox for trunk/src


Ignore:
Timestamp:
Jan 27, 2023 11:21:34 AM (2 years ago)
Author:
vboxsync
Message:

Audio/AC97: Some guests (like older NetBSDs) first seem to set up the BDL a tad later so that cbTotal is 0. This means that the BDL is not set up at all. In such cases pStream->Regs.picb also will be 0 here and (debug) asserts here, which is annoying for debug builds. So first check if we have *any* BDLE set up before checking if PICB is > 0.

File:
1 edited

Legend:

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

    r98103 r98333  
    937937    RT_NOREF(pStreamCC);
    938938    uint32_t fSrBcis = 0;
     939    uint32_t cbTotal = 0; /* Counts the total length (in bytes) of the buffer descriptor list (BDL). */
    939940
    940941    /*
     
    954955        pStream->Regs.bd.ctl_len = RT_H2LE_U32(Bdle.ctl_len);
    955956        pStream->Regs.picb       = pStream->Regs.bd.ctl_len & AC97_BD_LEN_MASK;
     957
     958        cbTotal += pStream->Regs.bd.ctl_len & AC97_BD_LEN_MASK;
    956959
    957960        LogFlowFunc(("BDLE%02u: %#RX32 L %#x / LB %#x, ctl=%#06x%s%s\n",
     
    988991                     ("Odd lengths buffers are not allowed: %#x (%d) samples\n",  pStream->Regs.picb, pStream->Regs.picb));
    989992
    990     /* 1.2.4.2 PCM Buffer Restrictions (in 302349-003) - #2  */
    991     ASSERT_GUEST_MSG(pStream->Regs.picb > 0, ("Zero length buffers not allowed to terminate list (LVI=%u CIV=%u)\n",
    992                                               pStream->Regs.lvi, pStream->Regs.civ));
     993    /* 1.2.4.2 PCM Buffer Restrictions (in 302349-003) - #2
     994     *
     995     * Note: Some guests (like older NetBSDs) first seem to set up the BDL a tad later so that cbTotal is 0.
     996     *       This means that the BDL is not set up at all.
     997     *       In such cases pStream->Regs.picb also will be 0 here and (debug) asserts here, which is annoying for debug builds.
     998     *       So first check if we have *any* BDLE set up before checking if PICB is > 0.
     999     */
     1000    ASSERT_GUEST_MSG(cbTotal == 0 || pStream->Regs.picb > 0, ("Zero length buffers not allowed to terminate list (LVI=%u CIV=%u, cbTotal=%zu)\n",
     1001                                                              pStream->Regs.lvi, pStream->Regs.civ, cbTotal));
    9931002
    9941003    return fSrBcis;
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