From 81ca525dc5d91a46cdf9dddb943d247caec512db Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Thu, 6 Aug 2015 19:39:43 +0300 Subject: [PATCH] supress useless v4l2-ctl error message when listing devices on machines with no v4l2 devices --- src/handlers.py | 2 -- src/v4l2ctl.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/handlers.py b/src/handlers.py index 34966e7..5921ac7 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -517,8 +517,6 @@ class ConfigHandler(BaseHandler): utils.test_mjpeg_url(self.get_data(), auth_modes=['basic', 'digest'], allow_jpeg=False, callback=on_response) elif proto == 'v4l2': - logging.debug('listing v4l2 devices') - configured_devices = set() for camera_id in config.get_camera_ids(): data = config.get_camera(camera_id) diff --git a/src/v4l2ctl.py b/src/v4l2ctl.py index 53de064..b466e2b 100644 --- a/src/v4l2ctl.py +++ b/src/v4l2ctl.py @@ -43,12 +43,12 @@ def find_v4l2_ctl(): def list_devices(): global _resolutions_cache, _ctrls_cache, _ctrl_values_cache - logging.debug('listing v4l devices...') + logging.debug('listing v4l2 devices...') try: output = '' started = time.time() - p = subprocess.Popen('v4l2-ctl --list-devices', shell=True, stdout=subprocess.PIPE, bufsize=1) + p = subprocess.Popen('v4l2-ctl --list-devices 2>/dev/null', shell=True, stdout=subprocess.PIPE, bufsize=1) fd = p.stdout.fileno() fl = fcntl.fcntl(fd, fcntl.F_GETFL) -- 2.39.5