#!$PYTHON_INTERPRETER # # # Copyright (C) 2008 Pieter Palmers # 2009-2010 Arnold Krille # # 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 # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # # Test for common FFADO problems # import sys # Add the path of the installed dependent files sys.path.insert(0, "$PYTHONDIR" ) import listirqinfo import helpstrings from ffado_diag_helpers import * ## message strings FFADODIAG_VERSION = "$VERSION$REVISIONSTRING" welcome_msg = """ FFADO diagnostic utility """ + FFADODIAG_VERSION + """ ============================ (C) 2008 Pieter Palmers 2009-2010 Arnold Krille """ ## main program if __name__== '__main__': print welcome_msg parse_command_line () print "=== CHECK ===" print " Base system..." # check kernel kernel_version = get_kernel_version() print " kernel version............ " + str(kernel_version) kernel_is_preempt = get_kernel_preempt() print " Preempt (low latency)... " + str(kernel_is_preempt) # Hint: The main parts of the rt patches are in mainline-kernels nowadays. Performance with stock kernels is sufficient... kernel_is_rt_patched = get_kernel_rt_patched() print " RT patched.............. " + str(kernel_is_rt_patched) # check modules oldstack_present = check_1394oldstack_present() oldstack_loaded = check_1394oldstack_loaded() oldstack_active = check_1394oldstack_active() oldstack_statically_linked = not check_1394oldstack_loaded() and check_1394oldstack_linked() newstack_present = check_1394newstack_present() newstack_loaded = check_1394newstack_loaded() newstack_active = check_1394newstack_active() newstack_statically_linked = not check_1394newstack_loaded() and check_1394newstack_linked() print " old 1394 stack present.... " + str(oldstack_present) print " old 1394 stack loaded..... " + str(oldstack_loaded) print " old 1394 stack active..... " + str(oldstack_active) print " new 1394 stack present.... " + str(newstack_present) print " new 1394 stack loaded..... " + str(newstack_loaded) print " new 1394 stack active..... " + str(newstack_active) # check /dev/raw1394 node presence devnode_present = check_1394oldstack_devnode_present() print " /dev/raw1394 node present. " + str(devnode_present) if devnode_present: # check /dev/raw1394 access permissions devnode_permissions = check_1394oldstack_devnode_permissions() print " /dev/raw1394 permissions.. " + str(devnode_permissions) else: devnode_permissions = None if newstack_active: # check permissions newstack_permissions = get_juju_permissions() print " /dev/fw* permissions:" print newstack_permissions print " User IDs:" print get_user_ids() # check libraries print(" Prerequisites (dynamic at run-time)...") check_libraries () print " Prerequisites (static at compile-time)..." f = open( "$PYTHONDIR/static_info.txt", "r" ) for line in f: line = line[:-1] if line is not "\n" and line.startswith(" "): print line f.close() # libraw print " uname -a..." print " " + run_command("uname -a") print " Hardware..." # check host controller print " Host controllers:" list_host_controllers() print " CPU info:" if len(run_command("which lscpu")) > 0: print run_command("lscpu") else: print run_command("cat /proc/cpuinfo") print " Configuration..." # check RT settings # check IRQ settings print " IRQ information" info = listirqinfo.IRQInfo() info.load() info.display() print "" print "=== REPORT ===" # do the interpretation of the tests print "FireWire kernel drivers:" if (oldstack_loaded or oldstack_statically_linked) and \ (newstack_loaded or newstack_statically_linked): print (helpstrings.MODULES_BOTH_STACKS_LOADED) sys.exit(-1) elif newstack_loaded or newstack_statically_linked: print (helpstrings.MODULES_NEW_STACK_LOADED) sys.exit(-1) elif oldstack_statically_linked: print "[PASS] Kernel drivers statically linked into the kernel." elif not oldstack_present: print (helpstrings.MODULES_OLD_STACK_NOT_INSTALLED) sys.exit(-1) elif not oldstack_loaded: print (helpstrings.MODULES_OLD_STACK_NOT_LOADED) sys.exit(-1) else: print "[PASS] Kernel modules present and correctly loaded." if not devnode_present: print (helpstrings.DEVNODE_OLD_STACK_NOT_PRESENT) sys.exit(-1) else: if not devnode_permissions: print (helpstrings.DEVNODE_OLD_STACK_NO_PERMISSION) sys.exit(-1) else: print "[PASS] /dev/raw1394 node present and accessible."