Changeset 82319 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 2, 2019 12:30:24 PM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r82318 r82319 3341 3341 3342 3342 /** 3343 * @callback_method_impl{FNIOMMMIO WNEWWRITE,3343 * @callback_method_impl{FNIOMMMIONEWWRITE, 3344 3344 * Looks up and calls the appropriate handler.} 3345 3345 */ … … 4724 4724 { 4725 4725 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); /* this shall come first */ 4726 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE); 4726 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE); 4727 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 4727 4728 Assert(iInstance == 0); RT_NOREF(iInstance); 4728 4729 … … 4736 4737 4737 4738 /* 4738 * Validat ions.4739 * Validate and read configuration. 4739 4740 */ 4740 if (!CFGMR3AreValuesValid(pCfg, "RZEnabled\0" 4741 "TimerHz\0" 4742 "PosAdjustEnabled\0" 4743 "PosAdjustFrames\0" 4744 "DebugEnabled\0" 4745 "DebugPathOut\0")) 4746 { 4747 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 4748 N_ ("Invalid configuration for the Intel HDA device")); 4749 } 4750 4751 int rc = CFGMR3QueryBoolDef(pCfg, "RZEnabled", &pThis->fRZEnabled, true); 4752 if (RT_FAILURE(rc)) 4753 return PDMDEV_SET_ERROR(pDevIns, rc, 4754 N_("HDA configuration error: failed to read RCEnabled as boolean")); 4755 4756 4757 rc = CFGMR3QueryU16Def(pCfg, "TimerHz", &pThis->uTimerHz, HDA_TIMER_HZ_DEFAULT /* Default value, if not set. */); 4741 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "TimerHz|PosAdjustEnabled|PosAdjustFrames|DebugEnabled|DebugPathOut", ""); 4742 4743 int rc = pHlp->pfnCFGMQueryU16Def(pCfg, "TimerHz", &pThis->uTimerHz, HDA_TIMER_HZ_DEFAULT /* Default value, if not set. */); 4758 4744 if (RT_FAILURE(rc)) 4759 4745 return PDMDEV_SET_ERROR(pDevIns, rc, … … 4763 4749 LogRel(("HDA: Using custom device timer rate (%RU16Hz)\n", pThis->uTimerHz)); 4764 4750 4765 rc = CFGMR3QueryBoolDef(pCfg, "PosAdjustEnabled", &pThis->fPosAdjustEnabled, true);4751 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "PosAdjustEnabled", &pThis->fPosAdjustEnabled, true); 4766 4752 if (RT_FAILURE(rc)) 4767 4753 return PDMDEV_SET_ERROR(pDevIns, rc, … … 4771 4757 LogRel(("HDA: Position adjustment is disabled\n")); 4772 4758 4773 rc = CFGMR3QueryU16Def(pCfg, "PosAdjustFrames", &pThis->cPosAdjustFrames, HDA_POS_ADJUST_DEFAULT);4759 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "PosAdjustFrames", &pThis->cPosAdjustFrames, HDA_POS_ADJUST_DEFAULT); 4774 4760 if (RT_FAILURE(rc)) 4775 4761 return PDMDEV_SET_ERROR(pDevIns, rc, … … 4779 4765 LogRel(("HDA: Using custom position adjustment (%RU16 audio frames)\n", pThis->cPosAdjustFrames)); 4780 4766 4781 rc = CFGMR3QueryBoolDef(pCfg, "DebugEnabled", &pThis->Dbg.fEnabled, false);4767 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "DebugEnabled", &pThis->Dbg.fEnabled, false); 4782 4768 if (RT_FAILURE(rc)) 4783 4769 return PDMDEV_SET_ERROR(pDevIns, rc, 4784 4770 N_("HDA configuration error: failed to read debugging enabled flag as boolean")); 4785 4771 4786 rc = CFGMR3QueryStringDef(pCfg, "DebugPathOut", pThis->Dbg.szOutPath, sizeof(pThis->Dbg.szOutPath),4787 VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH);4772 rc = pHlp->pfnCFGMQueryStringDef(pCfg, "DebugPathOut", pThis->Dbg.szOutPath, sizeof(pThis->Dbg.szOutPath), 4773 VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); 4788 4774 if (RT_FAILURE(rc)) 4789 4775 return PDMDEV_SET_ERROR(pDevIns, rc, 4790 4776 N_("HDA configuration error: failed to read debugging output path flag as string")); 4791 4792 if (!strlen(pThis->Dbg.szOutPath))4793 RTStrPrintf(pThis->Dbg.szOutPath, sizeof(pThis->Dbg.szOutPath), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH);4794 4777 4795 4778 if (pThis->Dbg.fEnabled) -
trunk/src/VBox/Devices/Audio/DevHDA.h
r82300 r82319 134 134 /** DMA position buffer enable bit. */ 135 135 bool fDMAPosition; 136 /** Flag whether the R0 and RC parts are enabled. */137 bool fRZEnabled;138 136 /** Reserved. */ 139 bool fPadding1b;137 bool afPadding1b[2]; 140 138 /** Number of active (running) SDn streams. */ 141 139 uint8_t cStreamsActive; -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r82317 r82319 492 492 /** RC pointer to the device instance. */ 493 493 PPDMDEVINSRC pDevInsRC; 494 /** Set if R0/RC is enabled. */ 495 bool fRZEnabled; 496 bool afPadding0[3]; 494 bool afPadding0[4]; 497 495 /** Global Control (Bus Master Control Register). */ 498 496 uint32_t glob_cnt; … … 4042 4040 { 4043 4041 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); /* this shall come first */ 4044 PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE); 4042 PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE); 4043 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 4045 4044 Assert(iInstance == 0); RT_NOREF(iInstance); 4046 4045 … … 4055 4054 4056 4055 /* 4057 * Validat ions.4056 * Validate and read configuration. 4058 4057 */ 4059 if (!CFGMR3AreValuesValid(pCfg, "RZEnabled\0" 4060 "Codec\0" 4061 "TimerHz\0" 4062 "DebugEnabled\0" 4063 "DebugPathOut\0")) 4064 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 4065 N_("Invalid configuration for the AC'97 device")); 4066 4067 /* 4068 * Read config data. 4069 */ 4070 int rc = CFGMR3QueryBoolDef(pCfg, "RZEnabled", &pThis->fRZEnabled, true); 4071 if (RT_FAILURE(rc)) 4072 return PDMDEV_SET_ERROR(pDevIns, rc, 4073 N_("AC'97 configuration error: failed to read RCEnabled as boolean")); 4058 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Codec|TimerHz|DebugEnabled|DebugPathOut", ""); 4074 4059 4075 4060 char szCodec[20]; 4076 rc = CFGMR3QueryStringDef(pCfg, "Codec", &szCodec[0], sizeof(szCodec), "STAC9700");4061 int rc = pHlp->pfnCFGMQueryStringDef(pCfg, "Codec", &szCodec[0], sizeof(szCodec), "STAC9700"); 4077 4062 if (RT_FAILURE(rc)) 4078 4063 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 4079 4064 N_("AC'97 configuration error: Querying \"Codec\" as string failed")); 4080 4065 4081 rc = CFGMR3QueryU16Def(pCfg, "TimerHz", &pThis->uTimerHz, AC97_TIMER_HZ_DEFAULT /* Default value, if not set. */);4066 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "TimerHz", &pThis->uTimerHz, AC97_TIMER_HZ_DEFAULT /* Default value, if not set. */); 4082 4067 if (RT_FAILURE(rc)) 4083 4068 return PDMDEV_SET_ERROR(pDevIns, rc, … … 4087 4072 LogRel(("AC97: Using custom device timer rate (%RU16Hz)\n", pThis->uTimerHz)); 4088 4073 4089 rc = CFGMR3QueryBoolDef(pCfg, "DebugEnabled", &pThis->Dbg.fEnabled, false);4074 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "DebugEnabled", &pThis->Dbg.fEnabled, false); 4090 4075 if (RT_FAILURE(rc)) 4091 4076 return PDMDEV_SET_ERROR(pDevIns, rc, 4092 4077 N_("AC97 configuration error: failed to read debugging enabled flag as boolean")); 4093 4078 4094 rc = CFGMR3QueryStringDef(pCfg, "DebugPathOut", pThis->Dbg.szOutPath, sizeof(pThis->Dbg.szOutPath),4095 VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH);4079 rc = pHlp->pfnCFGMQueryStringDef(pCfg, "DebugPathOut", pThis->Dbg.szOutPath, sizeof(pThis->Dbg.szOutPath), 4080 VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); 4096 4081 if (RT_FAILURE(rc)) 4097 4082 return PDMDEV_SET_ERROR(pDevIns, rc, 4098 4083 N_("AC97 configuration error: failed to read debugging output path flag as string")); 4099 4100 if (!strlen(pThis->Dbg.szOutPath))4101 RTStrPrintf(pThis->Dbg.szOutPath, sizeof(pThis->Dbg.szOutPath), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH);4102 4084 4103 4085 if (pThis->Dbg.fEnabled)
Note:
See TracChangeset
for help on using the changeset viewer.