Changeset 220


Ignore:
Timestamp:
Jul 17, 2007, 5:58:46 PM (18 years ago)
Author:
Brendan Oakley
Message:

Tag of updates from Vlad

Location:
OCO/tags/1.1.4RC2
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • OCO/tags/1.1.4RC2/drv16/apm.asm

    r33 r220  
    7777
    7878        enter  4,0
    79         pushad
     79;        pushad
    8080        push    ds
    8181        push    es
     
    9292        pop     es
    9393        pop     ds
    94         popad
     94;        popad
    9595        leave
    9696        ret  4
  • OCO/tags/1.1.4RC2/drv16/apmevent.cpp

    r33 r220  
    1717#endif
    1818
    19 static int fAPMSuspend = FALSE;
     19int fAPMSuspend = FALSE;
    2020
    2121/***********************************************************************/
     
    4949        return(APM_suspend(APM_STATE_OFF));     /* put chip to sleep */
    5050      default:
    51         return 1;
     51        return 0;
    5252    } /* endswitch */
    5353
     
    6565    return 0;
    6666  }
    67   return 1;
     67  return 0;
    6868}
    6969
     
    132132}
    133133
     134/* just external callback */
     135void far apm_resume(void)
     136{
     137    APM_resume(APM_STATE_READY);
     138}
    134139
    135140/***********************************************************************/
     
    152157        APM_Reg_Req.function = APM_REGISTER_FUNCTION;
    153158        APM_Reg_Req.eventh = APM_EVENT;
    154         APM_Reg_Req.mask = 0x3C0;
     159        APM_Reg_Req.mask = 0xFFF8;
    155160        APM_Reg_Req.ds = FP_SEG(&APM_Reg_Req);
    156161        APM_Reg_Req.device_id = 0x0001;
  • OCO/tags/1.1.4RC2/drv16/init.cpp

    r33 r220  
    6464static char szCopyRight1[]= "Copyright 2000-2002 InnoTek Systemberatung GmbH";
    6565static char szCopyRight2[]= "Copyright 2002 IBM Corporation";
    66 static char szCopyRight3[]= "Maintained by http://os2.kiev.ua/en/uniaud.php";
     66static char szCopyRight3[]= "Maintained by http://uniaud.netlabs.org";
    6767static char szParamError[]= "Parameter parsing error!!";
    6868static char szInitError[] = "Unable to initialize audio hardware";
     
    167167    if(DosOpen((PSZ)"ALSA32$", &hFile, &usAction, 0,
    168168               FILE_NORMAL, FILE_OPEN, OPEN_ACCESS_READWRITE |
    169                OPEN_SHARE_DENYNONE | OPEN_FLAGS_WRITE_THROUGH,
     169               OPEN_SHARE_DENYNONE | OPEN_FLAGS_WRITE_THROUGH
     170               /* Rudi's suggestion */ | OPEN_FLAGS_NOINHERIT,
    170171               NULL ) == NO_ERROR)
    171172    {
     
    190191    current_device = 0;
    191192    // Build the Wave Playback Hardware object
    192     new WAVEPLAY(current_device);
     193    pWavePlay = new WAVEPLAY(current_device);
    193194    new WAVEREC(current_device);
    194195
  • OCO/tags/1.1.4RC2/drv16/ossidc16.cpp

    r33 r220  
    4141
    4242extern "C" ULONG  far __cdecl OSSIDC_ENTRY(ULONG cmd, ULONG param1, ULONG param2);
    43 
     43extern int force_closed;
    4444//Used to call into the 32 bits OSS driver
    4545static OSSRET CallOSS32(USHORT cmd, IDC32_PACKET FAR *pIDCPacket);
     
    666666        break;
    667667
    668     case IDC16_CLOSE_PCM:
    669 //        force_close();
    670         break;
     668    case IDC16_CLOSE_UNI16:
     669        {
     670            force_closed = 1;
     671            pWavePlay->Close(0);
     672            //WAVEAUDIO::WavePlayClose();
     673            break;
     674        }
    671675    case IDC16_PROCESS:
    672676    {
    673677        PWAVESTREAM pStream;
    674 
    675 
    676678//            dprintf(("IDC16_PROCESS. param1: %x, param2: %x",param1, param2));
    677679        //Signal all active wave playback streams to update their status
  • OCO/tags/1.1.4RC2/drv16/strategy.cpp

    r33 r220  
    169169       goto failure;
    170170   }
     171   dprintf(("Device 0 name: %s", (char FAR *)devCaps[0].szDeviceName));
    171172   if(devCaps[0].nrDevices > OSS32_MAX_AUDIOCARDS)
    172173   {
     
    183184   }
    184185
     186   /* skip sertifying crap */
     187
     188   return TRUE;
    185189   //Check for certified audiocard/chipsets
    186190   if(!xorstrncmp(devCaps[0].szDeviceName, pszIntelICH, 6) ||
  • OCO/tags/1.1.4RC2/drv16/waudio.cpp

    r33 r220  
    434434    //manual sample rate conversion before sending buffers to the ALSA driver
    435435    FindMatchingSampleRate(pConfigInfo->ulSampleRate, pWaveCaps->ulRateFlags, &ulNrSampleRates, &pConfigInfo->ulFixedSampleRate);
    436     if(ulNrSampleRates == 1 && pConfigInfo->ulSampleRate != pConfigInfo->ulFixedSampleRate) {
     436    if(ulNrSampleRates <= 2 && pConfigInfo->ulSampleRate != pConfigInfo->ulFixedSampleRate) {
    437437        pConfigInfo->fSampleRateConversion = TRUE;
    438438    }
     
    10151015        sampleRates[nrSampleRates++] = 192000;
    10161016    }
    1017     if(nrSampleRates > 1) {
     1017    if(nrSampleRates > 2) {
    10181018        _usfind_matching_sample_rate(&ulSampleRate, nrSampleRates, (ULONG FAR *)sampleRates);
    10191019    }
    10201020    else {
    10211021        //fixed rate -> we support all sample rates by manually performing sample rate conversion
    1022         if(nrSampleRates == 1 && pulFixedSampleRate) {
    1023             *pulFixedSampleRate = sampleRates[0];
     1022        if(nrSampleRates <= 2 && pulFixedSampleRate) {
     1023            sampleRates[0] = 48000; /* hardware set to 48000 */
     1024            *pulFixedSampleRate = sampleRates[0];
     1025            nrSampleRates = 1;
    10241026        }
    10251027    }
  • OCO/tags/1.1.4RC2/drv16/waudio.hpp

    r33 r220  
    145145   virtual BOOL  Close(OSSSTREAMID StreamId) = 0;
    146146
    147           ULONG  ConvertLength(ULONG length, PWAVECONFIGINFO pConfigInfo);
    148           ULONG  ConvertLengthInvert(ULONG length, PWAVECONFIGINFO pConfigInfo);
    149           ULONG  ConvertPosition(ULONG length, PWAVECONFIGINFO pConfigInfo);
    150           ULONG  ConvertPositionInvert(ULONG length, PWAVECONFIGINFO pConfigInfo);
     147   ULONG  ConvertLength(ULONG length, PWAVECONFIGINFO pConfigInfo);
     148   ULONG  ConvertLengthInvert(ULONG length, PWAVECONFIGINFO pConfigInfo);
     149   ULONG  ConvertPosition(ULONG length, PWAVECONFIGINFO pConfigInfo);
     150   ULONG  ConvertPositionInvert(ULONG length, PWAVECONFIGINFO pConfigInfo);
    151151
    152152protected:
    153153
    154    ULONG         ulDeviceNr;
    155    OSSSTREAMID   StreamId;
     154    OSSSTREAMID   StreamId;
     155    ULONG         ulDeviceNr;
    156156
    157157private:
  • OCO/tags/1.1.4RC2/drv16/wavehw.hpp

    r33 r220  
    5353typedef WAVEPLAY *PWAVEPLAY;
    5454
     55PWAVEPLAY pWavePlay = NULL;
     56
    5557class WAVEREC : public WAVEAUDIO {
    5658public:
  • OCO/tags/1.1.4RC2/drv16/waveplay.cpp

    r33 r220  
    4040
    4141int waveOpened = 0;
    42 
     42int force_closed = 0;
     43extern int fAPMSuspend;
     44void far apm_resume(void);
    4345extern "C"
    4446{
     
    4749}
    4850
     51/*
     52 * save already opened by mmos2
     53 * to reuse in case of reopen stream needed
     54 * TODO!! if there is more right way?
     55 */
     56ULONG ulDeviceSave, ulStreamTypeSave, ulSysFileNumSave;
    4957//******************************************************************************
    5058//******************************************************************************
     
    5563    dprintf(("WAVEPLAY::Open %lx",StreamId));
    5664#endif
     65    if (fAPMSuspend)
     66    {
     67#ifdef DEBUG
     68        dprintf(("WAVEPLAY::Open. Suspend state"));
     69#endif
     70        apm_resume();
     71        //return FALSE;
     72    }
     73
    5774    if(StreamId == 0UL)
    5875    {
     
    7390        //if the device supports multiple active streams, then we always open
    7491        //a new ALSA stream
    75         if(devCaps[ulDevice].waveOutCaps.nrStreams == 1) {
     92        //if(devCaps[ulDevice].waveOutCaps.nrStreams == 1) {
    7693            StreamId = *pStreamId;
    77         }
     94        //}
     95        ulDeviceSave = ulDevice;
     96        ulStreamTypeSave = ulStreamType;
     97        ulSysFileNumSave = ulSysFileNum;
    7898    }
    7999    else {
     
    85105//******************************************************************************
    86106//******************************************************************************
    87 BOOL WAVEPLAY::Close(OSSSTREAMID StreamId)
     107BOOL WAVEPLAY::Close(OSSSTREAMID StreamIdl)
    88108{
    89109#ifdef DEBUG
     
    92112    //if ((open_strategy & 1))
    93113    //if (waveOpened == 1)
    94     if (0)
    95     {
    96         if (OSS16_WaveClose(StreamId) == OSSERR_SUCCESS)
     114    if (force_closed)
     115    {
     116        waveOpened--;
     117        StreamId = 0UL;
     118        open_strategy = 0UL;
     119        force_closed = 0;
     120#ifdef DEBUG
     121        dprintf(("WAVEPLAY::Closed stream: %lx, %lx, os: %lx\n", StreamId, waveOpened,open_strategy));
     122#endif
     123        return TRUE;
     124    }
     125    else
     126    {
     127        //if(devCaps[ulDeviceNr].waveOutCaps.nrStreams > 1)
     128        if (0)
    97129        {
    98             waveOpened--;
    99             StreamId = 0UL;
    100             open_strategy = 0UL;
    101 #ifdef DEBUG
    102             dprintf(("WAVEPLAY::Closed stream: %lx, %lx, os: %lx\n", StreamId, waveOpened,open_strategy));
    103 #endif
    104             return TRUE;
    105         }
    106         return FALSE;
    107     }
    108     else
    109     {
    110         if(devCaps[ulDeviceNr].waveOutCaps.nrStreams > 1)
    111         {
    112             if (OSS16_WaveClose(StreamId) == OSSERR_SUCCESS)
     130            if (OSS16_WaveClose(StreamIdl) == OSSERR_SUCCESS)
    113131            {
    114132                waveOpened--;
     
    137155#endif
    138156
    139 //    if (!waveOpened) return TRUE;
     157    if (fAPMSuspend)
     158    {
     159#ifdef DEBUG
     160        dprintf(("WAVEPLAY::ConfigDev. Suspend state"));
     161#endif
     162        apm_resume();
     163        //return FALSE;
     164    }
     165
     166    if (StreamId == NULL)
     167    {
     168        WAVEPLAY::Open(ulDeviceSave, ulStreamTypeSave, ulSysFileNumSave, &StreamId);
     169        if (StreamId == NULL)
     170        {
     171#ifdef DEBUG
     172            dprintf(("WAVEPLAY::ConfigDev. Error reopening stream"));
     173#endif
     174            return FALSE;
     175        }
     176    }
    140177#ifdef DEBUG
    141178    dprintf(("WAVEPLAY::ConfigDev1 SampleRate %d", pConfigInfo->ulHwSampleRate));
     
    228265//    dprintf(("WAVEPLAY::Transfer"));
    229266#endif
     267
     268    if (fAPMSuspend)
     269    {
     270#ifdef DEBUG
     271        dprintf(("WAVEPLAY::Transfer. Suspend state"));
     272#endif
     273        apm_resume();
     274        //return FALSE;
     275    }
    230276
    231277//    if (!waveOpened) return TRUE;
     
    281327//    if (!waveOpened) return TRUE;
    282328
     329    if (fAPMSuspend)
     330    {
     331#ifdef DEBUG
     332        dprintf(("WAVEPLAY::AddBuffer. Suspend state"));
     333#endif
     334        apm_resume();
     335        //return FALSE;
     336    }
     337
    283338    if(pConfigInfo->fSampleRateConversion)
    284339    {
  • OCO/tags/1.1.4RC2/include/ossidc.h

    r33 r220  
    162162#define IDC16_WAVEOUT_IRQ               1
    163163#define IDC16_MIDI_IRQ                  2
    164 #define IDC16_CLOSE_PCM                 3
     164#define IDC16_CLOSE_UNI16               3
    165165
    166166// Default device nr (first detected audio device)
  • OCO/tags/1.1.4RC2/include/version.h

    r33 r220  
    1010#define __VERSION_H__
    1111
    12 #define ALSA_VERSION            "1.1.2"
     12#define ALSA_VERSION            "1.1.4RC2"
    1313
    1414#endif //__VERSION_H__
Note: See TracChangeset for help on using the changeset viewer.