Changeset 220
- Timestamp:
- Jul 17, 2007, 5:58:46 PM (18 years ago)
- Location:
- OCO/tags/1.1.4RC2
- Files:
-
- 11 edited
- 1 copied
-
. (copied) (copied from OCO/trunk )
-
drv16/apm.asm (modified) (2 diffs)
-
drv16/apmevent.cpp (modified) (5 diffs)
-
drv16/init.cpp (modified) (3 diffs)
-
drv16/ossidc16.cpp (modified) (2 diffs)
-
drv16/strategy.cpp (modified) (2 diffs)
-
drv16/waudio.cpp (modified) (2 diffs)
-
drv16/waudio.hpp (modified) (1 diff)
-
drv16/wavehw.hpp (modified) (1 diff)
-
drv16/waveplay.cpp (modified) (9 diffs)
-
include/ossidc.h (modified) (1 diff)
-
include/version.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OCO/tags/1.1.4RC2/drv16/apm.asm
r33 r220 77 77 78 78 enter 4,0 79 pushad79 ; pushad 80 80 push ds 81 81 push es … … 92 92 pop es 93 93 pop ds 94 popad94 ; popad 95 95 leave 96 96 ret 4 -
OCO/tags/1.1.4RC2/drv16/apmevent.cpp
r33 r220 17 17 #endif 18 18 19 staticint fAPMSuspend = FALSE;19 int fAPMSuspend = FALSE; 20 20 21 21 /***********************************************************************/ … … 49 49 return(APM_suspend(APM_STATE_OFF)); /* put chip to sleep */ 50 50 default: 51 return 1;51 return 0; 52 52 } /* endswitch */ 53 53 … … 65 65 return 0; 66 66 } 67 return 1;67 return 0; 68 68 } 69 69 … … 132 132 } 133 133 134 /* just external callback */ 135 void far apm_resume(void) 136 { 137 APM_resume(APM_STATE_READY); 138 } 134 139 135 140 /***********************************************************************/ … … 152 157 APM_Reg_Req.function = APM_REGISTER_FUNCTION; 153 158 APM_Reg_Req.eventh = APM_EVENT; 154 APM_Reg_Req.mask = 0x 3C0;159 APM_Reg_Req.mask = 0xFFF8; 155 160 APM_Reg_Req.ds = FP_SEG(&APM_Reg_Req); 156 161 APM_Reg_Req.device_id = 0x0001; -
OCO/tags/1.1.4RC2/drv16/init.cpp
r33 r220 64 64 static char szCopyRight1[]= "Copyright 2000-2002 InnoTek Systemberatung GmbH"; 65 65 static char szCopyRight2[]= "Copyright 2002 IBM Corporation"; 66 static char szCopyRight3[]= "Maintained by http:// os2.kiev.ua/en/uniaud.php";66 static char szCopyRight3[]= "Maintained by http://uniaud.netlabs.org"; 67 67 static char szParamError[]= "Parameter parsing error!!"; 68 68 static char szInitError[] = "Unable to initialize audio hardware"; … … 167 167 if(DosOpen((PSZ)"ALSA32$", &hFile, &usAction, 0, 168 168 FILE_NORMAL, FILE_OPEN, OPEN_ACCESS_READWRITE | 169 OPEN_SHARE_DENYNONE | OPEN_FLAGS_WRITE_THROUGH, 169 OPEN_SHARE_DENYNONE | OPEN_FLAGS_WRITE_THROUGH 170 /* Rudi's suggestion */ | OPEN_FLAGS_NOINHERIT, 170 171 NULL ) == NO_ERROR) 171 172 { … … 190 191 current_device = 0; 191 192 // Build the Wave Playback Hardware object 192 new WAVEPLAY(current_device);193 pWavePlay = new WAVEPLAY(current_device); 193 194 new WAVEREC(current_device); 194 195 -
OCO/tags/1.1.4RC2/drv16/ossidc16.cpp
r33 r220 41 41 42 42 extern "C" ULONG far __cdecl OSSIDC_ENTRY(ULONG cmd, ULONG param1, ULONG param2); 43 43 extern int force_closed; 44 44 //Used to call into the 32 bits OSS driver 45 45 static OSSRET CallOSS32(USHORT cmd, IDC32_PACKET FAR *pIDCPacket); … … 666 666 break; 667 667 668 case IDC16_CLOSE_PCM: 669 // force_close(); 670 break; 668 case IDC16_CLOSE_UNI16: 669 { 670 force_closed = 1; 671 pWavePlay->Close(0); 672 //WAVEAUDIO::WavePlayClose(); 673 break; 674 } 671 675 case IDC16_PROCESS: 672 676 { 673 677 PWAVESTREAM pStream; 674 675 676 678 // dprintf(("IDC16_PROCESS. param1: %x, param2: %x",param1, param2)); 677 679 //Signal all active wave playback streams to update their status -
OCO/tags/1.1.4RC2/drv16/strategy.cpp
r33 r220 169 169 goto failure; 170 170 } 171 dprintf(("Device 0 name: %s", (char FAR *)devCaps[0].szDeviceName)); 171 172 if(devCaps[0].nrDevices > OSS32_MAX_AUDIOCARDS) 172 173 { … … 183 184 } 184 185 186 /* skip sertifying crap */ 187 188 return TRUE; 185 189 //Check for certified audiocard/chipsets 186 190 if(!xorstrncmp(devCaps[0].szDeviceName, pszIntelICH, 6) || -
OCO/tags/1.1.4RC2/drv16/waudio.cpp
r33 r220 434 434 //manual sample rate conversion before sending buffers to the ALSA driver 435 435 FindMatchingSampleRate(pConfigInfo->ulSampleRate, pWaveCaps->ulRateFlags, &ulNrSampleRates, &pConfigInfo->ulFixedSampleRate); 436 if(ulNrSampleRates == 1&& pConfigInfo->ulSampleRate != pConfigInfo->ulFixedSampleRate) {436 if(ulNrSampleRates <= 2 && pConfigInfo->ulSampleRate != pConfigInfo->ulFixedSampleRate) { 437 437 pConfigInfo->fSampleRateConversion = TRUE; 438 438 } … … 1015 1015 sampleRates[nrSampleRates++] = 192000; 1016 1016 } 1017 if(nrSampleRates > 1) {1017 if(nrSampleRates > 2) { 1018 1018 _usfind_matching_sample_rate(&ulSampleRate, nrSampleRates, (ULONG FAR *)sampleRates); 1019 1019 } 1020 1020 else { 1021 1021 //fixed rate -> we support all sample rates by manually performing sample rate conversion 1022 if(nrSampleRates == 1 && pulFixedSampleRate) { 1023 *pulFixedSampleRate = sampleRates[0]; 1022 if(nrSampleRates <= 2 && pulFixedSampleRate) { 1023 sampleRates[0] = 48000; /* hardware set to 48000 */ 1024 *pulFixedSampleRate = sampleRates[0]; 1025 nrSampleRates = 1; 1024 1026 } 1025 1027 } -
OCO/tags/1.1.4RC2/drv16/waudio.hpp
r33 r220 145 145 virtual BOOL Close(OSSSTREAMID StreamId) = 0; 146 146 147 ULONG ConvertLength(ULONG length, PWAVECONFIGINFO pConfigInfo);148 ULONG ConvertLengthInvert(ULONG length, PWAVECONFIGINFO pConfigInfo);149 ULONG ConvertPosition(ULONG length, PWAVECONFIGINFO pConfigInfo);150 ULONG ConvertPositionInvert(ULONG length, PWAVECONFIGINFO pConfigInfo);147 ULONG ConvertLength(ULONG length, PWAVECONFIGINFO pConfigInfo); 148 ULONG ConvertLengthInvert(ULONG length, PWAVECONFIGINFO pConfigInfo); 149 ULONG ConvertPosition(ULONG length, PWAVECONFIGINFO pConfigInfo); 150 ULONG ConvertPositionInvert(ULONG length, PWAVECONFIGINFO pConfigInfo); 151 151 152 152 protected: 153 153 154 ULONG ulDeviceNr;155 OSSSTREAMID StreamId;154 OSSSTREAMID StreamId; 155 ULONG ulDeviceNr; 156 156 157 157 private: -
OCO/tags/1.1.4RC2/drv16/wavehw.hpp
r33 r220 53 53 typedef WAVEPLAY *PWAVEPLAY; 54 54 55 PWAVEPLAY pWavePlay = NULL; 56 55 57 class WAVEREC : public WAVEAUDIO { 56 58 public: -
OCO/tags/1.1.4RC2/drv16/waveplay.cpp
r33 r220 40 40 41 41 int waveOpened = 0; 42 42 int force_closed = 0; 43 extern int fAPMSuspend; 44 void far apm_resume(void); 43 45 extern "C" 44 46 { … … 47 49 } 48 50 51 /* 52 * save already opened by mmos2 53 * to reuse in case of reopen stream needed 54 * TODO!! if there is more right way? 55 */ 56 ULONG ulDeviceSave, ulStreamTypeSave, ulSysFileNumSave; 49 57 //****************************************************************************** 50 58 //****************************************************************************** … … 55 63 dprintf(("WAVEPLAY::Open %lx",StreamId)); 56 64 #endif 65 if (fAPMSuspend) 66 { 67 #ifdef DEBUG 68 dprintf(("WAVEPLAY::Open. Suspend state")); 69 #endif 70 apm_resume(); 71 //return FALSE; 72 } 73 57 74 if(StreamId == 0UL) 58 75 { … … 73 90 //if the device supports multiple active streams, then we always open 74 91 //a new ALSA stream 75 if(devCaps[ulDevice].waveOutCaps.nrStreams == 1) {92 //if(devCaps[ulDevice].waveOutCaps.nrStreams == 1) { 76 93 StreamId = *pStreamId; 77 } 94 //} 95 ulDeviceSave = ulDevice; 96 ulStreamTypeSave = ulStreamType; 97 ulSysFileNumSave = ulSysFileNum; 78 98 } 79 99 else { … … 85 105 //****************************************************************************** 86 106 //****************************************************************************** 87 BOOL WAVEPLAY::Close(OSSSTREAMID StreamId )107 BOOL WAVEPLAY::Close(OSSSTREAMID StreamIdl) 88 108 { 89 109 #ifdef DEBUG … … 92 112 //if ((open_strategy & 1)) 93 113 //if (waveOpened == 1) 94 if (0) 95 { 96 if (OSS16_WaveClose(StreamId) == OSSERR_SUCCESS) 114 if (force_closed) 115 { 116 waveOpened--; 117 StreamId = 0UL; 118 open_strategy = 0UL; 119 force_closed = 0; 120 #ifdef DEBUG 121 dprintf(("WAVEPLAY::Closed stream: %lx, %lx, os: %lx\n", StreamId, waveOpened,open_strategy)); 122 #endif 123 return TRUE; 124 } 125 else 126 { 127 //if(devCaps[ulDeviceNr].waveOutCaps.nrStreams > 1) 128 if (0) 97 129 { 98 waveOpened--; 99 StreamId = 0UL; 100 open_strategy = 0UL; 101 #ifdef DEBUG 102 dprintf(("WAVEPLAY::Closed stream: %lx, %lx, os: %lx\n", StreamId, waveOpened,open_strategy)); 103 #endif 104 return TRUE; 105 } 106 return FALSE; 107 } 108 else 109 { 110 if(devCaps[ulDeviceNr].waveOutCaps.nrStreams > 1) 111 { 112 if (OSS16_WaveClose(StreamId) == OSSERR_SUCCESS) 130 if (OSS16_WaveClose(StreamIdl) == OSSERR_SUCCESS) 113 131 { 114 132 waveOpened--; … … 137 155 #endif 138 156 139 // if (!waveOpened) return TRUE; 157 if (fAPMSuspend) 158 { 159 #ifdef DEBUG 160 dprintf(("WAVEPLAY::ConfigDev. Suspend state")); 161 #endif 162 apm_resume(); 163 //return FALSE; 164 } 165 166 if (StreamId == NULL) 167 { 168 WAVEPLAY::Open(ulDeviceSave, ulStreamTypeSave, ulSysFileNumSave, &StreamId); 169 if (StreamId == NULL) 170 { 171 #ifdef DEBUG 172 dprintf(("WAVEPLAY::ConfigDev. Error reopening stream")); 173 #endif 174 return FALSE; 175 } 176 } 140 177 #ifdef DEBUG 141 178 dprintf(("WAVEPLAY::ConfigDev1 SampleRate %d", pConfigInfo->ulHwSampleRate)); … … 228 265 // dprintf(("WAVEPLAY::Transfer")); 229 266 #endif 267 268 if (fAPMSuspend) 269 { 270 #ifdef DEBUG 271 dprintf(("WAVEPLAY::Transfer. Suspend state")); 272 #endif 273 apm_resume(); 274 //return FALSE; 275 } 230 276 231 277 // if (!waveOpened) return TRUE; … … 281 327 // if (!waveOpened) return TRUE; 282 328 329 if (fAPMSuspend) 330 { 331 #ifdef DEBUG 332 dprintf(("WAVEPLAY::AddBuffer. Suspend state")); 333 #endif 334 apm_resume(); 335 //return FALSE; 336 } 337 283 338 if(pConfigInfo->fSampleRateConversion) 284 339 { -
OCO/tags/1.1.4RC2/include/ossidc.h
r33 r220 162 162 #define IDC16_WAVEOUT_IRQ 1 163 163 #define IDC16_MIDI_IRQ 2 164 #define IDC16_CLOSE_ PCM3164 #define IDC16_CLOSE_UNI16 3 165 165 166 166 // Default device nr (first detected audio device) -
OCO/tags/1.1.4RC2/include/version.h
r33 r220 10 10 #define __VERSION_H__ 11 11 12 #define ALSA_VERSION "1.1. 2"12 #define ALSA_VERSION "1.1.4RC2" 13 13 14 14 #endif //__VERSION_H__
Note:
See TracChangeset
for help on using the changeset viewer.
