#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/soundcard.h>

main()
{
    int fd, ret;
    unsigned int val = SOUND_MASK_LINE;

    fd = open("/dev/sound/dsp", O_RDWR);
    if (fd < 0) {
        perror("open");
        ret = fd;
    } else {
        ret=ioctl(fd, SOUND_MIXER_WRITE_RECSRC, (void *) &val);
        if (ret < 0) perror("ioctl");
    }
    exit(ret < 0 ? 1 : 0);
}

