Skip to contentSkip to conversation

Enable stereo line input for TAS codec

PATCH Applied Paul Mackerras 3 participants 3 messages Oct 29, 2006 – Oct 31, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enable stereo line input for TAS codec

Despite what the data sheet says in one place, to get stereo input from input A (line in), we have to clear the "input B monaural" bit in the ACR.

---

sound/aoa/codecs/snd-aoa-codec-tas.c +9 -4
index 2ef55a1..9de8485 100644
@@ -514,9 +514,15 @@ static int tas_snd_capture_source_put(st
 	mutex_lock(&tas->mtx);
 	oldacr = tas->acr;
 
-	tas->acr &= ~TAS_ACR_INPUT_B;
+	/*
+	 * Despite what the data sheet says in one place, the
+	 * TAS_ACR_B_MONAUREAL bit forces mono output even when
+	 * input A (line in) is selected.
+	 */
+	tas->acr &= ~(TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL);
 	if (ucontrol->value.enumerated.item[0])
-		tas->acr |= TAS_ACR_INPUT_B;
+		tas->acr |= TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL |
+		      TAS_ACR_B_MON_SEL_RIGHT;
 	if (oldacr == tas->acr) {
 		mutex_unlock(&tas->mtx);
 		return 0;
@@ -686,8 +692,7 @@ static int tas_reset_init(struct tas *ta
 	if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp))
 		goto outerr;
 
-	tas->acr |= TAS_ACR_ANALOG_PDOWN | TAS_ACR_B_MONAUREAL |
-		TAS_ACR_B_MON_SEL_RIGHT;
+	tas->acr |= TAS_ACR_ANALOG_PDOWN;
 	if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
 		goto outerr;
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

maintainer
#1 lore raw

sound/aoa/codecs/snd-aoa-codec-tas.c static int tas_snd_capture_source_put(st · line 525

Quoted 7 lines · Paul Mackerras
sound/aoa/codecs/snd-aoa-codec-tas.c +4 -1
+        */
+       tas->acr &= ~(TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL);
        if (ucontrol->value.enumerated.item[0])
-               tas->acr |= TAS_ACR_INPUT_B;
+               tas->acr |= TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL |
+                     TAS_ACR_B_MON_SEL_RIGHT; 

it seems a bit inconsequential to set the B_MON_SEL_RIGHT bit only when the microphone is selected, but leave it set afterwards. I suppose it doesn't matter in this case though since only B_MONAURAL (heh, we should fix that too, I'll make a patch to apply after yours) is buggy.

johannes

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

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

Applied
#2 lore raw
In reply to Paul Mackerras

At Sun, 29 Oct 2006 15:10:27 +1100,

Quoted 6 lines · Paul Mackerras

Despite what the data sheet says in one place, to get stereo input from input A (line in), we have to clear the "input B monaural" bit in the ACR.

Applied to ALSA tree now.
Thanks.

Takashi

Quoted 36 lines

---

sound/aoa/codecs/snd-aoa-codec-tas.c +9 -5
index 2ef55a1..9de8485 100644
@@ -514,9 +514,15 @@ static int tas_snd_capture_source_put(st
 	mutex_lock(&tas->mtx);
 	oldacr = tas->acr;
 
-	tas->acr &= ~TAS_ACR_INPUT_B;
+	/*
+	 * Despite what the data sheet says in one place, the
+	 * TAS_ACR_B_MONAUREAL bit forces mono output even when
+	 * input A (line in) is selected.
+	 */
+	tas->acr &= ~(TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL);
 	if (ucontrol->value.enumerated.item[0])
-		tas->acr |= TAS_ACR_INPUT_B;
+		tas->acr |= TAS_ACR_INPUT_B | TAS_ACR_B_MONAUREAL |
+		      TAS_ACR_B_MON_SEL_RIGHT;
 	if (oldacr == tas->acr) {
 		mutex_unlock(&tas->mtx);
 		return 0;
@@ -686,8 +692,7 @@ static int tas_reset_init(struct tas *ta
 	if (tas_write_reg(tas, TAS_REG_MCS, 1, &tmp))
 		goto outerr;
 
-	tas->acr |= TAS_ACR_ANALOG_PDOWN | TAS_ACR_B_MONAUREAL |
-		TAS_ACR_B_MON_SEL_RIGHT;
+	tas->acr |= TAS_ACR_ANALOG_PDOWN;
 	if (tas_write_reg(tas, TAS_REG_ACR, 1, &tas->acr))
 		goto outerr;
 
 
-------------------------------------------------------------------------
Quoted 9 lines

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642