This file is indexed.

/usr/bin/ffado-diag is in ffado-tools 2.2.1-2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#!/usr/bin/python
#

#
# 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 <http://www.gnu.org/licenses/>.
#

#
# Test for common FFADO problems
#

import sys

# Add the path of the installed dependent files
sys.path.insert(0, "/usr/share/libffado2/python" )

from listirqinfo import IRQ,SoftIRQ,IRQInfo
from helpstrings import HelpStrings
from ffado_diag_helpers import *

## message strings
FFADODIAG_VERSION = "2.2.1"

welcome_msg = """

FFADO diagnostic utility """ + FFADODIAG_VERSION + """
============================
(C) 2008 Pieter Palmers
    2009-2010 Arnold Krille

"""

help_msg = """
Usage: ffado-diag [verboselevel]

  verboselevel : verbosity level. (optional)

"""

## main program
if __name__== '__main__':

    print welcome_msg

    num_args = len(sys.argv)
    if num_args not in [1,2]:
        print help
        sys.exit(0)

    if num_args == 2:
        loglevel = eval(sys.argv[1])
        if loglevel == 1:
            logging.getLogger('diag').setLevel(logging.INFO)
        elif loglevel == 2:
            logging.getLogger('diag').setLevel(logging.DEBUG)

    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)..."
    print "   gcc ............... %s" % get_version_first_line('gcc --version')
    print "   g++ ............... %s" % get_version_first_line('g++ --version')
    print "   PyQt4 (by pyuic4) . %s" % get_version_first_line('pyuic4 --version')
    print "   jackd ............. %s" % get_version_first_line('jackd --version')
    print "     path ............ %s" % get_command_path('jackd')
    print "     flags ........... %s" % get_package_flags("jack")
    print "   libraw1394 ........ %s" % get_package_version("libraw1394")
    print "     flags ........... %s" % get_package_flags("libraw1394")
    print "   libavc1394 ........ %s" % get_package_version("libavc1394")
    print "     flags ........... %s" % get_package_flags("libavc1394")
    print "   libiec61883 ....... %s" % get_package_version("libiec61883")
    print "     flags ........... %s" % get_package_flags("libiec61883")
    print "   libxml++-2.6 ...... %s" % get_package_version("libxml++-2.6")
    print "     flags ........... %s" % get_package_flags("libxml++-2.6")
    print "   dbus-1 ............ %s" % get_package_version("dbus-1")
    print "     flags ........... %s" % get_package_flags("dbus-1")
    print " Prerequisites (static at compile-time)..."
    f = open( "/usr/share/libffado2/python/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 = IRQInfo()

    info.load()
    print str(info)

    print ""
    print "=== REPORT ==="
    
    help = HelpStrings()
    
    # do the interpretation of the tests
    print "FireWire kernel drivers:"
    if (oldstack_loaded or oldstack_statically_linked) and \
       (newstack_loaded or newstack_statically_linked):
        help.show('MODULES_BOTH_STACKS_LOADED')
        sys.exit(-1)
    elif newstack_loaded or newstack_statically_linked:
        help.show('MODULES_NEW_STACK_LOADED')
        sys.exit(-1)
    elif oldstack_statically_linked:
        print "[PASS] Kernel drivers statically linked into the kernel."
    elif not oldstack_present:
        help.show('MODULES_OLD_STACK_NOT_INSTALLED')
        sys.exit(-1)
    elif not oldstack_loaded:
        help.show('MODULES_OLD_STACK_NOT_LOADED')
        sys.exit(-1)
    else:
        print "[PASS] Kernel modules present and correctly loaded."

    if not devnode_present:
        help.show('DEVNODE_OLD_STACK_NOT_PRESENT')
        sys.exit(-1)
    else:
        if not devnode_permissions:
            help.show('DEVNODE_OLD_STACK_NO_PERMISSION')
            sys.exit(-1)
        else:
            print "[PASS] /dev/raw1394 node present and accessible."