Ignore:
Timestamp:
Jul 11, 2010, 5:31:02 PM (15 years ago)
Author:
David Azarewicz
Message:

Debug output changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OCO/trunk/drv16/waveplay.cpp

    r495 r507  
    4646    ULONG open_strategy = 0UL;
    4747    ULONG LastSpace=0;
    48 //    int force_close(void);
     48        //int force_close(void);
    4949}
    5050
     
    6060{
    6161    ULONG ret;
    62 #ifdef DEBUG
    63 //    dprintf(("WAVEPLAY::Open %lx",StreamId));
    64 #endif
     62        //dprintf(("WAVEPLAY::Open %lx",StreamId));
    6563    if (fAPMSuspend)
    6664    {
    67 #ifdef DEBUG
    68 //        dprintf(("WAVEPLAY::Open. Suspend state"));
    69 #endif
     65                //dprintf(("WAVEPLAY::Open. Suspend state"));
    7066        apm_resume();
    71         //return FALSE;
    7267    }
    7368
     
    7671        if((ret = OSS16_WaveOpen(ulDevice, ulStreamType, ulSysFileNum, pStreamId)) != OSSERR_SUCCESS)
    7772        {
    78 #ifdef DEBUG
    7973            dprintf(("OSS16_WaveOpen failed!!"));
    80 #endif
    8174            DebugInt3();
    82 //            StreamId = 0;
    83 //            waveOpened = 0;
     75                        //StreamId = 0;
     76                        //waveOpened = 0;
    8477            return FALSE;
    8578        } else
     
    10699BOOL WAVEPLAY::Close(OSSSTREAMID StreamIdl)
    107100{
    108 #ifdef DEBUG
    109 //    dprintf(("WAVEPLAY::Close stream: %lx, %lx, os: %lx", StreamId, waveOpened,open_strategy));
    110 #endif
     101        //dprintf(("WAVEPLAY::Close stream: %lx, %lx, os: %lx", StreamId, waveOpened,open_strategy));
    111102#if 0 // fixme to be gone?
    112103    //if ((open_strategy & 1))
     
    118109        open_strategy = 0UL;
    119110        force_closed = 0;
    120 #ifdef DEBUG
    121 //        dprintf(("WAVEPLAY::Closed stream: %lx, %lx, os: %lx", StreamId, waveOpened,open_strategy));
    122 #endif
     111                //dprintf(("WAVEPLAY::Closed stream: %lx, %lx, os: %lx", StreamId, waveOpened,open_strategy));
    123112        return TRUE;
    124113    }
     
    126115#endif // fixme to be gone?
    127116    {
    128 
    129117/* Setting DISABLE_STREAM_REUSE will close the open stream here.      */
    130118/* If left unset, the idea is the open stream will be reused instead. */
     
    139127                StreamId = 0UL;
    140128                open_strategy = 0UL;
    141 #ifdef DEBUG
    142 //                dprintf(("OSS16_WAVECLOSE: Success"));
    143 #endif /* DEBUG */
     129                                dprintf(("OSS16_WAVECLOSE: Success"));
    144130                return TRUE;
    145             } else
    146 #ifdef DEBUG
     131            } else {
    147132                dprintf(("OSS16_WAVECLOSE: Error"));
    148 #endif /* DEBUG */
    149133                return FALSE;
     134                        }
    150135        }
    151136        else
    152137#else /* !DISABLE_STREAM_REUSE */
    153         if (StreamIdl == NULL)
    154                 return FALSE;
     138                if (StreamIdl == NULL) return FALSE;
    155139#endif /* DISABLE_STREAM_REUSE */
    156140        return TRUE;
     
    170154    if (fAPMSuspend)
    171155    {
    172 #ifdef DEBUG
    173 //        dprintf(("WAVEPLAY::ConfigDev. Suspend state"));
    174 #endif
     156                //dprintf(("WAVEPLAY::ConfigDev. Suspend state"));
    175157        apm_resume();
    176         //return FALSE;
    177158    }
    178159
     
    182163        if (StreamId == NULL)
    183164        {
    184 #ifdef DEBUG
    185165            dprintf(("WAVEPLAY::ConfigDev. Error reopening stream"));
    186 #endif
    187166            return FALSE;
    188167        }
    189168    }
    190 #ifdef DEBUG
    191169    dprintf4(("WAVEPLAY::ConfigDev SampleRate %ld", pConfigInfo->ulHwSampleRate));
    192170    dprintf4(("WAVEPLAY::ConfigDev ulFirstBufSize=%lx ulFragsize=%lx", ulFirstBufSize, pConfigInfo->ulFragsize));
    193 #endif
    194171
    195172    if(ulFirstBufSize == 0)
     
    200177            DebugInt3();
    201178            ulFirstBufSize = 8192; //should never happen!
    202 #ifdef DEBUG
    203179            dprintf(("Arg - shouldn't happen"));
    204 #endif /* DEBUG */
    205180        }
    206181    }
     
    209184        //convert size of first buffer
    210185        ulFirstBufSize = ConvertLength(ulFirstBufSize, pConfigInfo);
    211 #ifdef DEBUG
    212186        dprintf4(("ulFirstBufSize %lx", ulFirstBufSize));
    213 #endif /* DEBUG */
    214187    }
    215188    //Must call this method (i.e. resets sample rate conversion position)
     
    221194    //convert consume rate
    222195    ulPCMConsumeRate = ConvertLength(pConfigInfo->ulPCMConsumeRate, pConfigInfo);
    223 #ifdef DEBUG
    224196    dprintf4(("cons rate %lx buf size %lx init rate %ld", ulPCMConsumeRate, ulFirstBufSize, pConfigInfo->ulHwSampleRate));
    225 #endif /* DEBUG */
    226197
    227198    fragsize = ulPCMConsumeRate/64; //start with 64 irqs/sec   2756
     
    250221    pConfigInfo->ulFragsize = fragsize;
    251222
    252 #ifdef DEBUG
    253223    dprintf4(("fragsize %lx", fragsize));
    254 #endif
    255224    hwparam.ulSampleRate    = pConfigInfo->ulHwSampleRate;
    256225    hwparam.ulBitsPerSample = pConfigInfo->ulHwBitsPerSample;
     
    258227    hwparam.ulDataType      = QueryOSSDataFormat(OPERATION_PLAY, pConfigInfo->ulDataType, pConfigInfo->ulHwBitsPerSample);
    259228    rc = (USHORT)OSS16_WaveSetFormat(StreamId, &hwparam);
    260 #ifdef DEBUG
    261229        dprintf4(("WAVEPLAY:ConfigDev:OSS16_WaveSetFormat . rc = %d",rc));
    262230        dprintf4(("samp rate=%ld bps=%ld channels=%ld type=%ld", hwparam.ulSampleRate, hwparam.ulBitsPerSample, hwparam.ulNumChannels, hwparam.ulDataType));
    263231
    264 #endif
    265232    if( rc != OSSERR_SUCCESS) {
    266233        dprintf(("WAVEPLAY:ConfigDev: rc %d",rc));
     
    276243//******************************************************************************
    277244//Convert (if required) and write wave data to audio device
     245// Return FALSE on error
    278246//******************************************************************************
    279247BOOL WAVEPLAY::Transfer(OSSSTREAMID StreamId, PWAVECONFIGINFO pConfigInfo,
     
    283251    *pulBytesTransferred = 0;
    284252
    285 #ifdef DEBUG
    286253    //dprintf(("WAVEPLAY::Transfer %ld",ulBytesToTransfer));
    287 #endif
    288 
    289     if (fAPMSuspend)
    290     {
    291 #ifdef DEBUG
    292 //        dprintf(("WAVEPLAY::Transfer. Suspend state"));
    293 #endif
     254
     255    if (fAPMSuspend) {
     256                //dprintf(("WAVEPLAY::Transfer. Suspend state"));
    294257        apm_resume();
    295         //return FALSE;
    296     }
    297 
    298     //PS very strange
    299     if (!ulBytesToTransfer)
    300     {
     258    }
     259
     260    if (!ulBytesToTransfer) {
    301261        return TRUE;
    302262    }
    303263
    304 //    if (!waveOpened) return TRUE;
     264        //if (!waveOpened) return TRUE;
    305265
    306266    if(pConfigInfo->usConversion == CONVERT_NONE)
     
    308268        if (AddBuffer(StreamId, pConfigInfo, pUserBuffer, ulBytesToTransfer, pulBytesTransferred) == FALSE)
    309269        {
    310 #ifdef DEBUG
    311270            dprintf(("Transfer.False. NoConv ulB %ld tr:%ld",ulBytesToTransfer,*pulBytesTransferred));
    312 #endif /* DEBUG */
    313271            *pulBytesTransferred = 0;
    314272            return FALSE;
     
    331289            {
    332290                dprintf(("Transfer New ulBr %ld" , ulBytesToTransfer));
    333 //                DebugInt3();
     291                                //DebugInt3();
    334292                ulBytesToTransfer = ulBytesToTransfer & ~(pConfigInfo->ulSampleSize-1);
    335 #ifdef DEBUG
    336293                dprintf(("Transfer New ulBr %ld" , ulBytesToTransfer));
    337 #endif
    338294            }
    339295            pConfigInfo->pfnConvert(pUserBuffer, ulBytesToTransfer, pConfigInfo->pConversionBuffer);
     
    347303            if(*pulBytesTransferred & (pConfigInfo->ulSampleSize-1))
    348304            {
    349 #ifdef DEBUG
    350305                dprintf(("Transfer New pulBr %ld" , pulBytesTransferred));
    351 #endif
    352 //                DebugInt3();
     306                                //DebugInt3();
    353307            }
    354308        }
     
    356310        {
    357311            dprintf(("Transfer Zero pConfigInfo->pfnConvert"));
    358 //            DebugInt3();
     312                        //DebugInt3();
    359313            return FALSE;
    360314        }
     
    370324    OSSRET rc;
    371325    ULONG  Space;
    372 //    if (!waveOpened) return TRUE;
    373 
    374 //PS Here is inrerrupt time....
    375     if (fAPMSuspend)
    376     {
    377 #ifdef DEBUG
    378 //        dprintf(("WAVEPLAY::AddBuffer. Suspend state"));
    379 #endif
     326        //if (!waveOpened) return TRUE;
     327
     328        //PS Here is inrerrupt time....
     329    if (fAPMSuspend) {
     330                //dprintf(("WAVEPLAY::AddBuffer. Suspend state"));
    380331        apm_resume();
    381332        //return FALSE;
     
    407358        if (ulCvtBufferSize > Space)
    408359        {
    409 #ifdef DEBUG
    410360            dprintf(("WPLAY::AddBuffer need %ld space:%ld", ulCvtBufferSize, Space));
    411 #endif
    412361            if (Space < pConfigInfo->ulBytesPerIRQ)
    413362            {
     
    482431    if(OSS16_WaveGetPos(StreamId, &ulCurBytesProcessed) != OSSERR_SUCCESS) {
    483432        *pulStreamPosition = 0;
    484 #ifdef DEBUG
    485433        dprintf(("WAVEPLAY::GetPosition: Failed"));
    486 #endif /* DEBUG */
    487434        return FALSE;
    488435    }
     
    505452    {
    506453        *pulStreamSpace = 0;
    507 #ifdef DEBUG
    508454        dprintf(("WAVEPLAY::GetSpace: Failed"));
    509 #endif /* DEBUG */
    510455        return FALSE;
    511456    }
     
    527472    {
    528473        *pulHwPtr = 0;
    529         #ifdef DEBUG
    530474        dprintf(("WAVEPLAY::WaveGetHwPtr: Failed"));
    531         #endif /* DEBUG */
    532475        return FALSE;
    533476    }
Note: See TracChangeset for help on using the changeset viewer.