- Timestamp:
- Jan 26, 2007 2:15:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/ossaudio.c
r1 r356 99 99 } 100 100 101 #ifndef VBOX 101 102 static void GCC_FMT_ATTR (3, 4) oss_logerr2 ( 102 103 int err, … … 116 117 AUD_log (AUDIO_CAP, "Reason: %s\n", strerror (err)); 117 118 } 119 #endif 118 120 119 121 static void oss_anal_close (int *fdp) … … 222 224 fd = open (dspname, (in ? O_RDONLY : O_WRONLY) | O_NONBLOCK); 223 225 if (-1 == fd) { 226 #ifndef VBOX 224 227 oss_logerr2 (errno, typ, "Failed to open `%s'\n", dspname); 225 LogRel(("Audio/OSS: Failed to open '%s' as %s\n", dspname, typ)); 228 #else 229 LogRel(("Audio/OSS: Failed to open %s for %s (%s)\n", 230 dspname, typ, strerror(errno))); 231 #endif 226 232 return -1; 227 233 } 234 235 #ifdef VBOX 236 LogRel(("Audio/OSS: Successfully opened %s for %s\n", dspname, typ)); 237 #endif 228 238 229 239 freq = req->freq; … … 232 242 233 243 if (ioctl (fd, SNDCTL_DSP_SAMPLESIZE, &fmt)) { 244 #ifndef VBOX 234 245 oss_logerr2 (errno, typ, "Failed to set sample size %d\n", req->fmt); 246 #else 247 LogRel(("Audio/OSS: Failed to set sample size %d (%s)\n", 248 req->fmt, strerror(errno))); 249 #endif 235 250 goto err; 236 251 } 237 252 238 253 if (ioctl (fd, SNDCTL_DSP_CHANNELS, &nchannels)) { 254 #ifndef VBOX 239 255 oss_logerr2 (errno, typ, "Failed to set number of channels %d\n", 240 256 req->nchannels); 257 #else 258 LogRel(("Audio/OSS: Failed to set nchannels=%d (%s)\n", 259 req->nchannels, strerror(errno))); 260 #endif 241 261 goto err; 242 262 } 243 263 244 264 if (ioctl (fd, SNDCTL_DSP_SPEED, &freq)) { 265 #ifndef VBOX 245 266 oss_logerr2 (errno, typ, "Failed to set frequency %d\n", req->freq); 267 #else 268 LogRel(("Audio/OSS: Failed to set freq=%dHZ\n", req->freq, strerror(errno))); 269 #endif 246 270 goto err; 247 271 } 248 272 249 273 if (ioctl (fd, SNDCTL_DSP_NONBLOCK)) { 274 #ifndef VBOX 250 275 oss_logerr2 (errno, typ, "Failed to set non-blocking mode\n"); 276 #else 277 LogRel(("Audio/OSS: Failed to set non-blocking mode (%s)\n", strerror(errno))); 278 #endif 251 279 goto err; 252 280 } … … 254 282 mmmmssss = (req->nfrags << 16) | lsbindex (req->fragsize); 255 283 if (ioctl (fd, SNDCTL_DSP_SETFRAGMENT, &mmmmssss)) { 284 #ifndef VBOX 256 285 oss_logerr2 (errno, typ, "Failed to set buffer length (%d, %d)\n", 257 286 req->nfrags, req->fragsize); 287 #else 288 LogRel(("Audio/OSS: Failed to set buffer_length=%d,%d (%s)\n", 289 req->nfrags, req->fragsize, strerror(errno))); 290 #endif 258 291 goto err; 259 292 } 260 293 261 294 if (ioctl (fd, in ? SNDCTL_DSP_GETISPACE : SNDCTL_DSP_GETOSPACE, &abinfo)) { 295 #ifndef VBOX 262 296 oss_logerr2 (errno, typ, "Failed to get buffer length\n"); 297 #else 298 LogRel(("Audio/OSS: Failed to get buffer length (%s)\n", strerror(errno))); 299 #endif 263 300 goto err; 264 301 } … … 289 326 err: 290 327 oss_anal_close (&fd); 328 #ifdef VBOX 329 LogRel(("Audio/OSS: Closed %s for %s\n", 330 in ? conf.devpath_in : conf.devpath_out, in ? "ADC" : "DAC")); 331 #endif 291 332 return -1; 292 333 } … … 440 481 ldebug ("oss_fini\n"); 441 482 oss_anal_close (&oss->fd); 483 #ifdef VBOX 484 LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out)); 485 #endif 442 486 443 487 if (oss->pcm_buf) { … … 485 529 if (err) { 486 530 oss_anal_close (&fd); 531 #ifdef VBOX 532 LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out)); 533 #endif 487 534 return -1; 488 535 } … … 563 610 ); 564 611 oss_anal_close (&fd); 612 #ifdef VBOX 613 LogRel(("Audio/OSS: Closed %s for DAC\n", conf.devpath_out)); 614 #endif 565 615 return -1; 566 616 } … … 636 686 if (err) { 637 687 oss_anal_close (&fd); 688 #ifdef VBOX 689 LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in)); 690 #endif 638 691 return -1; 639 692 } … … 659 712 hw->samples, 1 << hw->info.shift); 660 713 oss_anal_close (&fd); 714 #ifdef VBOX 715 LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in)); 716 #endif 661 717 return -1; 662 718 } … … 671 727 672 728 oss_anal_close (&oss->fd); 729 #ifdef VBOX 730 LogRel(("Audio/OSS: Closed %s for ADC\n", conf.devpath_in)); 731 #endif 673 732 674 733 if (oss->pcm_buf) {
Note:
See TracChangeset
for help on using the changeset viewer.