Changeset 2279
- Timestamp:
- 03/10/99 19:57:03 (14 years ago)
- Files:
-
- 1 modified
-
rat/trunk/auddev_sparc.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rat/trunk/auddev_sparc.c
r2277 r2279 65 65 ap->precision = fmt->bits_per_sample; 66 66 #ifdef Solaris 67 ap->buffer_size = DEVICE_BUF_UNIT* (fmt->sample_rate / 8000) * (fmt->bits_per_sample / 8);67 ap->buffer_size = 160 * fmt->channels * (fmt->sample_rate / 8000) * (fmt->bits_per_sample / 8); 68 68 #endif /* Solaris */ 69 69 … … 135 135 } 136 136 } 137 138 /* XXX driver issue - on Ultra II's if you don't drain 139 * the device before reading commences then the device 140 * reads in blocks of 500ms irrespective of the 141 * blocksize set. After a minute or so it flips into the 142 * correct mode, but obviously this is too late to be 143 * useful for most apps. grrr. 144 */ 145 146 sparc_audio_drain(ad); 147 137 148 return audio_fd; 138 149 } else { 139 150 /* Because we opened the device with O_NDELAY 140 151 * the waiting flag was not updated so update 141 * it manually using the audioctl device... 142 */ 152 * it manually using the audioctl device... */ 143 153 audio_fd = open("/dev/audioctl", O_RDWR); 144 154 AUDIO_INITINFO(&dev_info); … … 416 426 { 417 427 fd_set rfds; 418 struct timeval tv ;419 420 UNUSED(ad); assert(audio_fd > 0); 421 428 struct timeval tv, s1, s2; 429 430 UNUSED(ad); assert(audio_fd > 0); 431 422 432 tv.tv_sec = 0; 423 433 tv.tv_usec = delay_us; … … 426 436 FD_SET(audio_fd, &rfds); 427 437 438 gettimeofday (&s1, 0); 428 439 select(audio_fd+1, &rfds, NULL, NULL, &tv); 440 gettimeofday (&s2, 0); 441 442 s2.tv_usec -= s1.tv_usec; 443 s2.tv_sec -= s1.tv_sec; 444 445 if (s2.tv_usec < 0) { 446 s2.tv_usec += 1000000; 447 s2.tv_sec -= 1; 448 } 449 450 /* printf("delay %d pause %ld\n", delay_us, s2.tv_usec / 1000); */ 429 451 430 452 return FD_ISSET(audio_fd, &rfds);
