From cb0da292a78f2bb0afbede12c49140c983c3360b Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 28 Sep 2010 21:17:21 +0200 Subject: [PATCH] hda-analyzer: fix misindentation (mute checkbox) HDA Analyzer has a small bug caused by the misidentation of the code in hda-guilib.py. The outcome of it is that Mute checkbox is never checked for anything except pin widget regardless the actual amplifier value is. I came across this bug while trying to make microphone on my Lenovo Y550P work again after one of ALSA uprades, and although being a one-liner it cost me one or two hours of scratching my head thinking why I'm unable to hear any sound even with all relevant widgets unmuted. From: Valentine Sinitsyn --- hda-analyzer/hda_guilib.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/hda-analyzer/hda_guilib.py b/hda-analyzer/hda_guilib.py index dbe81f3..ae517a6 100644 --- a/hda-analyzer/hda_guilib.py +++ b/hda-analyzer/hda_guilib.py @@ -309,6 +309,7 @@ class NodeGui(gtk.ScrolledWindow): if caps.mute: checkbutton = gtk.CheckButton('Mute') checkbutton.connect("toggled", self.__amp_mute_toggled, (caps, vals, idx)) + #checkbutton.set_active(True) self.amp_checkbuttons[caps.dir].append(checkbutton) hbox.pack_start(checkbutton, False, False) else: @@ -635,21 +636,21 @@ class NodeGui(gtk.ScrolledWindow): if name: idx += 1 if node.pincap_vref: self.pincap_vref_combobox.set_active(active) - a = [] - if node.in_amp: - a.append((HDA_INPUT, node.amp_caps_in, node.amp_vals_in)) - if node.out_amp: - a.append((HDA_OUTPUT, node.amp_caps_out, node.amp_vals_out)) - for dir, caps, vals in a: - for idx in range(len(vals.vals)): - val = vals.vals[idx] - checkbutton = self.amp_checkbuttons[dir][idx] - if checkbutton: - checkbutton.set_active(val & 0x80 and True or False) - adj = self.amp_adjs[dir][idx] - if adj: - adj.set_value((val & 0x7f) % (caps.nsteps+1)) - idx += 1 + a = [] + if node.in_amp: + a.append((HDA_INPUT, node.amp_caps_in, node.amp_vals_in)) + if node.out_amp: + a.append((HDA_OUTPUT, node.amp_caps_out, node.amp_vals_out)) + for dir, caps, vals in a: + for idx in range(len(vals.vals)): + val = vals.vals[idx] + checkbutton = self.amp_checkbuttons[dir][idx] + if checkbutton: + checkbutton.set_active(val & 0x80 and True or False) + adj = self.amp_adjs[dir][idx] + if adj: + adj.set_value((val & 0x7f) % (caps.nsteps+1)) + idx += 1 if hasattr(self, 'connection_model'): for r in self.connection_model: r[0] = False -- 2.47.1