Skip to contentSkip to conversation

assorted fixes for the M-Audio Revolution 5.1

PATCH In review Jochen Voss 2 participants 8 messages Oct 3, 2006 – Oct 5, 2006

lore
Share & tools
lore
#0 lore raw

cover assorted fixes for the M-Audio Revolution 5.1

Hi,

here is a revised version of the two patches I posted to the list previously. I still didn't figure out how to activate the headphone output, but everything else seems to work now.

If nobody objects, I would suggest this version for inclusion.

All the best,
Jochen

Signature · 1 line
http://seehuhn.de/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#1 lore raw

PATCH 1/2 enable capture from line-in and CD on Revolution 5.1

Enable capture from line-in and CD on the Revolution 5.1 card.

This patch adds support for switching between the 5 input channels of the AK5365 ADC and modifies the Revolution 5.1 driver to make use of this facility. Previously the capture channel was fixed to channel 0 (microphone on the Revolution 5.1 card).

alsa-kernel/i2c/other/ak4xxx-adda.c +79 -2
diff -ur -x sound alsa-driver-hg20060929.orig/alsa-kernel/i2c/other/ak4xxx-adda.c alsa-driver-hg20060929/alsa-kernel/i2c/other/ak4xxx-adda.c
@@ -513,6 +513,61 @@
 	return change;
 }
 
+static int ak4xxx_capture_source_info(struct snd_kcontrol *kcontrol,
+				      struct snd_ctl_elem_info *uinfo)
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int mixer_ch = AK_GET_SHIFT(kcontrol->private_value);
+	const char **input_names;
+	int  num_names, idx;
+
+	input_names = ak->adc_info[mixer_ch].input_names;
+
+	num_names = 0;
+	while (num_names<5 && input_names[num_names])
+		++num_names;
+	
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = num_names;
+	idx = uinfo->value.enumerated.item;
+	if (idx >= num_names) return -1;
+	strncpy(uinfo->value.enumerated.name, input_names[idx],
+		sizeof(uinfo->value.enumerated.name));
+	return 0;
+}
+
+static int ak4xxx_capture_source_get(struct snd_kcontrol *kcontrol,
+				     struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int chip = AK_GET_CHIP(kcontrol->private_value);
+	int addr = AK_GET_ADDR(kcontrol->private_value);
+	int mask = AK_GET_MASK(kcontrol->private_value);
+	unsigned char val;
+
+	val = snd_akm4xxx_get(ak, chip, addr)&mask;
+        ucontrol->value.enumerated.item[0] = val;
+	return 0;
+}
+
+static int ak4xxx_capture_source_put(struct snd_kcontrol *kcontrol,
+				     struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int chip = AK_GET_CHIP(kcontrol->private_value);
+	int addr = AK_GET_ADDR(kcontrol->private_value);
+	int mask = AK_GET_MASK(kcontrol->private_value);
+	unsigned char oval, val;
+
+	oval = snd_akm4xxx_get(ak, chip, addr);
+	val = oval & ~mask;
+	val |= ucontrol->value.enumerated.item[0]&mask;
+	if (val != oval)
+		snd_akm4xxx_write(ak, chip, addr, val);
+	return 0;
+}
+
 /*
  * build AK4xxx controls
  */
@@ -647,10 +702,12 @@
 
 		if (ak->type == SND_AK5365 && (idx % 2) == 0) {
 			if (! ak->adc_info || 
-			    ! ak->adc_info[mixer_ch].switch_name)
+			    ! ak->adc_info[mixer_ch].switch_name) {
 				knew.name = "Capture Switch";
-			else
+				knew.index = mixer_ch + ak->idx_offset * 2;
+			} else {
 				knew.name = ak->adc_info[mixer_ch].switch_name;
+			}
 			knew.info = ak4xxx_switch_info;
 			knew.get = ak4xxx_switch_get;
 			knew.put = ak4xxx_switch_put;
@@ -662,6 +719,26 @@
 			err = snd_ctl_add(ak->card, snd_ctl_new1(&knew, ak));
 			if (err < 0)
 				return err;
+
+			memset(&knew, 0, sizeof(knew));
+			knew.name = ak->adc_info[mixer_ch].selector_name;
+			if (! knew.name) {
+				knew.name = "Capture Channel";
+				knew.index = mixer_ch + ak->idx_offset * 2;
+			}
+
+			knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
+			knew.info = ak4xxx_capture_source_info;
+			knew.get = ak4xxx_capture_source_get;
+			knew.put = ak4xxx_capture_source_put;
+			knew.access = 0;
+			/* input selector control: reg. 1, bits 0-2.
+			 * mis-use 'shift' to pass mixer_ch */
+			knew.private_value
+				= AK_COMPOSE(idx/2, 1, mixer_ch, 0x07);
+			err = snd_ctl_add(ak->card, snd_ctl_new1(&knew, ak));
+			if (err < 0)
+				return err;
 		}
 
 		idx += num_stereo;
alsa-kernel/include/ak4xxx-adda.h +2 -0
diff -ur -x sound alsa-driver-hg20060929.orig/alsa-kernel/include/ak4xxx-adda.h alsa-driver-hg20060929/alsa-kernel/include/ak4xxx-adda.h
@@ -50,6 +50,8 @@
 	char *name;		/* capture gain volume label */
 	char *switch_name;	/* capture switch */
 	unsigned int num_channels;
+	char *selector_name;	/* capture source select label */
+	const char **input_names; /* capture source names (NULL terminated) */
 };
 
 struct snd_akm4xxx {
alsa-kernel/pci/ice1712/revo.c +9 -1
diff -ur -x sound alsa-driver-hg20060929.orig/alsa-kernel/pci/ice1712/revo.c alsa-driver-hg20060929/alsa-kernel/pci/ice1712/revo.c
@@ -107,11 +107,19 @@
 	AK_DAC("PCM Rear Playback Volume", 2),
 };
 
+static const char *revo51_adc_input_names[] = {
+	"Mic",
+	"Line",
+	"CD",
+	NULL
+};
+
 static struct snd_akm4xxx_adc_channel revo51_adc[] = {
 	{
 		.name = "PCM Capture Volume",
 		.switch_name = "PCM Capture Switch",
-		.num_channels = 2
+		.num_channels = 2,
+		.input_names = revo51_adc_input_names
 	},
 };
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#2 lore raw

Re: [PATCH 1/2] enable capture from line-in and CD on Revolution 5.1

At Wed, 4 Oct 2006 00:27:57 +0100,

Quoted 9 lines · Jochen Voss

Enable capture from line-in and CD on the Revolution 5.1 card.

This patch adds support for switching between the 5 input channels of the AK5365 ADC and modifies the Revolution 5.1 driver to make use of this facility. Previously the capture channel was fixed to channel 0 (microphone on the Revolution 5.1 card).

Thanks, the patch is almost good but needs small fixes as follows:

Quoted 9 lines

diff -ur -x sound alsa-driver-hg20060929.orig/alsa-kernel/i2c/other/ak4xxx-adda.c alsa-driver-hg20060929/alsa-kernel/i2c/other/ak4xxx-adda.c

alsa-kernel/i2c/other/ak4xxx-adda.c +2 -0
@@ -513,6 +513,61 @@
 	return change;
 }
 
+static int ak4xxx_capture_source_info(struct snd_kcontrol *kcontrol,
+				      struct snd_ctl_elem_info *uinfo)

alsa-kernel/i2c/other/ak4xxx-adda.c line 527

Quoted 10 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +10 -0
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int mixer_ch = AK_GET_SHIFT(kcontrol->private_value);
+	const char **input_names;
+	int  num_names, idx;
+
+	input_names = ak->adc_info[mixer_ch].input_names;
+
+	num_names = 0;
+	while (num_names<5 && input_names[num_names])

White space around '<', and define a constant for 5, please.

alsa-kernel/i2c/other/ak4xxx-adda.c line 534

Quoted 7 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +7 -0
+		++num_names;
+	
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = num_names;
+	idx = uinfo->value.enumerated.item;
+	if (idx >= num_names) return -1;

Break a line, and return a meaningful error code, e.g. -EINVAL.

Quoted 5 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +5 -0
+	strncpy(uinfo->value.enumerated.name, input_names[idx],
+		sizeof(uinfo->value.enumerated.name));
+	return 0;
+}
+

alsa-kernel/i2c/other/ak4xxx-adda.c line 549

Quoted 10 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +10 -0
+static int ak4xxx_capture_source_get(struct snd_kcontrol *kcontrol,
+				     struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int chip = AK_GET_CHIP(kcontrol->private_value);
+	int addr = AK_GET_ADDR(kcontrol->private_value);
+	int mask = AK_GET_MASK(kcontrol->private_value);
+	unsigned char val;
+
+	val = snd_akm4xxx_get(ak, chip, addr)&mask;

Put spaces around '&'.

alsa-kernel/i2c/other/ak4xxx-adda.c line 550

Quoted 1 line
alsa-kernel/i2c/other/ak4xxx-adda.c +1 -0
+        ucontrol->value.enumerated.item[0] = val;

Indentation?

Quoted 8 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +8 -0
+	return 0;
+}
+
+static int ak4xxx_capture_source_put(struct snd_kcontrol *kcontrol,
+				     struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int chip = AK_GET_CHIP(kcontrol->private_value);

alsa-kernel/i2c/other/ak4xxx-adda.c line 568

Quoted 10 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +10 -0
+	int addr = AK_GET_ADDR(kcontrol->private_value);
+	int mask = AK_GET_MASK(kcontrol->private_value);
+	unsigned char oval, val;
+
+	oval = snd_akm4xxx_get(ak, chip, addr);
+	val = oval & ~mask;
+	val |= ucontrol->value.enumerated.item[0]&mask;
+	if (val != oval)
+		snd_akm4xxx_write(ak, chip, addr, val);
+	return 0;

The put callback should return 1 if the value is changed and 0 if the value is unchanged. That is, such as:

	if (val != oval) {
		snd_akm4xxx_write(ak, chip, addr, val);
		return 1;
	}
	return 0;
Quoted 7 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +2 -0
+}
+
 /*
  * build AK4xxx controls
  */
@@ -647,10 +702,12 @@
 

alsa-kernel/i2c/other/ak4xxx-adda.c line 710

Quoted 10 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +4 -2
 		if (ak->type == SND_AK5365 && (idx % 2) == 0) {
 			if (! ak->adc_info || 
-			    ! ak->adc_info[mixer_ch].switch_name)
+			    ! ak->adc_info[mixer_ch].switch_name) {
 				knew.name = "Capture Switch";
-			else
+				knew.index = mixer_ch + ak->idx_offset * 2;
+			} else {
 				knew.name = ak->adc_info[mixer_ch].switch_name;
+			}

Don't put braces around a single-line if.

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#3 lore raw

PATCH 1/2 enable capture from line-in and CD on Revolution 5.1

Enable capture from line-in and CD on the Revolution 5.1 card.

This patch adds support for switching between the 5 input channels of the AK5365 ADC and modifies the Revolution 5.1 driver to make use of this facility. Previously the capture channel was fixed to channel 0 (microphone on the Revolution 5.1 card).

---

Hi Takashi,

thanks for reviewing. A fixed patch is below.

Quoted 3 lines · Takashi Iwai

Review

Quoted 1 line
(quoted diff) +1 -0
+	while (num_names<5 && input_names[num_names])

White space around '<', and define a constant for 5, please.

fixed

Quoted 3 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+	if (idx >= num_names) return -1;

Break a line, and return a meaningful error code, e.g. -EINVAL.

ok

Quoted 3 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+	val = snd_akm4xxx_get(ak, chip, addr)&mask;

Put spaces around '&'.

fixed in two places

Quoted 3 lines
Quoted 1 line

+ ucontrol->value.enumerated.item[0] = val;

Indentation?

changed eight spaces into a tab

Quoted 7 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+	if (val != oval)
+		snd_akm4xxx_write(ak, chip, addr, val);
+	return 0;

The put callback should return 1 if the value is changed and 0 if the value is unchanged. That is, such as:

Quoted 5 lines
	if (val != oval) {
		snd_akm4xxx_write(ak, chip, addr, val);
		return 1;
	}
	return 0;

fixed

Quoted 4 lines
Quoted 4 lines
(quoted diff) +1 -1
 		if (ak->type == SND_AK5365 && (idx % 2) == 0) {
 			if (! ak->adc_info || 
-			    ! ak->adc_info[mixer_ch].switch_name)
+			    ! ak->adc_info[mixer_ch].switch_name) {
Quoted 8 lines

Review

Quoted 6 lines
(quoted diff) +3 -1
 				knew.name = "Capture Switch";
-			else
+				knew.index = mixer_ch + ak->idx_offset * 2;
+			} else {
 				knew.name = ak->adc_info[mixer_ch].switch_name;
+			}

Don't put braces around a single-line if.

I found it ugly to have braces around the two line if branch but no braces around the one line else branch. But I fixed it anyway.

---

alsa-kernel/i2c/other/ak4xxx-adda.c +83 -2
diff -ur alsa-driver-hg20060929.orig/alsa-kernel/i2c/other/ak4xxx-adda.c alsa-driver-hg20060929.p1/alsa-kernel/i2c/other/ak4xxx-adda.c
@@ -513,6 +513,66 @@
 	return change;
 }
 
+#define AK5365_NUM_INPUTS 5
+
+static int ak4xxx_capture_source_info(struct snd_kcontrol *kcontrol,
+				      struct snd_ctl_elem_info *uinfo)
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int mixer_ch = AK_GET_SHIFT(kcontrol->private_value);
+	const char **input_names;
+	int  num_names, idx;
+
+	input_names = ak->adc_info[mixer_ch].input_names;
+
+	num_names = 0;
+	while (num_names < AK5365_NUM_INPUTS && input_names[num_names])
+		++num_names;
+	
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = num_names;
+	idx = uinfo->value.enumerated.item;
+	if (idx >= num_names)
+		return -EINVAL;
+	strncpy(uinfo->value.enumerated.name, input_names[idx],
+		sizeof(uinfo->value.enumerated.name));
+	return 0;
+}
+
+static int ak4xxx_capture_source_get(struct snd_kcontrol *kcontrol,
+				     struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int chip = AK_GET_CHIP(kcontrol->private_value);
+	int addr = AK_GET_ADDR(kcontrol->private_value);
+	int mask = AK_GET_MASK(kcontrol->private_value);
+	unsigned char val;
+
+	val = snd_akm4xxx_get(ak, chip, addr) & mask;
+	ucontrol->value.enumerated.item[0] = val;
+	return 0;
+}
+
+static int ak4xxx_capture_source_put(struct snd_kcontrol *kcontrol,
+				     struct snd_ctl_elem_value *ucontrol)
+{
+	struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol);
+	int chip = AK_GET_CHIP(kcontrol->private_value);
+	int addr = AK_GET_ADDR(kcontrol->private_value);
+	int mask = AK_GET_MASK(kcontrol->private_value);
+	unsigned char oval, val;
+
+	oval = snd_akm4xxx_get(ak, chip, addr);
+	val = oval & ~mask;
+	val |= ucontrol->value.enumerated.item[0] & mask;
+	if (val != oval) {
+		snd_akm4xxx_write(ak, chip, addr, val);
+		return 1;
+	}
+	return 0;
+}
+
 /*
  * build AK4xxx controls
  */
@@ -647,9 +707,10 @@
 
 		if (ak->type == SND_AK5365 && (idx % 2) == 0) {
 			if (! ak->adc_info || 
-			    ! ak->adc_info[mixer_ch].switch_name)
+			    ! ak->adc_info[mixer_ch].switch_name) {
 				knew.name = "Capture Switch";
-			else
+				knew.index = mixer_ch + ak->idx_offset * 2;
+			} else
 				knew.name = ak->adc_info[mixer_ch].switch_name;
 			knew.info = ak4xxx_switch_info;
 			knew.get = ak4xxx_switch_get;
@@ -662,6 +723,26 @@
 			err = snd_ctl_add(ak->card, snd_ctl_new1(&knew, ak));
 			if (err < 0)
 				return err;
+
+			memset(&knew, 0, sizeof(knew));
+			knew.name = ak->adc_info[mixer_ch].selector_name;
+			if (! knew.name) {
+				knew.name = "Capture Channel";
+				knew.index = mixer_ch + ak->idx_offset * 2;
+			}
+
+			knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
+			knew.info = ak4xxx_capture_source_info;
+			knew.get = ak4xxx_capture_source_get;
+			knew.put = ak4xxx_capture_source_put;
+			knew.access = 0;
+			/* input selector control: reg. 1, bits 0-2.
+			 * mis-use 'shift' to pass mixer_ch */
+			knew.private_value
+				= AK_COMPOSE(idx/2, 1, mixer_ch, 0x07);
+			err = snd_ctl_add(ak->card, snd_ctl_new1(&knew, ak));
+			if (err < 0)
+				return err;
 		}
 
 		idx += num_stereo;
alsa-kernel/include/ak4xxx-adda.h +2 -0
diff -ur alsa-driver-hg20060929.orig/alsa-kernel/include/ak4xxx-adda.h alsa-driver-hg20060929.p1/alsa-kernel/include/ak4xxx-adda.h
@@ -50,6 +50,8 @@
 	char *name;		/* capture gain volume label */
 	char *switch_name;	/* capture switch */
 	unsigned int num_channels;
+	char *selector_name;	/* capture source select label */
+	const char **input_names; /* capture source names (NULL terminated) */
 };
 
 struct snd_akm4xxx {
alsa-kernel/pci/ice1712/revo.c +9 -1
diff -ur alsa-driver-hg20060929.orig/alsa-kernel/pci/ice1712/revo.c alsa-driver-hg20060929.p1/alsa-kernel/pci/ice1712/revo.c
@@ -107,11 +107,19 @@
 	AK_DAC("PCM Rear Playback Volume", 2),
 };
 
+static const char *revo51_adc_input_names[] = {
+	"Mic",
+	"Line",
+	"CD",
+	NULL
+};
+
 static struct snd_akm4xxx_adc_channel revo51_adc[] = {
 	{
 		.name = "PCM Capture Volume",
 		.switch_name = "PCM Capture Switch",
-		.num_channels = 2
+		.num_channels = 2,
+		.input_names = revo51_adc_input_names
 	},
 };
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#4 lore raw

Re: [PATCH try2 1/2] enable capture from line-in and CD on Revolution 5.1

At Wed, 4 Oct 2006 12:18:47 +0100,

Quoted 9 lines · Jochen Voss

Enable capture from line-in and CD on the Revolution 5.1 card.

This patch adds support for switching between the 5 input channels of the AK5365 ADC and modifies the Revolution 5.1 driver to make use of this facility. Previously the capture channel was fixed to channel 0 (microphone on the Revolution 5.1 card).

Thanks, both patches are applied to HG tree now.

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +1 -1
 		if (ak->type == SND_AK5365 && (idx % 2) == 0) {
 			if (! ak->adc_info || 
-			    ! ak->adc_info[mixer_ch].switch_name)
+			    ! ak->adc_info[mixer_ch].switch_name) {
Quoted 8 lines

alsa-kernel/i2c/other/ak4xxx-adda.c

Quoted 6 lines
alsa-kernel/i2c/other/ak4xxx-adda.c +3 -1
 				knew.name = "Capture Switch";
-			else
+				knew.index = mixer_ch + ak->idx_offset * 2;
+			} else {
 				knew.name = ak->adc_info[mixer_ch].switch_name;
+			}

Don't put braces around a single-line if.

Quoted 2 lines

I found it ugly to have braces around the two line if branch but no braces around the one line else branch. But I fixed it anyway.

Yeah, some styles are not my personal preference, too, but a rule is a rule. The only reason that it exists is to follow it :)

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#5 lore raw

Re: [PATCH try2 1/2] enable capture from line-in and CD on Revolution 5.1

Hi Takashi,

Quoted 1 line · Takashi Iwai

Thanks, both patches are applied to HG tree now.

Great, thanks a lot!

I tried to get the headphone output working, but to no avail. Until now I tried the following:

1) I tried setting each and every GPIO line to 1 and to 0. Nothing helped.

2) The DAC actually has 8 channels which looks like a waste for a 5.1 card, so I thought that maybe the last two channels are for the headphone output (they actually look connected to something on the board). Optimistically I tried to add a volume control for these two extra channels and turned up the volume, but there was still no output.

3) I tried to combine 1) and 2), i.e. having the volume up for channels 7 and 8 and then to play with the GPIO pins. Still no success.

Do you have any idea what else I could try? How do other, similar cards switch between speakers and headphone?

Many thanks,
Jochen

Signature · 1 line
http://seehuhn.de/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#6 lore raw

Re: [PATCH try2 1/2] enable capture from line-in and CD on Revolution 5.1

At Wed, 4 Oct 2006 17:22:38 +0100,

Quoted 20 lines · Jochen Voss

Hi Takashi,

Quoted 1 line · Takashi Iwai

Thanks, both patches are applied to HG tree now.

Great, thanks a lot!

I tried to get the headphone output working, but to no avail. Until now I tried the following:

1) I tried setting each and every GPIO line to 1 and to 0. Nothing helped.

2) The DAC actually has 8 channels which looks like a waste for a 5.1 card, so I thought that maybe the last two channels are for the headphone output (they actually look connected to something on the board). Optimistically I tried to add a volume control for these two extra channels and turned up the volume, but there was still no output.

Quoted 6 lines

3) I tried to combine 1) and 2), i.e. having the volume up for channels 7 and 8 and then to play with the GPIO pins. Still no success.

Do you have any idea what else I could try? How do other, similar cards switch between speakers and headphone?

IIRC revo 7.1 has no h/w control for the headphone. So I supposed that revo 5.1 is same, too, but it seems different.

Can you check which codec the headphone jack is connected to?

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#7 lore raw

PATCH 2/2 enable the analog loopback of the Revolution 5.1

In reply to Jochen Voss

Enable the analog loopback of the Revolution 5.1 card.

This patch adds support for the PT2258 volume controller and modifies the Revolution 5.1 driver to make use of this facility. This allows to control the analog loopback of the card.

alsa-kernel/i2c/Makefile +1 -0
diff -ur -x sound -x Modules.symvers -x Makefile.conf alsa-driver-hg20060929.p1/alsa-kernel/i2c/Makefile alsa-driver-hg20060929.p2/alsa-kernel/i2c/Makefile
@@ -16,3 +16,4 @@
 # Toplevel Module Dependency
 obj-$(CONFIG_SND_INTERWAVE_STB) += snd-tea6330t.o snd-i2c.o
 obj-$(CONFIG_SND_ICE1712) += snd-cs8427.o snd-i2c.o
+obj-$(CONFIG_SND_ICE1724) += snd-i2c.o
alsa-kernel/i2c/other/Makefile +2 -2
diff -ur -x sound -x Modules.symvers -x Makefile.conf alsa-driver-hg20060929.p1/alsa-kernel/i2c/other/Makefile alsa-driver-hg20060929.p2/alsa-kernel/i2c/other/Makefile
@@ -6,11 +6,11 @@
 snd-ak4114-objs := ak4114.o
 snd-ak4117-objs := ak4117.o
 snd-ak4xxx-adda-objs := ak4xxx-adda.o
+snd-pt2258-objs := pt2258.o
 snd-tea575x-tuner-objs := tea575x-tuner.o
 
 # Module Dependency
 obj-$(CONFIG_SND_PDAUDIOCF) += snd-ak4117.o
 obj-$(CONFIG_SND_ICE1712) += snd-ak4xxx-adda.o
-obj-$(CONFIG_SND_ICE1724) += snd-ak4xxx-adda.o
-obj-$(CONFIG_SND_ICE1724) += snd-ak4114.o
+obj-$(CONFIG_SND_ICE1724) += snd-ak4114.o snd-ak4xxx-adda.o snd-pt2258.o
 obj-$(CONFIG_SND_FM801_TEA575X) += snd-tea575x-tuner.o
alsa-kernel/i2c/other/pt2258.c +233 -0

233 lines not on this page · raw message

alsa-kernel/include/pt2258.h +37 -0
diff -ur -x sound -x Modules.symvers -x Makefile.conf alsa-driver-hg20060929.p1/alsa-kernel/include/pt2258.h alsa-driver-hg20060929.p2/alsa-kernel/include/pt2258.h
@@ -0,0 +1,37 @@
+/*
+ *   ALSA Driver for the PT2258 volume controller.
+ *
+ *	Copyright (c) 2006  Jochen Voss <[email protected]>
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ */      
+
+#ifndef __SOUND_PT2258_H
+#define __SOUND_PT2258_H
+
+struct snd_pt2258 {
+	struct snd_card *card;
+	struct snd_i2c_bus *i2c_bus;
+	struct snd_i2c_device *i2c_dev;
+
+	unsigned char volume[6];
+	int mute;
+};
+
+extern int snd_pt2258_reset(struct snd_pt2258 *pt);
+extern int snd_pt2258_build_controls(struct snd_pt2258 *pt);
+
+#endif /* __SOUND_PT2258_H */
alsa-kernel/pci/ice1712/ice1712.h +14 -0
diff -ur -x sound -x Modules.symvers -x Makefile.conf alsa-driver-hg20060929.p1/alsa-kernel/pci/ice1712/ice1712.h alsa-driver-hg20060929.p2/alsa-kernel/pci/ice1712/ice1712.h
@@ -28,6 +28,7 @@
 #include <sound/i2c.h>
 #include <sound/ak4xxx-adda.h>
 #include <sound/ak4114.h>
+#include <sound/pt2258.h>
 #include <sound/pcm.h>
 #include <sound/mpu401.h>
 
@@ -381,6 +382,11 @@
 			unsigned short master[2];
 			unsigned short vol[8];
 		} phase28;
+		/* a non-standard I2C device for revo51 */
+		struct revo51_spec {
+			struct snd_i2c_device *dev;
+			struct snd_pt2258 *pt2258;
+		} revo51;
 		/* Hoontech-specific setting */
 		struct hoontech_spec {
 			unsigned char boxbits[4];
@@ -462,6 +468,14 @@
 	snd_ice1712_gpio_write(ice, mask & bits);
 }
 
+static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice,
+					      unsigned int mask)
+{
+	ice->gpio.direction &= ~mask;
+	snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
+	return  (snd_ice1712_gpio_read(ice) & mask);
+}
+
 int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice);
 
 int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *template,
alsa-kernel/pci/ice1712/revo.c +122 -10

174 lines not on this page · raw message

alsa-kernel/pci/ice1712/revo.h +4 -2
diff -ur -x sound -x Modules.symvers -x Makefile.conf alsa-driver-hg20060929.p1/alsa-kernel/pci/ice1712/revo.h alsa-driver-hg20060929.p2/alsa-kernel/pci/ice1712/revo.h
@@ -42,9 +42,11 @@
 #define VT1724_REVO_CCLK	0x02
 #define VT1724_REVO_CDIN	0x04	/* not used */
 #define VT1724_REVO_CDOUT	0x08
-#define VT1724_REVO_CS0		0x10	/* AK5365 chipselect for Rev. 5.1 */
+#define VT1724_REVO_CS0		0x10	/* AK5365 chipselect for (revo51) */
 #define VT1724_REVO_CS1		0x20	/* front AKM4381 chipselect */
-#define VT1724_REVO_CS2		0x40	/* surround AKM4355 chipselect */
+#define VT1724_REVO_CS2		0x40	/* surround AKM4355 CS (revo71) */
+#define VT1724_REVO_I2C_DATA    0x40    /* I2C: PT 2258 SDA (on revo51) */
+#define VT1724_REVO_I2C_CLOCK   0x80    /* I2C: PT 2258 SCL (on revo51) */
 #define VT1724_REVO_MUTE	(1<<22)	/* 0 = all mute, 1 = normal operation */
 
 #endif /* __SOUND_REVO_H */
i2c/other/pt2258.c +1 -0
diff -ur -x sound -x Modules.symvers -x Makefile.conf alsa-driver-hg20060929.p1/i2c/other/pt2258.c alsa-driver-hg20060929.p2/i2c/other/pt2258.c
@@ -0,0 +1 @@
+#include "../../alsa-kernel/i2c/other/pt2258.c"

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel