From: Jaroslav Kysela Date: Wed, 27 Jan 2010 09:24:25 +0000 (+0100) Subject: hda-analyzer - monitor - fixes for speaker-test X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=8953d4fb6ec458489329140a73ebcf5f9117ce09;p=alsa.git hda-analyzer - monitor - fixes for speaker-test Signed-off-by: Jaroslav Kysela --- diff --git a/hda-analyzer/monitor.py b/hda-analyzer/monitor.py index f4ab3eb..4637007 100755 --- a/hda-analyzer/monitor.py +++ b/hda-analyzer/monitor.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (c) 2008 by Jaroslav Kysela +# Copyright (c) 2008-2010 by Jaroslav Kysela # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ import gobject import gtk import pango from errno import EAGAIN -from subprocess import Popen, PIPE +from subprocess import Popen, PIPE, STDOUT from fcntl import fcntl, F_SETFL, F_GETFL from signal import SIGKILL import os @@ -117,7 +117,7 @@ class Monitor(gtk.Window): self.generate_sound() def __channels_change(self, button, idx): - if self.channels != idx or self.record.p == None: + if self.channels != idx or self.record_p == None: self.set_text('Switching to record...') self.channels = idx self.generate_cleanup() @@ -152,7 +152,7 @@ class Monitor(gtk.Window): "-c", str(channels), "-s", str(self.channel + 1)] p = Popen(self.cmd, - shell=False, bufsize=0, stdin=PIPE, stdout=PIPE, stderr=PIPE, + shell=False, bufsize=0, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=True) for fd in [p.stdout.fileno(), p.stderr.fileno()]: set_fd_nonblocking(fd) @@ -192,6 +192,7 @@ class Monitor(gtk.Window): def generate_io_stdout(self, source, condition): if condition & gobject.IO_IN: self.generate_stdout += source.read(1024) + self.set_text(' '.join(self.cmd) + '\n\n' + self.generate_stdout) return True def generate_io_stderr(self, source, condition): @@ -205,7 +206,7 @@ class Monitor(gtk.Window): "-f", "dat", "-c", str(self.channels), "-t", "raw", "-vvv", "/dev/null"] p = Popen(self.cmd, - shell=False, bufsize=0, stdin=PIPE, stdout=PIPE, stderr=PIPE, + shell=False, bufsize=0, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=True) for fd in [p.stdout.fileno(), p.stderr.fileno()]: set_fd_nonblocking(fd)