Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Aug 2003 00:32:03 +0200
From:      Rudolf Cejka <cejkar@fit.vutbr.cz>
To:        Orion Hodson <orion@freebsd.org>
Cc:        Oleg Sharoiko <os@rsu.ru>
Subject:   ASUS P4P800-VM + AD1980 (Was Re: VIA8235 + AD1980)
Message-ID:  <20030815223203.GA68085@fit.vutbr.cz>
In-Reply-To: <200306261609.h5QG95Rt058222@puma.icir.org>
References:  <20030625162142.W547@brain.cc.rsu.ru> <200306261609.h5QG95Rt058222@puma.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <cejkar at fit.vutbr.cz> http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66  Brno, Czech Republic



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