Re: Re: [Familiar] h55xx headphone jack not usable

From: Christian Werner <chw_at_ch-werner.de>
Date: Mon, 31 Jan 2005 18:49:04 +0100

Michael Kropfberger wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Monday 31 January 2005 17:20, Jamey Hicks wrote:
>
> > I cannot verify that the patch does what it intends by reading it, but
> > it looks OK so I applied it to CVS. We'll need to build and upload new
> > kernel packages.
>
> I wanted to use the precompiled module which was handed around, but I couldnt
> find out how to effectively switch the output to the headphones... just
> connecting a headphone didnt help...

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

main()
{
    int fd, ret;

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

Hope that works and helps,
Christian
Received on Mon Jan 31 2005 - 12:50:16 EST

This archive was generated by hypermail 2.2.0 : Mon Jul 25 2005 - 17:20:11 EDT