- Timestamp:
- Jul 23, 2000, 6:21:57 PM (25 years ago)
- Location:
- sbliveos2/trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/ChangeLog
r152 r153 1 1 $Id$ 2 3 2000-07-23: Sander van Leeuwen <sandervl@xs4all.nl> 4 - Fix for video volume (missing from include\linux\soundcard.h) 5 6 2000-07-18: Sander van Leeuwen <sandervl@xs4all.nl> 7 - Changed volume levels (smoother decrease of volume) 8 - Changed buffer logic. Request space left in dma buffer once and 9 fill that up. 2 10 3 11 2000-07-13: Sander van Leeuwen <sandervl@xs4all.nl> -
sbliveos2/trunk/bin/control.scr
r142 r153 65 65 ssgroup=17 66 66 ssname="SoundBlaster Live! Wave Audio" 67 ssversion="0. 1.0"67 ssversion="0.6.0" 68 68 sssize=300 69 69 ssdll="genin.dll" -
sbliveos2/trunk/drv16/ossidc16.cpp
r152 r153 184 184 ULONG OSS16_StreamGetSpace(STREAM *stream) 185 185 { 186 return (BOOL)CallOSS32(IDC32_STREAM_GETSPACE, stream->ulSysFileNum, MMPMToOSSStreamType(stream->ulStreamType), stream->ulStreamId, 0, 0);186 return CallOSS32(IDC32_STREAM_GETSPACE, stream->ulSysFileNum, MMPMToOSSStreamType(stream->ulStreamType), stream->ulStreamId, 0, 0); 187 187 } 188 188 //****************************************************************************** -
sbliveos2/trunk/drv16/wavestrm.cpp
r152 r153 167 167 } 168 168 space = OSS16_StreamGetSpace(this); 169 if(space > 128) {170 space -= 128;171 }172 169 while(space) { 173 170 byteswritten = AddBuffer(space); … … 186 183 ULONG WAVESTREAM::AddBuffer(ULONG space) 187 184 { 188 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone. Head();185 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone.Tail(); 189 186 ULONG pdataBuf; 190 187 ULONG Buff_left, byteswritten; … … 193 190 pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 194 191 } 195 if(!pTemp) return 0; 192 if(!pTemp) { 193 dprintf4(("AddBuffer: pTemp == NULL")); 194 return 0; 195 } 196 196 197 197 // get the buffer pointer and amount of data remaining … … 209 209 pTemp->ulBuffpos += byteswritten; 210 210 211 if (!qhDone.Head() || pTemp != qhDone.Head()) {212 qhDone.PushOnTail(qhInProcess.PopHead());211 if(pTemp != qhDone.Tail()) { 212 qhDone.PushOnTail(qhInProcess.PopHead()); 213 213 } 214 214 dprintf4(("AddBuffer %lx size %d, bytes written %d", pdataBuf, (USHORT)Buff_left, (USHORT)byteswritten)); … … 221 221 BOOL WAVESTREAM::_vReadAudioBuf(void) 222 222 { 223 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qh Done.Head();223 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 224 224 ULONG pdataBuf; 225 225 ULONG Buff_left, bytesread; 226 226 227 if(!pTemp || pTemp->ulBuffpos >= (pTemp->ulBuffsz & 0xFFFFFFFC)) {228 pTemp = (PSTREAMBUFFER)qhInProcess.Head();229 }230 227 if(!pTemp) return FALSE; 231 228 … … 246 243 _ulBytesProcessed += bytesread; 247 244 248 if (!qhDone.Head() || pTemp != qhDone.Head()) {245 if(pTemp->ulBuffpos == pTemp->ulBuffsz) { 249 246 qhDone.PushOnTail(qhInProcess.PopHead()); 250 } 251 if(pTemp->ulBuffpos == pTemp->ulBuffsz) { 247 ReturnBuffer(); 252 248 dprintf4(("_vReadAudioBuf return buffer %lx size %ld, bytes read %ld", (ULONG)pTemp->pBuffptr, pTemp->ulBuffsz, bytesread)); 253 ReturnBuffer();254 249 } 255 250 … … 277 272 } 278 273 bytesinc = ulCurBytesProcessed - _ulBytesProcessed; 274 dprintf4(("Process: %lx %x", ulCurBytesProcessed, (USHORT)bytesinc)); 279 275 if(ulCurBytesProcessed < _ulBytesProcessed) { 280 276 dprintf(("WARNING: Process: Current pos %ld incr %d", ulCurBytesProcessed, (USHORT)bytesinc)); … … 396 392 { 397 393 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 398 ULONG fragsize; 399 400 #ifdef DEBUG 401 int oldlevel = dbglevel; 402 dbglevel = 4; 403 #endif 394 ULONG fragsize; 395 404 396 // configure the wave device 405 397 ((PWAVEAUDIO)pahw)->ConfigDev(this, &_configinfo); … … 439 431 OSS16_StartStream(this); 440 432 } 441 #ifdef DEBUG442 dbglevel = oldlevel;443 #endif444 433 445 434 //Must set volume after adding buffers (voices inside sblive driver might not … … 540 529 _ulBytesProcessed = 0; 541 530 _ulTimeBase = 0; 531 542 532 fUnderrun = FALSE; 543 533 -
sbliveos2/trunk/include/dbgos2.h
r142 r153 30 30 31 31 void cdecl PrintfOut(char far *DbgStr , ...); 32 extern int dbglevel; 32 33 33 34 #ifdef __cplusplus … … 37 38 #ifdef DEBUG 38 39 #define dprintf(a) PrintfOut a 40 #define dprintf2(a) if(dbglevel >= 2) PrintfOut a 41 #define dprintf3(a) if(dbglevel >= 3) PrintfOut a 42 #define dprintf4(a) if(dbglevel >= 4) PrintfOut a 39 43 #define DebugInt3() _asm int 3 40 44 #else 41 45 #define dprintf(a) 46 #define dprintf2(a) 47 #define dprintf3(a) 48 #define dprintf4(a) 42 49 #define DebugInt3() 43 50 #endif -
sbliveos2/trunk/include/linux/mm.h
r142 r153 7 7 #include <linux/errno.h> 8 8 #include <asm/page.h> 9 #include <asm/atomic.h> 9 10 10 11 /* -
sbliveos2/trunk/include/linux/poll.h
r142 r153 8 8 #include <asm/uaccess.h> 9 9 #include <linux/wait.h> 10 #include <linux/fs.h> 10 11 11 12 #ifdef __KERNEL__ -
sbliveos2/trunk/include/linux/slab.h
r142 r153 46 46 #endif /* __KERNEL__ */ 47 47 48 extern void *kmalloc( size_t, int);48 extern void *kmalloc(int, int); 49 49 extern void kfree(const void *); 50 extern void kfree_s(const void *, size_t);50 extern void kfree_s(const void *, int); 51 51 52 52 #endif /* _LINUX_SLAB_H */ -
sbliveos2/trunk/include/linux/soundcard.h
r142 r153 828 828 #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) 829 829 #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) 830 #define SOUND_MIXER_READ_VIDEO MIXER_READ(SOUND_MIXER_VIDEO) 830 831 831 832 /* Obsolete macros */ … … 858 859 #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) 859 860 #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) 861 #define SOUND_MIXER_WRITE_VIDEO MIXER_WRITE(SOUND_MIXER_VIDEO) 860 862 861 863 /* Obsolete macros */ -
sbliveos2/trunk/include/linux/types.h
r142 r153 72 72 typedef unsigned long ulong; 73 73 74 typedef unsigned long dma_addr_t; 75 74 76 #ifndef __BIT_TYPES_DEFINED__ 75 77 #define __BIT_TYPES_DEFINED__ -
sbliveos2/trunk/include/ossidc.h
r151 r153 82 82 ULONG bufsize; 83 83 } midiread; 84 struct { 85 ULONG streamtype; 86 ULONG streamid; 87 } getspace; 84 88 struct { 85 89 ULONG param1; … … 134 138 #define IDC32_MIDI_WRITE 12 135 139 #define IDC32_MIDI_READ 13 140 #define IDC32_STREAM_GETSPACE 14 136 141 137 142 #define MIX_SETMASTERVOL 0 … … 256 261 ULONG OSS32_StreamMidiWrite(ULONG streamid, ULONG midiByte); 257 262 ULONG OSS32_StreamMidiRead(ULONG streamid, char NEAR *buffer, ULONG bufsize); 263 ULONG OSS32_StreamGetSpace(ULONG streamtype, ULONG streamid); 258 264 259 265 //Sets file id in current task structure … … 273 279 BOOL OSS16_SetGlobalVol(ULONG ulSysFileNum, USHORT line, ULONG volume); 274 280 BOOL OSS16_StreamSetFragment(STREAM *stream, ULONG fragsize); 281 ULONG OSS16_StreamGetSpace(STREAM *stream); 275 282 BOOL OSS16_AttachToPdd(); 276 283 void OSS16_DetachFromPdd(); -
sbliveos2/trunk/include/sbversion.h
r151 r153 25 25 #define __SBVERSION_H__ 26 26 27 #define SBLIVE_VERSION "0. 4.0"27 #define SBLIVE_VERSION "0.6.0" 28 28 29 29 #endif //__SBVERSION_H__ -
sbliveos2/trunk/include/version.mak
r151 r153 11 11 12 12 _VENDOR = Creative Labs SoundBlaster Live 13 _VERSION = 0. 40.00013 _VERSION = 0.60.000 14 14 15 15 FILEVER = @^#$(_VENDOR):$(_VERSION)^#@ -
sbliveos2/trunk/install/control.scr
r151 r153 65 65 ssgroup=17 66 66 ssname="SoundBlaster Live! Wave Audio" 67 ssversion="0. 4.0"67 ssversion="0.6.0" 68 68 sssize=300 69 69 ssdll="genin.dll" -
sbliveos2/trunk/lib32/misc.c
r151 r153 210 210 211 211 212 /* --------------------------------------------------------------------- */ 213 /* 214 * hweightN: returns the hamming weight (i.e. the number 215 * of bits set) of a N-bit word 216 */ 217 218 #ifdef hweight32 219 #undef hweight32 220 #endif 221 222 unsigned int hweight32(unsigned int w) 223 { 224 unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555); 225 res = (res & 0x33333333) + ((res >> 2) & 0x33333333); 226 res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F); 227 res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF); 228 return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF); 229 } -
sbliveos2/trunk/lib32/pci.c
r151 r153 29 29 #include <asm/uaccess.h> 30 30 #include <asm/hardirq.h> 31 #include <asm/io.h> 31 32 32 33 #define LINUX … … 268 269 //****************************************************************************** 269 270 //****************************************************************************** 271 int __compat_get_order(unsigned long size) 272 { 273 int order; 274 275 size = (size-1) >> (PAGE_SHIFT-1); 276 order = -1; 277 do { 278 size >>= 1; 279 order++; 280 } while (size); 281 return order; 282 } 283 //****************************************************************************** 284 //****************************************************************************** 285 void *pci_alloc_consistent(struct pci_dev *hwdev, 286 size_t size, dma_addr_t *dma_handle) { 287 void *ret; 288 int gfp = GFP_ATOMIC; 289 290 if (hwdev == NULL) 291 gfp |= GFP_DMA; 292 ret = (void *)__get_free_pages(gfp, __compat_get_order(size)); 293 294 if (ret != NULL) { 295 memset(ret, 0, size); 296 *dma_handle = virt_to_bus(ret); 297 } 298 return ret; 299 } 300 //****************************************************************************** 301 //****************************************************************************** 302 void pci_free_consistent(struct pci_dev *hwdev, size_t size, 303 void *vaddr, dma_addr_t dma_handle) 304 { 305 free_pages((unsigned long)vaddr, __compat_get_order(size)); 306 } 307 //****************************************************************************** 308 //****************************************************************************** -
sbliveos2/trunk/lib32/sound.c
r152 r153 576 576 break; 577 577 case MIX_SETVIDEOVOL: 578 ////ioctl = SOUND_MIXER_WRITE_VIDEO;578 ioctl = SOUND_MIXER_WRITE_VIDEO; 579 579 break; 580 580 case MIX_SETAUXVOL: -
sbliveos2/trunk/readme.txt
r152 r153 1 SoundBlaster Live! OS/2 Audio driver version 0. 50 (beta)1 SoundBlaster Live! OS/2 Audio driver version 0.60 (beta) 2 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 3 … … 41 41 3 History 42 42 ========= 43 0.60 44 - Fixed video mixer control 45 - Changed wave volume level 46 - Fixed clicks when playing wave files with large audio buffers 47 43 48 0.50 44 49 - Added RTMIDI playback & recording (MPU401) -
sbliveos2/trunk/sblive/audio.c
r147 r153 1413 1413 emu10k1_waveout_update(woinst); 1414 1414 1415 #ifdef TARGET_OS21416 OSS32_ProcessIRQ(TRUE, (unsigned long)wave_dev);1417 #endif1418 1419 1415 if (woinst->mapped) { 1420 1416 spin_unlock_irqrestore(&woinst->lock, flags); … … 1431 1427 1432 1428 if (bytestocopy >= woinst->fragment_size) 1429 #ifdef TARGET_OS2 1430 OSS32_ProcessIRQ(TRUE, (unsigned long)wave_dev); 1431 #else 1433 1432 wake_up_interruptible(&woinst->wait_queue); 1433 #endif 1434 1434 else 1435 1435 DPD(4, "Not enough transfer size -> %x\n", bytestocopy); -
sbliveos2/trunk/sblive/cardwo.c
r152 r153 612 612 k = (len > PAGE_SIZE - j) ? PAGE_SIZE - j : len; 613 613 #ifdef TARGET_OS2 614 memset((u8 *)pt[i] + j, val, k); 614 if(k) { 615 memset((u8 *)pt[i] + j, val, k); 616 } 615 617 #else 616 618 memset(pt[i] + j, val, k); … … 621 623 len -= PAGE_SIZE; 622 624 } 625 #ifdef TARGET_OS2 626 if(len) 627 #endif 623 628 memset(pt[++i], val, len); 624 629 -
sbliveos2/trunk/sblive/mixer.c
r147 r153 269 269 #endif //TARGET_OS2 270 270 271 u32 bass_table[41][5] = {271 static const u32 bass_table[41][5] = { 272 272 { 0x3e4f844f, 0x84ed4cc3, 0x3cc69927, 0x7b03553a, 0xc4da8486 }, 273 273 { 0x3e69a17a, 0x84c280fb, 0x3cd77cd4, 0x7b2f2a6f, 0xc4b08d1d }, … … 313 313 }; 314 314 315 u32 treble_table[41][5] = {315 static const u32 treble_table[41][5] = { 316 316 { 0x0125cba9, 0xfed5debd, 0x00599b6c, 0x0d2506da, 0xfa85b354 }, 317 317 { 0x0142f67e, 0xfeb03163, 0x0066cd0f, 0x0d14c69d, 0xfa914473 }, … … 381 381 } 382 382 383 u32 db_table[101] = {383 static const u32 db_table[101] = { 384 384 0x00000000, 0x01571f82, 0x01674b41, 0x01783a1b, 0x0189f540, 385 385 0x019c8651, 0x01aff763, 0x01c45306, 0x01d9a446, 0x01eff6b8, … … 441 441 } 442 442 443 for (i = 0; i < 18; i++) {443 for (i = 0; i < 36; i++) { 444 444 if (card->digmix[i] != 0x80000000) { 445 if (( i >= 0) && (i < 4))445 if (((i >= 0) && (i < 4)) || ((i >= 18) && (i < 22))) 446 446 j = (i & 1) ? ((u64) db_table[r1] * (u64) db_table[r3]) : ((u64) db_table[l1] * (u64) db_table[l3]); 447 else if ((i == 6) || (i == 7) )447 else if ((i == 6) || (i == 7) || (i == 24) || (i == 25)) 448 448 j = (i & 1) ? ((u64) db_table[r1] * (u64) db_table[r4]) : ((u64) db_table[l1] * (u64) db_table[l4]); 449 449 else … … 467 467 } 468 468 469 for (i = 18; i <= 90; i += 18) {469 for (i = 36; i <= 90; i += 18) { 470 470 if (i != 72) { 471 471 for (k = 0; k < 4; k++) … … 489 489 #ifdef PRIVATE_PCM_VOLUME 490 490 491 static unsigned char LinToLog[100] = { 0, 0, 0, 0, 492 1, 2, 2, 5, 5, 10, 10, 10, 493 16, 19, 20, 22, 24, 25, 27, 27, 494 28, 28, 29, 30, 30, 35, 35, 35, 495 39, 39, 43, 45, 47, 49, 50, 50, 496 60, 60, 70, 72, 72, 74, 74, 74, 497 75, 75, 76, 77, 78, 80, 82, 83, 498 85, 85, 85, 88, 88, 88, 88, 90, 499 90, 93, 93, 93, 95, 95, 95, 95, 500 95, 95, 95, 96, 96, 97, 97, 98, 501 98, 98, 98, 99, 99, 99, 99, 99, 502 99, 99, 99, 99, 100, 100, 100, 100, 503 100, 100, 100, 100, 100, 100, 100, 100}; 504 505 491 506 /* calc & set attenuation factor for given channel */ 492 507 static int set_pcm_attn(struct emu10k1_card *card, int ch, int l) 493 508 { 494 509 #ifndef PCMLEVEL 495 #define PCMLEVEL 1 40 // almost silence510 #define PCMLEVEL 110 /* almost silence */ 496 511 #endif 497 int vol = IFATN_ATTENUATION_MASK; // silence 498 499 if (l > 0) 512 int vol = IFATN_ATTENUATION_MASK; /* silence */ 513 514 if (l > 0) { 515 if(l < 100) { 516 l = LinToLog[l]; 517 } 500 518 vol = (PCMLEVEL - (l * PCMLEVEL + 50) / 100); 519 } 501 520 sblive_writeptr(card, IFATN, ch, IFATN_FILTERCUTOFF_MASK | vol); 502 521 DPD(2, "SOUND_MIXER_PCM: channel:%d level:%d attn:%d\n", ch, l, vol); … … 548 567 } 549 568 } 550 if (i == MAX_PCM_CHANNELS) 551 card->arrwVol[volidx[SOUND_MIXER_PCM]] = mixer; 569 card->arrwVol[volidx[SOUND_MIXER_PCM]] = mixer; 552 570 553 571 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.