From owner-freebsd-multimedia@FreeBSD.ORG Sat Dec 5 00:24:50 2009 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0E1E106566B for ; Sat, 5 Dec 2009 00:24:50 +0000 (UTC) (envelope-from carl.gustavsson@bahnhofbredband.se) Received: from smtp-1.sys.kth.se (smtp-1.sys.kth.se [130.237.32.175]) by mx1.freebsd.org (Postfix) with ESMTP id EB6B98FC14 for ; Sat, 5 Dec 2009 00:24:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 185E41551FC; Sat, 5 Dec 2009 01:00:57 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-1.sys.kth.se ([127.0.0.1]) by localhost (smtp-1.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id o+ugdOBEx6DX; Sat, 5 Dec 2009 01:00:55 +0100 (CET) X-KTH-Auth: cjgu [213.100.49.247] Received: from sleipner.home.swe (c213-100-49-247.swipnet.se [213.100.49.247]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 1615C155860; Sat, 5 Dec 2009 01:00:54 +0100 (CET) Message-ID: <4B19A2B6.80803@bahnhofbredband.se> Date: Sat, 05 Dec 2009 01:00:54 +0100 From: Carl Johan Gustavsson User-Agent: Thunderbird 2.0.0.22 (X11/20090722) MIME-Version: 1.0 To: Yamagi Burmeister References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------010502020407020700020408" Cc: freebsd-multimedia@freebsd.org Subject: Re: snd_envy24ht regression in 8.0 (patch included) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 00:24:50 -0000 This is a multi-part message in MIME format. --------------010502020407020700020408 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Yamagi Burmeister wrote: > Hello, > I've got a Audiotrak Prodigy HD2 soundcard, based upon the VIA > Envy24HT-s chipset. Dmesg output is: > > pcm1: port > 0x3080-0x309f,0x3000-0x307f irq 28 at device 4.0 on pci18 > pcm1: [GIANT-LOCKED] > pcm1: [ITHREAD] > pcm1: system configuration > SubVendorID: 0x3137, SubDeviceID: 0x4154 > XIN2 Clock Source: 49.152MHz(192kHz*256) > MPU-401 UART(s) #: 1 > ADC #: 1 and SPDIF receiver connected > DAC #: 1 > Multi-track converter type: I2S(192KHz support, 24bit resolution, > ID#0x0) > S/PDIF(IN/OUT): 1/1 ID# 0x00 > GPIO(mask/dir/state): 0xfff8ff/0xdfffff/0x200700 > > /dev/sndstat shows: > > root@screw:pts/8 ~> cat /dev/sndstat > FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64) > Installed devices: > pcm0: at io 0x1800, 0x1400 irq 22 bufsz 16384 kld > snd_ich [MPSAFE] (1p:1v/1r:1v channels duplex) > pcm1: at io > 0x3080:32,0x3000:128 irq 28 [GIANT] (1p:1v/5r:1v channels duplex > default) > > In FreeBSD 7.2 it worked just like a charm but after upgrading to 8.0 > the left stereo channel is only half as loud as the right one. It can be > reproduced with either speakers and headphones. I tracked it down to a > change in revision 188480 of spicds.c, the change "fix: stupid bug with > volume control for AK4396" breaks volume control for me. The attached > patch fixes the problem by reverting the specific change but I guess > it'll break some other cards again. > > An other possible work around is to double the volume of the left > channel via the mixer. > > Ciao, > Yamagi > Hi, That patch was partly correct but it did only fix the problem on the right channel, the left one exhibits a similar error. Logical operators in case labels does not work well in C, or at least not as the original writer expected :) Please revert your changes and try the attached patch. -cjg --------------010502020407020700020408 Content-Type: text/plain; name="spicds.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="spicds.diff" Index: spicds.c =================================================================== --- spicds.c (revision 200112) +++ spicds.c (working copy) @@ -283,7 +283,8 @@ case SPICDS_TYPE_WM8770: left = left + 27; break; - case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396: + case SPICDS_TYPE_AK4381: + case SPICDS_TYPE_AK4396: left = left * 255 / 100; break; default: --------------010502020407020700020408--