From owner-freebsd-multimedia@FreeBSD.ORG Mon May 16 03:18:57 2011 Return-Path: Delivered-To: multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CBC1106566C for ; Mon, 16 May 2011 03:18:57 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from mx.nsu.ru (r2b9.nsu.ru [212.192.164.39]) by mx1.freebsd.org (Postfix) with ESMTP id D92A38FC08 for ; Mon, 16 May 2011 03:18:56 +0000 (UTC) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.69) (envelope-from ) id 1QLoKY-0000Ep-9k for multimedia@freebsd.org; Mon, 16 May 2011 10:18:50 +0700 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.14.2/8.14.2) with ESMTP id p4G3KBPv015676 for ; Mon, 16 May 2011 10:20:12 +0700 (NOVST) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.14.2/8.14.2/Submit) id p4G3K2BX015670 for multimedia@freebsd.org; Mon, 16 May 2011 10:20:02 +0700 (NOVST) (envelope-from danfe) Date: Mon, 16 May 2011 10:20:02 +0700 From: Alexey Dokuchaev To: multimedia@freebsd.org Message-ID: <20110516032002.GA94798@regency.nsu.ru> References: <20100731163218.GA39249@regency.nsu.ru> <20110515163619.GA49401@regency.nsu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110515163619.GA49401@regency.nsu.ru> User-Agent: Mutt/1.4.2.1i Cc: Subject: Re: snd_hda(4) pin routing issues 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: Mon, 16 May 2011 03:18:57 -0000 On Sun, May 15, 2011 at 11:36:19PM +0700, Alexey Dokuchaev wrote: > I've downloaded latest alsa-driver-1.0.24 sources, and apparently, they > do quite some magic in alsa-kernel/pci/hda/patch_sigmatel.c: > > 1) my sound card (8384:7690) is reported as STAC9220 on FreeBSD, but > ALSA code lists it as STAC9200; -- can that be a problem? > > 2) my codec seems reference one, and ALSA applies the following pin > configuration (in addition to other things): > > static unsigned int ref9200_pin_configs[8] = { > 0x01c47010, 0x01447010, 0x0221401f, 0x01114010, > 0x02a19020, 0x01a19021, 0x90100140, 0x01813122, > }; > > These values vaguely match what I see from our snd_hda(4), but I am > not sure how to properly apply them via device hints. Perhaps I was a bit too fast with reading the ALSA sources before carefully comparing HDA information dumps. This is what our snd_hda(4) reports about pins (only pin config, association, and sequence numbers quoted for better readability): nid 8 0x01c5e030 as 3 seq 0 nid 9 0x01451012 as 1 seq 2 nid 13 0x02214011 as 1 seq 1 nid 14 0x01014010 as 1 seq 0 nid 15 0x01813021 as 2 seq 1 nid 16 0x02a19020 as 2 seq 0 nid 17 0x50170013 as 1 seq 3 nid 18 0x90330022 as 2 seq 2 And this is excerpt from /proc/asound/card0/codec#0 for the same pins (again, concised by hand for better readability): Node 0x08 pincap 0x00010024 pin default 0x01c5e030 defas 0x3 seq 0x0 Node 0x09 pincap 0x00000010 pin default 0x00000010 defas 0x1 seq 0x2 Node 0x0d pincap 0x0000003f pin default 0x02214011 defas 0x1 seq 0x1 Node 0x0e pincap 0x0000003f pin default 0x01014010 defas 0x1 seq 0x0 Node 0x0f pincap 0x00000037 pin default 0x01813021 defas 0x2 seq 0x1 Node 0x10 pincap 0x00001737 pin default 0x02a19020 defas 0x2 seq 0x0 Node 0x11 pincap 0x00000010 pin default 0x50170013 defas 0x1 seq 0x3 Node 0x12 pincap 0x00000020 pin default 0x90330022 defas 0x2 seq 0x2 As you can see, all values match for both FreeBSD and ALSA. However, snd_hda(4) for some reason is unable to establish correct routing: hdac0: 3 associations found: hdac0: Association 0 (1) out: hdac0: Pin nid=14 seq=0 hdac0: Pin nid=13 seq=1 hdac0: Pin nid=9 seq=2 hdac0: Association 1 (2) in: hdac0: Pin nid=16 seq=0 hdac0: Pin nid=15 seq=1 hdac0: Pin nid=18 seq=2 hdac0: Association 2 (3) in: hdac0: Pin nid=8 seq=0 hdac0: Tracing association 0 (1) hdac0: Pin 14 traced to DAC 2 hdac0: Unable to trace pin 13 seq 1 with min nid 0 <--- WHY? hdac0: Unable to trace pin 14 seq 0 with min nid 3 <--- WHY? hdac0: Association 0 (1) trace failed Correctly established associations (per ALSA) can be seen here: http://193.124.210.26/hda-routing.svg Any ideas? ./danfe