Changeset 55430 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Apr 24, 2015 3:53:15 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r55394 r55430 49 49 *******************************************************************************/ 50 50 #undef LOG_VOICES 51 #ifndef VBOX52 //#define USE_MIXER53 #else54 # define USE_MIXER55 #endif56 51 57 52 #ifdef DEBUG … … 835 830 } 836 831 837 #ifdef USE_MIXER838 839 832 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 840 833 static void ichac97SetVolume(PAC97STATE pThis, int index, PDMAUDIOMIXERCTL mt, uint32_t val) … … 846 839 uint8_t rvol = val & VOL_MASK; 847 840 uint8_t lvol = (val >> 8) & VOL_MASK; 841 842 /* For the master volume, 0 corresponds to 0dB gain. But for the other 843 * volume controls, 0 corresponds to +12dB and 8 to 0dB. */ 844 if (mt != PDMAUDIOMIXERCTL_VOLUME) 845 { 846 /* NB: Currently there is no gain support, only attenuation. */ 847 lvol = lvol < 8 ? 0 : lvol - 8; 848 rvol = rvol < 8 ? 0 : rvol - 8; 849 } 850 848 851 /* AC'97 has 1.5dB steps; we use 0.375dB steps. */ 849 852 rvol = 255 - rvol * 4; … … 957 960 } 958 961 959 #endif /* USE_MIXER */960 961 962 static void ichac97MixerReset(PAC97STATE pThis) 962 963 { … … 1046 1047 ichac97MixerStore(pThis, AC97_Vendor_ID2 , 0x7600); /* 7608 */ 1047 1048 } 1048 #ifdef USE_MIXER1049 1049 ichac97RecordSelect(pThis, 0); 1050 1050 # ifdef VBOX_WITH_PDM_AUDIO_DRIVER … … 1057 1057 ichac97SetVolume(pThis, AC97_Line_In_Volume_Mute, AUD_MIXER_LINE_IN, 0x8808); 1058 1058 # endif 1059 #else1060 ichac97MixerStore(pThis, AC97_Record_Select, 0);1061 ichac97MixerStore(pThis, AC97_Master_Volume_Mute, 0x8000);1062 ichac97MixerStore(pThis, AC97_PCM_Out_Volume_Mute, 0x8808);1063 ichac97MixerStore(pThis, AC97_Line_In_Volume_Mute, 0x8808);1064 #endif1065 1059 1066 1060 /* Reset all streams. */ … … 1916 1910 ichac97MixerStore(pThis, index, u32); 1917 1911 break; 1918 #ifdef USE_MIXER1919 1912 case AC97_Master_Volume_Mute: 1920 1913 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER … … 1941 1934 ichac97RecordSelect(pThis, u32); 1942 1935 break; 1943 #else /* !USE_MIXER */1944 case AC97_Master_Volume_Mute:1945 case AC97_PCM_Out_Volume_Mute:1946 case AC97_Line_In_Volume_Mute:1947 case AC97_Record_Select:1948 ichac97MixerStore(pThis, index, u32);1949 break;1950 #endif /* !USE_MIXER */1951 1936 case AC97_Vendor_ID1: 1952 1937 case AC97_Vendor_ID2: … … 2140 2125 SSMR3GetMem(pSSM, active, sizeof(active)); 2141 2126 2142 #ifdef USE_MIXER2143 2127 ichac97RecordSelect(pThis, ichac97MixerLoad(pThis, AC97_Record_Select)); 2144 2128 # define V_(a, b) ichac97SetVolume(pThis, a, b, ichac97MixerLoad(pThis, a)) … … 2153 2137 # endif /* VBOX_WITH_PDM_AUDIO_DRIVER */ 2154 2138 # undef V_ 2155 #endif /* USE_MIXER */2156 2139 ichac97ResetStreams(pThis, active); 2157 2140
Note:
See TracChangeset
for help on using the changeset viewer.