Changeset 266


Ignore:
Timestamp:
Nov 4, 2007, 8:19:50 PM (18 years ago)
Author:
Brendan Oakley
Message:

Send Uniaud16 debug output to Uniaud32 instead of com port, from Pavel

Location:
OCO/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OCO/trunk/drv16/commdbg.c

    r33 r266  
    228228
    229229                                        //------------------------- PrintfOut -
     230ULONG DBGCALLCONV _cdecl OSS16_DebugString(char FAR *debstr,ULONG bufsize);
     231
    230232void cdecl far PrintfOut(char far *DbgStr , ...)
    231233{
     
    332334
    333335   *BuildPtr=0;                                 // cauterize the string
    334    StringOut((char far *) BuildString);         // print to comm port
     336//PS+++   StringOut((char far *) BuildString);         // print to comm port
     337//PS++ if want can add option like /Ox and set this if(comport) StringOut((char far *) BuildString);
     338   OSS16_DebugString((char far *) BuildString,0);         // print to Uniaud32 alsahlp$
    335339}
    336340
  • OCO/trunk/drv16/ossidc16.cpp

    r259 r266  
    645645}
    646646//******************************************************************************
     647//PS++ Debug string to uniaud32
     648//******************************************************************************
     649#pragma off (unreferenced)
     650extern "C" OSSRET DBGCALLCONV _cdecl OSS16_DebugString(char FAR *debstr,ULONG bufsize)
     651#pragma on (unreferenced)
     652{
     653   IDC32_PACKET idcpacket;
     654   ULONG        buffer;
     655
     656   _fmemset(&idcpacket, 0, sizeof(idcpacket));
     657
     658    if (DevHelp_VirtToLin(SELECTOROF(debstr),OFFSETOF(debstr),&buffer))
     659        return OSSERR_INVALID_PARAMETER;
     660
     661
     662   idcpacket.buffer.buffer  = (ULONG)buffer;
     663   idcpacket.buffer.size = bufsize;
     664   return CallOSS32(IDC32_DEBUG_STRING, &idcpacket);
     665}
    647666//******************************************************************************
    648667#ifdef DEBUG
  • OCO/trunk/drv16/waveplay.cpp

    r253 r266  
    140140                StreamId = 0UL;
    141141                open_strategy = 0UL;
     142#ifdef DEBUG
     143                dprintf(("OSS16_WAVECLOSE: Success\n"));
     144#endif /* DEBUG */
    142145                return TRUE;
    143146            } else
     147#ifdef DEBUG
     148                dprintf(("OSS16_WAVECLOSE: Error\n"));
     149#endif /* DEBUG */
    144150                return FALSE;
    145151        }
     
    188194#ifdef DEBUG
    189195    dprintf(("WAVEPLAY::ConfigDev1 SampleRate %d", pConfigInfo->ulHwSampleRate));
     196    dprintf(("WAVEPLAY::ConfigDev1 ulFirstBufSize %d", ulFirstBufSize));
     197    dprintf(("WAVEPLAY::ConfigDev1 ulFragsize %d", pConfigInfo->ulFragsize));
    190198#endif
    191199
     
    195203            DebugInt3();
    196204            ulFirstBufSize = 8192; //should never happen!
     205#ifdef DEBUG
     206            dprintf(("Arg - shouldn't happen"));
     207#endif /* DEBUG */
    197208        }
    198209    }
     
    200211        //convert size of first buffer
    201212        ulFirstBufSize = ConvertLength(ulFirstBufSize, pConfigInfo);
     213#ifdef DEBUG
     214        dprintf(("WAVEPLAY::ConfigDev2 ulFirstBufSize %d", ulFirstBufSize));
     215#endif /* DEBUG */
    202216    }
    203217
    204218    //Must call this method (i.e. resets sample rate conversion position)
    205219    WAVEAUDIO::ConfigDev(StreamId, pConfigInfo, ulFirstBufSize);
     220#ifdef DEBUG
     221    dprintf(("WAVEPLAY::ConfigDev3 ulFirstBufSize %d", ulFirstBufSize));
     222#endif /* DEBUG */
    206223
    207224    //get real sample format used to program the audio hardware (taking conversion into account)
    208225    QuerySampleFormat(OPERATION_PLAY, pConfigInfo);
     226#ifdef DEBUG
     227    dprintf(("WAVEPLAY::ConfigDev4 ulFirstBufSize %d", ulFirstBufSize));
     228#endif /* DEBUG */
    209229
    210230    //convert consume rate
    211231    ulPCMConsumeRate = ConvertLength(pConfigInfo->ulPCMConsumeRate, pConfigInfo);
    212 
    213     dprintf(("WAVEPLAY::ConfigDev: cons rate %d, buf size %d init rate %d", ulPCMConsumeRate, ulFirstBufSize, pConfigInfo->ulHwSampleRate));
     232#ifdef DEBUG
     233    dprintf(("WAVEPLAY::ConfigDev5 ulFirstBufSize %d", ulFirstBufSize));
     234    dprintf(("WAVEPLAY::ConfigDev5 ulPCMConsumeRate %d", ulPCMConsumeRate));
     235
     236    dprintf(("WAVEPLAY::ConfigDev: cons rate %d buf size %d init rate %d", ulPCMConsumeRate, ulFirstBufSize, pConfigInfo->ulHwSampleRate));
     237    dprintf(("WAVEPLAY::ConfigDev6 ulFirstBufSize %d", ulFirstBufSize));
     238#endif /* DEBUG */
    214239
    215240    fragsize = ulPCMConsumeRate/64; //start with 64 irqs/sec
     
    240265#ifdef DEBUG
    241266    dprintf(("WAVEPLAY::ConfigDev: SampleRate %d", pConfigInfo->ulHwSampleRate));
     267    dprintf(("WAVEPLAY::ConfigDev2 fragsize %d", fragsize));
    242268#endif
    243269    hwparam.ulSampleRate    = pConfigInfo->ulHwSampleRate;
     
    245271    hwparam.ulNumChannels   = pConfigInfo->ulHwNumChannels;
    246272    hwparam.ulDataType      = QueryOSSDataFormat(OPERATION_PLAY, pConfigInfo->ulDataType, pConfigInfo->ulHwBitsPerSample);
    247     if((rc = (int)OSS16_WaveSetFormat(StreamId, &hwparam)) != OSSERR_SUCCESS) {
    248 #ifdef DEBUG
    249         dprintf(("WAVEPLAY:ConfigDev:OSS16_WaveSetFormat error. rc = %d",rc));
     273    rc = (int)OSS16_WaveSetFormat(StreamId, &hwparam);
     274#ifdef DEBUG
     275        dprintf(("WAVEPLAY:ConfigDev:OSS16_WaveSetFormat . rc = %d",rc));
    250276        dprintf(("WAVEPLAY:ConfigDev:samp rate %d",hwparam.ulSampleRate));
    251277        dprintf(("WAVEPLAY:ConfigDev:bits per sample %d",hwparam.ulBitsPerSample));
     
    254280
    255281#endif
     282    if( rc != OSSERR_SUCCESS) {
    256283//        DevHelp_Beep(500, 100);
    257284        DebugInt3();
     
    290317    if(pConfigInfo->usConversion == CONVERT_NONE)
    291318    {
     319#ifdef DEBUG
     320        dprintf(("Transfer. NoConv ulB %d",ulBytesToTransfer));
     321#endif /* DEBUG */
    292322        if(AddBuffer(StreamId, pConfigInfo, pUserBuffer, ulBytesToTransfer, pulBytesTransferred) == FALSE)
    293323        {
     
    365395                pConfigInfo->ulSRatePosition -= pConfigInfo->ulSRateIncrement;
    366396            }
    367             dprintf2(("WAVEPLAY::AddBuffer %lx %lx %lx -> nothing left", ulBytesToTransfer, pConfigInfo->ulSRatePosition, pConfigInfo->ulSRateIncrement));
     397#ifdef DEBUG
     398            dprintf(("WAVEPLAY::AddBuffer %lx %lx %lx -> nothing left", ulBytesToTransfer, pConfigInfo->ulSRatePosition, pConfigInfo->ulSRateIncrement));
     399#endif /* DEBUG */
    368400            return TRUE;
    369401        }
     
    377409                 dprintf2(("WAVEPLAY::AddBuffer; OSS16_WaveAddBuffer %lx %x failed due to full buffer", ulCvtBufferSize, (USHORT)rc));
    378410            }
    379 //            else dprintf(("WAVEPLAY::AddBuffer; OSS16_WaveAddBuffer %lx %x failed", ulCvtBufferSize, (USHORT)rc));
     411#ifdef DEBUG
     412            else dprintf(("WAVEPLAY::AddBuffer; OSS16_WaveAddBuffer %lx %x failed", ulCvtBufferSize, (USHORT)rc));
     413#endif /* DEBUG */
    380414            *pulBytesTransferred = 0;
    381415            return FALSE;
     
    423457    if(OSS16_WaveGetPos(StreamId, &ulCurBytesProcessed) != OSSERR_SUCCESS) {
    424458        *pulStreamPosition = 0;
     459#ifdef DEBUG
     460        dprintf(("OSS16_WAVEPLAY::GetPosition: Failed"));
     461#endif /* DEBUG */
    425462        return FALSE;
    426463    }
     
    442479    if(OSS16_WaveGetSpace(StreamId, &space) != OSSERR_SUCCESS) {
    443480        *pulStreamSpace = 0;
     481#ifdef DEBUG
     482        dprintf(("OSS16_WAVEPLAY::GetSpace: Failed"));
     483#endif /* DEBUG */
    444484        return FALSE;
    445485    }
  • OCO/trunk/drv16/wavestrm.cpp

    r33 r266  
    208208    }
    209209    if(!pTemp) {
    210             dprintf4(("AddBuffer: pTemp == NULL"));
     210#ifdef DEBUG
     211            dprintf(("AddBuffer: pTemp == NULL"));
     212#endif /* DEBUG */
    211213            return (ULONG)-1;
    212214    }
     
    320322            ulStreamPos &= ~(_configinfo.ulSampleSize - 1);
    321323
    322 //            dprintf(("WARNING: Process: Current pos %lx pos %lx incr %lx", ulCurBytesProcessed, _ulBytesProcessed, bytesinc));
     324#ifdef DEBUG
     325              dprintf(("WARNING: Process: Current pos %ld pos %d incr %d", ulCurBytesProcessed, _ulBytesProcessed, bytesinc));
    323326//            dprintf(("WARNING: hw pos %lx, streampos %lx", ulCurBytesProcessed, ulStreamPos));
     327#endif /* DEBUG */
    324328        }
    325329        _ulBytesProcessed = ulCurBytesProcessed;
  • OCO/trunk/include/ossidc.h

    r221 r266  
    152152#define IDC32_MIDI_PITCH_BEND           0x3A
    153153#define IDC32_MIDI_CLOSE                0x3B
     154#define IDC32_DEBUG_STRING              0x3C
    154155
    155156#define IDC16_INIT                      0
  • OCO/trunk/include/ossidc16.h

    r33 r266  
    7878OSSRET DBGCALLCONV OSS16_MixGetProperty(OSSSTREAMID StreamId, USHORT usProperty, ULONG FAR *pValue);
    7979OSSRET DBGCALLCONV OSS16_MixQueryCaps(OSSSTREAMID Streamid, OSS32_MIXCAPS FAR *pCaps);
     80OSSRET DBGCALLCONV _cdecl _OSS16_DebugString(char FAR *debstr,ULONG bufsize); //PS++
    8081
    8182OSSRET DBGCALLCONV OSS16_MidiOpen(ULONG devicenr, MIDITYPE midiType, OSSSTREAMID FAR *pStreamid);
Note: See TracChangeset for help on using the changeset viewer.