Changeset 483
- Timestamp:
- May 6, 2010, 3:08:34 AM (15 years ago)
- Location:
- OCO/trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
OCO/trunk/drv16/commdbg.c
r473 r483 204 204 205 205 if (Power==0xF0000000) // 1 billion 206 Power=0xF000000; 206 Power=0xF000000; 207 207 else if (Power==0xF000000) 208 208 Power=0xF00000; … … 230 230 ULONG DBGCALLCONV _cdecl OSS16_DebugString(char FAR *debstr,ULONG bufsize); 231 231 232 #ifdef DEBUG_COM 233 234 short int MAGIC_COMM_PORT = 0x3f8; 235 236 237 #define UART_DATA 0x00 // UART Data port 238 #define UART_INT_ENAB 0x01 // UART Interrupt enable 239 #define UART_INT_ID 0x02 // interrupt ID 240 #define UART_LINE_CTRL 0x03 // line control registers 241 #define UART_MODEM_CTRL 0x04 // modem control register 242 #define UART_LINE_STAT 0x05 // line status register 243 #define UART_MODEM_STAT 0x06 // modem status regiser 244 #define UART_DIVISOR_LO 0x00 // divisor latch least sig 245 #define UART_DIVISOR_HI 0x01h // divisor latch most sig 246 247 #define DELAY nop 248 249 void CharOut(char c) 250 { 251 _asm { 252 253 mov dx, MAGIC_COMM_PORT // address of PS/2's first COM port 254 add dx, UART_LINE_STAT 255 256 ReadyCheck: 257 in al, dx // wait for comm port ready signal 258 259 DELAY 260 DELAY 261 DELAY 262 263 test al, 020h 264 jz ReadyCheck 265 266 // Send the character 267 268 add dx, UART_DATA - UART_LINE_STAT 269 mov al,c 270 out dx, al 271 } 272 } 273 274 void StringOut(char far *DbgStr) 275 { 276 while (*DbgStr) 277 CharOut(*DbgStr++); 278 279 if (fLineTerminate) 280 { 281 CharOut(CR); // append carriage return, 282 CharOut(LF); // linefeed 283 } 284 } 285 286 #endif 287 232 288 void cdecl far PrintfOut(char far *DbgStr , ...) 233 289 { … … 334 390 335 391 *BuildPtr=0; // cauterize the string 336 //PS+++ StringOut((char far *) BuildString); // print to comm port 392 #ifdef DEBUG_COM 393 StringOut((char far *) BuildString); // print to comm port 394 #endif 337 395 //PS++ if want can add option like /Ox and set this if(comport) StringOut((char far *) BuildString); 338 396 OSS16_DebugString((char far *) BuildString,0); // print to Uniaud32 alsahlp$ 339 397 } 340 398 341 #ifdef DEBUG_COM342 343 void StringOut(char far *DbgStr)344 {345 while (*DbgStr)346 CharOut(*DbgStr++);347 348 if (fLineTerminate)349 {350 CharOut(CR); // append carriage return,351 CharOut(LF); // linefeed352 }353 }354 355 short int MAGIC_COMM_PORT = 0x3f8;356 357 358 #define UART_DATA 0x00 // UART Data port359 #define UART_INT_ENAB 0x01 // UART Interrupt enable360 #define UART_INT_ID 0x02 // interrupt ID361 #define UART_LINE_CTRL 0x03 // line control registers362 #define UART_MODEM_CTRL 0x04 // modem control register363 #define UART_LINE_STAT 0x05 // line status register364 #define UART_MODEM_STAT 0x06 // modem status regiser365 #define UART_DIVISOR_LO 0x00 // divisor latch least sig366 #define UART_DIVISOR_HI 0x01h // divisor latch most sig367 368 #define DELAY nop369 370 void CharOut(char c)371 {372 _asm {373 374 mov dx, MAGIC_COMM_PORT // address of PS/2's first COM port375 add dx, UART_LINE_STAT376 377 ReadyCheck:378 in al, dx // wait for comm port ready signal379 380 DELAY381 DELAY382 DELAY383 384 test al, 020h385 jz ReadyCheck386 387 // Send the character388 389 add dx, UART_DATA - UART_LINE_STAT390 mov al,c391 out dx, al392 }393 }394 395 #endif -
OCO/trunk/drv16/commdbg.h
r237 r483 1 1 #ifndef __COMMDBG_H__ 2 2 #define __COMMDBG_H__ 3 4 #ifdef DEBUG 5 //#define DEBUG_COM 6 #endif 3 7 4 8 #ifdef __cplusplus -
OCO/trunk/drv16/dwavestrm.cpp
r478 r483 44 44 45 45 pStream = (PDWAVESTREAM)FindStream_fromFile(ulSysFileNum); 46 if (pStream == NULL) 46 if (pStream == NULL) 47 47 { 48 48 dprintf(("HookHandler stream %lx not found!", (ULONG) ulSysFileNum)); … … 124 124 if(temp) 125 125 { 126 if(ulStreamState == STREAM_STREAMING) 126 if(ulStreamState == STREAM_STREAMING) 127 127 {//means we're called during an interrupt 128 128 qhReturn.PushOnTail((PQUEUEELEMENT)temp); 129 129 DevHelp_ArmCtxHook(ulSysFileNum, hCtxHook); 130 130 } 131 else 131 else 132 132 { 133 133 DevHelp_VMFree((LIN)temp->pBuffptr); … … 143 143 hSem = pReg->hStream; 144 144 145 #ifdef DEBUG 145 146 dprintf(("DWAVESTREAM::Register")); 147 #endif 146 148 if(DevHelp_OpenEventSem(hSem) != 0) { 147 149 dprintf(("DevHlp_OpenEventSem %lx failed!", hSem)); … … 166 168 ULONG DWAVESTREAM::StartStream(void) 167 169 { 168 dprintf(("DWAVESTREAM::StartStream")); 169 return WAVESTREAM::StartStream(); 170 #ifdef DEBUG 171 dprintf(("DWAVESTREAM::StartStream")); 172 #endif 173 return WAVESTREAM::StartStream(); 170 174 } 171 175 //***************************************************************************** … … 176 180 ULONG space, Buff_left, byteswritten; 177 181 178 // dprintf(("DW::AddBuffers")); 182 #ifdef DEBUG 183 dprintf(("DW::AddBuffers")); 184 #endif 179 185 if (!pTemp) pTemp = (PSTREAMBUFFER)qhInProcess.Tail(); 180 186 181 if (ulStreamType & STREAM_WRITE && pTemp && pTemp->looping) 187 if (ulStreamType & STREAM_WRITE && pTemp && pTemp->looping) 182 188 { 183 189 Buff_left = pTemp->ulBuffsz - pTemp->ulBuffpos; 184 if (pahw->GetPosition(StreamId, &_configinfo, &space) != OSSERR_SUCCESS) 190 if (pahw->GetPosition(StreamId, &_configinfo, &space) != OSSERR_SUCCESS) 185 191 { 186 192 dprintf(("DWAVESTREAM::AddBuffers GetPositions")); … … 188 194 return; 189 195 } 190 if(fFirst) 196 if(fFirst) 191 197 { 192 198 space = min(space, 4*_configinfo.ulFragsize); 193 199 } 194 200 else 195 { 201 { 196 202 space = min(space, _configinfo.ulFragsize); 197 203 } 198 if (space) 199 { 200 if (space >= Buff_left) 204 if (space) 205 { 206 if (space >= Buff_left) 201 207 { 202 208 byteswritten = AddBuffer(Buff_left); 203 if (byteswritten == Buff_left) 209 if (byteswritten == Buff_left) 204 210 { 205 211 pTemp->ulBuffpos = 0; //reset fill position … … 207 213 } 208 214 } 209 else 215 else 210 216 { 211 217 AddBuffer(space); … … 214 220 pTemp->ulDonepos = 0; //make sure it ::Process never thinks it's done 215 221 } 216 else 222 else 217 223 { 218 224 WAVESTREAM::AddBuffers(fFirst); 219 225 } 220 // dprintf(("DW::AddBuffers End"));221 226 } 222 227 //***************************************************************************** … … 252 257 //***************************************************************************** 253 258 //***************************************************************************** 254 ULONG DWAVESTREAM::GetProperty(int type) 259 ULONG DWAVESTREAM::GetProperty(int type) 255 260 { 256 261 switch(type) { … … 279 284 WAVESTREAM(streamtype, pinit, filesysnum, mixerStreamId), fError(FALSE), hCtxHook(0), hSem(0) 280 285 { 281 dprintf(("DWS::DWS Init")); 282 if (DevHelp_AllocateCtxHook((NPFN)HookHandlerAsm, &hCtxHook)) 286 #ifdef DEBUG 287 dprintf(("DWS::DWS Init")); 288 #endif 289 if (DevHelp_AllocateCtxHook((NPFN)HookHandlerAsm, &hCtxHook)) 283 290 { 284 291 dprintf(("DWAVESTREAM::DWAVESTREAM AllocCtx")); -
OCO/trunk/drv16/event.cpp
r33 r483 53 53 ulPopTime = ulNextTime; 54 54 ulNextTime = 0xFFFFFFFF; 55 55 56 56 57 // send the event back to the SHDD -
OCO/trunk/drv16/fmsynth.cpp
r468 r483 44 44 BOOL FMSYNTH::Open(ULONG ulDevice, ULONG ulStreamType, ULONG ulSysFileNum, OSSSTREAMID FAR *pStreamId) 45 45 { 46 if(midiOutStreamId == 0) 46 if(midiOutStreamId == 0) 47 47 { 48 48 if(OSS16_MidiOpen(current_device, FM_SEND, pStreamId) != OSSERR_SUCCESS) … … 83 83 //****************************************************************************** 84 84 int FMSYNTH::writeByte(OSSSTREAMID StreamId, BYTE b) 85 { 86 int dummy = b; 87 return 0; 85 { 86 int dummy = b; 87 return 0; 88 88 } 89 89 //****************************************************************************** … … 94 94 //****************************************************************************** 95 95 int FMSYNTH::readByte(OSSSTREAMID StreamId) 96 { 97 dprintf(("FMSYNTH::readByte"));96 { 97 //dprintf(("FMSYNTH::readByte")); 98 98 DebugInt3(); 99 return -1; 99 return -1; 100 100 } 101 101 //****************************************************************************** -
OCO/trunk/drv16/init.cpp
r259 r483 137 137 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 138 138 DosWrite(1, (VOID FAR*)szParamError, sizeof(szParamError)-1, &result); 139 return; 139 return; 140 140 } 141 141 … … 194 194 DosWrite(1, (VOID FAR*)szAlsaError, sizeof(szAlsaError)-1, &result); 195 195 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 196 return; 196 return; 197 197 } 198 198 -
OCO/trunk/drv16/ioctl.cpp
r478 r483 72 72 // stream idle bit in the stream state then write the sysfilenum 73 73 // into the request packet, set rc = 0 and return 74 if (p->sMode == IDLE) 74 if (p->sMode == IDLE) 75 75 { 76 76 pstream = FindStream_fromFile((ULONG) prp->s.ioctl.usSysFileNum); … … 117 117 //HACK BEGIN 118 118 //SvL: Save stream handle & SHD entrypoint in case MMPM2 reinitializes 119 // a stream that was already registered 119 // a stream that was already registered 120 120 //HACK END 121 121 if(pstream->pfnSHD) { … … 145 145 146 146 p->ulFlags = 0; /* Zero the Flags */ 147 switch (HardwareType) 147 switch (HardwareType) 148 148 { 149 149 case AUDIOHW_WAVE_PLAY: … … 210 210 211 211 #ifdef DEBUG 212 dprintf(("IACapability: dev type: %ld, ldev %d",ulDevicetype, LDev));212 // dprintf(("IACapability: dev type: %ld, ldev %d",ulDevicetype, LDev)); 213 213 #endif 214 214 … … 220 220 // bailout if no hardware object is returned.. 221 221 pHWobj = GetHardwareDevice(ulDevicetype); 222 if (pHWobj) 222 if (pHWobj) 223 223 { 224 224 pHWobj->DevCaps(p); 225 if (p->ulSupport != SUPPORT_SUCCESS) 225 if (p->ulSupport != SUPPORT_SUCCESS) 226 226 { 227 227 //PS+++ filling to our parameters as say mmpm2.inf for returning error in this call … … 237 237 else { 238 238 #ifdef DEBUG 239 dprintf(("IACapability: Error get HW obj"));239 // dprintf(("IACapability: Error get HW obj")); 240 240 #endif 241 241 //PS+++ filling to our parameters as say mmpm2.inf for returning error in this call … … 268 268 ULONG addr; 269 269 270 if (p->usIOCtlRequest != AUDIO_CHANGE) 270 if (p->usIOCtlRequest != AUDIO_CHANGE) 271 271 { 272 272 dprintf(("IAudioControl: Error support req:%x",p->usIOCtlRequest)); … … 282 282 addr = OFFSETOF(pAudChange); 283 283 addr += sizeof(MCI_AUDIO_CHANGE); 284 if(addr >= 0x10000UL) 284 if(addr >= 0x10000UL) 285 285 { 286 286 dprintf(("Invalid MCI_AUDIO_CHANGE pnt %lx!!", (ULONG)pAudChange)); … … 294 294 addr = OFFSETOF(pMasterVol); 295 295 addr += sizeof(MCI_TRACK_INFO); 296 if(addr >= 0x10000UL) 296 if(addr >= 0x10000UL) 297 297 { 298 298 dprintf(("Invalid MCI_TRACK_INFO pnt %lx!!", (ULONG)pMasterVol)); … … 311 311 pStream->SetProperty(PROPERTY_BALANCE, pAudChange->lBalance); 312 312 313 if (pAudChange->lVolume != AUDIO_IGNORE) 313 if (pAudChange->lVolume != AUDIO_IGNORE) 314 314 { 315 315 // stream volume ranges from 0 to 0x7FFFFFFF (linear) … … 320 320 } 321 321 322 if (pMasterVol && pMasterVol->usMasterVolume != AUDIO_IGNORE) 322 if (pMasterVol && pMasterVol->usMasterVolume != AUDIO_IGNORE) 323 323 { 324 324 // master volume ranges from 0 to 0x7FFF (linear) 325 325 volume = pMasterVol->usMasterVolume; 326 326 volume = (volume*OSS32_MAX_VOLUME)/0x7FFFUL; 327 if (volume > OSS32_MAX_VOLUME) 327 if (volume > OSS32_MAX_VOLUME) 328 328 { 329 329 volume = OSS32_MAX_VOLUME; … … 331 331 // dprintf(("IlAudioControl:Set MV to %d", volume)); 332 332 MixerSetVolume(MixerStreamId, OSS32_MIX_VOLUME_MASTER_FRONT, MAKE_VOLUME_LR(volume, volume)); 333 if(mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(OSS32_MIX_VOLUME_MASTER_REAR)) 333 if(mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(OSS32_MIX_VOLUME_MASTER_REAR)) 334 334 { 335 335 MixerSetVolume(MixerStreamId, OSS32_MIX_VOLUME_MASTER_REAR, MAKE_VOLUME_LR(volume, volume)); … … 409 409 { 410 410 pHWobj->DevCaps(&audioCaps); 411 if (audioCaps.ulSupport != SUPPORT_SUCCESS) 411 if (audioCaps.ulSupport != SUPPORT_SUCCESS) 412 412 { 413 413 dprintf(("IDirectAudio: DevCaps failed")); … … 417 417 } 418 418 } 419 else 419 else 420 420 { 421 421 dprintf(("IDirectAudio: HW DevCaps failed")); … … 427 427 pStream = new DWAVESTREAM(AUDIOHW_WAVE_PLAY, pInit, prp->s.ioctl.usSysFileNum, MixerStreamId); 428 428 if(pStream == NULL) { 429 dprintf(("IDirectAudio: pStream"));429 // dprintf(("IDirectAudio: pStream")); 430 430 DebugInt3(); 431 431 pInit->sReturnCode = INVALID_REQUEST; … … 434 434 } 435 435 436 if(!pStream->IsEverythingOk()) 436 if(!pStream->IsEverythingOk()) 437 437 { 438 438 delete pStream; 439 dprintf(("IlDirectAudio: IsEverythingOk"));439 // dprintf(("IlDirectAudio: IsEverythingOk")); 440 440 DebugInt3(); 441 441 pInit->sReturnCode = INVALID_REQUEST; … … 482 482 { 483 483 pHWobj->DevCaps(&audioCaps); 484 if (audioCaps.ulSupport != SUPPORT_SUCCESS) 484 if (audioCaps.ulSupport != SUPPORT_SUCCESS) 485 485 { 486 486 dprintf(("IlDirectAudio: DevCaps failed")); … … 489 489 return; 490 490 } 491 dprintf(("IoctlDirectAudio ret0"));491 // dprintf(("IoctlDirectAudio ret0")); 492 492 pInit->sReturnCode = 0; 493 493 return; … … 500 500 } 501 501 } 502 else 503 if(prp->s.ioctl.bCode == DAUDIO_QUERYCAPS) 502 else 503 if(prp->s.ioctl.bCode == DAUDIO_QUERYCAPS) 504 504 { 505 505 LPOSS32_DEVCAPS lpCaps = (LPOSS32_DEVCAPS) prp->s.ioctl.pvData; … … 519 519 { 520 520 pHWobj->DevCaps(lpCaps); 521 dprintf(("IoctlDirectAudio ret1"));522 return; 523 } 524 else 521 // dprintf(("IoctlDirectAudio ret1")); 522 return; 523 } 524 else 525 525 { 526 526 prp->usStatus |= RPERR; 527 dprintf(("IoctlDirectAudio ret err1"));527 // dprintf(("IoctlDirectAudio ret err1")); 528 528 return; 529 529 } … … 532 532 533 533 pStream = FindStream_fromFile((ULONG) prp->s.ioctl.usSysFileNum); 534 if(pStream == NULL) 534 if(pStream == NULL) 535 535 { 536 536 dprintf(("IDirectAudio stream %lx not found!", (ULONG) prp->s.ioctl.usSysFileNum)); … … 553 553 { 554 554 case DAUDIO_CLOSE: 555 dprintf(("ID close"));555 // dprintf(("ID close")); 556 556 delete pStream; 557 557 break; … … 559 559 case DAUDIO_SETVOLUME: 560 560 { 561 dprintf(("ID SetVolume"));561 // dprintf(("ID SetVolume")); 562 562 pStream->SetProperty(PROPERTY_VOLUME, MAKE_VOLUME_LR(pDAudioCmd->Vol.VolumeL, pDAudioCmd->Vol.VolumeR)); 563 563 break; … … 566 566 case DAUDIO_GETVOLUME: 567 567 { 568 dprintf(("ID GetVolume"));568 // dprintf(("ID GetVolume")); 569 569 pDAudioCmd->Vol.VolumeL = GET_VOLUME_L(pStream->GetProperty(PROPERTY_VOLUME)); 570 570 pDAudioCmd->Vol.VolumeR = GET_VOLUME_R(pStream->GetProperty(PROPERTY_VOLUME)); … … 575 575 { 576 576 dprintf(("ID Start NF:%d",(USHORT)numFreeStreams)); 577 if(numFreeStreams > 0) 577 if(numFreeStreams > 0) 578 578 { 579 579 rc = pStream->StartStream(); … … 631 631 case DAUDIO_SETPROPERTY: 632 632 { 633 dprintf(("ID SetProp"));633 // dprintf(("ID SetProp")); 634 634 rc = pStream->SetProperty((USHORT)pDAudioCmd->SetProperty.type, pDAudioCmd->SetProperty.value); 635 635 break; … … 640 640 DDCMDREGISTER reg; 641 641 642 dprintf(("ID Reg"));642 // dprintf(("ID Reg")); 643 643 reg.ulFunction = DDCMD_REG_STREAM; 644 644 reg.hStream = pDAudioCmd->Thread.hSemaphore; … … 651 651 case DAUDIO_DEREGISTER_THREAD: 652 652 { 653 dprintf(("ID DeReg"));653 // dprintf(("ID DeReg")); 654 654 pStream->DeRegister(); 655 655 break; … … 657 657 658 658 case DAUDIO_QUERYVERSION: 659 dprintf(("ID qVer"));659 // dprintf(("ID qVer")); 660 660 pDAudioCmd->Version.ulVersion = DAUDIO_VERSION; 661 661 break; 662 662 } 663 663 664 if(rc) 665 { 666 dprintf(("IoctlDirectAudio ret err rc=%ld",rc));664 if(rc) 665 { 666 // dprintf(("IoctlDirectAudio ret err rc=%ld",rc)); 667 667 prp->usStatus |= RPERR | RPBADCMD; 668 668 return; … … 687 687 extern "C" void StrategyIoctl(PREQPACKET prp, USHORT LDev) 688 688 { 689 if (prp->s.ioctl.bCategory == DAUDIO_IOCTL_CAT) 689 if (prp->s.ioctl.bCategory == DAUDIO_IOCTL_CAT) 690 690 { 691 691 IoctlDirectAudio(prp); … … 696 696 dprintf(("StrategyIoctl:cat:0x%x, code:0x%x cd %d gd %d", prp->s.ioctl.bCategory, prp->s.ioctl.bCode, current_device, LDev)); 697 697 #endif 698 if (prp->s.ioctl.bCategory == 0x90) 698 if (prp->s.ioctl.bCategory == 0x90) 699 699 { 700 700 IoctlMixer(prp, LDev); 701 701 return; 702 702 } 703 if (prp->s.ioctl.bCategory != AUDIO_IOCTL_CAT) 703 if (prp->s.ioctl.bCategory != AUDIO_IOCTL_CAT) 704 704 { 705 705 prp->usStatus |= RPERR | RPBADCMD; … … 724 724 725 725 #ifdef DEBUG 726 dprintf(("StrategyIoctl:ret:0x%x", (USHORT)prp->usStatus));726 // dprintf(("StrategyIoctl:ret:0x%x", (USHORT)prp->usStatus)); 727 727 #endif 728 728 return; -
OCO/trunk/drv16/mixer.cpp
r478 r483 81 81 /* OSS32_MIX_VOLUME_SPEAKER */ MONOINSET & 0xF, 82 82 /* OSS32_MIX_VOLUME_PHONE */ PHONESET & 0xF, 83 /* OSS32_MIX_VOLUME_HEADPHONE */ -1, 83 /* OSS32_MIX_VOLUME_HEADPHONE */ -1, 84 84 /* OSS32_MIX_VOLUME_AUX */ AUXSET & 0xF, 85 85 /* OSS32_MIX_VOLUME_CAPTURE */ RECORDGAINSET & 0xF, … … 109 109 USHORT VolumeL, VolumeR; 110 110 111 //dprintf(("IoctlMixer Dev=%x Code=%x Data=%x", LDev, prp->s.ioctl.bCode, prp->s.ioctl.pvData)); 111 112 if((prp->s.ioctl.bCode & 0xF0) == 0x40) 112 113 { … … 123 124 if(prp->s.ioctl.bCode == RECORDSRCSET || 124 125 prp->s.ioctl.bCode == RECORDGAINSET || 125 prp->s.ioctl.bCode == STREAMVOLSET) 126 prp->s.ioctl.bCode == STREAMVOLSET) 126 127 { 127 128 if(pMixStruct->Mute != 2) { //don't save lock override value … … 149 150 } 150 151 151 if(prp->s.ioctl.bCode >= MONOINSET && prp->s.ioctl.bCode <= RECORDGAINSET) 152 if(prp->s.ioctl.bCode >= MONOINSET && prp->s.ioctl.bCode <= RECORDGAINSET) 152 153 { 153 154 int idx = prp->s.ioctl.bCode & 0xF; … … 198 199 break; 199 200 } 200 MixerSetProperty(MixerStreamId, OSS32_MIX_INPUTSRC, recsrc, 201 MixerSetProperty(MixerStreamId, OSS32_MIX_INPUTSRC, recsrc, 201 202 MIXFLAG_FORCE_UPDATE|MIXFLAG_IOCTL90); 202 203 break; … … 210 211 fRecGainIOCTL90 = TRUE; 211 212 //must use left volume value only 212 MixerSetVolume(MixerStreamId, OSS32_MIX_VOLUME_CAPTURE, MAKE_VOLUME_LR(VolumeL, VolumeL), 213 MixerSetVolume(MixerStreamId, OSS32_MIX_VOLUME_CAPTURE, MAKE_VOLUME_LR(VolumeL, VolumeL), 213 214 MIXFLAG_FORCE_UPDATE|MIXFLAG_IOCTL90); 214 215 break; … … 223 224 224 225 fPCMVolIOCTL90 = TRUE; 225 MixerSetVolume(MixerStreamId, OSS32_MIX_VOLUME_PCM, MAKE_VOLUME_LR(VolumeL, VolumeR), 226 MixerSetVolume(MixerStreamId, OSS32_MIX_VOLUME_PCM, MAKE_VOLUME_LR(VolumeL, VolumeR), 226 227 MIXFLAG_FORCE_UPDATE|MIXFLAG_IOCTL90); 227 228 break; … … 233 234 } 234 235 } 235 else 236 if(prp->s.ioctl.bCode >= MONOINQUERY && prp->s.ioctl.bCode <= RECORDGAINQUERY) 236 else 237 if(prp->s.ioctl.bCode >= MONOINQUERY && prp->s.ioctl.bCode <= RECORDGAINQUERY) 237 238 { 238 239 int idx = prp->s.ioctl.bCode & 0xF; … … 289 290 return; 290 291 } 291 } 292 else 292 } 293 else 293 294 if(oldsem) { 294 295 if(DevHelp_CloseEventSem(oldsem) != 0) { … … 333 334 334 335 //if input gain is not supported by hardware, then change line volume 335 if(ulControl == OSS32_MIX_VOLUME_CAPTURE && !(mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(OSS32_MIX_VOLUME_CAPTURE))) 336 if(ulControl == OSS32_MIX_VOLUME_CAPTURE && !(mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(OSS32_MIX_VOLUME_CAPTURE))) 336 337 { 337 338 dprintf(("MixerSetVolume: No input gain -> change line volume!!")); … … 359 360 } 360 361 361 if(!(fFlags & MIXFLAG_DONTSAVE)) 362 { 363 if(ulControl < OSS32_MIX_MAX_CONTROLS && ALSAToIOCTL90Control[ulControl] != -1) 362 if(!(fFlags & MIXFLAG_DONTSAVE)) 363 { 364 if(ulControl < OSS32_MIX_MAX_CONTROLS && ALSAToIOCTL90Control[ulControl] != -1) 364 365 { 365 366 int idx = ALSAToIOCTL90Control[ulControl]; … … 409 410 } 410 411 411 if(ulControl < OSS32_MIX_MAX_CONTROLS && (mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(ulControl))) 412 { 413 ulVolume = MAKE_VOLUME_LR(MixerSettingsALSA[ulControl].VolumeL, 412 if(ulControl < OSS32_MIX_MAX_CONTROLS && (mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(ulControl))) 413 { 414 ulVolume = MAKE_VOLUME_LR(MixerSettingsALSA[ulControl].VolumeL, 414 415 MixerSettingsALSA[ulControl].VolumeR); 415 416 } … … 424 425 ULONG ulVolume = 0; 425 426 426 if(ulControl < OSS32_MIX_MAX_CONTROLS && (mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(ulControl))) 427 { 428 ulVolume = MAKE_VOLUME_LR(MixerSettingsALSA[ulControl].VolumeL, 427 if(ulControl < OSS32_MIX_MAX_CONTROLS && (mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(ulControl))) 428 { 429 ulVolume = MAKE_VOLUME_LR(MixerSettingsALSA[ulControl].VolumeL, 429 430 MixerSettingsALSA[ulControl].VolumeR); 430 431 } … … 435 436 //****************************************************************************** 436 437 void DBGCALLCONV MixerSuspend() 437 { 438 { 438 439 ULONG ulVolume; 439 440 int i; 440 441 441 442 //dprintf(("MixerSuspend")); 442 443 443 444 for(i=0;i<=OSS32_MIX_VOLUME_MAX;i++) { … … 470 471 int i; 471 472 472 473 //dprintf(("MixerRestoreState")); 473 474 474 475 //restore mixer control volume … … 586 587 587 588 if(hMixerNotifySem) { 588 589 //dprintf(("Notify mixer change")); 589 590 rc = DevHelp_PostEventSem(hMixerNotifySem); 590 591 if(rc != 0) { … … 611 612 USHORT lVolume, rVolume; 612 613 613 if(OSS16_MixOpen(LDev, &MixerStreamId) != OSSERR_SUCCESS) 614 if(OSS16_MixOpen(LDev, &MixerStreamId) != OSSERR_SUCCESS) 614 615 { 615 616 DebugInt3(); … … 617 618 return; 618 619 } 619 if(OSS16_MixQueryCaps(MixerStreamId, &mixcaps) != OSSERR_SUCCESS) 620 if(OSS16_MixQueryCaps(MixerStreamId, &mixcaps) != OSSERR_SUCCESS) 620 621 { 621 622 DebugInt3(); … … 685 686 ALSAIOCTLMap[VIDEOSET] = 1; 686 687 ALSAIOCTLMap[VIDEOQUERY] = 1; 687 688 688 689 //Set VIDEO 689 690 rp.s.ioctl.bCode = VIDEOSET; … … 702 703 mixinfo.Mute = 1; 703 704 mixinfo.VolumeR = mixinfo.VolumeL = 80; 704 IoctlMixer(&rp, LDev); 705 IoctlMixer(&rp, LDev); 705 706 } 706 707 if(mixcaps.fuCtrlCaps & OSS32_MIX_FLAG(OSS32_MIX_VOLUME_PHONE)) { -
OCO/trunk/drv16/ossidc16.cpp
r473 r483 279 279 //****************************************************************************** 280 280 //****************************************************************************** 281 //******************************************************************************282 //******************************************************************************283 281 OSSRET DBGCALLCONV OSS16_WaveGetHwPtr(OSSSTREAMID StreamId, ULONG FAR *lpBytesLeft) 284 282 { … … 295 293 return ret; 296 294 } 295 //****************************************************************************** 296 //****************************************************************************** 297 297 OSSRET DBGCALLCONV OSS16_WaveSetVolume(OSSSTREAMID StreamId, ULONG volume) 298 298 { … … 688 688 #pragma on (unreferenced) 689 689 { 690 // dprintf(("OSSIDC ep. cmd: %x param1: %x, param2: %x",cmd, param1, param2));690 //dprintf(("OSSIDC cmd:%lx param1:%lx param2:%lx", cmd, param1, param2)); 691 691 switch(cmd & 0xFFFF) 692 692 { … … 715 715 { 716 716 PWAVESTREAM pStream; 717 // dprintf(("IDC16_PROCESS"));718 717 //dprintf(("IDC16_PROCESS, %d", param1)); 718 //Signal all active wave playback streams to update their status 719 719 pStream = (PWAVESTREAM)FindFirstActiveStream(STREAM_WAVE_PLAY); 720 while(pStream) 720 while(pStream) 721 721 { 722 722 pStream->Process(); … … 725 725 //Signal all active wave capture streams to update their status 726 726 pStream = (PWAVESTREAM)FindFirstActiveStream(STREAM_WAVE_CAPTURE); 727 while(pStream) 727 while(pStream) 728 728 { 729 729 pStream->Process(); 730 730 pStream = (PWAVESTREAM)FindNextActiveStream(STREAM_WAVE_CAPTURE, pStream); 731 731 } 732 //dprintf(("IDC16_PROCESS end"));732 //dprintf(("IDC16_PROCESS end")); 733 733 break; 734 734 } -
OCO/trunk/drv16/rtmidi.cpp
r33 r483 209 209 MIDIAUDIO *pma = (MIDIAUDIO *) pMidiAudio; 210 210 211 dprintf(("rtmidi: RecvByte"));211 //dprintf(("rtmidi: RecvByte")); 212 212 213 213 if(!pma) { … … 233 233 MIDIAUDIO *pma = (MIDIAUDIO *) pMidiAudio; 234 234 235 dprintf(("rtmidi: RecvString"));235 //dprintf(("rtmidi: RecvString")); 236 236 237 237 if(!pma) { -
OCO/trunk/drv16/ssm_idc.cpp
r478 r483 43 43 } 44 44 #endif 45 46 45 switch (pCommon->ulFunction) { 47 46 48 47 case DDCMD_SETUP: { 48 ddprintf(("DDCMD_SETUP")); 49 49 if (!pstream) 50 50 { … … 56 56 pstream->SetCurrentTime(psp->ulStreamTime); 57 57 58 59 60 if (p->ulSetupParmSize > sizeof(ULONG)) 58 // if there is a flags field in the SETUP_PARM 59 // the tell MMPM it can send us 'RECURRING' events.... 60 if (p->ulSetupParmSize > sizeof(ULONG)) 61 61 { 62 //dprintf(("DDCMD_SETUP ParmSize %ld", p->ulSetupParmSize));62 // dprintf(("DDCMD_SETUP ParmSize %ld", p->ulSetupParmSize)); 63 63 psp->ulFlags = SETUP_RECURRING_EVENTS; 64 64 } … … 68 68 ddprintf(("DDCMD_READ")); 69 69 PDDCMDREADWRITE p=(PDDCMDREADWRITE) pCommon; 70 71 70 72 71 if (!pstream) … … 79 78 } 80 79 // Task time 81 case DDCMD_WRITE: 80 case DDCMD_WRITE: 82 81 { 83 82 PDDCMDREADWRITE p=(PDDCMDREADWRITE) pCommon; 84 ULONG Space;85 83 86 84 if (!pstream) … … 89 87 return ERROR_INVALID_STREAM; 90 88 } 91 #ifdef PS_Thinking92 OSS16_WaveGetSpace(pstream->StreamId, &Space);93 ddprintf(("DDCMD_WRITE %lx space %lx",p->ulBufferSize, Space));94 if (Space < p->ulBufferSize)95 {96 DevHelp_ProcBlock (pstream->StreamId, 2, 0);97 ddprintf(("DDCMD_WRITE after %lx space %lx",p->ulBufferSize, Space));98 }99 #endif100 // ddprintf(("DDCMD_WRITE"));101 89 ulReturnCode = pstream->Write((PSTREAMBUF) p->pBuffer,(unsigned) p->ulBufferSize); 102 ddprintf(("DDCMD_WRITE %lx rc=%ld",p->ulBufferSize, ulReturnCode));90 ddprintf(("DDCMD_WRITE %lx %lx rc=%ld", p->pBuffer, p->ulBufferSize, ulReturnCode)); 103 91 if (ulReturnCode) 104 92 return ulReturnCode; … … 106 94 } 107 95 case DDCMD_STATUS: { 108 ddprintf(("DDCMD_STATUS")); 109 PDDCMDSTATUS p = (PDDCMDSTATUS) pCommon; 110 PSTATUS_PARM p2 = (PSTATUS_PARM) p->pStatus; 111 if (!pstream) 112 return ERROR_INVALID_STREAM; 113 p2->ulTime = pstream->GetCurrentTime(); 114 // ddprintf(("DDCMD_STATUS time:%ld",p2->ulTime)); 115 break; 96 PDDCMDSTATUS p = (PDDCMDSTATUS) pCommon; 97 PSTATUS_PARM p2 = (PSTATUS_PARM) p->pStatus; 98 if (!pstream) 99 return ERROR_INVALID_STREAM; 100 p2->ulTime = pstream->GetCurrentTime(); 101 ddprintf(("DDCMD_STATUS time:%lx", p2->ulTime)); 102 break; 116 103 } 117 case DDCMD_CONTROL: 104 case DDCMD_CONTROL: 118 105 { 119 106 PDDCMDCONTROL p = (PDDCMDCONTROL) pCommon; … … 124 111 } 125 112 126 switch (p->ulCmd) 113 switch (p->ulCmd) 127 114 { 128 115 case DDCMD_START: 129 116 ddprintf(("DDCMD_START")); 130 117 ulReturnCode = pstream->StartStream(); 131 ddprintf(("DDCMD_START End rc=%ld",ulReturnCode));118 //ddprintf(("DDCMD_START End rc=%ld",ulReturnCode)); 132 119 return ulReturnCode; 133 120 case DDCMD_STOP: 134 121 ddprintf(("DDCMD_STOP")); 135 //DevHelp_ProcBlock ((ULONG)p, 2, 0);122 //DevHelp_ProcBlock ((ULONG)p, 2, 0); 136 123 p->ulParmSize=sizeof(ULONG); 137 124 return pstream->StopStream((PCONTROL_PARM)p->pParm); … … 156 143 return pstream->ResumeStreamTime(); 157 144 default: 145 ddprintf(("DDCMD INVALID REQUEST\n")); 158 146 return ERROR_INVALID_REQUEST; 159 147 } /* endswitch */ 160 148 } 161 case DDCMD_REG_STREAM: 149 case DDCMD_REG_STREAM: 162 150 { 163 151 ddprintf(("DDCMD_REG_STREAM size:%lx countbuf:%lx",((PDDCMDREGISTER) pCommon)->ulBufSize, ((PDDCMDREGISTER) pCommon)->ulNumBufs)); -
OCO/trunk/drv16/stream.cpp
r468 r483 46 46 PSTREAMBUFFER temp = (PSTREAMBUFFER)qhDone.PopHead(); 47 47 48 if (temp) 48 if (temp) 49 49 { 50 50 shdri.ulFunction = SHD_REPORT_INT; … … 52 52 // if this is a write (playback) then set the streamtype and 53 53 // tell the stream handler that we played all of the buffer. 54 if (ulStreamType & STREAM_WRITE) 55 {54 if (ulStreamType & STREAM_WRITE) 55 { 56 56 shdri.ulFlag = SHD_WRITE_COMPLETE; 57 57 shdri.ulStatus = temp->ulBuffsz; … … 66 66 shdri.pBuffer = temp->pBuffptr; 67 67 shdri.ulStreamTime = GetCurrentTime(); 68 //ddprintf(("Returning %lx Time=%lx", temp->pBuffptr, shdri.ulStreamTime)); 68 69 pfnSHD(&shdri); 69 70 delete temp; … … 94 95 //SvL: BUGFIX: check all events 95 96 #if 1 96 if (qhEvent.IsElements()) { 97 PEVENT pnextevent = (PEVENT)qhEvent.Head(); 98 ULONG time = GetCurrentTime(); 99 while(pnextevent) { 100 ULONG eventtime = pnextevent->GetEventTime(); 101 if (eventtime <= time) 102 pnextevent->Report(time); 103 pnextevent = (PEVENT)pnextevent->pNext; 97 if (qhEvent.IsElements()) { 98 PEVENT pnextevent = (PEVENT)qhEvent.Head(); 99 ULONG time = GetCurrentTime(); 100 while(pnextevent) { 101 ULONG eventtime = pnextevent->GetEventTime(); 102 if (eventtime <= time) 103 pnextevent->Report(time); 104 pnextevent = (PEVENT)pnextevent->pNext; 105 } 104 106 } 105 }106 107 #else 107 108 if (qhEvent.IsElements()) { … … 173 174 ULONG STREAM::Register(PDDCMDREGISTER p) 174 175 { 175 ddprintf(("STREAM::Register"));176 // ddprintf(("STREAM::Register")); 176 177 hstream = p->hStream; 177 178 pfnSHD = (PFN_SHD) p->pSHDEntryPoint; … … 236 237 // event to time out.. if it is not already on 237 238 // the head of the Event queue then put it there 238 if (pele2 != qhEvent.Head()) 239 if (pele2 != qhEvent.Head()) 239 240 { 240 241 cli(); … … 328 329 //****************************************************************************** 329 330 //****************************************************************************** 330 ULONG STREAM::GetProperty(int type) 331 ULONG STREAM::GetProperty(int type) 331 332 { 332 333 switch(type) { … … 358 359 } 359 360 //****************************************************************************** 360 static int streamtype[STREAM_MAX_TYPES] = {STREAM_WAVE_CAPTURE, STREAM_WAVE_PLAY, 361 static int streamtype[STREAM_MAX_TYPES] = {STREAM_WAVE_CAPTURE, STREAM_WAVE_PLAY, 361 362 STREAM_MPU401_CAPTURE, 362 363 STREAM_MPU401_PLAY, STREAM_FMSYNTH_PLAY}; -
OCO/trunk/drv16/timer.cpp
r473 r483 127 127 pStream = (MIDISTREAM*) FindActiveStream( ulStreamType ); 128 128 129 dprintf(("TIMER::Ctx"));129 // dprintf(("TIMER::Ctx")); 130 130 if (pStream) // Should always be a valid fn adr when timer is running. 131 131 pStream->Process(); … … 399 399 uMSec = _uInterval_mSec; 400 400 _uCumulativeError += _uIntervalErr_uSec; 401 if (_uCumulativeError >= 1000) 401 if (_uCumulativeError >= 1000) 402 402 { 403 403 //PS++ begin -
OCO/trunk/drv16/waudio.cpp
r478 r483 559 559 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 560 560 pConfigInfo->pfnConvert = ConvertNone; 561 dprintf(("CNV_NONE"));561 // dprintf(("CNV_NONE")); 562 562 break; 563 563 … … 566 566 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 567 567 pConfigInfo->pfnConvert = Convert8To8SignChange; 568 dprintf(("CNV_8_U_TO_8_S/CNV_8_S_TO_8_U"));568 // dprintf(("CNV_8_U_TO_8_S/CNV_8_S_TO_8_U")); 569 569 break; 570 570 … … 573 573 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(1,0); //factor 2 574 574 pConfigInfo->pfnConvert = Convert8MonoTo8Stereo; 575 dprintf(("CNV_8_U_TO_8_U_MN_ST/CNV_8_S_TO_8_S_MN_ST"));575 // dprintf(("CNV_8_U_TO_8_U_MN_ST/CNV_8_S_TO_8_S_MN_ST")); 576 576 break; 577 577 … … 580 580 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(1,0); //factor 2 581 581 pConfigInfo->pfnConvert = Convert8MonoTo8StereoSignChange; 582 dprintf(("CNV_8_S_TO_8_U_MN_ST/CNV_8_U_TO_8_S_MN_ST"));582 // dprintf(("CNV_8_S_TO_8_U_MN_ST/CNV_8_U_TO_8_S_MN_ST")); 583 583 break; 584 584 … … 587 587 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(1,0); //factor 2 588 588 pConfigInfo->pfnConvert = Convert8To16; 589 dprintf(("CNV_8_S_TO_16_S/CNV_8_U_TO_16_U"));589 // dprintf(("CNV_8_S_TO_16_S/CNV_8_U_TO_16_U")); 590 590 break; 591 591 … … 594 594 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(1,0); //factor 2 595 595 pConfigInfo->pfnConvert = Convert8To16SignChange; 596 dprintf(("CNV_8_S_TO_16_U/CNV_8_U_TO_16_S"));596 //dprintf(("CNV_8_S_TO_16_U/CNV_8_U_TO_16_S")); 597 597 break; 598 598 … … 601 601 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(2,0); //factor 4 602 602 pConfigInfo->pfnConvert = Convert8MonoTo16Stereo; 603 dprintf(("CNV_8_S_TO_16_S_MN_ST/CNV_8_U_TO_16_U_MN_ST"));603 //dprintf(("CNV_8_S_TO_16_S_MN_ST/CNV_8_U_TO_16_U_MN_ST")); 604 604 break; 605 605 … … 608 608 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(2,0); //factor 4 609 609 pConfigInfo->pfnConvert = Convert8MonoTo16StereoSignChange; 610 dprintf(("CNV_8_S_TO_16_U_MN_ST/CNV_8_U_TO_16_S_MN_ST"));610 //dprintf(("CNV_8_S_TO_16_U_MN_ST/CNV_8_U_TO_16_S_MN_ST")); 611 611 break; 612 612 … … 614 614 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 615 615 pConfigInfo->pfnConvert = Convert8UnsignedTo8UnsignedStereoMono; 616 dprintf(("CNV_8_U_TO_8_U_ST_MN"));616 //dprintf(("CNV_8_U_TO_8_U_ST_MN")); 617 617 break; 618 618 … … 620 620 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 621 621 pConfigInfo->pfnConvert = Convert8SignedTo8SignedStereoMono; 622 dprintf(("CNV_8_S_TO_8_S_ST_MN"));622 //dprintf(("CNV_8_S_TO_8_S_ST_MN")); 623 623 break; 624 624 … … 626 626 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 627 627 pConfigInfo->pfnConvert = Convert8UnsignedTo8SignedStereoMono; 628 dprintf(("CNV_8_U_TO_8_S_ST_MN"));628 //dprintf(("CNV_8_U_TO_8_S_ST_MN")); 629 629 break; 630 630 … … 632 632 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 633 633 pConfigInfo->pfnConvert = Convert8SignedTo8UnsignedStereoMono; 634 dprintf(("CNV_8_S_TO_8_U_ST_MN"));634 //dprintf(("CNV_8_S_TO_8_U_ST_MN")); 635 635 break; 636 636 … … 638 638 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 639 639 pConfigInfo->pfnConvert = Convert8UnsignedTo16UnsignedStereoMono; 640 dprintf(("CNV_8_U_TO_16_U_ST_MN"));640 //dprintf(("CNV_8_U_TO_16_U_ST_MN")); 641 641 break; 642 642 … … 644 644 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 645 645 pConfigInfo->pfnConvert = Convert8UnsignedTo16SignedStereoMono; 646 dprintf(("CNV_8_U_TO_16_S_ST_MN"));646 //dprintf(("CNV_8_U_TO_16_S_ST_MN")); 647 647 break; 648 648 … … 650 650 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 651 651 pConfigInfo->pfnConvert = Convert8SignedTo16SignedStereoMono; 652 dprintf(("CNV_8_S_TO_16_S_ST_MN"));652 //dprintf(("CNV_8_S_TO_16_S_ST_MN")); 653 653 break; 654 654 … … 656 656 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 657 657 pConfigInfo->pfnConvert = Convert8SignedTo16UnsignedStereoMono; 658 dprintf(("CNV_8_S_TO_16_U_ST_MN"));658 //dprintf(("CNV_8_S_TO_16_U_ST_MN")); 659 659 break; 660 660 … … 663 663 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 664 664 pConfigInfo->pfnConvert = Convert16To16SignChange; 665 dprintf(("CNV_16_U_TO_16_S/CNV_16_S_TO_16_U"));665 //dprintf(("CNV_16_U_TO_16_S/CNV_16_S_TO_16_U")); 666 666 break; 667 667 … … 670 670 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 671 671 pConfigInfo->pfnConvert = Convert16To8; 672 dprintf(("CNV_16_U_TO_8_U/CNV_16_S_TO_8_S"));672 //dprintf(("CNV_16_U_TO_8_U/CNV_16_S_TO_8_S")); 673 673 break; 674 674 … … 677 677 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 678 678 pConfigInfo->pfnConvert = Convert16To8SignChange; 679 dprintf(("CNV_16_U_TO_8_S/CNV_16_S_TO_8_U"));679 //dprintf(("CNV_16_U_TO_8_S/CNV_16_S_TO_8_U")); 680 680 break; 681 681 … … 684 684 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(1,0); //factor 2 685 685 pConfigInfo->pfnConvert = Convert16MonoTo16Stereo; 686 dprintf(("CNV_16_U_TO_16_U_MN_ST/CNV_16_S_TO_16_S_MN_ST"));686 //dprintf(("CNV_16_U_TO_16_U_MN_ST/CNV_16_S_TO_16_S_MN_ST")); 687 687 break; 688 688 … … 691 691 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(1,0); //factor 2 692 692 pConfigInfo->pfnConvert = Convert16MonoTo16StereoSignChange; 693 dprintf(("CNV_16_U_TO_16_S_MN_ST/CNV_16_S_TO_16_U_MN_ST"));693 //dprintf(("CNV_16_U_TO_16_S_MN_ST/CNV_16_S_TO_16_U_MN_ST")); 694 694 break; 695 695 … … 698 698 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 699 699 pConfigInfo->pfnConvert = Convert16MonoTo8Stereo; 700 dprintf(("CNV_16_U_TO_8_U_MONO_ST/CNV_16_S_TO_8_U_MN_ST"));700 //dprintf(("CNV_16_U_TO_8_U_MONO_ST/CNV_16_S_TO_8_U_MN_ST")); 701 701 break; 702 702 … … 705 705 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,0); //factor 1 706 706 pConfigInfo->pfnConvert = Convert16MonoTo8StereoSignChange; 707 dprintf(("CNV_16_U_TO_8_S_MN_ST/CNV_16_S_TO_8_S_MN_ST"));707 //dprintf(("CNV_16_U_TO_8_S_MN_ST/CNV_16_S_TO_8_S_MN_ST")); 708 708 break; 709 709 … … 711 711 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 712 712 pConfigInfo->pfnConvert = Convert16UnsignedTo16SignedStereoMono; 713 dprintf(("CNV_16_U_TO_16_S_ST_MN"));713 //dprintf(("CNV_16_U_TO_16_S_ST_MN")); 714 714 break; 715 715 … … 717 717 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 718 718 pConfigInfo->pfnConvert = Convert16UnsignedTo16UnsignedStereoMono; 719 dprintf(("CNV_16_U_TO_16_U_ST_MN"));719 //dprintf(("CNV_16_U_TO_16_U_ST_MN")); 720 720 break; 721 721 … … 723 723 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 724 724 pConfigInfo->pfnConvert = Convert16SignedTo16SignedStereoMono; 725 dprintf(("CNV_16_S_TO_16_S_ST_MN"));725 //dprintf(("CNV_16_S_TO_16_S_ST_MN")); 726 726 break; 727 727 … … 729 729 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,1); //factor 0.5 730 730 pConfigInfo->pfnConvert = Convert16SignedTo16UnsignedStereoMono; 731 dprintf(("CNV_16_S_TO_16_U_ST_MN"));731 //dprintf(("CNV_16_S_TO_16_U_ST_MN")); 732 732 break; 733 733 … … 735 735 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,2); //factor 0.25 736 736 pConfigInfo->pfnConvert = Convert16UnsignedTo8UnsignedStereoMono; 737 dprintf(("CNV_16_U_TO_8_U_ST_MN"));737 //dprintf(("CNV_16_U_TO_8_U_ST_MN")); 738 738 break; 739 739 … … 741 741 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,2); //factor 0.25 742 742 pConfigInfo->pfnConvert = Convert16UnsignedTo8SignedStereoMono; 743 dprintf(("CNV_16_U_TO_8_S_ST_MN"));743 //dprintf(("CNV_16_U_TO_8_S_ST_MN")); 744 744 break; 745 745 … … 747 747 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,2); //factor 0.25 748 748 pConfigInfo->pfnConvert = Convert16SignedTo8SignedStereoMono; 749 dprintf(("CNV_16_S_TO_8_S_ST_MN"));749 //dprintf(("CNV_16_S_TO_8_S_ST_MN")); 750 750 break; 751 751 … … 753 753 pConfigInfo->ulConversionFactor = CONVERSION_FACTOR(0,2); //factor 0.25 754 754 pConfigInfo->pfnConvert = Convert16SignedTo8UnsignedStereoMono; 755 dprintf(("CNV_16_S_TO_8_U_ST_MN"));755 //dprintf(("CNV_16_S_TO_8_U_ST_MN")); 756 756 break; 757 757 … … 826 826 return TRUE; 827 827 } 828 if(pConfigInfo->fSampleRateConversion) 828 if(pConfigInfo->fSampleRateConversion) 829 829 { 830 830 pConfigInfo->ulHwSampleRate = pConfigInfo->ulFixedSampleRate; … … 1062 1062 } 1063 1063 1064 if(pCaps->ulOperation == OPERATION_PLAY) 1064 if(pCaps->ulOperation == OPERATION_PLAY) 1065 1065 { 1066 1066 pWaveCaps = &devCaps[ulDeviceNr].waveOutCaps; … … 1071 1071 if (pCaps->ulChannels != 1 && pCaps->ulChannels != 2) 1072 1072 { 1073 if(pCaps->ulChannels > pWaveCaps->ulMaxChannels) 1073 if(pCaps->ulChannels > pWaveCaps->ulMaxChannels) 1074 1074 { 1075 1075 dprintf(("DevCaps1 not channel")); … … 1078 1078 } 1079 1079 } 1080 if (pCaps->ulSamplingRate == 0) 1080 if (pCaps->ulSamplingRate == 0) 1081 1081 { 1082 1082 dprintf(("DevCaps1 not rate")); … … 1134 1134 break; 1135 1135 case 24: 1136 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_24BPS)) 1136 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_24BPS)) 1137 1137 { 1138 1138 dprintf(("DevCaps1 not 24BPS")); … … 1142 1142 break; 1143 1143 case 32: 1144 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_32BPS)) 1144 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_32BPS)) 1145 1145 { 1146 1146 pCaps->ulSupport = UNSUPPORTED_BPS; … … 1164 1164 case DATATYPE_RIFF_ALAW: 1165 1165 case A_LAW: 1166 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_ALAW)) 1166 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_ALAW)) 1167 1167 { 1168 1168 dprintf(("DevCaps1 not ALAW")); … … 1171 1171 } 1172 1172 // supported bits per sample are 8 (for unsigned PCM, u-law or A-law ) 1173 if (pCaps->ulBitsPerSample != 8) 1173 if (pCaps->ulBitsPerSample != 8) 1174 1174 { 1175 1175 dprintf(("DevCaps1 not ALAW BPS8")); … … 1184 1184 case DATATYPE_RIFF_MULAW: 1185 1185 case MU_LAW: 1186 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_MULAW)) 1186 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_MULAW)) 1187 1187 { 1188 1188 dprintf(("DevCaps1 not MULAW")); … … 1191 1191 } 1192 1192 // supported bits per sample are 8 (for unsigned PCM, u-law or A-law ) 1193 if (pCaps->ulBitsPerSample != 8) 1193 if (pCaps->ulBitsPerSample != 8) 1194 1194 { 1195 1195 dprintf(("DevCaps1 not MULAW BPS8")); … … 1203 1203 case DATATYPE_ADPCM_AVC: 1204 1204 case DATATYPE_CT_ADPCM: 1205 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_ADPCM)) 1205 if(!(pWaveCaps->ulDataFormats & OSS32_CAPS_PCM_FORMAT_ADPCM)) 1206 1206 { 1207 1207 dprintf(("DevCaps1 not ADPCM")); … … 1210 1210 } 1211 1211 // supported bits per sample are 4 1212 if (pCaps->ulBitsPerSample != 4) 1212 if (pCaps->ulBitsPerSample != 4) 1213 1213 { 1214 1214 dprintf(("DevCaps1 not ADPCM BPS4")); … … 1430 1430 #endif 1431 1431 1432 if(OSS16_WaveStop(StreamId) != OSSERR_SUCCESS) 1432 if(OSS16_WaveStop(StreamId) != OSSERR_SUCCESS) 1433 1433 { 1434 1434 DebugInt3(); … … 1436 1436 } 1437 1437 //Reset cleans up waveout instance 1438 if(OSS16_WaveReset(StreamId) != OSSERR_SUCCESS) 1438 if(OSS16_WaveReset(StreamId) != OSSERR_SUCCESS) 1439 1439 { 1440 1440 DebugInt3(); -
OCO/trunk/drv16/waveplay.cpp
r478 r483 189 189 } 190 190 #ifdef DEBUG 191 dprintf(("WAVEPLAY::ConfigDev1 SampleRate %ld", pConfigInfo->ulHwSampleRate)); 192 dprintf(("ulFirstBufSize %ld", ulFirstBufSize)); 193 dprintf(("ulFragsize %ld", pConfigInfo->ulFragsize)); 191 dprintf(("WAVEPLAY::ConfigDev SampleRate %ld", pConfigInfo->ulHwSampleRate)); 192 dprintf(("WAVEPLAY::ConfigDev ulFirstBufSize=%lx ulFragsize=%lx", ulFirstBufSize, pConfigInfo->ulFragsize)); 194 193 #endif 195 194 … … 197 196 { 198 197 ulFirstBufSize = pConfigInfo->ulFragsize; //no conversion required (see below) 199 if (ulFirstBufSize == 0) 198 if (ulFirstBufSize == 0) 200 199 { 201 200 DebugInt3(); … … 206 205 } 207 206 } 208 else 207 else 209 208 { 210 209 //convert size of first buffer 211 210 ulFirstBufSize = ConvertLength(ulFirstBufSize, pConfigInfo); 212 211 #ifdef DEBUG 213 dprintf(("ulFirstBufSize %l d", ulFirstBufSize));212 dprintf(("ulFirstBufSize %lx", ulFirstBufSize)); 214 213 #endif /* DEBUG */ 215 214 } … … 223 222 ulPCMConsumeRate = ConvertLength(pConfigInfo->ulPCMConsumeRate, pConfigInfo); 224 223 #ifdef DEBUG 225 dprintf(("cons rate %l d buf size %ldinit rate %ld", ulPCMConsumeRate, ulFirstBufSize, pConfigInfo->ulHwSampleRate));224 dprintf(("cons rate %lx buf size %lx init rate %ld", ulPCMConsumeRate, ulFirstBufSize, pConfigInfo->ulHwSampleRate)); 226 225 #endif /* DEBUG */ 227 226 … … 237 236 { 238 237 while(minimumsize < fragsize) fragsize = fragsize / 2; // 239 238 240 239 if(fragsize < ulPCMConsumeRate/256) 241 240 {//lower limit; don't accept extremely small buffers … … 252 251 253 252 #ifdef DEBUG 254 dprintf(("fragsize %l d", fragsize));253 dprintf(("fragsize %lx", fragsize)); 255 254 #endif 256 255 hwparam.ulSampleRate = pConfigInfo->ulHwSampleRate; … … 288 287 289 288 #ifdef DEBUG 290 //dprintf(("WAVEPLAY::Transfer %ld",ulBytesToTransfer));289 //dprintf(("WAVEPLAY::Transfer %ld",ulBytesToTransfer)); 291 290 #endif 292 291 … … 319 318 } 320 319 } 321 else 322 { 323 if(pConfigInfo->pfnConvert) 320 else 321 { 322 if(pConfigInfo->pfnConvert) 324 323 { 325 324 ULONG ulCvtBufferSize; … … 332 331 ulBytesToTransfer = CONVERT_LENGTH(ulCvtBufferSize, CONVERSION_INVERT(pConfigInfo->ulConversionFactor)); 333 332 334 if(ulBytesToTransfer & (pConfigInfo->ulSampleSize-1)) 333 if(ulBytesToTransfer & (pConfigInfo->ulSampleSize-1)) 335 334 { 336 335 dprintf(("Transfer New ulBr %ld" , ulBytesToTransfer)); … … 349 348 //convert back from conversion to 'real' 350 349 *pulBytesTransferred = CONVERT_LENGTH(*pulBytesTransferred, CONVERSION_INVERT(pConfigInfo->ulConversionFactor)); 351 if(*pulBytesTransferred & (pConfigInfo->ulSampleSize-1)) 350 if(*pulBytesTransferred & (pConfigInfo->ulSampleSize-1)) 352 351 { 353 352 #ifdef DEBUG … … 357 356 } 358 357 } 359 else 358 else 360 359 { 361 360 dprintf(("Transfer Zero pConfigInfo->pfnConvert")); … … 374 373 OSSRET rc; 375 374 ULONG Space; 376 ULONG i;377 375 // if (!waveOpened) return TRUE; 378 376 … … 398 396 ulCvtBufferSize &= ~(pConfigInfo->ulHwSampleSize - 1); 399 397 400 if(ulCvtBufferSize == 0) 398 if(ulCvtBufferSize == 0) 401 399 { 402 400 *pulBytesTransferred = ulBytesToTransfer; 403 if(pConfigInfo->ulSRatePosition >= pConfigInfo->ulSRateIncrement) 401 if(pConfigInfo->ulSRatePosition >= pConfigInfo->ulSRateIncrement) 404 402 { 405 403 pConfigInfo->ulSRatePosition -= pConfigInfo->ulSRateIncrement; … … 423 421 ulCvtBufferSize = Space & ~(pConfigInfo->ulHwSampleSize - 1); 424 422 } 425 if ((rc = OSS16_WaveAddBuffer(StreamId, pConfigInfo->pSRateConvBuffer, ulCvtBufferSize, pulBytesTransferred)) != OSSERR_SUCCESS 423 if ((rc = OSS16_WaveAddBuffer(StreamId, pConfigInfo->pSRateConvBuffer, ulCvtBufferSize, pulBytesTransferred)) != OSSERR_SUCCESS 426 424 || *pulBytesTransferred == 0) 427 425 { 428 if(rc == OSSERR_BUFFER_FULL) 426 if(rc == OSSERR_BUFFER_FULL) 429 427 { 430 428 GetSpace(StreamId, pConfigInfo, &Space); … … 432 430 } 433 431 #ifdef DEBUG 434 else 432 else 435 433 dprintf(("WPLAY::AddBuffer; %ld rc=%x failed", ulCvtBufferSize, (USHORT)rc)); 436 434 #endif … … 452 450 // if the last sample is still needed for the next run, then adjust sample count and 453 451 // sample rate conversion position 454 if(lSRatePosition < 0) 452 if(lSRatePosition < 0) 455 453 { 456 454 dprintf4(("WAVEPLAY::AddBuffer; sratepos < 0")); … … 458 456 pConfigInfo->ulSRatePosition = 0; 459 457 } 460 else 458 else 461 459 { 462 460 pConfigInfo->ulSRatePosition = (ULONG)lSRatePosition; … … 507 505 // if (!waveOpened) return TRUE; 508 506 509 if(OSS16_WaveGetSpace(StreamId, &space) != OSSERR_SUCCESS) 507 if(OSS16_WaveGetSpace(StreamId, &space) != OSSERR_SUCCESS) 510 508 { 511 509 *pulStreamSpace = 0; … … 529 527 ULONG space,cvt; 530 528 531 if(OSS16_WaveGetHwPtr(StreamId, &space) != OSSERR_SUCCESS) 529 if(OSS16_WaveGetHwPtr(StreamId, &space) != OSSERR_SUCCESS) 532 530 { 533 531 *pulHwPtr = 0; -
OCO/trunk/drv16/waverec.cpp
r468 r483 139 139 hwparam.ulDataType = QueryOSSDataFormat(OPERATION_RECORD, pConfigInfo->ulDataType, pConfigInfo->ulHwBitsPerSample); 140 140 if(OSS16_WaveSetFormat(StreamId, &hwparam) != OSSERR_SUCCESS) { 141 dprintf(("WAVEREC::ConfigDev: WaveSetFormat failed")); 141 142 DebugInt3(); 142 143 return FALSE; … … 151 152 ULONG FAR *pulBytesTransferred) 152 153 { 154 #ifdef DEBUG 155 //dprintf(("WAVEREC::Transfer %lx bytes", ulBytesToTransfer)); 156 #endif 153 157 if(pConfigInfo->usConversion == CONVERT_NONE) 154 158 { -
OCO/trunk/drv16/wavestrm.cpp
r478 r483 40 40 #endif 41 41 42 extern "C" ULONG __cdecl __saveregs OSSIDC_EntryPoint(ULONG cmd, ULONG param1, ULONG param2); 43 42 44 43 45 //****************************************************************************** … … 50 52 // the data has been played and 1 if there is still some data left. 51 53 //****************************************************************************** 52 USHORT WAVESTREAM::_vRealignBuffer(ULONG endpos, PSTREAMBUFFER pbuffer) 53 { 54 ULONG streambuf_start, bufconsumed; 55 USHORT usRC; 56 57 streambuf_start = pbuffer->ulDonepos - pbuffer->ulBuffpos; 58 // if none of the data in this stream buffer has been consumed 59 if (endpos <= streambuf_start) { 60 pbuffer->ulDonepos = 0; 61 pbuffer->ulBuffpos = 0; 62 usRC = 1; 63 } 64 // else some or all of the data has been consumed 65 else { 66 bufconsumed = endpos - streambuf_start; 67 // some of the buffer has been consumed 68 if (bufconsumed <= pbuffer->ulBuffsz) { 69 pbuffer->ulDonepos = 0; 70 pbuffer->ulBuffpos = pbuffer->ulBuffsz - bufconsumed; 71 pbuffer->ulBuffpos &= 0xFFFFFFFC; //keep it on a dword boundary 72 usRC = 1; 73 } 74 // all of the buffer has been consumed 75 else { 76 pbuffer->ulDonepos = 0; 77 pbuffer->ulBuffpos = pbuffer->ulBuffsz; 78 usRC = 0; 79 } 80 } 81 return(usRC); 54 USHORT WAVESTREAM::_vRealignBuffer(ULONG ulEndPos, PSTREAMBUFFER pBuffer) 55 { 56 if (ulEndPos >= pBuffer->ulDonepos) { /* all of the data has been consumed */ 57 pBuffer->ulBuffpos = pBuffer->ulBuffsz; 58 pBuffer->ulDonepos = 0; 59 return(0); 60 } 61 62 if (ulEndPos >= (pBuffer->ulDonepos - pBuffer->ulBuffpos)) { /* some of the data has been consumed */ 63 pBuffer->ulBuffpos = pBuffer->ulDonepos - ulEndPos; 64 pBuffer->ulBuffpos &= 0xFFFFFFFC; //keep it on a dword boundary 65 pBuffer->ulDonepos = 0; 66 return(1); 67 } 68 /* none of the data in this buffer has been consumed */ 69 pBuffer->ulDonepos = 0; 70 pBuffer->ulBuffpos = 0; 71 return(1); 82 72 } 83 73 … … 99 89 // and put the STREAMBUFFER on the Head queue. 100 90 //****************************************************************************** 101 void WAVESTREAM::_vRealignPausedBuffers(ULONG endpos) 102 { 103 PQUEUEHEAD pTempHead = new QUEUEHEAD; 104 PSTREAMBUFFER ptempbuff; 105 USHORT usRC; 106 107 108 switch (ulStreamType & STREAM_WRITE) { 109 case STREAM_READ: 110 _vReadAudioBuf(); 111 break; 112 113 case STREAM_WRITE: 114 115 // if there is a buffer on the InProcess Queue 116 // only check the first one as any others are just waiting..... 117 if (qhInProcess.IsElements()) 118 { 119 // if any data has been written from this stream buffer 120 ptempbuff = (PSTREAMBUFFER)qhInProcess.Head(); 121 if (ptempbuff->ulDonepos) 122 { 123 _vRealignBuffer(endpos, ptempbuff); 124 } /* end if ulDonepos */ 125 } 126 127 // if there are bufferes on the done queue, pop them off the head and 128 // push them on the head of qhTempHead. This will reorder them so 129 // that the more recently used ones will be in the front of the queue. 130 // Pass them all to _vRealignBuffer. If the rc from _vRealignBuffer is 131 // 0 then there is no unprocessed data in the buffer (it is ready to 132 // be returned) so put it on the Tail of the done queue. 133 // If the rc is 1 then put it on the head of the InProcess queue. 134 135 while (qhDone.IsElements()) 136 { 137 pTempHead->PushOnHead(qhDone.PopHead()); 138 } /* endwhile */ 139 140 while (pTempHead->IsElements()) 141 { 142 usRC = _vRealignBuffer(endpos, (PSTREAMBUFFER)pTempHead->Head()); 143 if (usRC) 144 qhInProcess.PushOnHead(pTempHead->PopHead()); 145 else 146 qhDone.PushOnTail(pTempHead->PopHead()); 147 } /* endwhile */ 148 break; 149 default: 150 break; 151 } /* endswitch */ 152 delete pTempHead; // free the memory this ain't no Java here !! 91 void WAVESTREAM::_vRealignPausedBuffers(ULONG ulEndPos) 92 { 93 PQUEUEHEAD pTempHead = new QUEUEHEAD; 94 PSTREAMBUFFER pTmpBuf; 95 USHORT usRC; 96 97 98 switch (ulStreamType & STREAM_WRITE) { 99 case STREAM_READ: 100 _vReadAudioBuf(); 101 break; 102 103 case STREAM_WRITE: 104 105 // if there is a buffer on the InProcess Queue 106 // only check the first one as any others are just waiting..... 107 if (qhInProcess.IsElements()) 108 { 109 // if any data has been written from this stream buffer 110 pTmpBuf = (PSTREAMBUFFER)qhInProcess.Head(); 111 if (pTmpBuf->ulDonepos) 112 { 113 _vRealignBuffer(ulEndPos, pTmpBuf); 114 } 115 } 116 117 // if there are buffere on the done queue, pop them off the head and 118 // push them on the head of qhTempHead. This will reorder them so 119 // that the more recently used ones will be in the front of the queue. 120 // Pass them all to _vRealignBuffer. If the rc from _vRealignBuffer is 121 // 0 then there is no unprocessed data in the buffer (it is ready to 122 // be returned) so put it on the Tail of the done queue. 123 // If the rc is 1 then put it on the head of the InProcess queue. 124 125 while (qhDone.IsElements()) { 126 pTempHead->PushOnHead(qhDone.PopHead()); 127 } 128 129 while (pTempHead->IsElements()) 130 { 131 usRC = _vRealignBuffer(ulEndPos, (PSTREAMBUFFER)pTempHead->Head()); 132 if (usRC) 133 qhInProcess.PushOnHead(pTempHead->PopHead()); 134 else 135 qhDone.PushOnTail(pTempHead->PopHead()); 136 } 137 while (qhDone.IsElements()) { 138 ReturnBuffer(); 139 } 140 break; 141 default: 142 break; 143 } /* endswitch */ 153 144 } 154 145 … … 163 154 #pragma on (unreferenced) 164 155 { 165 ULONG space, byteswritten, curspace,i; 166 167 // dgprintf(("AddBuffers %d",fFirst == TRUE?1:2)); 168 169 byteswritten = 0; 170 if (ulStreamType & STREAM_WRITE) 156 ULONG ulSpace, ulBytesWritten; 157 ULONG ulDAZ; 158 159 //dgprintf(("WS:AddBuffers First=%d, SampleSize=%lx", fFirst, _configinfo.ulSampleSize)); 160 161 ulBytesWritten = 0; 162 if (ulStreamType & STREAM_WRITE) 171 163 { 172 164 // get the space available in the hardware buffer … … 175 167 // could keep us in this loop writing 4 or 8 bytes at a time. 176 168 // In extream cases we will stay stuck in this loop long enough to casue a trap rjj 177 if (pahw->GetSpace(StreamId, &_configinfo, &space) == FALSE)169 if (pahw->GetSpace(StreamId, &_configinfo, &ulSpace) == FALSE) 178 170 { 179 // dgprintf(("WAVESTREAM::AddBuffers Error 1"));171 dgprintf(("WAVESTREAM::AddBuffers GetSpace failed")); 180 172 return; 181 173 } 182 space &= (~(_configinfo.ulSampleSize - 1)); 183 // curspace = min(space, _configinfo.ulBytesPerIRQ/_configinfo.ulSampleSize * 2); 184 curspace = space; 185 while (space && qhInProcess.IsElements()) 174 ulSpace &= (~(_configinfo.ulSampleSize - 1)); 175 ulDAZ = 0; 176 while (ulSpace && qhInProcess.IsElements()) 186 177 { 187 // Fisrt time going in task time 188 // for I7 need give time for interrupt time 189 if (fFirst == TRUE) //PS+++ 190 { 191 cli(); 192 // DevHelp_ProcBlock (space, 20, 0); 193 } 194 // dgprintf(("AddBuffers write %ld SSize:%ld %d",space, _configinfo.ulSampleSize, fFirst == TRUE?1:2)); 195 byteswritten = AddBuffer(space > curspace? curspace: space); 196 if (pahw->GetSpace(StreamId, &_configinfo, &curspace) == FALSE) 197 { 198 // dgprintf(("WAVESTREAM::AddBuffers Error 2")); 199 break; 200 } 201 if(byteswritten == (ULONG)-1) 202 break; 203 if (!curspace) 204 { 205 curspace = _configinfo.ulSampleSize; 206 } 207 space -= byteswritten; 208 space &= ( ~(_configinfo.ulSampleSize - 1)); 209 } 210 211 } 212 // dgprintf(("AddBuffers %d End",fFirst == TRUE?1:2)); 213 } 178 if (ulDAZ++ > 20) { 179 dgprintf(("WAVESTREAM::AddBuffers DAZ break")); // Temporary hack to prevent lockups when uniaud32 stops (underrun) 180 break; 181 } 182 // First time is in task time. For I7 need to give time for interrupt time 183 if (fFirst == TRUE) //PS+++ 184 { 185 //cli(); 186 DevHelp_ProcBlock (0x5541, 20, 0); // ok since the first call is at task time 187 ulBytesWritten = AddBuffer(ulSpace); 188 return; 189 } 190 ulBytesWritten = AddBuffer(ulSpace); 191 if (ulBytesWritten == (ULONG)-1) break; 192 ulSpace -= ulBytesWritten; 193 ulSpace &= ( ~(_configinfo.ulSampleSize - 1)); 194 } 195 196 } 197 } 198 214 199 //****************************************************************************** 215 200 // write one buffer to the audio buffer 1 … … 218 203 // there are buffers on pHead... BEWARE 219 204 //****************************************************************************** 220 ULONG WAVESTREAM::AddBuffer(ULONG space)205 ULONG WAVESTREAM::AddBuffer(ULONG ulSpace) 221 206 { 222 207 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 223 ULONG pdataBuf; 224 ULONG Buff_left, byteswritten, start_pos; 225 226 // ddprintf(("AddBuffer")); 227 // make sure we have a buffer to copy from..... 228 if (!pTemp) 208 ULONG pDataBuf; 209 ULONG ulBuffLeft; 210 ULONG ulBytesWritten; 211 ULONG ulStartPos; 212 213 /* make sure we have a buffer to copy from */ 214 if (!pTemp) 229 215 { 230 216 return (ULONG)-1; 231 217 } 232 218 233 // get the starting position. Call WaveGetHwPtr. if we get a bad rc 234 // then we bail out. 235 if(pahw->GetHwPtr(StreamId, &_configinfo, &start_pos) == FALSE) 219 /* make sure there is space in the output buffer */ 220 if (!ulSpace) 221 { 222 return (ULONG)-1; 223 } 224 225 /* PS+++ if input buffer is ZERO do nothing and ask for give new buffer, See REMARK in mmpm2.inf */ 226 if (!pTemp->ulBuffsz) 227 { 228 qhDone.PushOnTail(qhInProcess.PopHead()); 229 return (ULONG)-1; 230 } 231 232 // get the starting position. Call WaveGetHwPtr. if we get a bad rc then we bail out. 233 if(pahw->GetHwPtr(StreamId, &_configinfo, &ulStartPos) == FALSE) 236 234 { 237 235 dgprintf(("WAVESTREAM::AddBuffer Err in GetHwPtr")); … … 240 238 } 241 239 242 if (!pTemp->ulBuffsz || !space) 243 { 244 dgprintf(("WAVESTREAM::AddBuffer 0, Bufsz:%ld Space:%ld",pTemp->ulBuffsz, space)); 245 //PS+++ if is ZERO do nothing and ask for give new buffer, See REMARK in mmpm2.inf 240 // get the buffer pointer and amount of data remaining 241 pDataBuf = (ULONG)pTemp->pBuffptr + pTemp->ulBuffpos; /* points to the beginning of data in src buffer */ 242 ulBuffLeft = pTemp->ulBuffsz - pTemp->ulBuffpos; /* amount of src data left to transfer */ 243 //dgprintf(("WS::AddBuffer buf=%lx remain=%lx, space=%lx bp=%lx dp=%lx size=%lx", pTemp->pBuffptr, ulBuffLeft, ulSpace, pTemp->ulBuffpos, pTemp->ulDonepos, pTemp->ulBuffsz)); 244 ulBuffLeft = min(ulBuffLeft, ulSpace); /* the smaller of src data left or dst space available */ 245 246 if (pahw->Transfer(StreamId, &_configinfo, pDataBuf, ulBuffLeft, &ulBytesWritten) == FALSE) 247 { 248 // This could mean that the hardware has underrun TODO: implement underrun logic 249 dgprintf(("WS::AddBuffer: pahw->Transfer failed")); 250 return (ULONG)-1; 251 } 252 if (ulBytesWritten == 0) 253 { 254 // This could mean that the hardware has underrun TODO: implement underrun logic 255 dgprintf(("WS::AddBuffer: 0 of %lx bytes written by transfer", ulBuffLeft)); 256 return (ULONG)-1; /* DAZ check into returning zero, returning 0 may cause lockup */ 257 } 258 //dgprintf(("WS::AddBuffer added %lx from %lx BuffPos=%lx sz=%lx bw=%lx dp=%lx", ulBytesWritten, pTemp->pBuffptr, pTemp->ulBuffpos, pTemp->ulBuffsz, _ulBytesWritten, pTemp->ulDonepos)); 259 260 _ulBytesWritten += ulBytesWritten; /* update the running counter */ 261 pTemp->ulBuffpos += ulBytesWritten; /* update the buffer pos counter */ 262 pTemp->ulDonepos = _ulBytesWritten; /* update the done Position for returning the buffer */ 263 264 // check to see if the whole buffer has been copied and needs to be put on the done queue 265 if (pTemp->ulBuffpos >= (pTemp->ulBuffsz /* & 0xFFFFFFFC*/)) /* DAZ */ 266 { 267 //dgprintf(("WS::AddBuffer done with buffer %lx dp=%lx", pTemp->pBuffptr, pTemp->ulDonepos)); 246 268 qhDone.PushOnTail(qhInProcess.PopHead()); 247 // DebugInt3(); 248 return -1; 249 } 250 // get the buffer pointer and amount of data remaining 251 pdataBuf = (ULONG)pTemp->pBuffptr + pTemp->ulBuffpos; 252 Buff_left = pTemp->ulBuffsz - pTemp->ulBuffpos; 253 Buff_left = min(Buff_left, space); 254 255 if (pahw->Transfer(StreamId, &_configinfo, pdataBuf, Buff_left, &byteswritten) == FALSE) 256 { 257 dgprintf(("AddBuffer: pahw->Transfer failed!!")); 258 // DebugInt3(); 259 return (ULONG)-1; 260 } 261 if (byteswritten == 0) 262 { 263 dgprintf(("AddBuffer: No more room!!")); 264 // DebugInt3(); 265 //PS+++ return (ULONG)-1; //no more room 266 return 0; //PS+++ may be in next time? 267 } 268 // update the buffer pos counter 269 pTemp->ulBuffpos += byteswritten; 270 271 // update the done Position 272 pTemp->ulDonepos = start_pos + byteswritten; 273 274 // check to see if the buffer has been copied and needs to be put on the done queue 275 if (pTemp->ulBuffpos >= (pTemp->ulBuffsz & 0xFFFFFFFC)) 276 { 277 qhDone.PushOnTail(qhInProcess.PopHead()); 278 } 279 // dgprintf(("WV::AddBuffer sz %lx, bywr %lx dp %lx", Buff_left, byteswritten,pTemp->ulDonepos)); 280 return byteswritten; 269 } 270 return ulBytesWritten; 281 271 } 282 272 //****************************************************************************** … … 287 277 { 288 278 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 289 ULONG pdataBuf; 290 ULONG Buff_left, bytesread; 291 292 if(!pTemp) 293 return FALSE; 279 ULONG pDataBuf; 280 ULONG ulBuffLeft, ulBytesRead; 281 282 if(!pTemp) return FALSE; 294 283 295 284 // get the buffer pointer and amount of data remaining 296 p dataBuf = (ULONG)pTemp->pBuffptr + pTemp->ulBuffpos;297 Buff_left = pTemp->ulBuffsz - pTemp->ulBuffpos;285 pDataBuf = (ULONG)pTemp->pBuffptr + pTemp->ulBuffpos; 286 ulBuffLeft = pTemp->ulBuffsz - pTemp->ulBuffpos; 298 287 299 288 // read wave data 300 if(pahw->Transfer(StreamId, &_configinfo, p dataBuf, Buff_left, &bytesread) == FALSE)301 { 302 dprintf(("_vReadAudioBuf: pahw->Transfer failed!!"));303 return FALSE;304 }305 if(bytesread == 0) {306 return FALSE; //no more data307 } 308 309 // dprintf4(("_vReadAudioBuf %lx size %ld, bytes read %ld", pdataBuf, Buff_left, bytesread)); 289 if(pahw->Transfer(StreamId, &_configinfo, pDataBuf, ulBuffLeft, &ulBytesRead) == FALSE) 290 { 291 return FALSE; /* No more data */ 292 } 293 if(ulBytesRead == 0) { 294 return FALSE; /* No more data */ 295 } 296 if (ulBytesRead > ulBuffLeft) { 297 return FALSE; /* Internal error */ 298 } 310 299 311 300 // update the buffer pos counter 312 pTemp->ulBuffpos += bytesread; 313 _ulBytesProcessed += bytesread; 301 pTemp->ulBuffpos += ulBytesRead; 302 _ulBytesProcessed += ulBytesRead; 303 304 //dprintf(("_vReadAudioBuf %lx Requested=%lx Read=%lx Remain=%lx Processed=%lx", pDataBuf, ulBuffLeft, ulBytesRead, pTemp->ulBuffsz-pTemp->ulBuffpos, _ulBytesProcessed)); 314 305 315 306 if(pTemp->ulBuffpos == pTemp->ulBuffsz) { 316 307 qhDone.PushOnTail(qhInProcess.PopHead()); 317 308 ReturnBuffer(); 318 dprintf(("_vReadAudioBuf return buffer %lx size %ld, bytes read %ld position %ld", (ULONG)pTemp->pBuffptr, pTemp->ulBuffsz, bytesread, _ulBytesProcessed));319 309 } 320 310 … … 328 318 // can be returned and finally process any events pending. 329 319 //****************************************************************************** 330 USHORT ProcNumber = 0;331 320 void DBGCALLCONV WAVESTREAM::Process(void) 332 321 { 333 PSTREAMBUFFER ptemp; 334 ULONG ulCurBytesProcessed = 0; 335 USHORT CurProcNumber = ProcNumber++; 336 ULONG space; 337 338 #ifdef DEBUG 339 // ddprintf(("WAVESTREAM::Process %d",CurProcNumber)); 340 #endif 322 PSTREAMBUFFER pTemp; 323 ULONG ulBytes; 324 ULONG ulDAZ; 325 326 //ddprintf(("WAVESTREAM::Process Start")); 341 327 342 328 // get the stream position. if we get a bad rc or the position is 0 … … 344 330 // GetPostiion returns the adjusted hw pointer from the ALSA status ioctl 345 331 // This is really a running total of bytes consumed by the hardware. 346 if(pahw->GetPosition(StreamId, &_configinfo, &ulCurBytesProcessed) == FALSE) 332 // DAZ - Note that this is a 32 bit counter and will wrap at sometime. ALSA 333 // attempts to wrap this counter intelligently. I haven't determined what 334 // effect, if any, the wrapping of this counter will have playing a stream. 335 if(pahw->GetPosition(StreamId, &_configinfo, &ulBytes) == FALSE) 347 336 { 348 337 ddprintf(("Error No bytes processed")); … … 350 339 return; 351 340 } 352 // ddprintf(("StPos: %lx", ulCurBytesProcessed)); 353 // save the bytes processed in the stream object 354 _ulBytesProcessed = ulCurBytesProcessed; 355 356 switch (ulStreamType & STREAM_WRITE) 357 { 358 359 // if there are buffers that have been completly written to the audio buffer 360 // check the first one on the done queue 361 // if it's data has been consumed by the hardware return it. 362 // 363 // Bug #18 Sometimes MMPM gives us really small buffers. If we 364 // wait for the buffer to be completly consumed and there is a tiny buffer 365 // on the queue after this one, the sound part could underrun before we get a 366 // chance to refill it. To fix this we will return the buffer if it will be 367 // consumed before the next call to WAVESTREAM:Process(). 368 // rjj Fix for Bug #18 28082008 341 _ulBytesProcessed = ulBytes; 342 343 switch (ulStreamType & STREAM_WRITE) 344 { 369 345 case STREAM_WRITE: 370 { 371 if (qhDone.IsElements()) 346 if (qhInProcess.IsElements()) 372 347 { 373 ptemp = (PSTREAMBUFFER)qhDone.Head(); 374 while ((_ulBytesProcessed + _configinfo.ulBytesPerIRQ) >= ptemp->ulDonepos) 375 { 376 ReturnBuffer(); 377 ptemp = (PSTREAMBUFFER)qhDone.Head(); 378 } 348 AddBuffers(FALSE); 379 349 } 380 if ((pahw->GetSpace(StreamId, &_configinfo, &space) != FALSE) 381 && qhInProcess.IsElements()) 382 { 383 AddBuffers(FALSE); 384 } 385 386 break; 387 388 } 350 // Return any buffers that have been completely written to uniaud32 351 while (qhDone.IsElements()) { 352 pTemp = (PSTREAMBUFFER)qhDone.Head(); /* get a pointer to the first completed buffer */ 353 // Hang on to the last buffer until the hardware is done writing the data 354 // We do this because MMPM uses the return of the last buffer to determine when we are 355 // done playing the stream 356 if ((qhDone.Head() == qhDone.Tail()) && !qhInProcess.IsElements() && (_ulBytesProcessed < pTemp->ulDonepos)) break; /* only one buffer left */ 357 ReturnBuffer(); 358 } 359 break; 389 360 case STREAM_READ: 390 while(_vReadAudioBuf()); 391 break; 361 ulDAZ = 0; 362 while(_vReadAudioBuf()) { 363 if (ulDAZ++ > 20) { /* temporary hack to prevent hangs when uniaud32 stops (overruns) */ 364 ddprintf(("WAVESTREAM::Process Read DAZ Break")); 365 break; 366 } 367 } 368 break; 392 369 default: 393 370 break; … … 395 372 396 373 ProcessEvents(); 397 // ddprintf(("WAVESTREAM::Process %d End",CurProcNumber));374 //ddprintf(("WAVESTREAM::Process End")); 398 375 } 399 376 //****************************************************************************** … … 404 381 { 405 382 PSTREAMBUFFER pStreamBuf = new STREAMBUFFER(uLength, pbuf); 406 383 407 384 return Write(pStreamBuf); 408 385 } … … 420 397 { 421 398 qhInProcess.PushOnTail((PQUEUEELEMENT)new STREAMBUFFER(uLength, pbuf)); 422 // dprintf2(("WAVESTREAM::Read: Push on tail %lx %d", pbuf, uLength));399 //dprintf2(("WAVESTREAM::Read: Push on tail %lx %lx", pbuf, uLength)); 423 400 return 0; 424 401 } … … 441 418 ULONG Seconds, MilliSeconds, Overflow, Processed; 442 419 443 //PS++ optimize code420 //PS++ optimize code 444 421 Processed = _ulBytesProcessed; 445 422 if (ulStreamState == STREAM_STREAMING) // if the stream is active … … 449 426 if (pahw->GetPosition(StreamId, &_configinfo, &Processed) == FALSE) 450 427 { 451 //DebugInt3();428 //DebugInt3(); 452 429 Processed = _ulBytesProcessed; //last known position 453 430 } … … 455 432 } 456 433 457 // if we haven't processed anything then just return 458 // _ulTimeBase 434 // if we haven't processed anything then just return _ulTimeBase 459 435 if(Processed == 0) 460 436 return(_ulTimeBase); … … 470 446 ULONG WAVESTREAM::GetCurrentPos(void) 471 447 { 472 ULONG Processed; 473 474 //PS++ optimize code 475 Processed = _ulBytesProcessed; 476 if (ulStreamState == STREAM_STREAMING) // if the stream is active 477 { 478 if (ulStreamType & STREAM_WRITE) 479 { 480 if (pahw->GetPosition(StreamId, &_configinfo, &Processed) == FALSE) 481 { 482 DebugInt3(); 483 Processed = _ulBytesProcessed; //last known position 484 } 448 ULONG Processed; 449 450 //PS++ optimize code 451 Processed = _ulBytesProcessed; 452 if (ulStreamState == STREAM_STREAMING) // if the stream is active 453 { 454 if (ulStreamType & STREAM_WRITE) 455 { 456 if (pahw->GetPosition(StreamId, &_configinfo, &Processed) == FALSE) 457 { 458 DebugInt3(); 459 Processed = _ulBytesProcessed; //last known position 460 } 461 } 485 462 } 486 } 487 488 return Processed; 463 return Processed; 489 464 } 490 465 //****************************************************************************** … … 498 473 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone.Tail(); 499 474 500 if(!pTemp) 475 if(!pTemp) 501 476 { 502 477 pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 503 478 } 504 if(pTemp) 479 if(pTemp) 505 480 { 506 481 writepos = pTemp->ulBuffpos; … … 517 492 void WAVESTREAM::SetCurrentTime(ULONG time) 518 493 { 494 //ddprintf(("SetCurrentTime: %lx", time)); 519 495 _ulTimeBase = time; 520 496 } … … 525 501 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 526 502 527 #ifdef DEBUG 528 // ddprintf(("WAVESTREAM::StartStream")); 529 #endif 530 531 if(ulStreamState == STREAM_STREAMING) 503 if(ulStreamState == STREAM_STREAMING) 532 504 { 533 505 ddprintf(("StartStream: already playing!!")); … … 537 509 // configure the wave device 538 510 // (NOTE: Must call this function; sample rate position is reset there) 539 if(pahw->ConfigDev(StreamId, &_configinfo, (pTemp) ? pTemp->ulBuffsz : 0) == FALSE) 511 if(pahw->ConfigDev(StreamId, &_configinfo, (pTemp) ? pTemp->ulBuffsz : 0) == FALSE) 540 512 { 541 513 ddprintf(("StartStream: ConfigDev failed!!")); 542 514 return ERROR_INSUFF_BUFFER; 543 //goto fail;515 //goto fail; 544 516 } 545 517 // prepare wave device for playback/recording 546 if(pahw->Prepare(StreamId) == FALSE) 518 if(pahw->Prepare(StreamId) == FALSE) 547 519 { 548 520 ddprintf(("StartStream: Prepare failed!!")); … … 551 523 552 524 _ulBytesProcessed = 0; 525 _ulBytesWritten = 0; 553 526 554 527 ulStreamState = STREAM_STREAMING; 555 528 //Adding the first buffer also starts playback 556 if (ulStreamType == STREAM_WAVE_PLAY) 557 { 558 559 529 if (ulStreamType == STREAM_WAVE_PLAY) 530 { 531 pahw->SetVolume(StreamId, getMixerStreamId(), volume); //PS 532 AddBuffers(TRUE); 560 533 //Must set volume after adding buffers (voices inside sblive driver might not 561 534 //be allocated otherwise (first start) ) 562 535 // dprintf(("SetVolume %lx",volume)); 563 536 // PS, removing to high 564 // pahw->SetVolume(StreamId, getMixerStreamId(), volume); 565 } 566 else 567 { 537 // pahw->SetVolume(StreamId, getMixerStreamId(), volume); 538 } 539 else 540 { 541 //dprintf(("Starting Rec Stream")); 568 542 ulSavedInputGain = pahw->QueryVolume(StreamId, getMixerStreamId()); 569 543 pahw->SetInputSrc(StreamId, getMixerStreamId(), inputsrc); 570 544 pahw->SetVolume(StreamId, getMixerStreamId(), inputgain); 571 545 572 if(pahw->Start(StreamId) != TRUE)573 546 if(pahw->Start(StreamId) != TRUE) 547 { 574 548 dprintf(("pahw->Start failed!!")); 575 549 goto fail; 576 550 } 577 551 } 578 // ddprintf(("WAVESTREAM::StartStream %lx End", StreamId));579 552 return NO_ERROR; 580 553 … … 602 575 603 576 ulStreamState = STREAM_STOPPED; 604 // ddprintf(("WAVESTREAM::StopStream %lx", StreamId)); 577 //ddprintf(("WAVESTREAM::StopStream %lx", StreamId)); 578 605 579 ReturnBuffers(); 606 580 pControl->ulTime = GetCurrentTime(); … … 610 584 // DDCMD_ENABLE_EVENT the event time will get screwed up. rjj 611 585 _ulBytesProcessed = 0; 586 _ulBytesWritten = 0; 612 587 return NO_ERROR; 613 588 } … … 616 591 ULONG WAVESTREAM::PauseStream(PCONTROL_PARM pControl) 617 592 { 618 ULONG endpos; 619 620 pahw->GetPosition(StreamId, &_configinfo, &endpos); 593 ULONG ulEndPos, ulEndPos2; 594 595 if(ulStreamState == STREAM_PAUSED) { 596 dprintf(("WAVESTREAM::PauseStream %lx (already paused)", StreamId)); 597 pControl->ulTime = GetCurrentTime(); 598 return NO_ERROR; 599 } 600 601 pahw->GetPosition(StreamId, &_configinfo, &ulEndPos); 621 602 //silence wave stream before stopping it (removes clicks) 622 603 pahw->SetVolume(StreamId, getMixerStreamId(), 0); 623 604 pahw->Stop(StreamId); 624 605 606 /* DAZ test code begin */ 607 if (pahw->GetPosition(StreamId, &_configinfo, &ulEndPos2) == FALSE) ulEndPos2 = 0; 608 if (ulEndPos2 != ulEndPos) { 609 ddprintf(("WAVESTREAM::PauseStream %lx!=%lx", ulEndPos, ulEndPos2)); 610 if (ulEndPos2) ulEndPos = ulEndPos2; 611 } 612 /* DAZ test code end */ 613 625 614 ulStreamState = STREAM_PAUSED; 626 615 627 616 ddprintf(("WAVESTREAM::PauseStream %lx", StreamId)); 628 617 629 _vRealignPausedBuffers(endpos); 630 631 _ulBytesProcessed = endpos; 618 _ulBytesProcessed = ulEndPos; 619 620 _vRealignPausedBuffers(ulEndPos); 621 632 622 pControl->ulTime = GetCurrentTime(); 623 633 624 _ulBytesProcessed = 0; 625 _ulBytesWritten = 0; 626 634 627 return NO_ERROR; 635 628 } … … 639 632 { 640 633 #ifdef DEBUG 641 dprintf(("WAVESTREAM::ResumeStream %lx", StreamId));634 //dprintf(("WAVESTREAM::ResumeStream %lx", StreamId)); 642 635 #endif 643 636 return StartStream(); … … 647 640 BOOL WAVESTREAM::SetProperty(int type, ULONG value, ULONG reserved) 648 641 { 649 #ifdef DEBUG650 // dprintf(("WAVESTREAM::SetProperty"));651 #endif652 653 642 switch(type) { 654 643 case PROPERTY_VOLUME: … … 677 666 ULONG WAVESTREAM::GetProperty(int type) 678 667 { 679 #ifdef DEBUG680 // dprintf(("WAVESTREAM::GetProperty"));681 #endif682 668 switch(type) { 683 669 case PROPERTY_FREQUENCY: … … 699 685 STREAM(streamtype, filesysnum, mixerStreamId) 700 686 { 701 #ifdef DEBUG702 dprintf(("WS::WS:S"));703 #endif704 687 // get the pointer to the hardware object 705 688 pahw = (WAVEAUDIO*)GetHardwareDevice(streamtype); … … 710 693 _configinfo.ulNumChannels = pinit->sChannels; 711 694 _configinfo.ulDataType = pinit->sMode; 695 _ulBytesWritten = 0; 712 696 _ulBytesProcessed = 0; 713 697 _ulTimeBase = 0; 714 //_ulUnderrunBase = 0;715 698 ulSavedInputGain = 0; 716 699 … … 746 729 pinit->ulFlags |= pahw->QueryDataFlags(pinit->ulOperation, pinit->sMode, pinit->lBitsPerSRate); 747 730 748 //fUnderrun = FALSE;749 731 StreamId = 0; 750 732 … … 755 737 } 756 738 757 //dprintf(("WAVESTREAM stream %lx ctor %lx: rate %d bps %d numchan %d type %x", hstream, StreamId, (USHORT)_configinfo.ulSampleRate, (USHORT)_configinfo.ulBitsPerSample, (USHORT)_configinfo.ulNumChannels, (USHORT)_configinfo.ulNumChannels, (USHORT)_configinfo.ulDataType));739 //dprintf(("WAVESTREAM stream %lx ctor %lx: rate %d bps %d numchan %d type %x", hstream, StreamId, (USHORT)_configinfo.ulSampleRate, (USHORT)_configinfo.ulBitsPerSample, (USHORT)_configinfo.ulNumChannels, (USHORT)_configinfo.ulNumChannels, (USHORT)_configinfo.ulDataType)); 758 740 } 759 741 //****************************************************************************** … … 761 743 WAVESTREAM::~WAVESTREAM() 762 744 { 763 //dprintf(("WAVESTREAM stream %x dtor %lx", hstream, StreamId));745 //dprintf(("WAVESTREAM stream %x dtor %lx", hstream, StreamId)); 764 746 if(_configinfo.pConversionBuffer) { 765 747 if(DevHelp_VMFree(_configinfo.pConversionBuffer) != 0) { -
OCO/trunk/drv16/wavestrm.hpp
r396 r483 61 61 62 62 WaveConfigInfo _configinfo; // configuration info shared with the hardware 63 ULONG _ulBytesProcessed; // number of bytes consumed or produces 63 ULONG _ulBytesWritten; // number of bytes transferred to uniaud32 64 ULONG _ulBytesProcessed; // number of bytes consumed or produced 64 65 ULONG _ulTimeBase; // value in ms. MMPM sends for stream time 65 66 -
OCO/trunk/include/dbgos2.h
r469 r483 19 19 #endif 20 20 21 #ifdef DEBUG 21 22 #define dprintf(a) if(dbglevel >= 1) PrintfOut a 22 23 #define dprintf2(a) if(dbglevel >= 2) PrintfOut a … … 25 26 #define ddprintf(a) if(dbglevel >= 1) PrintfOut a 26 27 #define dgprintf(a) if(dbglevel >= 1) PrintfOut a 28 #else 29 #define dprintf(a) //if(dbglevel >= 1) PrintfOut a 30 #define dprintf2(a) //if(dbglevel >= 2) PrintfOut a 31 #define dprintf3(a) //if(dbglevel >= 3) PrintfOut a 32 #define dprintf4(a) //if(dbglevel >= 4) PrintfOut a 33 #define ddprintf(a) //if(dbglevel >= 1) PrintfOut a 34 #define dgprintf(a) //if(dbglevel >= 1) PrintfOut a 35 #endif 27 36 28 37 #ifdef DEBUG 29 #define DebugInt3() _asm int 338 #define DebugInt3() //_asm int 3 DAZ temporarily taken out of debug build to prevent traps 30 39 #else 31 40 #define DebugInt3() //_asm int 3 -
OCO/trunk/install/control.scr
r409 r483 25 25 ssgroup=0 26 26 ssname="mmbase" 27 ssversion="1. 1.4-RC7"27 ssversion="1.9.1-SVNr483" 28 28 sstermdll="ITERM.DLL" 29 29 sstermdllentry="ITermEntry" … … 43 43 ssgroup=17 44 44 ssname="OS/2 Universal Audio: Wave" 45 ssversion="1. 1.4-RC7"45 ssversion="1.9.1-SVNr483" 46 46 sssize=680 47 47 ssdll="genin.dll" -
OCO/trunk/listerr.cmd
r238 r483 2 2 del all.txt 3 3 4 'dir *.err / s /m /h /k /f>tmp.xxx'4 'dir *.err /f /s >tmp.xxx' 5 5 6 6 LINEIN(tmp.xxx,1,0) -
OCO/trunk/uniaud.inc
r471 r483 7 7 # BUILDVERSION must be 3 parts, and only numbers like 5.44.108 8 8 # It is best that 2'nd number is always 2 digits, eg at least 10 9 BUILDVERSION = 1.9. 09 BUILDVERSION = 1.9.1 10 10 11 11 # Fixpack version … … 13 13 # ex RC3 GA FIXPACK2 beta_47 14 14 # Comment out to avoid a fixpack line in bldlevel 15 FIXPACK = SVNr4 7115 FIXPACK = SVNr483 16 16 17 17 # ALSA BUILD VERSION
Note:
See TracChangeset
for help on using the changeset viewer.