rpms/system-config-soundcard/F-7 system-config-soundcard-2.0.6-usb-hack.patch, NONE, 1.1 system-config-soundcard-2.0.6-update.patch, 1.1, 1.2 system-config-soundcard-no-vendor.patch, 1.1, 1.2 system-config-soundcard.spec, 1.57, 1.58

Martin Stransky (stransky) fedora-extras-commits at redhat.com
Mon May 28 13:03:18 UTC 2007


Author: stransky

Update of /cvs/pkgs/rpms/system-config-soundcard/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11047

Modified Files:
	system-config-soundcard-2.0.6-update.patch 
	system-config-soundcard-no-vendor.patch 
	system-config-soundcard.spec 
Added Files:
	system-config-soundcard-2.0.6-usb-hack.patch 
Log Message:
update the no-vendor fix, added a hack for USB devices, disabled fix for (#227778)

system-config-soundcard-2.0.6-usb-hack.patch:

--- NEW FILE system-config-soundcard-2.0.6-usb-hack.patch ---
--- system-config-soundcard-2.0.6/src/soundcardBackend.py.usb	2007-05-28 14:24:36.000000000 +0200
+++ system-config-soundcard-2.0.6/src/soundcardBackend.py	2007-05-28 14:54:20.000000000 +0200
@@ -47,6 +47,9 @@
 DETECTION_PROC = "proc"
 DETECTION_HAL = "hal"
 
+USB_AUDIO_DRIVER = "snd-usb-audio"
+USB_AUDIO_POSITION = 7
+
 ##
 ## Error message
 ##
@@ -141,7 +144,9 @@
         self.card_default_changed = False        
 
         self.readAlsaConfig()
-        
+       
+	self.usb_cards_hack = True
+	self.usb_cards_hack_position = USB_AUDIO_POSITION
 
     def dump(self):
         print " ----------- soundConfiguration -----------"        
@@ -192,7 +197,7 @@
 
             lines.append("#Generated by system-config-soundcard\n")
             lines.append("#If you edit this file, don't run system-config-soundcard,\n")
-            lines.append("#all changes could be lost.\n")
+            lines.append("#all your changes here could be lost.\n")
             if self.hardware_device:            
                 lines.append("#HWCONF\n")
                 lines.append("#DEV %d\n" % device)
@@ -228,6 +233,51 @@
             if card.active:
                 num = card.index
         return num
+
+    def readUSBDevicePosition(self, list):
+	# Checking for "options snd-usb-audio index=X"
+        for whole_line in list:
+
+            line = string.strip(whole_line)
+            if line == []:
+               modprobe.append(whole_line)
+               continue;
+
+            tmp = line.split()
+
+            if tmp == [] or tmp[0] == [] or tmp[0][0] == '#'\
+               or tmp[1] == [] or tmp[2] == [] :
+                continue
+
+            if tmp[0] != "options":
+                continue
+
+            if tmp[1] != "snd-usb-audio" and tmp[1] != "snd_usb_audio":
+		continue;
+	
+	    if tmp[2][:5] == "index":
+		option = string.split(string.join(tmp[2:]), '=')		
+		# option[1] has to be the index
+	        self.usb_cards_hack = True
+        	self.usb_cards_hack_position = string.atoi(option[1])
+		break;
+
+
+    def writeUSBDevicePosition(self, cardArray, modprobe):
+	if self.usb_cards_hack:
+            is_there_any_usb = False
+            for card in cardArray:
+                if card.active and (card.driver == "snd-usb-audio" or card.driver == "snd_usb_audio"):
+                   is_there_any_usb = True
+                   break;
+
+            if not is_there_any_usb:
+                modprobe.append("alias snd-card-%d %s\n" % (self.usb_cards_hack_position, USB_AUDIO_DRIVER))
+                modprobe.append("options %s index=%d\n" % (USB_AUDIO_DRIVER, self.usb_cards_hack_position))
+
+    def setUSBDevice(self):
+	self.usb_cards_hack = True;
+        self.card_index_changed = True
     
     def rewriteModprobe(self, cardArray):
         
@@ -238,6 +288,8 @@
         except:
             return False
 
+	self.readUSBDevicePosition(list)
+
         sound_lines = []
         modprobe = []
         
@@ -280,6 +332,8 @@
             if card.active:
                 modprobe.append("alias snd-card-%d %s\n" % (card.index, card.driver))
                 modprobe.append("options %s index=%d\n" % (card.driver, card.index))
+	
+	self.writeUSBDevicePosition(cardArray, modprobe)
 
         try:
             os.rename('/etc/modprobe.conf', '/etc/modprobe.conf.scs')

system-config-soundcard-2.0.6-update.patch:

Index: system-config-soundcard-2.0.6-update.patch
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-soundcard/F-7/system-config-soundcard-2.0.6-update.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- system-config-soundcard-2.0.6-update.patch	11 Apr 2007 09:03:44 -0000	1.1
+++ system-config-soundcard-2.0.6-update.patch	28 May 2007 13:03:09 -0000	1.2
@@ -47,7 +47,7 @@
          if card.maker != None:
 +            maker_string = []
 +            if self.firstBoot:
-+              maker_string = self.wrapLine(card.maker)
++              maker_string = card.maker
 +            else:
 +              maker_string = card.maker
 +        
@@ -62,7 +62,7 @@
          elif card.type != None:
 +            type_string = []
 +            if self.firstBoot:
-+              type_string = self.wrapLine(card.type)
++              type_string = card.type
 +            else:
 +              type_string = card.type
 +              
@@ -76,7 +76,7 @@
  
 +        model_string = []
 +        if self.firstBoot:
-+          model_string = self.wrapLine(card.model)
++          model_string = card.model
 +        else:
 +          model_string = card.model          
 +

system-config-soundcard-no-vendor.patch:

Index: system-config-soundcard-no-vendor.patch
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-soundcard/F-7/system-config-soundcard-no-vendor.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- system-config-soundcard-no-vendor.patch	21 May 2007 18:58:36 -0000	1.1
+++ system-config-soundcard-no-vendor.patch	28 May 2007 13:03:09 -0000	1.2
@@ -1,15 +1,29 @@
-Index: src/soundcardBackendHal.py
-===================================================================
-RCS file: /usr/local/CVS/redhat-config-soundcard/src/soundcardBackendHal.py,v
-retrieving revision 1.1
-diff -u -u -r1.1 soundcardBackendHal.py
---- src/soundcardBackendHal.py	30 Jun 2006 12:07:38 -0000	1.1
-+++ src/soundcardBackendHal.py	21 May 2007 18:51:10 -0000
-@@ -100,6 +100,7 @@
+--- system-config-soundcard-2.0.6/src/soundcardBackendHal.py.novendor	2007-05-28 11:56:32.000000000 +0200
++++ system-config-soundcard-2.0.6/src/soundcardBackendHal.py	2007-05-28 12:15:04.000000000 +0200
+@@ -107,6 +107,26 @@
              if new_parentUdi == None:
                  break
              parentUdi = new_parentUdi
-+        return ("Unknown", "Sound Device")
++
++	# Vendor has not been found - search the product name at least
++	vendor = _("Unknown")
++        parentUdi = udi
++        device_skipped = False
++        while parentUdi and len(parentUdi):
++            obj = self._dbusBus.get_object("org.freedesktop.Hal", parentUdi)
++
++            product = self.getProperty(obj, "info.product")
++            if product != None and device_skipped :
++                return vendor, product
++
++            new_parentUdi = self.getProperty(obj, "info.parent")
++            if new_parentUdi == None:
++                break
++            parentUdi = new_parentUdi
++	    device_skipped = True
++
++	# hmm, it's a strange device
++        return (vendor, vendor)
          
      def getBus(self, udi):
          parentUdi = udi


Index: system-config-soundcard.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-soundcard/F-7/system-config-soundcard.spec,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- system-config-soundcard.spec	21 May 2007 18:58:36 -0000	1.57
+++ system-config-soundcard.spec	28 May 2007 13:03:09 -0000	1.58
@@ -1,7 +1,7 @@
 Summary: A graphical interface for detecting and configuring soundcards
 Name: system-config-soundcard
 Version: 2.0.6
-Release: 5%{dist}
+Release: 6%{dist}
 URL: http://fedora.redhat.com/projects/config-tools/redhat-config-soundcard.html
 License: GPL
 ExclusiveOS: Linux
@@ -12,6 +12,7 @@
 Patch: system-config-soundcard-2.0.6-dbus.patch
 Patch1: system-config-soundcard-2.0.6-update.patch
 Patch2: system-config-soundcard-no-vendor.patch
+Patch3: system-config-soundcard-2.0.6-usb-hack.patch
 BuildRequires: desktop-file-utils
 BuildRequires: gettext, intltool
 ExcludeArch: s390 s390x
@@ -33,10 +34,11 @@
 detects and configures the soundcard(s) on the system.
 
 %prep
-%setup -q
-%patch -p1
-%patch1 -p1 -b .old
-%patch2 -p0 -b .novendor
+%setup  -q
+%patch  -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1 -b .usb
 
 %build
 make
@@ -86,6 +88,11 @@
 %ghost /root/scsound.log
 
 %changelog
+* Mon May 28 2007 Martin Stransky <stransky at redhat.com> - 2.0.6-6
+- update the no-vendor fix (#237709)
+- added a hack for USB devices (#232217)
+- disabled fix for (#227778)
+
 * Mon May 21 2007 Jeremy Katz <katzj at redhat.com> - 2.0.6-5
 - fix case of no vendor being able to be found in the hal tree (#237709)
 




More information about the fedora-extras-commits mailing list