From nobody@FreeBSD.org  Tue May 13 19:52:24 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 C57DD1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 May 2008 19:52:24 +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 B48F98FC21
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 May 2008 19:52:24 +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 m4DJpHmS009422
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 May 2008 19:51:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m4DJpH3h009421;
	Tue, 13 May 2008 19:51:17 GMT
	(envelope-from nobody)
Message-Id: <200805131951.m4DJpH3h009421@www.freebsd.org>
Date: Tue, 13 May 2008 19:51:17 GMT
From: Juan Jos del Ro <juanjose@simpleoption.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] snd_cmi driver now supports "C-Media INC. USB Sound Device" a.k.a. CMI120
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: keramida

>Number:         123640
>Category:       kern
>Synopsis:       [patch] [snd_cmi] add support of "C-Media INC. USB Sound Device" a.k.a. CMI120
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    ariff
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 13 20:00:13 UTC 2008
>Closed-Date:    Mon Feb 02 04:55:06 UTC 2009
>Last-Modified:  Mon Feb  2 05:00:15 UTC 2009
>Originator:     Juan Jos del Ro
>Release:        7.0-RELEASE
>Organization:
Simple Option S.L.
>Environment:
FreeBSD galileo.simpleoption.com 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Thu May  1 15:21:50 CEST 2008     root@galileo.simpleoption.com:/usr/src/sys/i386/compile/GENERIC  i386
>Description:
I plug my USB Speakers in FreeBSD and no pcm device is created.

Grep'd dump of usbdevs -v :

Controller /dev/usb1:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x0000), rev 1.00
 port 1 addr 2: full speed, power 500 mA, config 1, USB Sound Device(0x0103), C-Media INC.(0x0d8c), rev 0.10
 port 2 powered
>How-To-Repeat:
Plug in the speakers in a system using 7.0-RELEASE
>Fix:
I have patched sys/dev/sound/pci/cmi.c adding my DEVICE ID to the list of supported devices. The patch is attached to this PR.

Just load the patched module, and plug in the USB. If it's already plugged, unplug and plug it again.

Patch attached with submission follows:

--- cmi.c~	2008-05-13 21:35:37.000000000 +0200
+++ cmi.c	2008-05-13 21:35:04.000000000 +0200
@@ -60,6 +60,7 @@
 #define CMI8338B_PCI_ID   0x010113f6
 #define CMI8738_PCI_ID    0x011113f6
 #define CMI8738B_PCI_ID   0x011213f6
+#define CMI120_USB_ID     0x01030d8c
 
 /* Buffer size max is 64k for permitted DMA boundaries */
 #define CMI_DEFAULT_BUFSZ      16384
@@ -916,6 +917,9 @@
 	case CMI8738B_PCI_ID:
 		device_set_desc(dev, "CMedia CMI8738B");
 		return BUS_PROBE_DEFAULT;
+	case CMI120_USB_ID:
+	        device_set_desc(dev, "CMedia CMI120");
+	        return BUS_PROBE_DEFAULT;
 	default:
 		return ENXIO;
 	}


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ariff 
Responsible-Changed-By: ariff 
Responsible-Changed-When: Thu May 15 12:09:59 UTC 2008 
Responsible-Changed-Why:  
I'm taking care of this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123640 
State-Changed-From-To: open->patched 
State-Changed-By: keramida 
State-Changed-When: Sun Jan 18 04:29:58 UTC 2009 
State-Changed-Why:  
I have committed the patch, after a request by Ariff. 
We will merge the patch to the stable branches after 
it settles for a couple of weeks into CURRENT, or even 
earlier if Ariff approves the MFC. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/123640: commit references a PR
Date: Sun, 18 Jan 2009 04:29:53 +0000 (UTC)

 Author: keramida (doc committer)
 Date: Sun Jan 18 04:29:42 2009
 New Revision: 187375
 URL: http://svn.freebsd.org/changeset/base/187375
 
 Log:
   Add support for CMedia CMI120.
   
   PR:		kern/123640
   Approved by:	ariff
   MFC after:	2 weeks
 
 Modified:
   head/sys/dev/sound/pci/cmi.c
 
 Modified: head/sys/dev/sound/pci/cmi.c
 ==============================================================================
 --- head/sys/dev/sound/pci/cmi.c	Sat Jan 17 23:01:40 2009	(r187374)
 +++ head/sys/dev/sound/pci/cmi.c	Sun Jan 18 04:29:42 2009	(r187375)
 @@ -60,6 +60,7 @@ SND_DECLARE_FILE("$FreeBSD$");
  #define CMI8338B_PCI_ID   0x010113f6
  #define CMI8738_PCI_ID    0x011113f6
  #define CMI8738B_PCI_ID   0x011213f6
 +#define CMI120_USB_ID     0x01030d8c
  
  /* Buffer size max is 64k for permitted DMA boundaries */
  #define CMI_DEFAULT_BUFSZ      16384
 @@ -916,6 +917,9 @@ cmi_probe(device_t dev)
  	case CMI8738B_PCI_ID:
  		device_set_desc(dev, "CMedia CMI8738B");
  		return BUS_PROBE_DEFAULT;
 +	case CMI120_USB_ID:
 +	        device_set_desc(dev, "CMedia CMI120");
 +	        return BUS_PROBE_DEFAULT;
  	default:
  		return ENXIO;
  	}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/123640: commit references a PR
Date: Mon,  2 Feb 2009 04:48:52 +0000 (UTC)

 Author: keramida (doc committer)
 Date: Mon Feb  2 04:48:32 2009
 New Revision: 187997
 URL: http://svn.freebsd.org/changeset/base/187997
 
 Log:
   MFC 187375 from /head
   
   Add support for CMedia CMI120.
   
   PR:           kern/123640
   Approved by:  ariff
 
 Modified:
   stable/7/sys/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
   stable/7/sys/dev/ath/ath_hal/   (props changed)
   stable/7/sys/dev/cxgb/   (props changed)
   stable/7/sys/dev/sound/pci/cmi.c
 
 Modified: stable/7/sys/dev/sound/pci/cmi.c
 ==============================================================================
 --- stable/7/sys/dev/sound/pci/cmi.c	Mon Feb  2 03:34:40 2009	(r187996)
 +++ stable/7/sys/dev/sound/pci/cmi.c	Mon Feb  2 04:48:32 2009	(r187997)
 @@ -60,6 +60,7 @@ SND_DECLARE_FILE("$FreeBSD$");
  #define CMI8338B_PCI_ID   0x010113f6
  #define CMI8738_PCI_ID    0x011113f6
  #define CMI8738B_PCI_ID   0x011213f6
 +#define CMI120_USB_ID     0x01030d8c
  
  /* Buffer size max is 64k for permitted DMA boundaries */
  #define CMI_DEFAULT_BUFSZ      16384
 @@ -916,6 +917,9 @@ cmi_probe(device_t dev)
  	case CMI8738B_PCI_ID:
  		device_set_desc(dev, "CMedia CMI8738B");
  		return BUS_PROBE_DEFAULT;
 +	case CMI120_USB_ID:
 +	        device_set_desc(dev, "CMedia CMI120");
 +	        return BUS_PROBE_DEFAULT;
  	default:
  		return ENXIO;
  	}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: keramida 
State-Changed-When: Mon Feb 2 04:54:02 UTC 2009 
State-Changed-Why:  
Merged to stable/7 [r187997] and stable/6 [r187998]. 

Thanks for the patch :-) 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/123640: commit references a PR
Date: Mon,  2 Feb 2009 04:53:49 +0000 (UTC)

 Author: keramida (doc committer)
 Date: Mon Feb  2 04:53:39 2009
 New Revision: 187998
 URL: http://svn.freebsd.org/changeset/base/187998
 
 Log:
   MFC 187375 from /head
   
   Add support for CMedia CMI120.
   
   PR:           kern/123640
   Approved by:  ariff
 
 Modified:
   stable/6/sys/   (props changed)
   stable/6/sys/contrib/pf/   (props changed)
   stable/6/sys/dev/cxgb/   (props changed)
   stable/6/sys/dev/sound/pci/cmi.c
 
 Modified: stable/6/sys/dev/sound/pci/cmi.c
 ==============================================================================
 --- stable/6/sys/dev/sound/pci/cmi.c	Mon Feb  2 04:48:32 2009	(r187997)
 +++ stable/6/sys/dev/sound/pci/cmi.c	Mon Feb  2 04:53:39 2009	(r187998)
 @@ -58,6 +58,7 @@ SND_DECLARE_FILE("$FreeBSD$");
  #define CMI8338B_PCI_ID   0x010113f6
  #define CMI8738_PCI_ID    0x011113f6
  #define CMI8738B_PCI_ID   0x011213f6
 +#define CMI120_USB_ID     0x01030d8c
  
  /* Buffer size max is 64k for permitted DMA boundaries */
  #define CMI_DEFAULT_BUFSZ      16384
 @@ -822,6 +823,9 @@ cmi_probe(device_t dev)
  	case CMI8738B_PCI_ID:
  		device_set_desc(dev, "CMedia CMI8738B");
  		return BUS_PROBE_DEFAULT;
 +	case CMI120_USB_ID:
 +	        device_set_desc(dev, "CMedia CMI120");
 +	        return BUS_PROBE_DEFAULT;
  	default:
  		return ENXIO;
  	}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
