• Home
  • Raw
  • Download

Lines Matching refs:oss

147     OSSVoiceOut *oss = (OSSVoiceOut *) hw;  in oss_poll_out()  local
149 return qemu_set_fd_handler (oss->fd, NULL, oss_helper_poll_out, NULL); in oss_poll_out()
154 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_poll_in() local
156 return qemu_set_fd_handler (oss->fd, oss_helper_poll_in, NULL, NULL); in oss_poll_in()
384 static void oss_write_pending (OSSVoiceOut *oss) in oss_write_pending() argument
386 HWVoiceOut *hw = &oss->hw; in oss_write_pending()
388 if (oss->mmapped) { in oss_write_pending()
392 while (oss->pending) { in oss_write_pending()
395 int samples_till_end = hw->samples - oss->wpos; in oss_write_pending()
396 int samples_to_write = audio_MIN (oss->pending, samples_till_end); in oss_write_pending()
398 void *pcm = advance (oss->pcm_buf, oss->wpos << hw->info.shift); in oss_write_pending()
400 bytes_written = write (oss->fd, pcm, bytes_to_write); in oss_write_pending()
416 oss->pending -= samples_written; in oss_write_pending()
417 oss->wpos = (oss->wpos + samples_written) % hw->samples; in oss_write_pending()
426 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_run_out() local
434 if (oss->mmapped) { in oss_run_out()
437 err = ioctl (oss->fd, SNDCTL_DSP_GETOPTR, &cntinfo); in oss_run_out()
448 err = ioctl (oss->fd, SNDCTL_DSP_GETOSPACE, &abinfo); in oss_run_out()
477 decr = audio_pcm_hw_clip_out (hw, oss->pcm_buf, decr, oss->pending); in oss_run_out()
478 oss->pending += decr; in oss_run_out()
479 oss_write_pending (oss); in oss_run_out()
487 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_fini_out() local
490 oss_anal_close (&oss->fd); in oss_fini_out()
492 if (oss->pcm_buf) { in oss_fini_out()
493 if (oss->mmapped) { in oss_fini_out()
494 err = munmap (oss->pcm_buf, hw->samples << hw->info.shift); in oss_fini_out()
497 oss->pcm_buf, hw->samples << hw->info.shift); in oss_fini_out()
501 g_free (oss->pcm_buf); in oss_fini_out()
503 oss->pcm_buf = NULL; in oss_fini_out()
509 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_init_out() local
517 oss->fd = -1; in oss_init_out()
541 oss->nfrags = obt.nfrags; in oss_init_out()
542 oss->fragsize = obt.fragsize; in oss_init_out()
551 oss->mmapped = 0; in oss_init_out()
553 oss->pcm_buf = mmap ( in oss_init_out()
561 if (oss->pcm_buf == MAP_FAILED) { in oss_init_out()
580 oss->mmapped = 1; in oss_init_out()
584 if (!oss->mmapped) { in oss_init_out()
585 err = munmap (oss->pcm_buf, hw->samples << hw->info.shift); in oss_init_out()
588 oss->pcm_buf, hw->samples << hw->info.shift); in oss_init_out()
594 if (!oss->mmapped) { in oss_init_out()
595 oss->pcm_buf = audio_calloc ( in oss_init_out()
600 if (!oss->pcm_buf) { in oss_init_out()
611 oss->fd = fd; in oss_init_out()
618 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_ctl_out() local
636 if (!oss->mmapped) { in oss_ctl_out()
640 audio_pcm_info_clear_buf (&hw->info, oss->pcm_buf, hw->samples); in oss_ctl_out()
642 if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) { in oss_ctl_out()
654 qemu_set_fd_handler (oss->fd, NULL, NULL, NULL); in oss_ctl_out()
658 if (!oss->mmapped) { in oss_ctl_out()
664 if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) { in oss_ctl_out()
675 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_init_in() local
683 oss->fd = -1; in oss_init_in()
706 oss->nfrags = obt.nfrags; in oss_init_in()
707 oss->fragsize = obt.fragsize; in oss_init_in()
715 oss->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); in oss_init_in()
716 if (!oss->pcm_buf) { in oss_init_in()
723 oss->fd = fd; in oss_init_in()
729 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_fini_in() local
731 oss_anal_close (&oss->fd); in oss_fini_in()
733 if (oss->pcm_buf) { in oss_fini_in()
734 g_free (oss->pcm_buf); in oss_fini_in()
735 oss->pcm_buf = NULL; in oss_fini_in()
741 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_run_in() local
771 void *p = advance (oss->pcm_buf, bufs[i].add << hwshift); in oss_run_in()
772 nread = read (oss->fd, p, bufs[i].len); in oss_run_in()
816 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_ctl_in() local
838 qemu_set_fd_handler (oss->fd, NULL, NULL, NULL); in oss_ctl_in()