Changeset 188


Ignore:
Timestamp:
Sep 9, 2001, 5:31:35 PM (24 years ago)
Author:
sandervl
Message:

joystick reactivated; version increase; Rudi's fixes

Location:
sbliveos2/trunk
Files:
3 added
13 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/ChangeLog

    r185 r188  
    11$Id$
     2
     3 2001-09-09: Sander van Leeuwen <sandervl@xs4all.nl>
     4        - DRV16: Put back joystick code
     5
     6 2001-09-09: Ruediger Ihle
     7        - DRV16: Workaround added for MMPM/2 device share bug
     8                 Fix for NULL buffers
    29
    310 2001-05-24: Sander van Leeuwen <sandervl@xs4all.nl>
  • sbliveos2/trunk/bin/control.scr

    r153 r188  
    6565ssgroup=17
    6666ssname="SoundBlaster Live! Wave Audio"
    67 ssversion="0.6.0"
     67ssversion="0.7.5"
    6868sssize=300
    6969ssdll="genin.dll"
  • sbliveos2/trunk/drv16/init.cpp

    r178 r188  
    6565#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002UL
    6666#endif
    67 #define PCI_ID  ((PCI_DEVICE_ID_CREATIVE_EMU10K1<<16UL)|PCI_VENDOR_ID_CREATIVE)
     67
     68#ifndef PCI_DEVICE_ID_CREATIVE_EMU10K1_JOYSTICK
     69#define PCI_DEVICE_ID_CREATIVE_EMU10K1_JOYSTICK 0x7002
     70#endif
     71
     72#define PCI_ID     ((PCI_DEVICE_ID_CREATIVE_EMU10K1<<16UL)|PCI_VENDOR_ID_CREATIVE)
     73#define PCI_IDJOY  ((PCI_DEVICE_ID_CREATIVE_EMU10K1_JOYSTICK<<16UL)|PCI_VENDOR_ID_CREATIVE)
    6874
    6975// Default MIDI timer interval, milliseconds.
     
    7682static char szSBLiveAllocResFailed1[] = "Another device driver was granted exclusive access to IRQ ";
    7783static char szSBLiveAllocResFailed2[] = "Unable to allocate hardware resources! Aborting...";
    78 static char szSBLiveConfig1[]  = "SB Live! configuration: IRQ ";
    79 static char szSBLiveConfig2[]  = ", IO Port 0x";
    80 
     84static char szSBLiveConfig1[]   = "SB Live! configuration: IRQ ";
     85static char szSBLiveConfig2[]   = ", IO Port 0x";
     86static char szSBLiveConfigJoy[] = "SB Live! Joystick     : IO Port 0x";
    8187
    8288//
     
    183189        HexWordToASCII(digit, pResources->uIOBase[0], 0);
    184190        DosWrite(1, (VOID FAR*)digit, strlen(digit), &result);
    185 
    186         DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
    187         DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
    188191   }
    189192   delete pResources;
     193
     194   //Joystick detection
     195   if(pRM->bIsDevDetected(PCI_IDJOY, SEARCH_ID_DEVICEID, TRUE))
     196   {
     197       pResources = pRM->pGetDevResources(PCI_IDJOY, SEARCH_ID_DEVICEID, TRUE, TRUE);
     198       if((pResources) && !pResources->isEmpty() && fVerbose) {
     199           USHORT result;
     200           DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
     201           DosWrite(1, (VOID FAR*)szSBLiveConfigJoy, sizeof(szSBLiveConfigJoy)-1, &result);
     202           HexWordToASCII(digit, pResources->uIOBase[0], 0);
     203           DosWrite(1, (VOID FAR*)digit, strlen(digit), &result);
     204       }
     205       delete pResources;
     206   }
     207   if (fVerbose) {
     208        USHORT result;
     209        DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
     210        DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);
     211   }
    190212
    191213   // Build the MPU401 object only if we got a good 2115 init.
  • sbliveos2/trunk/drv16/ioctl.cpp

    r186 r188  
    108108      }
    109109      else {
    110          delete pstream;
     110#if 1
     111        // Rudi: Workaround for MMPM device sharing bug
     112        if (pstream->ulStreamState & STREAM_STREAMING) {
     113          CONTROL_PARM dummy;
     114          pstream->PauseStream(&dummy);
     115          pstream->ResumeStream();
     116          p->pvReserved = (VOID FAR *) (ULONG)prp->s.ioctl.usSysFileNum;
     117          p->sReturnCode = 0;
     118          return;
     119        }
     120#endif
     121         delete pstream;
    111122      }
    112123   }
  • sbliveos2/trunk/drv16/wavestrm.cpp

    r178 r188  
    165165                //underrun: stop playback
    166166                dprintf(("underrun: stop playback"));
    167                 pahw->Stop(this);
     167                pahw->Stop(this);
    168168                fUnderrun = TRUE;
    169169                return;
     
    171171        space = OSS16_StreamGetSpace(this);
    172172        while(space) {
    173                 byteswritten = AddBuffer(space);
     173                byteswritten = AddBuffer(space);
     174                if(byteswritten == (ULONG)-1) break;
    174175                space -= byteswritten;
    175                 if(byteswritten == 0) break;
    176         }       
     176        }
    177177   }
    178178}
     
    191191
    192192   if(!pTemp || pTemp->ulBuffpos >= (pTemp->ulBuffsz & 0xFFFFFFFC)) {
    193         pTemp = (PSTREAMBUFFER)qhInProcess.Head();
     193        pTemp = (PSTREAMBUFFER)qhInProcess.Head();
    194194   }
    195195   if(!pTemp) {
    196196        dprintf4(("AddBuffer: pTemp == NULL"));
    197         return 0;
     197        return (ULONG)-1;
    198198   }
    199199
     
    202202   Buff_left = pTemp->ulBuffsz - pTemp->ulBuffpos;
    203203
    204    // write the audio buffer
    205    Buff_left = min(Buff_left, space);
    206    byteswritten = OSS16_StreamAddBuffer(this, pdataBuf, Buff_left);
    207    if(byteswritten == 0) {
    208         return 0; //no more room
    209    }
    210 
    211    // update the buffer pos counter
    212    pTemp->ulBuffpos += byteswritten;
    213 
    214    if(pTemp != qhDone.Tail()) {
    215         qhDone.PushOnTail(qhInProcess.PopHead());
     204   if(Buff_left) {
     205        // write the audio buffer
     206        Buff_left = min(Buff_left, space);
     207        byteswritten = OSS16_StreamAddBuffer(this, pdataBuf, Buff_left);
     208        if(byteswritten == 0) {
     209            return (ULONG)-1; //no more room
     210        }
     211
     212        // update the buffer pos counter
     213        pTemp->ulBuffpos += byteswritten;
     214   }
     215   else byteswritten = 0;
     216
     217   if(pTemp == qhInProcess.Head()) {
     218        qhDone.PushOnTail(qhInProcess.PopHead());
    216219   }
    217220   dprintf4(("AddBuffer %lx size %d, bytes written %d", pdataBuf, (USHORT)Buff_left, (USHORT)byteswritten));
     
    299302          else  break; //shouldn't happen
    300303        }
    301 
    302         //Get rid of empty buffers
    303         ptemp = (PSTREAMBUFFER)qhInProcess.Head();
    304         if(ptemp && (ptemp->ulBuffsz == 0 || ptemp->pBuffptr == NULL)) {
    305                 dprintf(("Returning 0 size buffer immediately"));
    306                 ReturnBuffer();
    307         }
    308         AddBuffers(FALSE);
    309         break;
    310    }
    311    case STREAM_READ:           
    312         while(_vReadAudioBuf());
    313         break;
     304        AddBuffers(FALSE);
     305        break;
     306   }
     307   case STREAM_READ:
     308        while(_vReadAudioBuf());
     309        break;
    314310   default:
    315311      break;
  • sbliveos2/trunk/include/kee.h

    r142 r188  
    101101//NOTE: esp and ebp are modified when this function returns
    102102//      --> can cause problems if compiler uses i.e. ebp for storing a value!!
     103
     104#ifdef  __WATCOMC__
     105ULONG KernThunkStackTo32(VOID);
     106#pragma aux KernThunkStackTo32 "KernThunkStackTo32" modify exact [eax ecx edx] value [edx];
     107#else
    103108ULONG APIENTRY KernThunkStackTo32(VOID);
    104 #pragma aux KernThunkStackTo32 "KernThunkStackTo32" modify exact [edx];
     109#endif
     110
    105111
    106112/*ordinal 42*/
  • sbliveos2/trunk/include/linux/kernel.h

    r142 r188  
    1515/* Optimization barrier */
    1616/* The "volatile" is due to gcc bugs */
    17 #define barrier() __asm__ __volatile__("": : :"memory")
     17//#define barrier() __asm__ __volatile__("": : :"memory")
     18#define barrier()
    1819
    1920#define STACK_MAGIC     0xdeadbeef
     
    5556extern int session_of_pgrp(int pgrp);
    5657
    57 int printk(const char * fmt, ...);
     58extern int printk(const char * fmt, ...);
    5859
    5960
  • sbliveos2/trunk/include/sbversion.h

    r163 r188  
    2525#define __SBVERSION_H__
    2626
    27 #define SBLIVE_VERSION "0.7.0"
     27#define SBLIVE_VERSION "0.7.5"
    2828
    2929#endif //__SBVERSION_H__
  • sbliveos2/trunk/include/version.mak

    r163 r188  
    1111
    1212_VENDOR = Creative Labs SoundBlaster Live
    13 _VERSION = 0.70.000
     13_VERSION = 0.75.000
    1414
    1515FILEVER = @^#$(_VENDOR):$(_VERSION)^#@
  • sbliveos2/trunk/install/control.scr

    r153 r188  
    6565ssgroup=17
    6666ssname="SoundBlaster Live! Wave Audio"
    67 ssversion="0.6.0"
     67ssversion="0.7.5"
    6868sssize=300
    6969ssdll="genin.dll"
  • sbliveos2/trunk/lib32/spinlock.c

    r142 r188  
    2828#include <asm/hardirq.h>
    2929
     30
     31unsigned long __lock(void);
     32#pragma aux __lock =            \
     33        "pushfd"                \
     34        "cli"                   \
     35        "pop eax"               \
     36        modify exact [eax]      \
     37        value [eax];
     38
     39
     40void __unlock(unsigned long cpuflags);
     41#pragma aux __unlock =          \
     42        "push eax"              \
     43        "popfd"                 \
     44        modify exact []         \
     45        parm [eax];
     46
     47
     48
    3049void spin_lock_init(spinlock_t *lock)
    3150{
     
    3554void spin_lock(spinlock_t *lock)
    3655{
    37   unsigned long cpuflags;
    38 
    39   _asm {
    40         pushfd
    41         pop eax
    42         mov [cpuflags], eax
    43         cli
    44   }
    45   *lock = cpuflags;
     56  *lock = __lock();
    4657}
    4758
    4859void spin_lock_flag(spinlock_t *lock, unsigned long *flag)
    4960{
    50   spin_lock(lock);
     61  *lock = __lock();
    5162}
    5263
     
    6576void spin_unlock(spinlock_t *lock)
    6677{
    67  unsigned long cpuflags = *lock;
     78  __unlock(*lock);
     79}
    6880
    69   _asm {
    70         mov  eax, [cpuflags]
    71         push eax
    72         popfd
    73   }
    74 }
     81
  • sbliveos2/trunk/lib32/waitqueue.c

    r142 r188  
    4646}
    4747
     48long interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout)
     49{
     50  return 1;
     51}
    4852
    4953void interruptible_sleep_on(wait_queue_head_t *q)
  • sbliveos2/trunk/readme.txt

    r153 r188  
    1             SoundBlaster Live! OS/2 Audio driver version 0.60 (beta)
     1            SoundBlaster Live! OS/2 Audio driver version 0.75 (beta)
    22            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    33
     
    3737  Crystal Semiconductor and supported by the Crystal OS/2 audio drivers)
    3838- RTMIDI playback & recording
     39  --> Note: this is not the same as midi playback via MMPM/2 (midi applet)
     40      Playing midi files requires an external MIDI device
    3941
    4042
    41433 History
    4244=========
     450.75
     46- Put back joystick code
     47- Fix for playing small wave files
     48
     490.70
     50- Fail to load if resource manager returned error while allocating resources.
     51  (prevents SB Live driver from allocating irq when the (e.g.) the USB driver
     52   has already claimed exclusive access)
     53- Added new DirectAudio interface used by Odin for wave playback
     54
    43550.60
     56- Fixed detection of SB Live on some systems
    4457- Fixed video mixer control
    4558- Changed wave volume level
    4659- Fixed clicks when playing wave files with large audio buffers
     60- Print joystick port during init + register joystick device + it's resources
    4761
    48620.50
     
    5973- OS/2 Warp 4 or Warp Server for e-Business
    6074  (Warp 3 not tested)
    61 - Creative Labs SoundBlaster Live! soundcard
     75- Creative Labs SoundBlaster Live! or
     76  Creative Labs SoundBlaster PCI 512 soundcard
    6277
    6378
     
    6580========================
    6681To install the SB Live driver:
     82- Make sure your BIOS configures the SB Live! card (assigns IRQ and IO addresses)
     83  Look for a 'PnP OS' (or similar) setting in your BIOS options and set it to
     84  'No' or 'Off'.
     85  The SB Live! driver does not work if the BIOS doesn't assign hardware
     86  resources to the card.
    6787- Unzip driver archive
    6888- Run install.cmd
     
    7393as described above, but select zero SB Live cards when asked.
    7494
     95To use the SB Live's joystick port you need to install one of the
     96OS/2 joystick drivers and tell it to you the IO port that the
     97sb live driver prints during boot.
     98I.e.: Sblive16 prints this during boot:
     99      SB Live! joystick at : 0xE400
     100Change the joystick port address to E400 for the gamedd2 driver:
     101      DEVICE=C:\GAMEDD.SYS /P:E400 /W:400 /C:1E
     102
     103Note that this is not an ideal solution as the SB Live's joystick
     104port address can be changed by the BIOS when hardware is added or
     105removed.
     106However, it's safer than mapping it to the standard joystick port address
     107(i.e. 0x201) due to the risk of a conflict with other (audio) hardware.
     108
     109
    751106 Config.sys options
    76111====================
    77112DEVICE=J:\MMOS2\SBLIVE16.SYS /V /C /M /L
    78113- /V: verbose (prints copyrights during driver init)
    79 - /C: enable CD audio input
    80 - /M: enable microphone audio input
    81 - /L: enable linein audio input
     114- /C: enable CD audio input         (default muted; can be changed with mixer app)
     115- /M: enable microphone audio input (default muted; can be changed with mixer app)
     116- /L: enable linein audio input     (default muted; can be changed with mixer app)
    82117
    83118DEVICE=J:\MMOS2\SBLIVE32.SYS /D
     
    95130  If you find a way to reliably reproduce this, please contact the author.
    96131  (see section 9)
    97 - Small distortions when recording at 44.1khz 16 bits stereo
    98132- Crash in PMMERGE when installing the driver on a system that uses the Scitech
    99133  display drivers.
     
    118152        - reboot
    119153
     154- IRQ conflicts can occurs with drivers that are unable to share their interrupt.
     155  (the USB drivers have this problem, but only on some systems)
     156  The SBLive driver can detect some of these conflicts and will print the
     157  following messages:
     158   Another device driver was granted exclusive access to IRQ xx
     159   Unable to allocate hardware resources! Aborting...
     160
     161  When you see this message, you must force the BIOS to allocate another
     162  interrupt for the sblive driver.
     163 
     164
    1201658 File listing
    121166==============
     
    17522010.1 SoundBlaster Live OS/2 mailinglist
    176221======================================
    177 A mailinglist to discuss the OS/2 sblive driver has been created at egroups.com.
    178 Go to www.egroups.com to subscribe to sbliveos2@egroups.com.
     222A mailinglist to discuss the OS/2 sblive driver has been created at yahoogroups.com.
     223Go to www.yahoogroups.com to subscribe to sbliveos2@yahoogroups.com.
    179224
    180225
Note: See TracChangeset for help on using the changeset viewer.