playthrough

guenter geiger geiger at epy.co.at
Mon Feb 15 23:15:44 CET 1999



On Fri, 12 Feb 1999, |L_| wrote:

> hi
> is it possible to mute the playthrough/(monitoring) when you re using
> "live" input on linux & oss drivers?
> tks,oss
> 
> -- 
> 1337777.16662735
> 
Yes, basically it should be possible. Yet, I have not seen
a mixer implementation which has this feature.
The second problem is that not all soundcards seem to support
this feature, and the third that not all soundcard drivers
implement this feature. 

I am attaching a small program which should mute the recording 
monitor ... 

compile it with gcc -o mute_mon mute_mon.c 

and pray .....

Guenter


mute_mon.c
-----------------------------------------------------------

#include <stdio.h>
#include <linux/soundcard.h>

char* mix_dev = "/dev/mixer";

main() {
	int fd;
	int res;
	int param=0;

	fd = open (mix_dev);
        if (fd <0) {
            fprintf(stderr,"Could not open mixer device %s\n",mix_dev);
            exit(0);
        }


	res = ioctl(fd,SOUND_MIXER_READ_DEVMASK,&param);
	if (res < 0) fprintf(stderr,"Mixer ioctl failed - No mixer present ?\n");
	fprintf(stderr,"Devices supported = %x\n",param);

	if (param&SOUND_MIXER_IMIX) 
            fprintf(stderr,"Can change recording monitor\n");
        else
            fprintf(stderr,"Unable to change recording monitor\n");


	param = 0;
        res = ioctl(fd,SOUND_MIXER_WRITE_IMIX,&param);
	if (res < 0) fprintf(stderr,"Muting recording monitor failed\n");
	else fprintf(stderr,"Recording monitor muted\n");
}






More information about the Pd-list mailing list