[PC-BSD Commits] r1105 - pcbsd/trunk/SoundDetect

svn at pcbsd.org svn at pcbsd.org
Fri Jan 4 17:32:31 PST 2008


Author: carlos
Date: 2008-01-04 17:32:31 -0800 (Fri, 04 Jan 2008)
New Revision: 1105

Modified:
   pcbsd/trunk/SoundDetect/parse_sound.c
   pcbsd/trunk/SoundDetect/sound_detect.c
Log:
fixed major bugsrm soundcards.xml

Modified: pcbsd/trunk/SoundDetect/parse_sound.c
===================================================================
--- pcbsd/trunk/SoundDetect/parse_sound.c	2008-01-04 18:05:06 UTC (rev 1104)
+++ pcbsd/trunk/SoundDetect/parse_sound.c	2008-01-05 01:32:31 UTC (rev 1105)
@@ -21,17 +21,21 @@
 const char* GetKo(xmlDocPtr doc, xmlNodePtr cur, char* chip_id) {
 
 	xmlChar *key;
-	char tempkey[12];
+	char tempkey[10];
 	cur = cur->xmlChildrenNode;
 
 	while (cur != NULL) {
 
 		    key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
 		    sprintf(tempkey,"%s",key);
-		    xmlFree(key);
-		if(!memcmp(tempkey,chip_id,sizeof(chip_id))) return cur->name;
+		if(!memcmp(tempkey,chip_id,10)) 
+		{
+		        xmlFree(key);
+			return cur->name;
+		}
 		cur = cur->next;
 	}
+		    xmlFree(key);
     return "snd_driver";
 }
 
@@ -72,7 +76,8 @@
 	while (cur != NULL) 
 	{
 		if ((!xmlStrcmp(cur->name, (const xmlChar *)Vendor_Name))){
-		sprintf(kernelmodule,"%s",GetKo (doc, cur,chip_id));
+			sprintf(kernelmodule,"%s",GetKo (doc, cur,chip_id));
+			return kernelmodule;
 		}
 		 
 		cur = cur->next;

Modified: pcbsd/trunk/SoundDetect/sound_detect.c
===================================================================
--- pcbsd/trunk/SoundDetect/sound_detect.c	2008-01-04 18:05:06 UTC (rev 1104)
+++ pcbsd/trunk/SoundDetect/sound_detect.c	2008-01-05 01:32:31 UTC (rev 1105)
@@ -78,13 +78,26 @@
 
 				sprintf(chip_id,"0x%08x",((p->pc_device << 16) | p->pc_vendor)) ;
 				sprintf(vendor,"x%x",p->pc_vendor );
- 			        sprintf(kmodule,"%s",parse_Sound_CardXML(SOUNDCARD_XML,vendor,
-							chip_id)); 
-
+ 			        sprintf(kmodule,"%s",parse_Sound_CardXML(SOUNDCARD_XML,vendor, chip_id)); 
+				
 				if(kldload(kmodule) <0)
 				{
 					warn("\nError loading module... ");
+				}else{ 
+				  if(memcmp(kmodule,"snd_driver",10))
+				{	
+					printf("*** Great  you have sound !!***\n");
+					printf("I have found a module for your card ! is : %s.\n",kmodule);
+					printf("i just have loaded the module for you !.\n");
+				}else {
+					printf("*** This is BAD !!***\n");
+					printf("I Could not find a driver  for your card.\n");
+					printf("snd_driver was loaded..\n");
+					printf("Send us a file with the output of pciconf -lv.\n");
+					printf("Coordially the  PCBSD team");
+					}
 				}
+
 			}
 		}
 	} while (pc.status == PCI_GETCONF_MORE_DEVS);



More information about the Commits mailing list