Lines Matching defs:dsp_fd
58 static int dsp_fd = -1;
81 if (dsp_fd == -1)
85 FD_SET(dsp_fd, wfds);
87 FD_SET(dsp_fd, rfds);
88 if (dsp_fd > *n)
89 *n = dsp_fd;
95 if (FD_ISSET(dsp_fd, wfds))
97 if (FD_ISSET(dsp_fd, rfds))
107 if (fstat(dsp_fd, &s) == -1)
149 if (dsp_fd != -1)
162 ioctl(dsp_fd, SNDCTL_DSP_SETDUPLEX, 0);
163 if ((ioctl(dsp_fd, SNDCTL_DSP_GETCAPS, &caps) < 0)
169 close(dsp_fd);
181 dsp_fd = open(dsp_dev, dsp_mode | O_NONBLOCK);
183 if (dsp_fd == -1)
197 close(dsp_fd);
198 dsp_fd = -1;
264 assert(dsp_fd != -1);
282 ioctl(dsp_fd, SNDCTL_DSP_RESET, NULL);
283 ioctl(dsp_fd, SNDCTL_DSP_SYNC, NULL);
292 if (ioctl(dsp_fd, SNDCTL_DSP_SETFMT, &format) == -1)
309 if (ioctl(dsp_fd, SNDCTL_DSP_STEREO, &stereo) == -1)
318 if (ioctl(dsp_fd, SNDCTL_DSP_SPEED, &snd_rate) == -1)
326 && (ioctl(dsp_fd, SNDCTL_DSP_SPEED, prates) != -1))
353 ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &fragments);
360 if (ioctl(dsp_fd, SNDCTL_DSP_GETOSPACE, &info) == -1)
389 if (ioctl(dsp_fd, MIXER_WRITE(SOUND_MIXER_PCM), &volume) == -1)
405 assert(dsp_fd != -1);
416 len = write(dsp_fd, out->p, (len > MAX_LEN) ? MAX_LEN : len);
449 if (ioctl(dsp_fd, SNDCTL_DSP_GETODELAY, &delay_bytes) == -1)
457 if (ioctl(dsp_fd, SNDCTL_DSP_GETOSPACE, &info) != -1)
475 assert(dsp_fd != -1);
477 len = read(dsp_fd, buffer, sizeof(buffer));