Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 May 2004 12:24:10 -0400 (EDT)
From:      Mikhail Teterin <mi@aldan.algebra.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        FUKAUMI Naoki <naoki@fukaumi.org>
Subject:   kern/66422: no sound on modern Sony Vaio (PCG-TR*) [patch]
Message-ID:  <200405091624.i49GOAK5068504@aldan.algebra.com>
Resent-Message-ID: <200405091630.i49GUNbm018057@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         66422
>Category:       kern
>Synopsis:       no sound on modern Sony Vaio (PCG-TR*) [patch]
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 09 09:30:23 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Mikhail Teterin
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
Virtual Estates, Inc.
>Environment:
System: FreeBSD aldan.algebra.com 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Mon Mar 29 19:54:25 EST 2004 mi@aldan.algebra.com:/home/obj/oh/src/sys/DEBUG i386

>Description:

	The laptop uses Intel's Centrino for everything. The sound card
	is recognized by the snd_ich module, and all of the
	sound-producing programs work, but no sound ever comes out.

>How-To-Repeat:

	Boot a Vaio-TR laptop.

		kldload snd_ich
		mpg123 anything.mp3

	mpg123 honestly decodes, but there is no sound in the speakers,
	nor in the headphones.

>Fix:

	The idea is from FUKAUMI Naoki, whose e-mail I found at

		http://www.unixmagic.org/ml/netbsd/200308/msg00011.html

	reading it was impossible for me, except for the patches :-)

	The ach97.c-patch was not directly applicable to FreeBSD, but
	the idea to write AC97_POWER_EAMP while initializing turned out
	to be applicable.

	The sound on my PCG-TR2/B now works, although pushing the
	sound-controlling buttons on the laptop's keyboard and on the
	lid still has no effect.

	I'm sure, there were good reasons to conditionalize this
	based on ``codec->flags & AC97_F_EAPD_INV'', so my patch will,
	probably, break sound on some other machine. Someone with
	knowledge of the specs should carefully examine it...

	The patch is slightly bigger than it absolutely needs to be,
	because I'm replacing the 0x8000 constant with AC97_POWER_EAMP
	borrowed from NetBSD.

===================================================================
RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.h,v
retrieving revision 1.15
diff -U2 -r1.15 ac97.h
--- sys/dev/sound/pcm/ac97.h	7 Sep 2003 16:28:03 -0000	1.15
+++ sys/dev/sound/pcm/ac97.h	9 May 2004 16:21:35 -0000
@@ -63,4 +63,5 @@
 #define		AC97_POWER_STATUS	(AC97_POWER_ADC | AC97_POWER_DAC | \
 					 AC97_POWER_REF | AC97_POWER_ANL )
+#define AC97_POWER_EAMP	0x8000
 #define AC97_REGEXT_ID		0x28
 #define 	AC97_EXTCAP_VRA		(1 << 0)
===================================================================
RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.c,v
retrieving revision 1.50
diff -U2 -r1.50 ac97.c
--- sys/dev/sound/pcm/ac97.c	23 Jan 2004 16:38:54 -0000	1.50
+++ sys/dev/sound/pcm/ac97.c	9 May 2004 16:21:35 -0000
@@ -546,7 +546,7 @@
 	}
 
-	ac97_wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000);
+	ac97_wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? AC97_POWER_EAMP : 0x0000);
 	ac97_reset(codec);
-	ac97_wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000);
+	ac97_wrcd(codec, AC97_REG_POWER, AC97_POWER_EAMP);
 
 	i = ac97_rdcd(codec, AC97_REG_RESET);
@@ -661,7 +661,7 @@
 	}
 
-	ac97_wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000);
+	ac97_wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? AC97_POWER_EAMP : 0x0000);
 	ac97_reset(codec);
-	ac97_wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000);
+	ac97_wrcd(codec, AC97_REG_POWER, AC97_POWER_EAMP);
 
 	if (!codec->noext) {
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405091624.i49GOAK5068504>