Lines Matching full:oss

2  * QEMU OSS audio driver
35 #define AUDIO_CAP "oss"
122 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_poll_out() local
124 qemu_set_fd_handler(oss->fd, NULL, oss_helper_poll_out, hw->s); in oss_poll_out()
129 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_poll_in() local
131 qemu_set_fd_handler(oss->fd, oss_helper_poll_in, NULL, hw->s); in oss_poll_in()
239 oss_logerr2 (errno, typ, "Failed to get OSS version\n"); in oss_get_version()
249 AudiodevOssOptions *oopts = &dev->u.oss; in oss_open()
369 static size_t oss_get_available_bytes(OSSVoiceOut *oss) in oss_get_available_bytes() argument
373 assert(oss->mmapped); in oss_get_available_bytes()
375 err = ioctl(oss->fd, SNDCTL_DSP_GETOPTR, &cntinfo); in oss_get_available_bytes()
381 return audio_ring_dist(cntinfo.ptr, oss->hw.pos_emul, oss->hw.size_emul); in oss_get_available_bytes()
386 OSSVoiceOut *oss = (OSSVoiceOut *)hw; in oss_run_buffer_out() local
388 if (!oss->mmapped) { in oss_run_buffer_out()
395 OSSVoiceOut *oss = (OSSVoiceOut *)hw; in oss_buffer_get_free() local
397 if (oss->mmapped) { in oss_buffer_get_free()
398 return oss_get_available_bytes(oss); in oss_buffer_get_free()
406 OSSVoiceOut *oss = (OSSVoiceOut *)hw; in oss_get_buffer_out() local
408 if (oss->mmapped) { in oss_get_buffer_out()
418 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_put_buffer_out() local
419 if (oss->mmapped) { in oss_put_buffer_out()
431 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_write() local
434 if (oss->mmapped) { in oss_write()
436 len = MIN(len, oss_get_available_bytes(oss)); in oss_write()
455 bytes_written = write(oss->fd, pcm, len); in oss_write()
476 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_fini_out() local
479 oss_anal_close (&oss->fd); in oss_fini_out()
481 if (oss->mmapped && hw->buf_emul) { in oss_fini_out()
494 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_init_out() local
502 AudiodevOssOptions *oopts = &dev->u.oss; in oss_init_out()
504 oss->fd = -1; in oss_init_out()
526 oss->nfrags = obt.nfrags; in oss_init_out()
527 oss->fragsize = obt.fragsize; in oss_init_out()
536 oss->mmapped = 0; in oss_init_out()
563 oss->mmapped = 1; in oss_init_out()
567 if (!oss->mmapped) { in oss_init_out()
578 oss->fd = fd; in oss_init_out()
579 oss->dev = dev; in oss_init_out()
586 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_enable_out() local
587 AudiodevOssPerDirectionOptions *opdo = oss->dev->u.oss.out; in oss_enable_out()
597 if (!oss->mmapped) { in oss_enable_out()
603 if (ioctl(oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) { in oss_enable_out()
610 qemu_set_fd_handler (oss->fd, NULL, NULL, NULL); in oss_enable_out()
614 if (!oss->mmapped) { in oss_enable_out()
620 if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) { in oss_enable_out()
629 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_init_in() local
638 oss->fd = -1; in oss_init_in()
659 oss->nfrags = obt.nfrags; in oss_init_in()
660 oss->fragsize = obt.fragsize; in oss_init_in()
669 oss->fd = fd; in oss_init_in()
670 oss->dev = dev; in oss_init_in()
676 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_fini_in() local
678 oss_anal_close (&oss->fd); in oss_fini_in()
683 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_read() local
690 nread = read(oss->fd, dst, len); in oss_read()
714 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_enable_in() local
715 AudiodevOssPerDirectionOptions *opdo = oss->dev->u.oss.out; in oss_enable_in()
725 qemu_set_fd_handler (oss->fd, NULL, NULL, NULL); in oss_enable_in()
744 oopts = &dev->u.oss; in oss_audio_init()
781 .name = "oss",
782 .descr = "OSS http://www.opensound.com",