From e84da8a680e662c0cf332adeb1fdde780a6cd3a2 Mon Sep 17 00:00:00 2001 From: Miller Puckette <msp@ucsd.edu> Date: Sat, 15 Sep 2007 16:43:08 -0700 Subject: [PATCH] before trying font patch --- src/s_audio_oss.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/s_audio_oss.c b/src/s_audio_oss.c index 965d5b6cc..081fabcd2 100644 --- a/src/s_audio_oss.c +++ b/src/s_audio_oss.c @@ -245,8 +245,27 @@ void oss_configure(t_oss_dev *dev, int srate, int dac, int skipblocksize) static int oss_setchannels(int fd, int wantchannels, char *devname) { - int param = wantchannels; - + int param; + if (sys_verbose) + post("setchan %d", wantchannels); + if (ioctl(fd, SNDCTL_DSP_CHANNELS, ¶m) == -1) + { + if (sys_verbose) + error("OSS: SOUND_DSP_READ_CHANNELS failed %s", devname); + } + else + { + if (sys_verbose) + post("channels originally %d for %s", param, devname); + if (param == wantchannels) + { + if (sys_verbose) + post("number of channels doesn't need setting\n"); + return (wantchannels); + } + } + param = wantchannels; +whynot: while (param > 1) { int save = param; @@ -399,10 +418,12 @@ int oss_open_audio(int nindev, int *indev, int nchin, int *chin, sys_setalarm(1000000); /* perhaps it's already open from the above? */ - if (linux_dacs[n].d_fd >= 0) + if (linux_adcs[n].d_fd >= 0) { fd = linux_adcs[n].d_fd; alreadyopened = 1; + if (sys_verbose) + post("already opened it"); } else { -- GitLab