* [PATCH] hda_analyzer: don't fail to display audio selector if caps variables aren't available
@ 2013-05-30 12:14 Anisse Astier
2013-05-30 12:27 ` Jaroslav Kysela
0 siblings, 1 reply; 3+ messages in thread
From: Anisse Astier @ 2013-05-30 12:14 UTC (permalink / raw)
To: alsa-devel, Jaroslav Kysela; +Cc: Anisse Astier
In particular, when an audio selector node has Amp-In caps: N/A, it
allows to still interact with the selector, and not have TypeError traceback
throwns because of NoneType variables.
Signed-off-by: Anisse Astier <anisse@astier.eu>
---
Hi Jared,
I'm not sure if this is the proper way to fix this, so please consider this a
formal report for the error thrown while parsing this node:
Node 0x22 [Audio Selector] wcaps 0x30010b: Stereo Amp-In
Amp-In caps: N/A
Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00]
Connection: 7
0x18* 0x19 0x1a 0x1b 0x1d 0x0b 0x12
Regards,
Anisse
--
hda-analyzer/hda_guilib.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hda-analyzer/hda_guilib.py b/hda-analyzer/hda_guilib.py
index 93c85e1..62eddab 100644
--- a/hda-analyzer/hda_guilib.py
+++ b/hda-analyzer/hda_guilib.py
@@ -285,9 +285,9 @@ class NodeGui(gtk.ScrolledWindow):
frame.set_border_width(4)
vbox = gtk.VBox(False, 0)
if caps:
- str = 'Offset: %d\n' % caps.ofs
- str += 'Number of steps: %d\n' % caps.nsteps
- str += 'Step size: %d\n' % caps.stepsize
+ str = 'Offset: %s\n' % (caps.ofs if caps.ofs else "N/A")
+ str += 'Number of steps: %s\n' % (caps.nsteps if caps.nsteps else "N/A")
+ str += 'Step size: %s\n' % (caps.stepsize if caps.stepsize else "N/A")
str += 'Mute: %s\n' % (caps.mute and "True" or "False")
vbox.pack_start(self.__new_text_view(text=str), True, True, 0)
idx = 0
--
1.8.3.rc1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] hda_analyzer: don't fail to display audio selector if caps variables aren't available
2013-05-30 12:14 [PATCH] hda_analyzer: don't fail to display audio selector if caps variables aren't available Anisse Astier
@ 2013-05-30 12:27 ` Jaroslav Kysela
2013-05-30 12:37 ` Anisse Astier
0 siblings, 1 reply; 3+ messages in thread
From: Jaroslav Kysela @ 2013-05-30 12:27 UTC (permalink / raw)
To: Anisse Astier; +Cc: alsa-devel
Date 30.5.2013 14:14, Anisse Astier wrote:
> In particular, when an audio selector node has Amp-In caps: N/A, it
> allows to still interact with the selector, and not have TypeError traceback
> throwns because of NoneType variables.
When ofs is None, the steps are not defined, too. I fixed it in:
http://git.alsa-project.org/?p=alsa.git;a=commitdiff;h=5bcf62d6947fe348a2b055bce633df1d12ff4370
Thank you for this report.
Jaroslav
--
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hda_analyzer: don't fail to display audio selector if caps variables aren't available
2013-05-30 12:27 ` Jaroslav Kysela
@ 2013-05-30 12:37 ` Anisse Astier
0 siblings, 0 replies; 3+ messages in thread
From: Anisse Astier @ 2013-05-30 12:37 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: alsa-devel
On Thu, 30 May 2013 14:27:19 +0200, Jaroslav Kysela <perex@perex.cz> wrote :
> Date 30.5.2013 14:14, Anisse Astier wrote:
> > In particular, when an audio selector node has Amp-In caps: N/A, it
> > allows to still interact with the selector, and not have TypeError traceback
> > throwns because of NoneType variables.
>
> When ofs is None, the steps are not defined, too. I fixed it in:
>
> http://git.alsa-project.org/?p=alsa.git;a=commitdiff;h=5bcf62d6947fe348a2b055bce633df1d12ff4370
>
Awesome, thanks.
Anisse
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-30 12:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-30 12:14 [PATCH] hda_analyzer: don't fail to display audio selector if caps variables aren't available Anisse Astier
2013-05-30 12:27 ` Jaroslav Kysela
2013-05-30 12:37 ` Anisse Astier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.