- Timestamp:
- May 28, 2000, 6:50:46 PM (25 years ago)
- Location:
- sbliveos2/trunk
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/Build.txt
r150 r151 16 16 OS/2 audio driver. 17 17 It also tries to give some information about the architecture of the driver 18 and some oftechnical details.18 and explain some technical details. 19 19 20 20 However, it does not attempt to explain everything. People that are not -
sbliveos2/trunk/ChangeLog
r150 r151 1 1 $Id$ 2 3 2000-05-20: Sander van Leeuwen <sandervl@xs4all.nl> 4 - Added RTMIDI support 5 6 2000-05-18: Sander van Leeuwen <sandervl@xs4all.nl> 7 - Added /D debug option for sblive32.sys (prints code start + end address) 8 9 2000-05-15: Sander van Leeuwen <sandervl@xs4all.nl> 10 - Replaced Resource Manager detection with manual PCI detection 2 11 3 12 2000-04-28: Sander van Leeuwen <sandervl@xs4all.nl> -
sbliveos2/trunk/drv16/init.cpp
r147 r151 63 63 #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002UL 64 64 #endif 65 #define PCI_ID ((PCI_ VENDOR_ID_CREATIVE<<16UL)|PCI_DEVICE_ID_CREATIVE_EMU10K1)65 #define PCI_ID ((PCI_DEVICE_ID_CREATIVE_EMU10K1<<16UL)|PCI_VENDOR_ID_CREATIVE) 66 66 67 67 // Default MIDI timer interval, milliseconds. … … 133 133 memcpy(phdr->abName,szCL_DevName,8); // yes, copy it to the dev header 134 134 135 pRM = new ResourceManager( ); // Create the RM object.135 pRM = new ResourceManager(PCI_ID); // Create the RM object. 136 136 if (! pRM) { 137 137 return; … … 156 156 // First create a timer, then the HW object. 157 157 TIMER* pMPUTimer = 158 new TIMER( 158 new TIMER(NULL, MIDI_TimerInterval, STREAM_MPU401_PLAY ); 159 159 if (pMPUTimer->eState() != TIMER_Disabled) 160 160 new MPU_401(pMPUTimer); -
sbliveos2/trunk/drv16/mpu401.cpp
r147 r151 40 40 #include "parse.h" 41 41 #include "ossidc.h" 42 #include <dbgos2.h> 43 44 #define TIMEOUT 60000 42 45 43 46 … … 47 50 MIDIAUDIO ( AUDIOHW_MPU401_PLAY, pTimer ) 48 51 { 49 static char szName[] = "SBLive #"; // Instance name for RTMIDI. A number will be appended.52 static char szName[] = "SBLive RTMIDI #"; // Instance name for RTMIDI. A number will be appended. 50 53 static char szSuffix[] = "0"; // Printable char that is appended to szName. 51 54 52 55 // RTMIDI (MIDI.SYS) related stuff 53 ++szSuffix[0]; // Bump number in instance name.56 //// ++szSuffix[0]; // Bump number in instance name. 54 57 strcpy( szRTMIDI_Name, szName ); // Setup instance name. 55 58 strcat( szRTMIDI_Name, szSuffix ); // Append ASCII number to instance name. 56 ulRTMIDI_Caps = MIDICAPSA_INPUT; // Set RTMIDI caps. 57 // When we have an IRQ and a send capability, add next line. 58 // ulCapabilities |= MIDICAPSA_OUTPUT; 59 ulRTMIDI_Caps = MIDICAPSA_INPUT | MIDICAPSA_OUTPUT; // Set RTMIDI caps. 59 60 60 61 midiOutStreamId = 0; … … 124 125 int MPU_401::writeByte(BYTE b) 125 126 { 126 //TODO: 127 if(!midiOutStreamId) { 128 DebugInt3(); 129 return 0; 130 } 131 unsigned int i; 132 133 for (i=0; i<TIMEOUT; i++) { 134 if(OSS16_WriteMidiByte(midiOutStreamId, b)) { 135 return 1; 136 } 137 iodelay(1); 138 } 127 139 return 0; 128 140 } … … 132 144 //TODO: 133 145 return -1; 146 } 147 148 void MPU_401::processIrq(unsigned long streamid) 149 { 150 char buffer[64]; 151 int bufsize; 152 153 MIDIAUDIO* pma = (MIDIAUDIO *) pAudioHWList->Head(); 154 while (pma) { 155 if((pma->ulDeviceType == AUDIOHW_MPU401_CAPTURE) || 156 (pma->ulDeviceType == AUDIOHW_MPU401_PLAY)) { 157 break; 158 } 159 pma = (MIDIAUDIO *) pma->pNext; 160 } 161 if(pma == NULL) { 162 dprintf(("MPU_401::processIrq: mpu device found!!")); 163 return; 164 } 165 166 while(TRUE) { 167 bufsize = OSS16_ReadMidiBytes(streamid, &buffer[0], sizeof(buffer)); 168 for(int i=0;i<bufsize;i++) { 169 pma->pfnSendByte(pma->ulRTMIDI_Handle, buffer[i]); 170 } 171 if(bufsize != sizeof(buffer)) { 172 break; 173 } 174 } 134 175 } 135 176 … … 175 216 USHORT MPU_401::RTMIDI_OpenReceive(void) 176 217 { 218 if(midiOutStreamId == 0) { 219 midiOutStreamId = OSS16_OpenMidiStream(MIDI_RECEIVE); 220 } 221 return (midiOutStreamId) ? 0 : MIDIERRA_HW_FAILED; 222 } 223 224 USHORT MPU_401::RTMIDI_OpenSend(void) 225 { 177 226 if(midiInStreamId == 0) { 178 midiInStreamId = OSS16_OpenMidiStream(MIDI_ RECEIVE);227 midiInStreamId = OSS16_OpenMidiStream(MIDI_SEND); 179 228 } 180 229 return (midiInStreamId) ? 0 : MIDIERRA_HW_FAILED; 181 230 } 182 231 183 USHORT MPU_401::RTMIDI_OpenSend(void)184 {185 if(midiOutStreamId == 0) {186 midiOutStreamId = OSS16_OpenMidiStream(MIDI_SEND);187 }188 return (midiOutStreamId) ? 0 : MIDIERRA_HW_FAILED;189 }190 191 232 USHORT MPU_401::RTMIDI_CloseReceive(void) 192 233 { 193 OSS16_CloseMidiStream(MIDI_RECEIVE, midiInStreamId); 234 if(midiOutStreamId) { 235 OSS16_CloseMidiStream(MIDI_RECEIVE, midiOutStreamId); 236 midiOutStreamId = 0; 237 } 194 238 return 0; 195 239 } … … 197 241 USHORT MPU_401::RTMIDI_CloseSend(void) 198 242 { 199 OSS16_CloseMidiStream(MIDI_SEND, midiOutStreamId); 200 return 0; 201 } 202 243 if(midiInStreamId) { 244 OSS16_CloseMidiStream(MIDI_SEND, midiInStreamId); 245 midiInStreamId = 0; 246 } 247 return 0; 248 } 249 -
sbliveos2/trunk/drv16/mpu401.hpp
r147 r151 49 49 MPU_401( TIMER* pTimer ); 50 50 51 static void processIrq(unsigned long streamid); 52 51 53 // Standard MIDI channel commands. 52 54 virtual void noteOff( BYTE mchan, BYTE note, BYTE velocity ); -
sbliveos2/trunk/drv16/ossidc16.cpp
r147 r151 24 24 #include "stream.hpp" 25 25 #include "wavestrm.hpp" 26 #include "mpu401.hpp" 26 27 #include "malloc.h" 27 28 #include <ossidc.h> … … 84 85 ULONG OSS16_OpenMidiStream(MIDITYPE midiType) 85 86 { 86 return CallOSS32(IDC32_STREAM_OPEN, 0x666, (midiType == MIDI_RECEIVE) ? OSS_STREAM_MIDIIN : OSS_STREAM_MIDIOUT, 0, 0, 0); 87 return CallOSS32(IDC32_STREAM_OPEN, 0x666, (midiType == MIDI_RECEIVE) ? OSS_STREAM_MIDIOUT: OSS_STREAM_MIDIIN, 0, 0, 0); 88 } 89 //****************************************************************************** 90 //****************************************************************************** 91 BOOL OSS16_WriteMidiByte(ULONG streamid, BYTE midiByte) 92 { 93 return CallOSS32(IDC32_MIDI_WRITE, 0x666, OSS_STREAM_MIDIOUT, streamid, midiByte, 0); 94 } 95 //****************************************************************************** 96 //****************************************************************************** 97 int OSS16_ReadMidiBytes(ULONG streamid, char far *buffer, int bufsize) 98 { 99 return CallOSS32(IDC32_MIDI_READ, 0x666, OSS_STREAM_MIDIIN, streamid, (ULONG)buffer, bufsize); 87 100 } 88 101 //****************************************************************************** … … 90 103 void OSS16_CloseMidiStream(MIDITYPE midiType, ULONG streamid) 91 104 { 92 CallOSS32(IDC32_STREAM_CLOSE, 0x666, (midiType == MIDI_RECEIVE) ? OSS_STREAM_MIDI IN : OSS_STREAM_MIDIOUT, streamid, 0, 0);105 CallOSS32(IDC32_STREAM_CLOSE, 0x666, (midiType == MIDI_RECEIVE) ? OSS_STREAM_MIDIOUT : OSS_STREAM_MIDIIN, streamid, 0, 0); 93 106 } 94 107 //****************************************************************************** … … 309 322 PWAVESTREAM pStream; 310 323 311 pStream = (PWAVESTREAM)FindActiveStream((packet->process.type) ? STREAM_WAVE_PLAY : STREAM_WAVE_CAPTURE, 324 if(packet->process.type == IDC16_MIDI_IRQ) { 325 MPU_401::processIrq(packet->process.streamid); 326 break; 327 } 328 329 pStream = (PWAVESTREAM)FindActiveStream((packet->process.type == IDC16_WAVEOUT_IRQ) ? STREAM_WAVE_PLAY : STREAM_WAVE_CAPTURE, 312 330 packet->process.streamid); 313 331 if(pStream) { -
sbliveos2/trunk/drv16/rm.cpp
r142 r151 40 40 #include <string.h> // _fmemset() 41 41 #include "malloc.h" // malloc() 42 42 #include <dbgos2.h> 43 43 44 44 char DeviceName[64] = "Creative Labs SoundBlaster Live"; … … 96 96 * allocate resources. 97 97 */ 98 ResourceManager::ResourceManager ()98 ResourceManager::ResourceManager(ULONG pciId) 99 99 { 100 100 APIRET rc; … … 141 141 ((pGIS->uchMajorVersion == 20) && (pGIS->uchMinorVersion > 30)) ); 142 142 } 143 } 144 145 bool ResourceManager::bIsDevDetected ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice) 143 144 if(getPCIConfiguration(pciId) == FALSE) { 145 _state = rmDriverFailed; 146 } 147 148 } 149 150 #pragma off (unreferenced) 151 bool ResourceManager::bIsDevDetected( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice) 152 #pragma on (unreferenced) 146 153 /* 147 154 ; PURPOSE: Search the Resource Manager's "current detected" tree for … … 158 165 */ 159 166 { 167 #if 1 168 //Manual detection in ResourceManager class constructor; 169 return _state == rmDriverCreated; 170 #else 160 171 BOOL bReturn = FALSE; 161 172 NPHANDLELIST pHandleList = 0; … … 173 184 174 185 return bReturn ; 186 #endif 175 187 } 176 188 … … 190 202 * @return NULL on error situations. 191 203 */ 204 #pragma off (unreferenced) 192 205 LDev_Resources* ResourceManager::GetRMDetectedResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice) 193 { 206 #pragma on (unreferenced) 207 { 208 #if 1 209 LDev_Resources* pResources = 0; // Used to return result. 210 211 pResources = new LDev_Resources(); 212 if (!pResources) return NULL; 213 214 pResources->vClear(); 215 216 //Fill in resources read from PCI Configuration space 217 pResources->uIRQLevel[0] = pciConfigData->InterruptLine; 218 if(pResources->uIRQLevel[0] == 0 || pResources->uIRQLevel[0] > 15) { 219 dprintf(("Invalid PCI irq %x", (int)pResources->uIRQLevel[0])); 220 DebugInt3(); 221 return NULL; 222 } 223 pResources->uIOBase[0] = (USHORT)(pciConfigData->Bar0 & 0xFFFFFF00); 224 pResources->uIOLength[0] = 0x20; 225 226 return pResources; 227 #else 194 228 LDev_Resources* pResources = 0; // Used to return result. 195 229 NPRM_GETNODE_DATA pNode = 0; // Node resource data for spec'd DEVID's. … … 254 288 delete pResources; 255 289 return NULL; 290 #endif 256 291 } 257 292 … … 723 758 } 724 759 760 761 #define PCI_CONFIG_ENABLE 0x80000000 762 #define PCI_CONFIG_ADDRESS 0xCF8 763 #define PCI_CONFIG_DATA 0xCFC 764 765 unsigned long _inpd(unsigned short); 766 #pragma aux _inpd "_inpd" \ 767 parm [dx] \ 768 value [dx ax]; 769 770 //COMPILER BUG: bx cx == cx bx 771 void _outpd(unsigned short, unsigned long); 772 #pragma aux _outpd "_outpd" \ 773 parm [dx] [cx bx] \ 774 modify [ax dx]; 775 776 BOOL ResourceManager::getPCIConfiguration(ULONG pciId) 777 { 778 ULONG devNr, busNr, funcNr, temp, cfgaddrreg, detectedId; 779 BOOL found = FALSE; 780 781 cfgaddrreg = _inpd(PCI_CONFIG_ADDRESS); 782 for(busNr=0;busNr<255;busNr++) //BusNumber<255 783 { 784 for(devNr=0;devNr<32;devNr++) 785 { 786 for(funcNr=0;funcNr<8;funcNr++) 787 { 788 temp = ((ULONG)((ULONG)devNr<<11UL) + ((ULONG)busNr<<16UL) + ((ULONG)funcNr << 8UL)); 789 790 _outpd(PCI_CONFIG_ADDRESS, PCI_CONFIG_ENABLE|temp); 791 detectedId = _inpd(PCI_CONFIG_DATA); 792 if(detectedId == pciId) 793 { 794 found = TRUE; 795 break; 796 } 797 } 798 if(found) break; 799 } 800 if(found) break; 801 } 802 803 if(!found) { 804 _outpd(PCI_CONFIG_ADDRESS, cfgaddrreg); 805 return FALSE; 806 } 807 808 for(int i=0;i<64;i++) 809 { 810 temp = ((ULONG)((ULONG)devNr<<11UL) + ((ULONG)busNr<<16UL) + ((ULONG)funcNr << 8UL) + (i << 2)); 811 _outpd(PCI_CONFIG_ADDRESS, PCI_CONFIG_ENABLE|temp); 812 813 PCIConfig[i] = _inpd(PCI_CONFIG_DATA); 814 } 815 _outpd(PCI_CONFIG_ADDRESS, cfgaddrreg); 816 817 pciConfigData = (PCIConfigData *)&PCIConfig[0]; 818 819 if(pciConfigData->Bar0 == 0 || pciConfigData->Bar0 == 0xFFFFFFFF) 820 { 821 DebugInt3(); 822 return(FALSE); 823 } 824 return TRUE; 825 } 826 -
sbliveos2/trunk/drv16/rm.hpp
r142 r151 83 83 84 84 85 typedef struct 86 { 87 USHORT VendorID; 88 USHORT DeviceID; 89 USHORT Command; 90 USHORT Status; 91 UCHAR RevisionID; 92 UCHAR filler1[7]; 93 ULONG Bar0; 94 ULONG Bar1; 95 ULONG filler2[5]; 96 USHORT SubsystemVendorID; 97 USHORT SubsystemID; 98 ULONG filler3[3]; 99 UCHAR InterruptLine; 100 UCHAR InterruptPin; 101 UCHAR Max_Gnt; 102 UCHAR Max_Lat; 103 UCHAR TRDY_Timeout; 104 UCHAR Retry_Timeout; 105 UCHAR filler4[0x9a]; 106 UCHAR CapabilityID; 107 UCHAR NextItemPtr; 108 USHORT PowerMgtCapability; 109 USHORT PowerMgtCSR; 110 } PCIConfigData; 111 85 112 // This value indicates an empty entry in an LDev_Resource data item. 86 113 const USHORT NoIOValue = 0xffff; … … 126 153 public: // at bottom of file. 127 154 128 ResourceManager ( void );155 ResourceManager ( ULONG pciId ); 129 156 // Register the device driver (this activates the RM interface). 130 157 // Intention is that only one ResourceManager object is created … … 185 212 APIRET _rmCreateDevice( PSZ pszName, NPAHRESOURCE pahResource ); 186 213 214 BOOL getPCIConfiguration(ULONG pciId); 215 216 ULONG PCIConfig[64]; 217 PCIConfigData *pciConfigData; 218 187 219 }; 188 220 -
sbliveos2/trunk/drv16/timer.cpp
r142 r151 207 207 } 208 208 } 209 #endif 209 210 210 211 // Timer IRQ hook didn't work for some reason, use system timer. … … 215 216 _eState = TIMER_Stopped; 216 217 } 217 } // End of setup for interrupt operation, executed for 1st Timer only. 218 #endif 218 // } // End of setup for interrupt operation, executed for 1st Timer only. 219 219 220 220 // If good creation, add Timer to global timer list & reset all time vbls. -
sbliveos2/trunk/drv16/vddentry.asm
r142 r151 103 103 _OSSIDC_ENTRY ENDP 104 104 105 PUBLIC _inpd 106 _inpd proc near 107 in eax, dx 108 mov dx, ax 109 shr eax, 16 110 xchg ax, dx 111 ret 112 _inpd endp 113 114 PUBLIC _outpd 115 _outpd proc near 116 mov ax, cx 117 shl eax, 16 118 mov ax, bx 119 out dx, eax 120 ret 121 _outpd endp 122 105 123 _TEXT ENDS 106 124 -
sbliveos2/trunk/drv16/wavestrm.cpp
r147 r151 258 258 OSS16_StreamGetPos(this, &ulCurBytesProcessed); 259 259 if(ulCurBytesProcessed == 0) { 260 //shouldn't happen (TODO recording)260 //shouldn't happen 261 261 DebugInt3(); 262 262 return; -
sbliveos2/trunk/drv32/idc.c
r142 r151 105 105 } 106 106 107 case IDC32_MIDI_WRITE: 108 return OSS32_StreamMidiWrite(pPacket->midiwrite.streamid, pPacket->midiwrite.midiByte); 109 110 case IDC32_MIDI_READ: 111 return OSS32_StreamMidiRead(pPacket->midiread.streamid, (char NEAR *)__StackToFlat((ULONG)pPacket->midiread.buffer), pPacket->midiread.bufsize); 112 107 113 case IDC32_STREAM_RESET: 108 114 return OSS32_StreamReset(pPacket->startstop.streamtype, pPacket->startstop.streamid); -
sbliveos2/trunk/drv32/init.c
r142 r151 27 27 #include <os2.h> 28 28 } 29 #include <string.h> 29 30 30 31 // Device support … … 48 49 const char szCopyRight1[]= "Copyright 1999, 2000 Creative Labs, Inc.\r\n"; 49 50 const char szCopyRight2[]= "Copyright 2000 Sander van Leeuwen (OS/2 Port)\r\n\r\n"; 50 51 const char szCodeStartEnd[] = "Code 0x%0x - 0x%0x\r\n\r\n"; 52 51 53 typedef struct { 52 54 USHORT MsgLength; … … 55 57 56 58 extern "C" WORD32 MSG_TABLE32; 59 60 extern "C" int sprintf (char *buffer, const char *format, ...); 57 61 58 62 //Print messages with DosWrite when init is done or has failed (see startup.asm) … … 149 153 150 154 // Initialize device driver 151 152 155 WORD32 DiscardableInit(RPInit __far* rp) 153 156 { 157 char debugmsg[64]; 158 char FAR48 *args; 159 154 160 GetTKSSBase(); 155 161 if(LockSegments()) { 156 WriteString(ERR_ERROR, sizeof(ERR_ERROR)-1);157 WriteString(ERR_LOCK, sizeof(ERR_LOCK)-1);158 return RPDONE | RPERR;162 WriteString(ERR_ERROR, sizeof(ERR_ERROR)-1); 163 WriteString(ERR_LOCK, sizeof(ERR_LOCK)-1); 164 return RPDONE | RPERR; 159 165 } 160 166 … … 167 173 WriteString(szCopyRight1, sizeof(szCopyRight1)-1); 168 174 WriteString(szCopyRight2, sizeof(szCopyRight2)-1); 175 176 args = __Make48Pointer(rp->In.Args); 177 while(*args && *args == ' ') args++; 178 while(*args && *args != ' ') args++; 179 while(*args && *args == ' ') args++; 180 while(*args && *args != '/') args++; 181 if(*args) args++; 182 183 if(*args == 'D' || *args == 'd') { 184 sprintf(debugmsg, szCodeStartEnd, OffsetBeginCS32, OffsetFinalCS32); 185 WriteString(debugmsg, strlen(debugmsg)); 186 } 169 187 170 188 // Complete the installation -
sbliveos2/trunk/drv32/sbseg.inc
r142 r151 9 9 CODE32 segment dword public use32 'CODE' 10 10 CODE32 ends 11 12 _TEXT segment dword public use32 'CODE' 13 _TEXT ends 11 14 12 15 BSS32 segment dword use32 public 'BSS' … … 37 40 DGROUP group DATA32, CONST32, C_COMMON, c_common, CONST2, CONST, BSS32, _BSS 38 41 42 CGROUP group CODE32, _TEXT -
sbliveos2/trunk/include/linux/delay.h
r142 r151 28 28 #endif 29 29 30 #include <iodelay.h> 30 void iodelay(unsigned long); 31 #pragma aux iodelay parm nomemory [ecx] modify nomemory exact [eax ecx]; 31 32 32 33 #define mdelay(n) iodelay(n*2) -
sbliveos2/trunk/include/ossidc.h
r148 r151 71 71 ULONG volume; 72 72 } mixer; 73 struct { 74 ULONG streamtype; 75 ULONG streamid; 76 ULONG midiByte; 77 } midiwrite; 78 struct { 79 ULONG streamtype; 80 ULONG streamid; 81 ULONG buffer; 82 ULONG bufsize; 83 } midiread; 73 84 struct { 74 85 ULONG param1; … … 121 132 #define IDC32_STREAM_IOCTL 10 122 133 #define IDC32_STREAM_MIXER 11 134 #define IDC32_MIDI_WRITE 12 135 #define IDC32_MIDI_READ 13 123 136 124 137 #define MIX_SETMASTERVOL 0 … … 164 177 #define IDC16_VMFREE 11 165 178 #define IDC16_PROCESS 12 179 180 #define IDC16_WAVEIN_IRQ 0 181 #define IDC16_WAVEOUT_IRQ 1 182 #define IDC16_MIDI_IRQ 2 166 183 167 184 #define MAX_RES_IRQ 2 … … 237 254 ULONG OSS32_StreamAddBuffer(ULONG streamtype, ULONG streamid, ULONG buffer, ULONG size); 238 255 ULONG OSS32_SetVolume(ULONG streamtype, ULONG streamid, ULONG cmd, ULONG volume); 256 ULONG OSS32_StreamMidiWrite(ULONG streamid, ULONG midiByte); 257 ULONG OSS32_StreamMidiRead(ULONG streamid, char NEAR *buffer, ULONG bufsize); 239 258 240 259 //Sets file id in current task structure … … 263 282 } MIDITYPE; 264 283 ULONG OSS16_OpenMidiStream(MIDITYPE midiType); 265 void OSS16_CloseMidiStream(MIDITYPE midiType, ULONG streamid); 284 void OSS16_CloseMidiStream(MIDITYPE midiType, ULONG streamid); 285 BOOL OSS16_WriteMidiByte(ULONG streamid, BYTE midiByte); 286 int OSS16_ReadMidiBytes(ULONG streamid, char far *buffer, int bufsize); 266 287 267 288 #endif //TARGET_OS216 -
sbliveos2/trunk/include/sbversion.h
r148 r151 25 25 #define __SBVERSION_H__ 26 26 27 #define SBLIVE_VERSION "0. 2.5"27 #define SBLIVE_VERSION "0.4.0" 28 28 29 29 #endif //__SBVERSION_H__ -
sbliveos2/trunk/include/version.mak
r148 r151 11 11 12 12 _VENDOR = Creative Labs SoundBlaster Live 13 _VERSION = 0. 25.00013 _VERSION = 0.40.000 14 14 15 15 FILEVER = @^#$(_VENDOR):$(_VERSION)^#@ -
sbliveos2/trunk/install/control.scr
r149 r151 65 65 ssgroup=17 66 66 ssname="SoundBlaster Live! Wave Audio" 67 ssversion="0. 2.5"67 ssversion="0.4.0" 68 68 sssize=300 69 69 ssdll="genin.dll" -
sbliveos2/trunk/lib32/debug.c
r142 r151 39 39 #include <os2.h> 40 40 41 #ifdef DEBUG42 41 43 42 #define CR 0x0d … … 146 145 } 147 146 147 #ifdef DEBUG 148 148 char BuildString[1024]; 149 149 #endif // DEBUG -
sbliveos2/trunk/lib32/misc.c
r142 r151 50 50 } 51 51 52 #define CR 0x0d 53 #define LF 0x0a 54 55 56 #define LEADING_ZEROES 0x8000 57 #define SIGNIFICANT_FIELD 0x0007 58 59 char *HexLongToASCII(char *StrPtr, unsigned long wHexVal, unsigned short Option); 60 char *DecLongToASCII(char *StrPtr, unsigned long lDecVal, unsigned short Option); 61 62 63 //SvL: Not safe to use in non-KEE driver 52 64 int sprintf (char *buffer, const char *format, ...) 53 65 { 54 return 0; 66 char *BuildPtr=buffer; 67 char *pStr = (char *) format; 68 char *SubStr; 69 union { 70 void *VoidPtr; 71 unsigned short *WordPtr; 72 unsigned long *LongPtr; 73 #ifdef KEE 74 unsigned long *StringPtr; 75 #else 76 double *StringPtr; 77 #endif 78 } Parm; 79 int wBuildOption; 80 81 Parm.VoidPtr=(void *) &format; 82 Parm.StringPtr++; // skip size of string pointer 83 84 while (*pStr) 85 { 86 switch (*pStr) 87 { 88 case '%': 89 wBuildOption=0; 90 pStr++; 91 if (*pStr=='0') 92 { 93 wBuildOption|=LEADING_ZEROES; 94 pStr++; 95 } 96 if (*pStr=='u') // always unsigned 97 pStr++; 98 99 switch(*pStr) 100 { 101 case 'x': 102 case 'X': 103 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 104 pStr++; 105 continue; 106 107 case 'd': 108 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 109 pStr++; 110 continue; 111 112 #ifdef KEE 113 case 's': 114 SubStr=(char *)*Parm.StringPtr; 115 while (*BuildPtr++ = *SubStr++); 116 Parm.StringPtr++; 117 BuildPtr--; // remove the \0 118 pStr++; 119 continue; 120 #endif 121 case 'l': 122 pStr++; 123 switch (*pStr) 124 { 125 case 'x': 126 case 'X': 127 BuildPtr=HexLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 128 pStr++; 129 continue; 130 131 case 'd': 132 BuildPtr=DecLongToASCII(BuildPtr, *Parm.LongPtr++,wBuildOption); 133 pStr++; 134 continue; 135 } // end switch 136 continue; // dunno what he wants 137 138 case 0: 139 continue; 140 } // end switch 141 break; 142 143 case '\\': 144 pStr++; 145 switch (*pStr) 146 { 147 case 'n': 148 *BuildPtr++=LF; 149 pStr++; 150 continue; 151 152 case 'r': 153 *BuildPtr++=CR; 154 pStr++; 155 continue; 156 157 case 0: 158 continue; 159 break; 160 } // end switch 161 162 break; 163 } // end switch 164 165 *BuildPtr++=*pStr++; 166 } // end while 167 168 *BuildPtr=0; // cauterize the string 169 return 1; //not correct 55 170 } 56 171 -
sbliveos2/trunk/lib32/ossidc.cpp
r148 r151 96 96 extern "C" int OSS32_ProcessIRQ(int fWaveOut, unsigned long streamid) 97 97 { 98 return CallOSS16(IDC16_PROCESS, fWaveOut, streamid);98 return CallOSS16(IDC16_PROCESS, (fWaveOut) ? IDC16_WAVEOUT_IRQ : IDC16_WAVEIN_IRQ, streamid); 99 99 } 100 100 //****************************************************************************** 101 101 //****************************************************************************** 102 extern "C" int OSS32_ProcessMidiIRQ(unsigned long streamid) 103 { 104 return CallOSS16(IDC16_PROCESS, IDC16_MIDI_IRQ, streamid); 105 } 106 //****************************************************************************** 107 //****************************************************************************** -
sbliveos2/trunk/lib32/pci.c
r142 r151 77 77 pcidev->device = device; 78 78 79 devid = ( vendor << 16) | device;79 devid = (device << 16) | vendor; 80 80 81 81 #ifdef KEE -
sbliveos2/trunk/lib32/sound.c
r147 r151 30 30 #include <asm/uaccess.h> 31 31 #include <asm/hardirq.h> 32 #include "..\sblive\icardmid.h" 33 #include "..\sblive\cardmi.h" 34 #include "..\sblive\midi.h" 32 35 33 36 #define LINUX … … 563 566 //****************************************************************************** 564 567 //****************************************************************************** 568 unsigned long OSS32_StreamMidiWrite(unsigned long streamid, unsigned long midiByte) 569 { 570 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *)streamid; 571 572 return emu10k1_mpu_write_data(midi_dev->card, (u8)midiByte) == 0; 573 } 574 //****************************************************************************** 575 //****************************************************************************** 576 unsigned long OSS32_StreamMidiRead(unsigned long streamid, char near *buffer, unsigned long bufsize) 577 { 578 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *)streamid; 579 int count = 0; 580 u8 MPUIvalue; 581 582 while(TRUE) { 583 if(emu10k1_mpu_read_data(midi_dev->card, &MPUIvalue) == 0) { 584 buffer[count] = MPUIvalue; 585 count++; 586 } 587 else break; 588 589 if(count >= bufsize) { 590 break; 591 } 592 } 593 return count; 594 } 595 //****************************************************************************** 596 //****************************************************************************** -
sbliveos2/trunk/readme.txt
r148 r151 1 SoundBlaster Live! OS/2 Audio driver version 0. 25 (beta)1 SoundBlaster Live! OS/2 Audio driver version 0.35 (beta) 2 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 3 … … 7 7 2 Features 8 8 3 Requirements 9 4 Installation 9 4 Installation/uninstall 10 10 5 Config.sys options 11 11 6 Known problems … … 35 35 - Support for the IOCTL90 mixer interface (designed by Joe Nord of 36 36 Crystal Semiconductor and supported by the Crystal OS/2 audio drivers) 37 - RTMIDI playback & recording (not yet implemented in this release)37 - RTMIDI playback & recording 38 38 39 39 … … 45 45 46 46 47 4 Installation 48 ============== 47 4 Installation/uninstall 48 ======================== 49 To install the SB Live driver: 49 50 - Unzip driver archive 50 51 - Run install.cmd 51 52 - Select 'SoundBlaster Live! Wave Audio' and continue installation 52 53 - Reboot 53 - During OS/2 boot, press Alt-F1 and select 'Enable Hardware Detection'54 54 55 To remove the SB Live driver you should proceed with the installation 56 as described above, but select zero SB Live cards when asked. 55 57 56 58 5 Config.sys options … … 61 63 - /M: enable microphone audio input 62 64 - /L: enable linein audio input 65 66 DEVICE=J:\MMOS2\SBLIVE32.SYS /D 67 - /D: print start and end address of code 68 (useful to locate the code that causes a trap (CS:EIP in trapscreen)) 63 69 64 70 The installation adds the verbose and CD settings to the config.sys line. … … 77 83 Workaround: move the first minstall window (which asks you to select the sb 78 84 driver) almost completely outside of the screen and press enter. 79 85 - No sound when there are still inactive audio drivers in MMOS2\mmpm2.ini. 86 To correct the problem uninstall the SB Live and your old audio driver. 87 You can also manually remove references to the old driver: 88 - uninstall the SB Live driver 89 - edit MMOS2\mmpm2.ini 90 - search for 'Waveaudio=' section and remove any names that 91 are listed on that line 92 - search for 'Ampmix=' section and remove any names that 93 are listed on that line 94 (result: Waveaudio= 95 Ampmix= 96 ) 97 - reinstall the SB Live driver 98 MMOS2\mmpm2.ini should now contain: 99 Waveaudio=SBLIVEWAVE01 100 Ampmix=SBLIVEAMPMIX01 101 - reboot 80 102 81 103 7 File listing 82 104 ============== 83 105 Installation files: 84 23-04-00 16:55 326 0audfiles.scr85 19-07-94 17:54 4395 0audplay.ico86 24-04-00 10:37 952 0AUDHELP.HLP87 24-04-00 17:09 20519 0CARDINFO.dll88 24-04-00 17:09 3500 0control.scr89 19-07-94 17:54 4395 0midiplay.ico90 19-07-94 17:54 4395 0vidplay.ico106 audfiles.scr 107 audplay.ico 108 AUDHELP.HLP 109 CARDINFO.dll 110 control.scr 111 midiplay.ico 112 vidplay.ico 91 113 92 114 16 bits MMPM/2 audio driver: 93 24-04-00 17:26 40382 0sblive16.sys115 sblive16.sys 94 116 95 117 32 bits SB Live Core audio driver: 96 25-04-00 21:38 81056 0sblive32w4.sys118 sblive32w4.sys 97 119 98 120 32 bits SB Live Core audio driver: 99 121 (uses the new KEE api found in Warp 4 + Fixpack 13 or Warp Server for 100 122 e-Business) 101 25-04-00 21:42 63936 0sblive32kee.sys123 sblive32kee.sys 102 124 103 125 … … 121 143 - OS/2 version + fixpack level 122 144 - Description of the procedure to reproduce the bug 145 - Trap description (register contents) (if you're reporting a crash) 146 Add the /D option to the sblive32.sys config.sys line and write down 147 the start & end address printed during the driver initialization. 123 148 124 149 Please note that I do *not* want people to mail me about problems that -
sbliveos2/trunk/sblive/cardmi.c
r142 r151 37 37 #include "cardmi.h" 38 38 39 #ifdef TARGET_OS2 40 extern int OSS32_ProcessMidiIRQ(unsigned long streamid); 41 #endif 42 39 43 static struct { 40 44 int (*Fn) (struct emu10k1_mpuin *, u8); … … 96 100 emu10k1_mpu_acquire(card); 97 101 102 #ifdef TARGET_OS2 103 emu10k1_irq_enable(card, INTE_MIDIRXENABLE); 104 #endif 98 105 return CTSTATUS_SUCCESS; 99 106 } … … 343 350 */ 344 351 352 #ifdef TARGET_OS2 353 OSS32_ProcessMidiIRQ((unsigned long)card_mpuin->openinfo.refdata); 354 return CTSTATUS_SUCCESS; 355 #else 345 356 count = 0; 346 357 idx = card_mpuin->qtail; … … 364 375 365 376 return CTSTATUS_SUCCESS; 377 #endif 366 378 } 367 379 -
sbliveos2/trunk/sblive/cardmi.h
r142 r151 58 58 /* flags for card MIDI in object */ 59 59 #define FLAGS_MIDM_STARTED 0x00001000 // Data has started to come in after Midm Start 60 61 #ifdef TARGET_OS2 62 #define MIDIIN_MAX_BUFFER_SIZE 4 63 #else 60 64 #define MIDIIN_MAX_BUFFER_SIZE 200 // Definition for struct emu10k1_mpuin 65 #endif 61 66 62 67 struct midi_data -
sbliveos2/trunk/sblive/midi.c
r142 r151 55 55 struct midi_hdr *midihdr; 56 56 57 #ifdef TARGET_OS2 58 if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) { 59 #else 57 60 if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr *), GFP_KERNEL)) == NULL) { 61 #endif 58 62 ERROR(); 59 63 return -EINVAL; … … 336 340 return -EFAULT; 337 341 342 #ifdef TARGET_OS2 343 if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) 344 #else 338 345 if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr *), GFP_KERNEL)) == NULL) 346 #endif 339 347 return -EINVAL; 340 348 -
sbliveos2/trunk/sblive/midi.h
r142 r151 42 42 #define MIDIIN_STATE_STOPPED 0x00000002 43 43 44 #ifdef TARGET_OS2 45 #define MIDIIN_BUFLEN 16 46 #else 44 47 #define MIDIIN_BUFLEN 1024 48 #endif 45 49 46 50 struct emu10k1_mididevice
Note:
See TracChangeset
for help on using the changeset viewer.