From owner-freebsd-bugs@FreeBSD.ORG Sun May 9 09:30:25 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65C9D16A4D2 for ; Sun, 9 May 2004 09:30:25 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C51243D45 for ; Sun, 9 May 2004 09:30:24 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i49GUNoA018060 for ; Sun, 9 May 2004 09:30:23 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i49GUNbm018057; Sun, 9 May 2004 09:30:23 -0700 (PDT) (envelope-from gnats) Resent-Date: Sun, 9 May 2004 09:30:23 -0700 (PDT) Resent-Message-Id: <200405091630.i49GUNbm018057@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mikhail Teterin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48E3716A4CE for ; Sun, 9 May 2004 09:24:19 -0700 (PDT) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F04A43D4C for ; Sun, 9 May 2004 09:24:18 -0700 (PDT) (envelope-from mi@aldan.algebra.com) Received: from aldan.algebra.com (mi@localhost [127.0.0.1]) by aldan.algebra.com (8.12.11/8.12.11) with ESMTP id i49GOBAp068505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 9 May 2004 12:24:12 -0400 (EDT) (envelope-from mi@aldan.algebra.com) Received: (from mi@localhost) by aldan.algebra.com (8.12.11/8.12.11/Submit) id i49GOAK5068504; Sun, 9 May 2004 12:24:10 -0400 (EDT) (envelope-from mi) Message-Id: <200405091624.i49GOAK5068504@aldan.algebra.com> Date: Sun, 9 May 2004 12:24:10 -0400 (EDT) From: Mikhail Teterin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: FUKAUMI Naoki Subject: kern/66422: no sound on modern Sony Vaio (PCG-TR*) [patch] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2004 16:30:25 -0000 >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: