From nobody@FreeBSD.org  Fri Jul 18 17:53:10 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D111106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jul 2008 17:53:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 6EC5A8FC23
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jul 2008 17:53:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m6IHr9FL011894
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jul 2008 17:53:09 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m6IHr9oG011893;
	Fri, 18 Jul 2008 17:53:09 GMT
	(envelope-from nobody)
Message-Id: <200807181753.m6IHr9oG011893@www.freebsd.org>
Date: Fri, 18 Jul 2008 17:53:09 GMT
From: Alex Keda <admin@lissyara.su>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cannot detect soft-modem on HDA bus
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: ariff@FreeBSD.org

>Number:         125756
>Category:       kern
>Synopsis:       [sound] [patch] cannot detect soft-modem on HDA bus
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-multimedia
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 18 18:00:03 UTC 2008
>Closed-Date:    
>Last-Modified:  Thu Dec 25 01:12:16 UTC 2008
>Originator:     Alex Keda
>Release:        8.0
>Organization:
USSR
>Environment:
FreeBSD acer.lissyara.int.otradno.ru 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Wed Jul  9 23:10:07 MSD 2008     lissyara@acer.lissyara.int.otradno.ru:/tmp/obj/usr/src/sys/main-color-console  amd64

>Description:
cannot detect modem on HDA bus
===========
hda - as a hub through which can be connected many devices (audio and
modem - which I know)

linux determined in all possible devices that are connected to hda

BSD made in the implementation wrong, because in many places there are
special control points to check - what this device.  And if this does not
sound - it is ignored that is - not universally

hence - Ariff only knows how to implement it hda code to add a modem
============
see patch for detect all HDA devices
on my machine I have sound and modem:

pcm0: HDA_DEBUG: Scanning HDA codecs [start index=0] ...
pcm0: HDA_DEBUG: Probing codec: 0
pcm0: HDA_DEBUG:    startnode=1 endnode=2
pcm0:        Vendor: 0x10ec0883
pcm0: HDA_DEBUG:    Found AFG nid=1 [startnode=1 endnode=2]
pcm0: HDA_DEBUG: Probing codec: 1
pcm0: HDA_DEBUG:    startnode=2 endnode=3
pcm0:        Vendor: 0x14f12bfa
pcm0: HDA_DEBUG:    AFG not found
pcm0: HDA_DEBUG: Probing codec: 3
pcm0: hdac_command_send_internal: TIMEOUT numcmd=1, sent=1, received=0
pcm0: hdac_command_send_internal: TIMEOUT numcmd=1, sent=1, received=0
pcm0: hdac_command_send_internal: TIMEOUT numcmd=1, sent=1, received=0
pcm0: HDA_DEBUG:    startnode=255 endnode=510
pcm0:        Vendor: 0xffffffff
>How-To-Repeat:
always
>Fix:
rewrite HDA

Patch attached with submission follows:

--- ./sys/dev/sound/pci/hda/hdac.c.orig	2008-07-15 06:34:44.000000000 +0400
+++ ./sys/dev/sound/pci/hda/hdac.c	2008-07-18 21:51:59.000000000 +0400
@@ -1813,8 +1813,9 @@
 			codec->sc = sc;
 			codec->cad = i;
 			sc->codecs[i] = codec;
-			if (hdac_probe_codec(codec) != 0)
-				break;
+		//	if (hdac_probe_codec(codec) != 0)
+		//		break;
+			hdac_probe_codec(codec);
 		}
 	}
 	/* All codecs have been probed, now try to attach drivers to them */
@@ -1855,6 +1856,8 @@
 	HDA_BOOTVERBOSE(
 		device_printf(sc->dev, "HDA_DEBUG: \tstartnode=%d endnode=%d\n",
 		    startnode, endnode);
+			device_printf(sc->dev, "	Vendor: 0x%08x\n",
+			vendorid);
 	);
 	for (i = startnode; i < endnode; i++) {
 		devinfo = hdac_probe_function(codec, i);


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-multimedia 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Jul 18 20:06:04 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

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

From: =?UTF-8?B?0JPQvtC70YPQsSDQnNCw0LrRgdC40Lw=?= <manefesto@inbox.ru>
To: bug-followup@FreeBSD.org, admin@lissyara.su
Cc:  
Subject: kern/125756: [sound] [patch] cannot detect soft-modem on HDA bus
Date: Sun, 20 Jul 2008 13:05:45 +0600

 This is a multi-part message in MIME format.
 --------------080704010406000604040903
 Content-Type: text/plain; charset=UTF-8; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I have a laptop with built modem.
 But it is not defined at boot time.
 Also, it is not visible in the list pciconf-lv.
 On how much I learned modem located on the bus hda.
 I would like to use the modem to work, so I ask the developer to
 finalize the driver hda to work correctly with other devices except for
 the sound card.
 When using a patch to hda I managed to see the modem, but to use it, I
 could not.
 
 
 --------------080704010406000604040903
 Content-Type: text/x-vcard; charset=utf-8;
  name="manefesto.vcf"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment;
  filename="manefesto.vcf"
 
 YmVnaW46dmNhcmQNCmZuO3F1b3RlZC1wcmludGFibGU6PUQwPTlDPUQwPUIwPUQwPUJBPUQx
 PTgxPUQwPUI4PUQwPUJDID1EMD05Mz1EMD1CRT1EMD1CQj1EMT04Mz1EMD1CMQ0KbjtxdW90
 ZWQtcHJpbnRhYmxlO3F1b3RlZC1wcmludGFibGU6PUQwPTkzPUQwPUJFPUQwPUJCPUQxPTgz
 PUQwPUIxOz1EMD05Qz1EMD1CMD1EMD1CQT1EMT04MT1EMD1COD1EMD1CQw0KZW1haWw7aW50
 ZXJuZXQ6bWFuZWZlc3RvQGluYm94LnJ1DQp2ZXJzaW9uOjIuMQ0KZW5kOnZjYXJkDQoNCg==
 --------------080704010406000604040903--

From: WATANABE Kazuhiro <CQG00620@nifty.ne.jp>
To: bug-followup@FreeBSD.org, admin@lissyara.su
Cc:  
Subject: Re: kern/125756: [sound] [patch] cannot detect soft-modem on HDA bus
Date: Sat, 26 Jul 2008 13:59:30 +0900

 Hi.
 
 We can treat a modem codec as one of the "function group" like the
 audio function group.  But almost all the structure of the modem
 function group is vendor specific.  To control the modem codec, we
 have to obtain the codec's specifications.
 
 But I don't know a manufacturer which offers HDA modem codec's
 datasheets.  So it is hard for us to write these codec's device
 driver.
 
 Listing a modem codec in a verbose dmesg is not so an important matter
 (because we cannot use it now).
 
 
 FYI, last year I tried to port the "slmodemd" daemon which supports
 several number of modem codecs on Linux with the ALSA driver.
 
  http://homepage2.nifty.com/dumb_show/unix/slmodemd-FreeBSD.en.html
 
 I could get some responses from the modem codec.  It generated sound
 which was similar to a dialing and negotiation tone.  But I could not
 use it as a modem at all.
 ---
 WATANABE Kazuhiro (CQG00620@nifty.ne.jp)
State-Changed-From-To: open->suspended 
State-Changed-By: mav 
State-Changed-When: Thu Dec 25 01:07:29 UTC 2008 
State-Changed-Why:  
Latest snd_hda driver detects/reports all present codecs. But due 
to lack of codec specifications, modem support implementation 
looks very problematic. 

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