diff options
author | netchild <netchild@FreeBSD.org> | 2004-07-02 15:31:44 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2004-07-02 15:31:44 +0000 |
commit | 14b36b7b4473068765fe5d0d01e12053dac0cd84 (patch) | |
tree | 53f37d81502aa7a7aad9b21b4c91c28a5f59e77d | |
parent | e4bfd018649abae34a0fbb4e0980aedc2fd607ff (diff) | |
download | FreeBSD-src-14b36b7b4473068765fe5d0d01e12053dac0cd84.zip FreeBSD-src-14b36b7b4473068765fe5d0d01e12053dac0cd84.tar.gz |
Implement SNDCTL_DSP_SETDUPLEX. This may fix sound apps which want to
use full duplex mode.
Approved by: matk
-rw-r--r-- | sys/compat/linux/linux_ioctl.c | 4 | ||||
-rw-r--r-- | sys/compat/linux/linux_ioctl.h | 1 | ||||
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 10 |
3 files changed, 15 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 867a13a..0ee8e8e 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -1799,6 +1799,10 @@ linux_ioctl_sound(struct thread *td, struct linux_ioctl_args *args) args->cmd = SNDCTL_DSP_GETOPTR; return (ioctl(td, (struct ioctl_args *)args)); + case LINUX_SNDCTL_DSP_SETDUPLEX: + args->cmd = SNDCTL_DSP_SETDUPLEX; + return (ioctl(td, (struct ioctl_args *)args)); + case LINUX_SNDCTL_DSP_GETODELAY: args->cmd = SNDCTL_DSP_GETODELAY; return (ioctl(td, (struct ioctl_args *)args)); diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index af1aac7..4d20ab9 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -254,6 +254,7 @@ #define LINUX_SNDCTL_DSP_SETTRIGGER LINUX_SNDCTL_DSP_GETTRIGGER #define LINUX_SNDCTL_DSP_GETIPTR 0x5011 #define LINUX_SNDCTL_DSP_GETOPTR 0x5012 +#define LINUX_SNDCTL_DSP_SETDUPLEX 0x5016 #define LINUX_SNDCTL_DSP_GETODELAY 0x5017 #define LINUX_SNDCTL_SEQ_RESET 0x5100 #define LINUX_SNDCTL_SEQ_SYNC 0x5101 diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 29fe27f..64088f9 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -1006,6 +1006,15 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread * } break; + case SNDCTL_DSP_SETDUPLEX: + /* + * switch to full-duplex mode if card is in half-duplex + * mode and is able to work in full-duplex mode + */ + if (rdch && wrch && (dsp_get_flags(i_dev) & SD_F_SIMPLEX)) + dsp_set_flags(i_dev, dsp_get_flags(i_dev)^SD_F_SIMPLEX); + break; + case SNDCTL_DSP_MAPINBUF: case SNDCTL_DSP_MAPOUTBUF: case SNDCTL_DSP_SETSYNCRO: @@ -1015,6 +1024,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread * case SOUND_PCM_WRITE_FILTER: case SOUND_PCM_READ_FILTER: /* dunno what these do, don't sound important */ + default: DEB(printf("default ioctl fn 0x%08lx fail\n", cmd)); ret = EINVAL; |