• Home
  • Raw
  • Download

Lines Matching refs:hw

46     HWVoiceOut hw;  member
57 HWVoiceIn hw; member
145 static int oss_poll_out (HWVoiceOut *hw) in oss_poll_out() argument
147 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_poll_out()
152 static int oss_poll_in (HWVoiceIn *hw) in oss_poll_in() argument
154 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_poll_in()
386 HWVoiceOut *hw = &oss->hw; in oss_write_pending() local
395 int samples_till_end = hw->samples - oss->wpos; in oss_write_pending()
397 int bytes_to_write = samples_to_write << hw->info.shift; in oss_write_pending()
398 void *pcm = advance (oss->pcm_buf, oss->wpos << hw->info.shift); in oss_write_pending()
409 if (bytes_written & hw->info.align) { in oss_write_pending()
415 samples_written = bytes_written >> hw->info.shift; in oss_write_pending()
417 oss->wpos = (oss->wpos + samples_written) % hw->samples; in oss_write_pending()
424 static int oss_run_out (HWVoiceOut *hw, int live) in oss_run_out() argument
426 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_run_out()
432 bufsize = hw->samples << hw->info.shift; in oss_run_out()
443 pos = hw->rpos << hw->info.shift; in oss_run_out()
445 decr = audio_MIN (bytes >> hw->info.shift, live); in oss_run_out()
471 decr = audio_MIN (abinfo.bytes >> hw->info.shift, live); in oss_run_out()
477 decr = audio_pcm_hw_clip_out (hw, oss->pcm_buf, decr, oss->pending); in oss_run_out()
484 static void oss_fini_out (HWVoiceOut *hw) in oss_fini_out() argument
487 OSSVoiceOut *oss = (OSSVoiceOut *) hw; 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()
507 static int oss_init_out (HWVoiceOut *hw, struct audsettings *as) in oss_init_out() argument
509 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_init_out()
540 audio_pcm_init_info (&hw->info, &obt_as); in oss_init_out()
544 if (obt.nfrags * obt.fragsize & hw->info.align) { in oss_init_out()
546 obt.nfrags * obt.fragsize, hw->info.align + 1); in oss_init_out()
549 hw->samples = (obt.nfrags * obt.fragsize) >> hw->info.shift; in oss_init_out()
555 hw->samples << hw->info.shift, in oss_init_out()
563 hw->samples << hw->info.shift); 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()
597 hw->samples, in oss_init_out()
598 1 << hw->info.shift in oss_init_out()
603 hw->samples, in oss_init_out()
604 1 << hw->info.shift in oss_init_out()
615 static int oss_ctl_out (HWVoiceOut *hw, int cmd, ...) in oss_ctl_out() argument
618 OSSVoiceOut *oss = (OSSVoiceOut *) hw; in oss_ctl_out()
631 if (poll_mode && oss_poll_out (hw)) { in oss_ctl_out()
634 hw->poll_mode = poll_mode; in oss_ctl_out()
640 audio_pcm_info_clear_buf (&hw->info, oss->pcm_buf, hw->samples); in oss_ctl_out()
653 if (hw->poll_mode) { in oss_ctl_out()
655 hw->poll_mode = 0; in oss_ctl_out()
673 static int oss_init_in (HWVoiceIn *hw, struct audsettings *as) in oss_init_in() argument
675 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_init_in()
705 audio_pcm_init_info (&hw->info, &obt_as); in oss_init_in()
709 if (obt.nfrags * obt.fragsize & hw->info.align) { in oss_init_in()
711 obt.nfrags * obt.fragsize, hw->info.align + 1); in oss_init_in()
714 hw->samples = (obt.nfrags * obt.fragsize) >> hw->info.shift; in oss_init_in()
715 oss->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); in oss_init_in()
718 hw->samples, 1 << hw->info.shift); in oss_init_in()
727 static void oss_fini_in (HWVoiceIn *hw) in oss_fini_in() argument
729 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_fini_in()
739 static int oss_run_in (HWVoiceIn *hw) in oss_run_in() argument
741 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_run_in()
742 int hwshift = hw->info.shift; in oss_run_in()
744 int live = audio_pcm_hw_get_live_in (hw); in oss_run_in()
745 int dead = hw->samples - live; in oss_run_in()
751 { .add = hw->wpos, .len = 0 }, in oss_run_in()
759 if (hw->wpos + dead > hw->samples) { in oss_run_in()
760 bufs[0].len = (hw->samples - hw->wpos) << hwshift; in oss_run_in()
761 bufs[1].len = (dead - (hw->samples - hw->wpos)) << hwshift; in oss_run_in()
775 if (nread & hw->info.align) { in oss_run_in()
778 hw->info.align + 1); in oss_run_in()
781 hw->conv (hw->conv_buf + bufs[i].add, p, nread >> hwshift, in oss_run_in()
805 hw->wpos = (hw->wpos + read_samples) % hw->samples; in oss_run_in()
814 static int oss_ctl_in (HWVoiceIn *hw, int cmd, ...) in oss_ctl_in() argument
816 OSSVoiceIn *oss = (OSSVoiceIn *) hw; in oss_ctl_in()
828 if (poll_mode && oss_poll_in (hw)) { in oss_ctl_in()
831 hw->poll_mode = poll_mode; in oss_ctl_in()
836 if (hw->poll_mode) { in oss_ctl_in()
837 hw->poll_mode = 0; in oss_ctl_in()