Lines Matching defs:oss
42 #define AUDIO_CAP "oss"
344 OSSVoiceOut *oss = (OSSVoiceOut *) hw;
363 if (oss->mmapped) {
366 err = ioctl (oss->fd, SNDCTL_DSP_GETOPTR, &cntinfo);
372 if (cntinfo.ptr == oss->old_optr) {
379 if (cntinfo.ptr > oss->old_optr) {
380 bytes = cntinfo.ptr - oss->old_optr;
383 bytes = bufsize + cntinfo.ptr - oss->old_optr;
390 err = ioctl (oss->fd, SNDCTL_DSP_GETOSPACE, &abinfo);
428 dst = advance (oss->pcm_buf, rpos << hw->info.shift);
434 if (!oss->mmapped) {
438 written = write (oss->fd, dst, convert_samples << hw->info.shift);
476 if (oss->mmapped) {
477 oss->old_optr = cntinfo.ptr;
490 OSSVoiceOut *oss = (OSSVoiceOut *) hw;
493 oss_anal_close (&oss->fd);
498 if (oss->pcm_buf) {
500 qemu_free (oss->pcm_buf);
502 if (oss->mmapped) {
503 err = munmap (oss->pcm_buf, hw->samples << hw->info.shift);
506 oss->pcm_buf, hw->samples << hw->info.shift);
510 qemu_free (oss->pcm_buf);
513 oss->pcm_buf = NULL;
519 OSSVoiceOut *oss = (OSSVoiceOut *) hw;
527 oss->fd = -1;
554 oss->nfrags = obt.nfrags;
555 oss->fragsize = obt.fragsize;
565 oss->mmapped = 0;
567 oss->pcm_buf = mmap (
575 if (oss->pcm_buf == MAP_FAILED) {
595 oss->mmapped = 1;
599 if (!oss->mmapped) {
600 err = munmap (oss->pcm_buf, hw->samples << hw->info.shift);
603 oss->pcm_buf, hw->samples << hw->info.shift);
611 if (!oss->mmapped) {
613 oss->pcm_buf = audio_calloc (
618 if (!oss->pcm_buf) {
634 oss->fd = fd;
641 OSSVoiceOut *oss = (OSSVoiceOut *) hw;
646 if (!oss->mmapped) {
654 audio_pcm_info_clear_buf (&hw->info, oss->pcm_buf, hw->samples);
656 if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {
668 if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {
679 OSSVoiceIn *oss = (OSSVoiceIn *) hw;
687 oss->fd = -1;
713 oss->nfrags = obt.nfrags;
714 oss->fragsize = obt.fragsize;
722 oss->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift);
723 if (!oss->pcm_buf) {
733 oss->fd = fd;
739 OSSVoiceIn *oss = (OSSVoiceIn *) hw;
741 oss_anal_close (&oss->fd);
746 if (oss->pcm_buf) {
747 qemu_free (oss->pcm_buf);
748 oss->pcm_buf = NULL;
754 OSSVoiceIn *oss = (OSSVoiceIn *) hw;
787 void *p = advance (oss->pcm_buf, bufs[i].add << hwshift);
788 nread = read (oss->fd, p, bufs[i].len);
886 INIT_FIELD (name = ) "oss",