From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 15 15:32:07 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6162F37B408; Fri, 15 Aug 2003 15:32:07 -0700 (PDT) Received: from kazi.fit.vutbr.cz (kazi.fit.vutbr.cz [147.229.8.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4CCA43F3F; Fri, 15 Aug 2003 15:32:05 -0700 (PDT) (envelope-from cejkar@fit.vutbr.cz) Received: from kazi.fit.vutbr.cz (localhost [127.0.0.1]) by kazi.fit.vutbr.cz (8.12.9/8.12.9) with ESMTP id h7FMW3bW070383 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 16 Aug 2003 00:32:03 +0200 (CEST) Received: (from cejkar@localhost) by kazi.fit.vutbr.cz (8.12.9/8.12.5/Submit) id h7FMW3sX070382; Sat, 16 Aug 2003 00:32:03 +0200 (CEST) X-Authentication-Warning: kazi.fit.vutbr.cz: cejkar set sender to cejkar@fit.vutbr.cz using -f Date: Sat, 16 Aug 2003 00:32:03 +0200 From: Rudolf Cejka To: Orion Hodson Message-ID: <20030815223203.GA68085@fit.vutbr.cz> References: <20030625162142.W547@brain.cc.rsu.ru> <200306261609.h5QG95Rt058222@puma.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200306261609.h5QG95Rt058222@puma.icir.org> User-Agent: Mutt/1.4.1i X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) cc: hackers@freebsd.org cc: Oleg Sharoiko Subject: ASUS P4P800-VM + AD1980 (Was Re: VIA8235 + AD1980) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2003 22:32:07 -0000 Orion Hodson wrote (2003/06/26): > Oleg, Well done on working out a working fix for this problem... > ... There are some comments inline below that may help. > - Orion Hello, how did you solve it in the end? Recently, I have got my new machine with ASUS P4P800-VM with AD1980 and I came into exactly same problem with no sound. Oleg's patch was very good starting point how to get working sound and where to start ;o) > Oleg Sharoiko writes: > > ... > The gain setting method would need to check for whether the register > was the AC97_MIXEXT_SURROUND and have a specific piece of code to deal > with this case. And it seems that it has something to do with 5.2.1 AUX_OUT Options in ac97_r23.pdf, page 39. > | need some help. If I understood everything correctly than it happens > | so that the sound somehow goes to surround dac. The question that I It seems that problem is elsewhere: Manufacturers using AD1980 connect as line out rather signal SURR_OUT/HP_OUT than LINE_OUT, because of its higher power amplifiers. Important bit in Oleg's patch is HPSEL, not LOSEL (atleast in my case). And HPSEL means that SURR_OUT/HP_OUT is driven by mixer outputs instead of surround DACs. I have another machine with different problem: Output is good, however main volume is not adjusted by Master Volume (0x02) register, but by Headphone Volume (0x04) register (Monitor Volume in Aumix). It is just though, but maybe my and Oleg's machine is case 3 in 5.2.1 AUX_OUT Options and the another machine would be case 1 or 2, so that it is needed to implement checking procedure at the end of 5.2.1 AUX_OUT Options. However, I have to access the another machine and check its chipset and registers first. If there is anybody with AD1980 chip too, it would be interesting to see content of 0x00, 0x04, 0x28, and 0x38 registers and experiences with current pcm driver. > | cannot answer: why it goes to surround dac? Unfortunately I don't > | have via8235 spec. Myabe data are being put into wrong timeslots? It does not seem so. > The behaviour you are describing would be partially explained if > channel spreading were enabled in the codec (2 channels spread to 6). > This can be manually and automatically enabled (AD1980 rev 0 specs > pages 25 and 27). It does not seem to be this case. You can look at my dirty a bad patches for -current and their output (however on my machine working very well :o) in ftp://ftp.FreeBSD.cz/pub/FreeBSD-local/ad1980/ : dmesg.txt - Verbose boot log from my machine debug.txt - All reads and writes to AD1980 registers produced by printf() commands in ich_rdcd() and ich_wrcd() functions with read loop for all AD1980 registers in ad1980_patch() function during kldload/kldunoad snd_ich operation ac97_patch.c.1.1.diff: Patch function which swaps sources for LINE_OUT and SURR_OUT/HP_OUT (just change for SURR_OUT/HP_OUT is needed) and changes main volume register to Surround Volume Register ich.c.1.32.diff: Debugging output for read/write register operations ac97.h.1.13.diff: Make muting work. This is very bad solution, but correct way is too hard for now and at first we have to agree on some things before correct solution is found ac97.c.1.42.diff: Just call to ad1980_patch() added ac97_patch.h.1.1.diff: Just prototype added > Since the AD1980 is an ac97 2.3 codec and these codecs do jack sense > detection, it's probably worth checking out the ac97 2.3 spec and > writing some code to find out what the jack sense registers report as > attached. I tried many variants and register writes with channels spreading and jack sense, but without any success in this direction. Regards. -- Rudolf Cejka http://www.fit.vutbr.cz/~cejkar Brno University of Technology, Faculty of Information Technology Bozetechova 2, 612 66 Brno, Czech Republic