Changeset 65022 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 29, 2016 9:42:39 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 112517
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r65018 r65022 1065 1065 static void hdaTimerMaybeStart(PHDASTATE pThis); 1066 1066 static void hdaTimerMaybeStop(PHDASTATE pThis); 1067 static void hdaTimerMain(PHDASTATE pThis); 1067 1068 #endif 1068 1069 /** @} */ … … 3896 3897 3897 3898 #ifndef VBOX_WITH_AUDIO_HDA_CALLBACKS 3899 /** 3900 * Starts the internal audio device timer (if not started yet). 3901 * 3902 * @param pThis HDA state. 3903 */ 3898 3904 static void hdaTimerMaybeStart(PHDASTATE pThis) 3899 3905 { … … 3917 3923 3918 3924 /* Start transfers. */ 3919 hdaDoTransfers(pThis); 3920 } 3921 } 3922 3925 hdaTimerMain(pThis); 3926 } 3927 } 3928 3929 /** 3930 * Stops the internal audio device timer (if not stopped yet). 3931 * 3932 * @param pThis HDA state. 3933 */ 3923 3934 static void hdaTimerStop(PHDASTATE pThis) 3924 3935 { … … 3943 3954 } 3944 3955 3945 static void hdaDoTransfers(PHDASTATE pThis) 3956 /** 3957 * Main routine for the device timer. 3958 * 3959 * @returns IPRT status code. 3960 * @param pThis HDA state. 3961 */ 3962 static void hdaTimerMain(PHDASTATE pThis) 3946 3963 { 3947 3964 AssertPtrReturnVoid(pThis); … … 3960 3977 bool fKickTimer = false; 3961 3978 3962 PHDASTREAM pStreamLineIn = hdaSinkGetStream(pThis, &pThis->SinkLineIn); 3963 #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN 3964 PHDASTREAM pStreamMicIn = hdaSinkGetStream(pThis, &pThis->SinkMicIn); 3965 #endif 3966 PHDASTREAM pStreamFront = hdaSinkGetStream(pThis, &pThis->SinkFront); 3967 #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 3968 /** @todo See note below. */ 3969 #endif 3970 3971 hdaStreamUpdate(pThis, pStreamLineIn); 3972 #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN 3973 hdaStreamUpdate(pThis, pStreamMicIn); 3974 #endif 3975 hdaStreamUpdate(pThis, pStreamFront); 3976 3977 3978 #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 3979 int rc2 = AudioMixerSinkUpdate(pThis->SinkCenterLFE.pMixSink); 3980 AssertRC(rc2); 3981 3982 rc2 = AudioMixerSinkUpdate(pThis->SinkRear.pMixSink); 3983 AssertRC(rc2); 3984 /** @todo Check for stream interleaving and only call hdaStreamDoDMA() if required! */ 3985 3986 /* 3987 * Only call hdaTransfer if CenterLFE and/or Rear are on different SDs, 3988 * otherwise we have to use the interleaved streams support for getting the data 3989 * out of the Front sink (depending on the mapping layout). 3990 */ 3991 #endif 3979 hdaDoTransfers(pThis); 3992 3980 3993 3981 /* Do we need to kick the timer again? */ … … 4022 4010 } 4023 4011 4012 /** 4013 * Timer callback which handles the audio data transfers on a periodic basis. 4014 * 4015 * @param pDevIns Device instance. 4016 * @param pTimer Timer which was used when calling this. 4017 * @param pvUser User argument as PHDASTATE. 4018 */ 4024 4019 static DECLCALLBACK(void) hdaTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 4025 4020 { … … 4030 4025 AssertPtr(pThis); 4031 4026 4032 hda DoTransfers(pThis);4027 hdaTimerMain(pThis); 4033 4028 } 4034 4029 … … 4082 4077 } 4083 4078 #endif /* VBOX_WITH_AUDIO_HDA_CALLBACKS */ 4079 4080 /** 4081 * Main routine to perform the actual audio data transfers from the HDA streams 4082 * to the backend(s) and vice versa. 4083 * 4084 * @param pThis HDA state. 4085 */ 4086 static void hdaDoTransfers(PHDASTATE pThis) 4087 { 4088 PHDASTREAM pStreamLineIn = hdaSinkGetStream(pThis, &pThis->SinkLineIn); 4089 #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN 4090 PHDASTREAM pStreamMicIn = hdaSinkGetStream(pThis, &pThis->SinkMicIn); 4091 #endif 4092 PHDASTREAM pStreamFront = hdaSinkGetStream(pThis, &pThis->SinkFront); 4093 #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 4094 /** @todo See note below. */ 4095 #endif 4096 4097 hdaStreamUpdate(pThis, pStreamLineIn); 4098 #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN 4099 hdaStreamUpdate(pThis, pStreamMicIn); 4100 #endif 4101 hdaStreamUpdate(pThis, pStreamFront); 4102 4103 4104 #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 4105 int rc2 = AudioMixerSinkUpdate(pThis->SinkCenterLFE.pMixSink); 4106 AssertRC(rc2); 4107 4108 rc2 = AudioMixerSinkUpdate(pThis->SinkRear.pMixSink); 4109 AssertRC(rc2); 4110 /** @todo Check for stream interleaving and only call hdaStreamDoDMA() if required! */ 4111 4112 /* 4113 * Only call hdaTransfer if CenterLFE and/or Rear are on different SDs, 4114 * otherwise we have to use the interleaved streams support for getting the data 4115 * out of the Front sink (depending on the mapping layout). 4116 */ 4117 #endif 4118 } 4084 4119 4085 4120 #ifdef DEBUG_andy … … 4763 4798 RTCircBufReleaseReadBlock(pCircBuf, cbDMA); 4764 4799 4800 /* All DMA transfers done for now? */ 4765 4801 if (!cbDMA) 4766 4802 fDone = true;
Note:
See TracChangeset
for help on using the changeset viewer.