Home | History | Annotate | Download | only in audio

Lines Matching defs:hw

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