From jsa@wickedmachine.net  Sun Jun 14 02:20:04 2009
Return-Path: <jsa@wickedmachine.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 34A5C106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Jun 2009 02:20:03 +0000 (UTC)
	(envelope-from jsa@wickedmachine.net)
Received: from shaitan.wickedmachine.net (tn-67-232-80-18.dhcp.embarqhsd.net [67.232.80.18])
	by mx1.freebsd.org (Postfix) with ESMTP id E691B8FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Jun 2009 02:20:02 +0000 (UTC)
	(envelope-from jsa@wickedmachine.net)
Received: from shaitan.wickedmachine.net (localhost [127.0.0.1])
	by shaitan.wickedmachine.net (8.14.3/8.14.3) with ESMTP id n5E2K2Jn002610;
	Sat, 13 Jun 2009 22:20:02 -0400 (EDT)
	(envelope-from jsa@wickedmachine.net)
Message-Id: <1244946002.2329@shaitan.wickedmachine.net>
Date: Sat, 13 Jun 2009 22:20:02 -0400
From: "Joseph S. Atkinson" <jsa@wickedmachine.net>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Cc: ariff@freebsd.org
Subject: Sound (mostly) broken w/ snd_hda on -CURRENT
X-Send-Pr-Version: gtk-send-pr 0.4.9 
X-GNATS-Notify:

>Number:         135556
>Category:       kern
>Synopsis:       [sound] [snd_hda] Sound (mostly) broken w/ snd_hda on -CURRENT
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 14 02:30:01 UTC 2009
>Closed-Date:    Mon Jul 27 09:50:54 UTC 2009
>Last-Modified:  Mon Jul 27 09:50:54 UTC 2009
>Originator:     Joseph S. Atkinson
>Release:        FreeBSD 8.0-CURRENT amd64
>Organization:
>Environment:


System: FreeBSD 8.0-CURRENT #0 r194047: Fri Jun 12 04:13:43 EDT 2009
    jsa@shaitan.wickedmachine.net:/usr/obj/usr/src/sys/SHAITAN



>Description:


snd_hda will not play audio when loaded from /boot/loader.conf

I've read the lists about this, and I do have a video card w/ and HDMI port that is detect as hdac0 first. Setting hw.snd.default_unti=1 has no effect, though I can confirm the sysctl is being set properly.

The only way I can get audio is by `kldload snd_hda` after boot, which makes the devices discover in reverse order and sets the ATI SB600 as hdac0 and pcm0.

The detection order seems like it needs to be stabilized so devices are in predictable places unless hotplugged.

Here's output from the last kld_load.

hdac0: <ATI SB600 High Definition Audio Controller> mem 0xfe024000-0xfe027fff irq 16 at device 20.2 on pci0
hdac0: HDA Driver Revision: 20090608_0134
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC888
hdac1: <ATI RV730 High Definition Audio Controller> mem 0xfdffc000-0xfdffffff irq 19 at device 0.1 on pci1
hdac1: HDA Driver Revision: 20090608_0134
hdac1: [ITHREAD]
hdac1: HDA Codec #0: ATI R6xx HDMI
pcm0: <HDA Realtek ALC888 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC888 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC888 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm3: <HDA ATI R6xx HDMI PCM #0 Digital> at cad 0 nid 1 on hdac1


>How-To-Repeat:


Boot w/ snd_hda_load="YES" (loader.conf), no sound through desired device.

Boot w/ snd_hda_load="YES" (loader.conf) and hw.snd.default_unit=1 (sysctl.conf), still no sound through desired device.

Boot without snd_hda_load, then kldload snd_hda after boot. Sound plays through desired device.


>Fix:





>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-multimedia 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jun 14 02:54:06 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135556 

From: "Joseph S. Atkinson" <jsa.bsd@gmail.com>
To: bug-followup@FreeBSD.org, Ariff Abdullag <ariff@FreeBSD.org>
Cc:  
Subject: Re: kern/135556: [snd_hda] Sound (mostly) broken w/ snd_hda on -CURRENT
Date: Mon, 22 Jun 2009 04:17:07 -0400

 What I am suspecting is going on here is that sound will only pipe through pcm0 
 and that hw.snd.default_unit may be honored, but meaningless.
 
 I'm doing as much testing on this as I can with what I have.
 
 So far, sound only comes up when I manually kldload snd_hda still. Doing so 
 makes the AL888 come up as hdac0 and pcm0 through pcm2 and the R6xx HDMI port as 
 hdac1/pcm3.
 
 I can switch hw.snd.default_unit around however, and sound will stop on pcm0 if 
 I point it at another pcm device. There may be sound going there, but I don't 
 have speakers on those ports yet (plan to test that tomorrow).
 
 I am thinking that if sound isn't on pcm0, then it goes nowhere. So booting with 
 snd_hda_load="YES" forces detection of the HDMI port first, making it pcm0, then 
 the sysctl sets it to pcm1. But via my suspected bug, the signal isn't making it 
 to pcm1, because it is only working for pcm0.
 
 Tomorrow, I will test this theory by hooking up speakers to another AL888 sound 
 jack. If I get no sound from the pcm1 device  on AL888 as hdac0, it should be an 
 indicator that the problem is just some misdirection for devices other than pcm0.
 
 If you know a way of disabling the HDMI port, preventing it from even being 
 probed, it might help me. Doing so would force snd_hda to detect AL888 only and 
 other factors affecting sound-on-boot could be eliminated.
 
 I will email again tomorrow when I test my pcm1 device, and am willing to try 
 any and all patches you may have here.

From: Alexander Motin <mav@FreeBSD.org>
To: bug-followup@FreeBSD.org, jsa@wickedmachine.net
Cc:  
Subject: Re: kern/135556: [snd_hda] Sound (mostly) broken w/ snd_hda on -CURRENT
Date: Tue, 14 Jul 2009 11:22:14 +0300

 > If you know a way of disabling the HDMI port, preventing it from even
 > being probed, it might help me.
 
 To stop some pin from being used you can boot with verbose messages
 enabled to get pin node ID of HDMI codec and then add to loader.conf
 something like:
 hint.hdac.0.cad0.nid%d.config="as=0"
 
 -- 
 Alexander Motin

From: "Joseph S. Atkinson" <jsa.bsd@gmail.com>
To: Alexander Motin <mav@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/135556: [snd_hda] Sound (mostly) broken w/ snd_hda on -CURRENT
Date: Fri, 17 Jul 2009 16:44:11 -0400

 Alexander Motin wrote:
 >> If you know a way of disabling the HDMI port, preventing it from even
 >> being probed, it might help me.
 > 
 > To stop some pin from being used you can boot with verbose messages
 > enabled to get pin node ID of HDMI codec and then add to loader.conf
 > something like:
 > hint.hdac.0.cad0.nid%d.config="as=0"
 > 
 
 I got a chance to play with this today. I couldn't get the hardware to disable, 
 but the issue appears to have "evaporated". My audio is working fine now with 
 nothing more than hw.pcm.default_unit=1 in sysctl.conf again.
 
 This PR can now be closed.
 
 Thanks mav.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: joel 
State-Changed-When: Mon Jul 27 09:50:15 UTC 2009 
State-Changed-Why:  
Close on submitters request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135556 
>Unformatted:
