Changeset 185 for trunk

Show
Ignore:
Timestamp:
04/24/06 13:59:21 (18 years ago)
Author:
wagi
Message:

CVS-SVN migration developer public sync patch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libfreebob/ChangeLog

    r183 r185  
     12006-04-23  Daniel Wagner  <wagi@monom.org> 
     2 
     3        * configure.ac: Version bumped to 0.7.0 
     4 
     5        * Abstract interface IAvDevice introduced.  
     6        * BeBoB device discovering code moved into bebob directory. 
     7        * Bounce device added. 
     8 
     92006-04-17  Daniel Wagner  <wagi@monom.org> 
     10 
     11        * configure.ac: Version bumped to 0.6.4 
     12 
     13        * src/libfreebobavc/avc_generic.cpp (serialize): Decode subunit_type  
     14        and subunit_id field. 
     15        (fire): avc1394_transaction_block2 inteface change update. 
     16        * src/libfreebobavc/ieee1394service.cpp (transactionBlock): Likewise. 
     17        * src/libfreebobavc/ieee1394service.h: Likewise. 
     18 
     192006-04-11  Daniel Wagner  <wagi@monom.org> 
     20 
     21        * configure.ac: Version bumped to 0.6.3 
     22         
     23        * src/avdevicesubunit.cpp (discoverFunctionBlocks): reformating. 
     24        (discoverFunctionBlocksDo): Really added a correct 
     25        bugfix for the reuse of ExtendedSubunitInfoCmd. 
     26 
     272006-04-07  Pieter Palmers <pieterpalmers@users.sourceforge.net> 
     28 
     29        * src/avdevice.h src/avdevice.cpp: moved the include of stdint.h 
     30        from the implementation to the header, to fix certain compilation 
     31        problems wrt uint64_t. This datatype is also used in the class 
     32        definition in avdevice.h. 
     33 
     342006-04-05  Pieter Palmers <pieterpalmers@users.sourceforge.net> 
     35 
     36        * configure.ac: Version bump to 0.6.2 
     37 
     38        * src/freebob.cpp: Retry setting the sample rate if it fails the 
     39        first time. 
     40         
     41        * src/libfreebobstreaming/*: Added an way to choose for playback 
     42        or capture only (for ALSA plugin), using the options passed when 
     43        creating the freebob device.  * src/libfreebobstreaming/*: fixed 
     44        the bug that prevented playback only operation. 
     45 
     462006-04-04  Daniel Wagner  <wagi@monom.org> 
     47 
     48        * configure.ac: Version bump to 0.6.1 
     49 
     50        * src/avdevicesubunit.cpp (discoverFunctionBlocksDo):  
     51        ExtendedSubunitInfoCmd is not reusable at this point.  
     52        Moved into its own block so that's initatilialized correctly. 
     53 
    1542006-03-30  Daniel Wagner  <wagi@monom.org> 
    255 
  • trunk/libfreebob/config.h.in

    r155 r185  
    4343#undef HAVE_UNISTD_H 
    4444 
     45/* Define to 1 if your C compiler doesn't accept -c and -o together. */ 
     46#undef NO_MINUS_C_MINUS_O 
     47 
    4548/* Name of package */ 
    4649#undef PACKAGE 
     
    6467#undef STDC_HEADERS 
    6568 
     69/* Define to 1 if MMX assembly is available. */ 
     70#undef USE_MMX 
     71 
     72/* Define to 1 if SSE assembly is available. */ 
     73#undef USE_SSE 
     74 
    6675/* Version number of package */ 
    6776#undef VERSION 
     
    8190   code using `volatile' can become incorrect without. Disable with care. */ 
    8291#undef volatile 
     92 
     93/* "Nope it's intel" */ 
     94#undef x86 
  • trunk/libfreebob/configure.ac

    r183 r185  
    11# configure.ac - Configure script for FreeBob. 
    2 # Copyright (C) 2005 by Daniel Wagner. 
     2# Copyright (C) 2005,06 by Daniel Wagner. 
     3# Copyright (C) 2006    by Pieter Palmers. 
    34# 
    45# This file is part of FreeBob. 
     
    2223 
    2324m4_define(freebob_major_version, 0) 
    24 m4_define(freebob_minor_version, 6
     25m4_define(freebob_minor_version, 7
    2526m4_define(freebob_micro_version, 0) 
    2627 
     
    4748AC_SUBST(FREEBOB_MICRO_VERSION, freebob_micro_version) 
    4849 
    49 AM_INIT_AUTOMAKE 
     50AM_INIT_AUTOMAKE([subdir-objects]) 
    5051AM_MAINTAINER_MODE 
    5152AC_CONFIG_SRCDIR([src/freebob.cpp]) 
     
    7374AC_PROG_CXX 
    7475AM_PROG_AS 
     76AM_PROG_CC_C_O 
    7577AC_PROG_LIBTOOL 
    7678AC_CHECK_TOOL([AR], [ar], :) 
     
    125127esac],[debug=false]) 
    126128 
    127 CFLAGS="$CFLAGS -g -Wall -std=gnu99" 
    128 CXXFLAGS="$CXXFLAGS -g -Wall" 
     129 
     130dnl Check for MMX assembly 
     131 
     132AC_ARG_ENABLE(mmx, 
     133    [  --enable-mmx            enable MMX support (default=auto)],, 
     134    enable_mmx=yes) 
     135 
     136AC_ARG_ENABLE(sse, 
     137    [  --enable-sse            enable SSE support (default=auto)],, 
     138    enable_sse=$enable_mmx) 
     139 
     140if test "x$enable_mmx" = xyes; then 
     141     
     142    AC_MSG_CHECKING(whether we can compile MMX code) 
     143     
     144    AC_COMPILE_IFELSE([asm ("movq 0, %mm0");], 
     145         
     146        AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.]) 
     147        AC_MSG_RESULT(yes) 
     148        MMX_FLAGS="-mmmx" 
     149         
     150        if test "x$enable_sse" = xyes; then 
     151               
     152              AC_MSG_CHECKING(whether we can compile SSE code) 
     153               
     154              AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");], 
     155                  AC_DEFINE(USE_SSE, 1, 
     156                            [Define to 1 if SSE assembly is available.]) 
     157                  SSE_FLAGS="-msse -mfpmath=sse" 
     158                  AC_MSG_RESULT(yes) 
     159                  , 
     160                  enable_sse=no 
     161                  AC_MSG_RESULT(no) 
     162                  AC_MSG_WARN( 
     163                      [The assembler does not support the SSE command set.] 
     164                  ) 
     165              ) 
     166               
     167          fi 
     168          , 
     169          enable_mmx=no 
     170          AC_MSG_RESULT(no) 
     171          AC_MSG_WARN([The assembler does not support the MMX command set.]) 
     172      ) 
     173  fi 
     174 
     175  AC_DEFINE(x86, 1, "Nope it's intel") 
     176  COMMON_X86_OPT_FLAGS="-DREENTRANT -O3 -fomit-frame-pointer -ffast-math -funroll-loops" 
     177 
     178  if test "$target_cpu" = "i586"; then 
     179      FREEBOB_OPT_CFLAGS="-march=i586 " 
     180  elif test "$target_cpu" = "i686"; then 
     181      FREEBOB_OPT_CFLAGS="-march=i686" 
     182  else 
     183      : 
     184  fi 
     185 
     186  FREEBOB_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $FREEBOB_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS" 
     187 
     188 
     189AC_ARG_ENABLE(optimize, 
     190    AC_HELP_STRING([--enable-optimize], 
     191                   [ask the compiler for its best optimizations]), 
     192    [ if test x$enable_optimize != xno ; then 
     193        CFLAGS="$CFLAGS $FREEBOB_OPT_CFLAGS" ; 
     194        CXXFLAGS="$CXXFLAGS $FREEBOB_OPT_CFLAGS" 
     195      fi  
     196    ] 
     197
     198 
     199 
     200CFLAGS="$CFLAGS -Wall -std=gnu99" 
     201CXXFLAGS="$CXXFLAGS -Wall" 
    129202 
    130203if test "${debug}" = true; then 
    131    CFLAGS="$CFLAGS -DDEBUG" 
    132    CXXFLAGS="$CXXFLAGS -DDEBUG"  
    133 else 
    134    CFLAGS="$CFLAGS -O2" 
    135    CXXFLAGS="$CXXFLAGS -O2"  
     204   CFLAGS="$CFLAGS -g -DDEBUG" 
     205   CXXFLAGS="$CXXFLAGS -g -DDEBUG"  
    136206fi; 
    137207 
     
    165235                 tests/streaming/Makefile 
    166236                 libfreebob.pc]) 
     237 
    167238AC_OUTPUT 
    168239 
     
    175246  Installation prefix:  $prefix 
    176247  C++ compiler:         $CXX $CXXFLAGS 
     248 
     249  libraw1394 CFLAGS:    $LIBRAW1394_CFLAGS 
     250  libraw1394 LIBS:      $LIBRAW1394_LIBS 
     251  libiec61883 CFLAGS:   $LIBIEC61883_CFLAGS 
     252  libiec61883 LIBS:     $LIBIEC61883_LIBS 
     253  libavc1394 CFLAGS:    $LIBAVC1394_CFLAGS 
     254  libavc1394 LIBS:      $LIBAVC1394_LIBS 
    177255]) 
  • trunk/libfreebob/INSTALL

    r166 r185  
    1 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software 
    2 Foundation, Inc. 
    3  
    4    This file is free documentation; the Free Software Foundation gives 
     1Installation Instructions 
     2************************* 
     3 
     4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free 
     5Software Foundation, Inc. 
     6 
     7This file is free documentation; the Free Software Foundation gives 
    58unlimited permission to copy, distribute and modify it. 
    69 
     
    811================== 
    912 
    10    These are generic installation instructions. 
     13These are generic installation instructions. 
    1114 
    1215   The `configure' shell script attempts to guess correct values for 
     
    6871===================== 
    6972 
    70    Some systems require unusual options for compilation or linking that 
    71 the `configure' script does not know about.  Run `./configure --help' 
    72 for details on some of the pertinent environment variables. 
     73Some systems require unusual options for compilation or linking that the 
     74`configure' script does not know about.  Run `./configure --help' for 
     75details on some of the pertinent environment variables. 
    7376 
    7477   You can give `configure' initial values for configuration parameters 
     
    8386==================================== 
    8487 
    85    You can compile the package for more than one kind of computer at the 
     88You can compile the package for more than one kind of computer at the 
    8689same time, by placing the object files for each architecture in their 
    8790own directory.  To do this, you must use a version of `make' that 
     
    100103================== 
    101104 
    102    By default, `make install' will install the package's files in 
     105By default, `make install' will install the package's files in 
    103106`/usr/local/bin', `/usr/local/man', etc.  You can specify an 
    104107installation prefix other than `/usr/local' by giving `configure' the 
    105 option `--prefix=PATH'. 
     108option `--prefix=PREFIX'. 
    106109 
    107110   You can specify separate installation prefixes for 
    108111architecture-specific files and architecture-independent files.  If you 
    109 give `configure' the option `--exec-prefix=PATH', the package will use 
    110 PATH as the prefix for installing programs and libraries. 
     112give `configure' the option `--exec-prefix=PREFIX', the package will 
     113use PREFIX as the prefix for installing programs and libraries. 
    111114Documentation and other data files will still use the regular prefix. 
    112115 
    113116   In addition, if you use an unusual directory layout you can give 
    114 options like `--bindir=PATH' to specify different values for particular 
     117options like `--bindir=DIR' to specify different values for particular 
    115118kinds of files.  Run `configure --help' for a list of the directories 
    116119you can set and what kinds of files go in them. 
     
    123126================= 
    124127 
    125    Some packages pay attention to `--enable-FEATURE' options to 
     128Some packages pay attention to `--enable-FEATURE' options to 
    126129`configure', where FEATURE indicates an optional part of the package. 
    127130They may also pay attention to `--with-PACKAGE' options, where PACKAGE 
     
    138141========================== 
    139142 
    140    There may be some features `configure' cannot figure out 
    141 automatically, but needs to determine by the type of machine the package 
    142 will run on.  Usually, assuming the package is built to be run on the 
    143 _same_ architectures, `configure' can figure that out, but if it prints 
    144 a message saying it cannot guess the machine type, give it the 
     143There may be some features `configure' cannot figure out automatically, 
     144but needs to determine by the type of machine the package will run on. 
     145Usually, assuming the package is built to be run on the _same_ 
     146architectures, `configure' can figure that out, but if it prints a 
     147message saying it cannot guess the machine type, give it the 
    145148`--build=TYPE' option.  TYPE can either be a short name for the system 
    146149type, such as `sun4', or a canonical name which has the form: 
     
    168171================ 
    169172 
    170    If you want to set default values for `configure' scripts to share, 
    171 you can create a site shell script called `config.site' that gives 
    172 default values for variables like `CC', `cache_file', and `prefix'. 
     173If you want to set default values for `configure' scripts to share, you 
     174can create a site shell script called `config.site' that gives default 
     175values for variables like `CC', `cache_file', and `prefix'. 
    173176`configure' looks for `PREFIX/share/config.site' if it exists, then 
    174177`PREFIX/etc/config.site' if it exists.  Or, you can set the 
     
    179182================== 
    180183 
    181    Variables not defined in a site shell script can be set in the 
     184Variables not defined in a site shell script can be set in the 
    182185environment passed to `configure'.  However, some packages may run 
    183186configure again during the build, and the customized values of these 
     
    187190     ./configure CC=/usr/local2/bin/gcc 
    188191 
    189 will cause the specified gcc to be used as the C compiler (unless it is 
    190 overridden in the site shell script). 
     192causes the specified `gcc' to be used as the C compiler (unless it is 
     193overridden in the site shell script).  Here is a another example: 
     194 
     195     /bin/bash ./configure CONFIG_SHELL=/bin/bash 
     196 
     197Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent 
     198configuration-related scripts to be executed by `/bin/bash'. 
    191199 
    192200`configure' Invocation 
    193201====================== 
    194202 
    195    `configure' recognizes the following options to control how it 
    196 operates. 
     203`configure' recognizes the following options to control how it operates. 
    197204 
    198205`--help' 
  • trunk/libfreebob/libfreebob/freebob.h

    r183 r185  
    11/* freebob.h 
    22 * Copyright (C) 2005 Pieter Palmers 
     3 * Copyright (C) 2006 Daniel Wagner 
    34 * 
    45 * This file is part of FreeBoB 
     
    2425 
    2526#define FREEBOB_MAX_NAME_LEN 256 
     27 
     28#define FREEBOB_BOUNCE_SERVER_VENDORNAME  "FreeBoB Server" 
     29#define FREEBOB_BOUNCE_SERVER_MODELNAME   "freebob-server" 
    2630 
    2731enum freebob_direction { 
  • trunk/libfreebob/libfreebob/freebob_streaming.h

    r159 r185  
    1 /* $Id$ */ 
    2  
    31/* 
    42 *   FreeBob Streaming API 
     
    4038 
    4139#define FREEBOB_STREAMING_MAX_URL_LENGTH 2048 
     40 
     41#define FREEBOB_IGNORE_CAPTURE          (1<<0) 
     42#define FREEBOB_IGNORE_PLAYBACK         (1<<1) 
     43 
    4244#include <stdlib.h> 
    4345 
     
    119121        int port; 
    120122         
     123 
     124        /* direction map */ 
     125        int directions; 
     126 
    121127} freebob_options_t; 
    122128 
  • trunk/libfreebob/src/configrom.cpp

    r140 r185  
    155155} 
    156156 
     157// XXX This might work only for the M-Audio Audiophile 
     158// but can easily extended. 
     159#define VENDOR_ID_MAUDIO    0x00000d6c 
     160#define MODEL_ID_MAUDIO_BOOTLOADER 0x00010060 
     161 
     162const bool 
     163ConfigRom::isBootloader() const 
     164{ 
     165    if ( ( m_vendorId == VENDOR_ID_MAUDIO ) 
     166         && ( m_modelId == MODEL_ID_MAUDIO_BOOTLOADER ) ) 
     167    { 
     168        return true; 
     169    } 
     170    return false; 
     171} 
    157172 
    158173static int 
     
    203218                                 "\tvendor_id = 0x%08x\n", 
    204219                                 kv->value.immediate); 
     220                    m_vendorId = kv->value.immediate; 
    205221                } 
    206222                break; 
     
    210226                             "\tmodel_id = 0x%08x\n", 
    211227                             kv->value.immediate); 
     228                m_modelId = kv->value.immediate; 
    212229                break; 
    213230 
     
    314331} 
    315332 
     333const fb_nodeid_t 
     334ConfigRom::getNodeId() const 
     335{ 
     336    return m_nodeId; 
     337} 
     338 
    316339const fb_octlet_t 
    317340ConfigRom::getGuid() const 
  • trunk/libfreebob/src/configrom.h

    r125 r185  
    11/* configrom.h 
    2  * Copyright (C) 2005 by Daniel Wagner 
     2 * Copyright (C) 2005,06 by Daniel Wagner 
    33 * 
    44 * This file is part of FreeBob. 
     
    3939 
    4040    const bool isAvcDevice() const; 
     41    const bool isBootloader() const; 
     42    const fb_nodeid_t getNodeId() const; 
    4143    const fb_octlet_t getGuid() const; 
    4244    const std::string getModelName() const; 
    4345    const std::string getVendorName() const; 
     46 
    4447 
    4548 protected: 
     
    5659    std::string      m_vendorName; 
    5760    std::string      m_modelName; 
     61    unsigned int     m_vendorId; 
     62    unsigned int     m_modelId; 
    5863 
    5964    /* only used during parsing */ 
  • trunk/libfreebob/src/devicemanager.cpp

    r183 r185  
    2222 
    2323#include "devicemanager.h" 
    24 #include "avdevice.h" 
     24#include "iavdevice.h" 
    2525#include "configrom.h" 
    2626 
    2727#include "libfreebobavc/ieee1394service.h" 
    2828#include "debugmodule/debugmodule.h" 
     29#include "bebob/bebob_avdevice.h" 
     30#include "bounce/bounce_avdevice.h" 
    2931 
    3032#include <iostream> 
     
    3739    : m_1394Service( 0 ) 
    3840{ 
     41    m_probeList.push_back( probeBeBoB ); 
     42    m_probeList.push_back( probeBounce ); 
    3943} 
    4044 
    4145DeviceManager::~DeviceManager() 
    4246{ 
    43     for ( AvDeviceVectorIterator it = m_avDevices.begin(); 
     47    for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 
    4448          it != m_avDevices.end(); 
    4549          ++it ) 
     
    7680        setDebugLevel( DEBUG_LEVEL_VERBOSE ); 
    7781    } 
    78     for ( AvDeviceVectorIterator it = m_avDevices.begin(); 
     82    for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 
    7983          it != m_avDevices.end(); 
    8084          ++it ) 
     
    8892          ++nodeId ) 
    8993    { 
    90         ConfigRom* configRom = new ConfigRom( m_1394Service, nodeId ); 
    91         if ( !configRom->initialize() ) { 
     94        ConfigRom configRom( m_1394Service, nodeId ); 
     95        if ( !configRom.initialize() ) { 
    9296            // \todo If a PHY on the bus in power safe mode than 
    9397            // the config rom is missing. So this might be just 
     
    99103                         "Skip device discovering for this node\n", 
    100104                         nodeId ); 
    101             delete configRom; 
    102105            continue; 
    103106        } 
    104107 
    105         if ( !configRom->isAvcDevice() ) { 
    106             delete configRom; 
     108        if ( !configRom.isAvcDevice() ) { 
    107109            continue; 
    108110        } 
    109111 
    110         AvDevice* avDevice = new AvDevice( m_1394Service, 
    111                                            configRom, 
    112                                            nodeId, 
    113                                            verboseLevel ); 
    114         if ( !avDevice ) { 
    115             debugError( "discover: Could not allocate AvDevice\n" ); 
    116             delete configRom; 
    117             return false; 
    118         } 
    119  
    120         if ( !avDevice->discover() ) { 
    121             debugError( "discover: Could not discover device (node id %d)\n", 
    122                         nodeId ); 
    123             delete avDevice; 
    124             return false; 
    125         } 
    126         if ( verboseLevel ) { 
    127             avDevice->showDevice(); 
    128         } 
    129  
    130         m_avDevices.push_back( avDevice ); 
     112        for ( ProbeFunctionVector::iterator it = m_probeList.begin(); 
     113              it != m_probeList.end(); 
     114              ++it ) 
     115        { 
     116            ProbeFunction func = *it; 
     117            IAvDevice* avDevice = func(*m_1394Service, nodeId, verboseLevel); 
     118            if ( avDevice ) { 
     119                m_avDevices.push_back( avDevice ); 
     120                if ( verboseLevel ) { 
     121                    avDevice->showDevice(); 
     122                } 
     123                break; 
     124            } 
     125        } 
     126 
    131127    } 
    132128 
    133129    return true; 
     130} 
     131 
     132 
     133IAvDevice* 
     134DeviceManager::probeBeBoB(Ieee1394Service& service, int id, int level) 
     135{ 
     136    IAvDevice* avDevice = new BeBoB::AvDevice( service, id, level ); 
     137    if ( !avDevice ) { 
     138        return 0; 
     139    } 
     140 
     141    if ( !avDevice->discover() ) { 
     142        delete avDevice; 
     143        return 0; 
     144    } 
     145    return avDevice; 
     146} 
     147 
     148IAvDevice* 
     149DeviceManager::probeBounce(Ieee1394Service& service, int id, int level) 
     150{ 
     151    IAvDevice* avDevice = new Bounce::BounceDevice( service, id, level ); 
     152    if ( !avDevice ) { 
     153        return 0; 
     154    } 
     155 
     156    if ( !avDevice->discover() ) { 
     157        delete avDevice; 
     158        return 0; 
     159    } 
     160    return avDevice; 
    134161} 
    135162 
     
    137164DeviceManager::isValidNode(int node) 
    138165{ 
    139     for ( AvDeviceVectorIterator it = m_avDevices.begin(); 
    140           it != m_avDevices.end(); 
    141           ++it ) 
    142     { 
    143         AvDevice* avDevice = *it; 
    144  
    145         if (avDevice->getNodeId() == node) { 
     166    for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 
     167          it != m_avDevices.end(); 
     168          ++it ) 
     169    { 
     170        IAvDevice* avDevice = *it; 
     171 
     172        if (avDevice->getConfigRom().getNodeId() == node) { 
    146173                return true; 
    147         } 
    148174        } 
    149         return false; 
     175    } 
     176    return false; 
    150177} 
    151178 
     
    164191    } 
    165192 
    166     AvDevice* avDevice = m_avDevices.at( deviceNr ); 
     193    IAvDevice* avDevice = m_avDevices.at( deviceNr ); 
    167194 
    168195    if ( !avDevice ) { 
     
    170197    } 
    171198 
    172     return avDevice->getNodeId(); 
    173 } 
    174  
    175 AvDevice* 
     199    return avDevice->getConfigRom().getNodeId(); 
     200} 
     201 
     202IAvDevice* 
    176203DeviceManager::getAvDevice( int nodeId ) 
    177204{ 
    178     for ( AvDeviceVectorIterator it = m_avDevices.begin(); 
    179           it != m_avDevices.end(); 
    180           ++it ) 
    181     { 
    182         AvDevice* avDevice = *it; 
    183         if ( avDevice->getNodeId() == nodeId ) { 
     205    for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 
     206          it != m_avDevices.end(); 
     207          ++it ) 
     208    { 
     209        IAvDevice* avDevice = *it; 
     210        if ( avDevice->getConfigRom().getNodeId() == nodeId ) { 
    184211            return avDevice; 
    185212        } 
     
    207234    xmlDocSetRootElement( doc, rootNode ); 
    208235 
    209     for ( AvDeviceVectorIterator it = m_avDevices.begin(); 
    210           it != m_avDevices.end(); 
    211           ++it ) 
    212     { 
    213         AvDevice* avDevice = *it; 
     236    for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 
     237          it != m_avDevices.end(); 
     238          ++it ) 
     239    { 
     240        IAvDevice* avDevice = *it; 
    214241 
    215242        xmlNodePtr deviceNode = xmlNewChild( rootNode, 0, 
     
    223250 
    224251        char* result; 
    225         asprintf( &result, "%d", avDevice->getNodeId() ); 
     252        asprintf( &result, "%d", avDevice->getConfigRom().getNodeId() ); 
    226253        if ( !xmlNewChild( deviceNode,  0, 
    227254                           BAD_CAST "NodeId",  BAD_CAST result ) ) 
     
    232259 
    233260        std::string res = "Connection Information for " 
    234                           + avDevice->getVendorName() 
     261                          + avDevice->getConfigRom().getVendorName() 
    235262                          +", " 
    236                           + avDevice->getModelName() 
     263                          + avDevice->getConfigRom().getModelName() 
    237264                          + " configuration"; 
    238265        if ( !xmlNewChild( deviceNode, 
     
    246273        } 
    247274 
    248         res = avDevice->getVendorName(); 
     275        res = avDevice->getConfigRom().getVendorName(); 
    249276 
    250277        if ( !xmlNewChild( deviceNode, 
     
    258285        } 
    259286 
    260         res = avDevice->getModelName(); 
     287        res = avDevice->getConfigRom().getModelName(); 
    261288 
    262289        if ( !xmlNewChild( deviceNode, 
     
    271298 
    272299        asprintf( &result, "%08x%08x", 
    273                   ( quadlet_t )( avDevice->getGuid() >> 32 ), 
    274                   ( quadlet_t )( avDevice->getGuid() & 0xfffffff ) ); 
     300                  ( quadlet_t )( avDevice->getConfigRom().getGuid() >> 32 ), 
     301                  ( quadlet_t )( avDevice->getConfigRom().getGuid() & 0xfffffff ) ); 
    275302        if ( !xmlNewChild( deviceNode,  0, 
    276303                           BAD_CAST "GUID",  BAD_CAST result ) ) { 
  • trunk/libfreebob/src/devicemanager.h

    r183 r185  
    2929 
    3030class Ieee1394Service; 
    31 class AvDevice; 
     31class IAvDevice; 
    3232 
    33 typedef std::vector< AvDevice* > AvDeviceVector; 
    34 typedef std::vector< AvDevice* >::iterator AvDeviceVectorIterator; 
     33typedef std::vector< IAvDevice* > IAvDeviceVector; 
     34typedef std::vector< IAvDevice* >::iterator IAvDeviceVectorIterator; 
     35 
     36typedef IAvDevice* (*ProbeFunction)(Ieee1394Service&, int, int); 
     37typedef std::vector<ProbeFunction> ProbeFunctionVector; 
     38typedef std::vector<ProbeFunction>::iterator ProbeFunctionVectorIterator; 
    3539 
    3640class DeviceManager{ 
     
    4852    int getDeviceNodeId( int deviceNr ); 
    4953 
    50     AvDevice* getAvDevice( int nodeId ); 
     54    IAvDevice* getAvDevice( int nodeId ); 
    5155 
    5256    xmlDocPtr getXmlDescription(); 
    53  protected: 
     57 
     58protected: 
     59    static IAvDevice* probeBeBoB(Ieee1394Service& service, int id, int level); 
     60    static IAvDevice* probeBounce(Ieee1394Service& service, int id, int level); 
     61 
     62protected: 
    5463    Ieee1394Service* m_1394Service; 
    55     AvDeviceVector   m_avDevices; 
     64    IAvDeviceVector  m_avDevices; 
     65    ProbeFunctionVector m_probeList; 
    5666 
    5767    DECLARE_DEBUG_MODULE; 
  • trunk/libfreebob/src/freebob.cpp

    r183 r185  
    2828#include "fbtypes.h" 
    2929#include "devicemanager.h" 
    30 #include "avdevice.h" 
     30#include "iavdevice.h" 
    3131 
    3232#include "libfreebobavc/avc_generic.h" 
     
    135135freebob_set_samplerate( freebob_handle_t freebob_handle, int node_id, int samplerate ) 
    136136{ 
    137     AvDevice* avDevice = freebob_handle->m_deviceManager->getAvDevice( node_id ); 
     137    IAvDevice* avDevice = freebob_handle->m_deviceManager->getAvDevice( node_id ); 
    138138    if ( avDevice ) { 
    139139        if ( avDevice->setSamplingFrequency( parseSampleRate( samplerate ) ) ) { 
    140140            return freebob_handle->m_deviceManager->discover(0)? 1 : 0; 
    141         } 
    142     } 
    143     return 0; 
     141 
     142        // retry 
     143        } else if ( avDevice->setSamplingFrequency( parseSampleRate( samplerate ) ) ) { 
     144            return freebob_handle->m_deviceManager->discover(0)? 1 : 0; 
     145        // failed 
     146        } else { 
     147            return -1; 
     148        } 
     149    } 
     150    return -1; 
    144151} 
    145152 
  • trunk/libfreebob/src/libfreebobavc/avc_generic.cpp

    r183 r185  
    4545{ 
    4646    se.write( m_ctype, "AVCCommand ctype" ); 
    47     se.write( m_subunit, "AVCCommand subunit" ); 
     47    // XXX \todo improve IOSSerialize::write interface 
     48    char* buf; 
     49    asprintf( &buf, "AVCCommand subunit (subunit_type = %d, subunit_id = %d)", 
     50              getSubunitType(), getSubunitId() ); 
     51    se.write( m_subunit, buf ); 
    4852    se.write( m_opcode, "AVCCommand opcode" ); 
    4953    return true; 
     
    168172    } 
    169173 
     174    unsigned int resp_len; 
    170175    quadlet_t* resp = m_1394Service->transactionBlock( m_nodeId, 
    171176                                                       (quadlet_t*)m_fcpFrame, 
    172                                                        ( fcpFrameSize + 3 ) / 4 ); 
     177                                                       ( fcpFrameSize+3 ) / 4, 
     178                                                       &resp_len ); 
    173179    bool result = false; 
    174180    if ( resp ) { 
     181        resp_len *= 4; 
    175182        unsigned char* buf = ( unsigned char* ) resp; 
    176183 
     
    182189        case eR_NotImplemented: 
    183190        { 
    184             BufferDeserialize de( buf, 512 ); // XXX magic number 
     191            BufferDeserialize de( buf, resp_len ); 
    185192            result = deserialize( de ); 
    186193 
     
    196203        default: 
    197204            printf( "unexpected response received (0x%x)\n", m_eResponse ); 
     205            if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE) { 
     206                puts("  Response:"); 
     207                BufferDeserialize de( buf, resp_len ); 
     208                deserialize( de ); 
     209 
     210                showFcpFrame( buf, resp_len ); 
     211            } 
     212 
    198213        } 
    199214    } else { 
  • trunk/libfreebob/src/libfreebobavc/ieee1394service.cpp

    r183 r185  
    8484Ieee1394Service::transactionBlock( fb_nodeid_t nodeId, 
    8585                                   fb_quadlet_t* buf, 
    86                                    int len ) 
     86                                   int len, 
     87                                   unsigned int* resp_len ) 
    8788{ 
    8889    for (int i = 0; i < len; ++i) { 
     
    9192 
    9293    fb_quadlet_t* result = 
    93         avc1394_transaction_block( m_handle, nodeId, buf, len,  10 ); 
     94        avc1394_transaction_block2( m_handle, 
     95                                    nodeId, 
     96                                    buf, 
     97                                    len, 
     98                                    resp_len, 
     99                                    10 ); 
    94100 
    95     for ( int i = 0; i < 512/4; ++i ) { //XXX 
     101    for ( unsigned int i = 0; i < *resp_len; ++i ) { 
    96102        result[i] = htonl( result[i] ); 
    97103    } 
  • trunk/libfreebob/src/libfreebobavc/ieee1394service.h

    r183 r185  
    8282    fb_quadlet_t* transactionBlock( fb_nodeid_t nodeId, 
    8383                                    fb_quadlet_t* buf, 
    84                                     int len ); 
     84                                    int len, 
     85                                    unsigned int* resp_len ); 
    8586 
    8687    bool transactionBlockClose(); 
  • trunk/libfreebob/src/libfreebobstreaming/freebob_connections.c

    r159 r185  
    1 /* $Id$ */ 
    2  
    31/* 
    42 *   FreeBob Streaming API 
  • trunk/libfreebob/src/libfreebobstreaming/freebob_connections.h

    r164 r185  
    1 /* $Id$ */ 
    2  
    31/* 
    42 *   FreeBob Streaming API 
  • trunk/libfreebob/src/libfreebobstreaming/freebob_debug.h

    r164 r185  
    8585        //#define DEBUG_LEVEL (DEBUG_LEVEL_BUFFERS | DEBUG_LEVEL_RUN_CYCLE | (DEBUG_LEVEL_XRUN_RECOVERY)| DEBUG_LEVEL_STARTUP ) 
    8686        //#define DEBUG_LEVEL (DEBUG_LEVEL_RUN_CYCLE | (DEBUG_LEVEL_XRUN_RECOVERY)| DEBUG_LEVEL_STARTUP | DEBUG_LEVEL_PACKETCOUNTER| DEBUG_LEVEL_WAIT) 
    87         #define DEBUG_LEVEL (  DEBUG_LEVEL_RUN_CYCLE | DEBUG_LEVEL_XRUN_RECOVERY | \ 
    88                                            DEBUG_LEVEL_STARTUP | DEBUG_LEVEL_PACKETCOUNTER) 
     87        #define DEBUG_LEVEL (   \ 
     88                                0 * DEBUG_LEVEL_BUFFERS | \ 
     89                                0 * DEBUG_LEVEL_HANDLERS | \ 
     90                                0 * DEBUG_LEVEL_HANDLERS_LOWLEVEL | \ 
     91                                1 * DEBUG_LEVEL_XRUN_RECOVERY | \ 
     92                                0 * DEBUG_LEVEL_WAIT | \ 
     93                                0 * DEBUG_LEVEL_RUN_CYCLE | \ 
     94                                1 * DEBUG_LEVEL_PACKETCOUNTER | \ 
     95                                1 * DEBUG_LEVEL_STARTUP | \ 
     96                                0 * DEBUG_LEVEL_THREADS | \ 
     97                                0 * DEBUG_LEVEL_STREAMS \ 
     98                            ) 
    8999 
    90100        //#define DEBUG_LEVEL (DEBUG_LEVEL_XRUN_RECOVERY | DEBUG_LEVEL_STARTUP | DEBUG_LEVEL_PACKETCOUNTER) 
  • trunk/libfreebob/src/libfreebobstreaming/freebob_streaming.c

    r165 r185  
    104104        printMessage("  RAW1394 ISO Prebuffers   : %d\n",options.iso_prebuffers); 
    105105        printMessage("  RAW1394 ISO IRQ Interval : %d\n",options.iso_irq_interval); 
     106        printMessage("  Directions               : %X\n",options.directions); 
    106107         
    107108        // initialize the freebob_device 
     
    178179        /* Read the connection specification 
    179180         */ 
    180          
    181         libfreebob_capture_connections=freebob_get_connection_info(dev->fb_handle, options.node_id, 0); 
    182         libfreebob_playback_connections=freebob_get_connection_info(dev->fb_handle, options.node_id, 1); 
    183                          
     181  
     182        if(!(options.directions & FREEBOB_IGNORE_CAPTURE)) { 
     183                libfreebob_capture_connections=freebob_get_connection_info(dev->fb_handle, options.node_id, 0); 
     184        } 
     185 
     186        if(!(options.directions & FREEBOB_IGNORE_PLAYBACK)) { 
     187                libfreebob_playback_connections=freebob_get_connection_info(dev->fb_handle, options.node_id, 1); 
     188        } 
     189  
     190 
    184191        if (libfreebob_capture_connections) { 
    185192                dev->nb_connections_capture=libfreebob_capture_connections->nb_connections; 
     
    925932} 
    926933 
     934int freebob_streaming_reset_playback_streams(freebob_device_t *dev) { 
     935        int i; 
     936        int err=0; 
     937         
     938        for(i=0; i < dev->nb_playback_streams; i++) { 
     939                freebob_stream_t *stream; 
     940 
     941                stream=*(dev->playback_streams+i); 
     942                 
     943                assert(stream); 
     944                err=freebob_streaming_reset_stream(dev, stream); 
     945                if (err) { 
     946                        printError("Could not reset stream %d\n",i); 
     947                        return -1; 
     948                } 
     949        } 
     950        return 0; 
     951         
     952} 
     953 
    927954int freebob_streaming_reset(freebob_device_t *dev) { 
    928955        /*  
     
    14271454                                        connection->raw_handle,  
    14281455                                        iso_master_receive_handler,  
    1429                                         connection->iso.buffers*2,  // use 2 times the transmit buffer for the receive buffer 
     1456                                        /* the receive buffer size doesn't matter for the latency,  
     1457                                           but it has a minimal value in order for libraw to operate correctly (300)  
     1458                                        */ 
     1459                                        400, 
    14301460                                        AMDTP_MAX_PACKET_SIZE,  
    14311461                                        connection->iso.iso_channel,  
    1432                                         RAW1394_DMA_BUFFERFILL,  
     1462//                                      RAW1394_DMA_BUFFERFILL,  
     1463                                        /* Packet per buffer enables low latency */ 
     1464                                        RAW1394_DMA_PACKET_PER_BUFFER,  
    14331465                                        connection->iso.irq_interval); 
    14341466 
     
    14401472                                        connection->raw_handle,  
    14411473                                        iso_slave_receive_handler,  
    1442                                         connection->iso.buffers*2,  // use 2 times the transmit buffer for the receive buffer  
     1474                                        /* the receive buffer size doesn't matter for the latency,  
     1475                                           but it has a minimal value in order for libraw to operate correctly (300)  
     1476                                        */ 
     1477                                        400, 
    14431478                                        AMDTP_MAX_PACKET_SIZE,  
    14441479                                        connection->iso.iso_channel,  
    1445                                         RAW1394_DMA_BUFFERFILL,  
     1480//                                      RAW1394_DMA_BUFFERFILL,  
     1481                                        /* Packet per buffer enables low latency */ 
     1482                                        RAW1394_DMA_PACKET_PER_BUFFER,  
    14461483                                        connection->iso.irq_interval); 
    14471484                } 
     
    15551592         
    15561593        // FIXME: only works for sync on receive stream because we don't prefill. 
    1557          
     1594        // ?FIXED? 
     1595        if(connection->spec.direction==1) { // playback 
     1596                int i; 
     1597 
     1598                if((err=freebob_streaming_reset_playback_streams(dev))<0) { 
     1599                        printError("Could not reset playback streams.\n"); 
     1600                        return err; 
     1601                } 
     1602 
     1603                // put nb_periods*period_size of null frames into the playback buffers 
     1604                if((err=freebob_streaming_prefill_playback_streams(dev))<0) { 
     1605                        printError("Could not prefill playback streams.\n"); 
     1606                        return err; 
     1607                } 
     1608                         
     1609                // we should transfer nb_buffers periods of playback from the stream buffers to the event buffer 
     1610                for (i=0;i<dev->options.nb_buffers;i++) { 
     1611                        freebob_streaming_transfer_playback_buffers(dev); 
     1612                } 
     1613        }        
     1614 
    15581615        debugPrint(DEBUG_LEVEL_STARTUP, "  stream is running.\n"); 
    15591616 
     
    19291986//                      debugPrint(DEBUG_LEVEL_PACKETCOUNTER, "Stream %d,%d,%d is midi, dbc=%d  [",s,stream->spec.location,stream->spec.position,dbc); 
    19301987                                                 
    1931                         for(j = (dbc%8)+stream->spec.location-1; j < nsamples; j += 8) { 
     1988//                      for(j = (dbc%8)+stream->spec.location-1; j < nsamples; j += 8) { 
     1989                        for(j = (dbc & 0x07)+stream->spec.location-1; j < nsamples; j += 8) { 
    19321990                                target_event=(quadlet_t *)(events + ((j * connection->spec.dimension) + stream->spec.position)); 
    19331991                                quadlet_t sample_int=ntohl(*target_event); 
     
    20122070                                read=freebob_ringbuffer_read(stream->buffer, (char *)(stream->user_buffer), 1*sizeof(quadlet_t))/sizeof(quadlet_t); 
    20132071                                if(read) { 
    2014                                         j = (dbc%8)+stream->spec.location-1;  
     2072//                                      j = (dbc%8)+stream->spec.location-1;  
     2073                                        j = (dbc & 0x07)+stream->spec.location-1;  
    20152074                                        target_event=(quadlet_t *)(events + ((j * connection->spec.dimension) + stream->spec.position)); 
    20162075                                        buffer=((quadlet_t *)(stream->user_buffer)); 
     
    21302189                return RAW1394_ISO_DEFER; 
    21312190        } 
    2132         if( (!(connection->status.packets % 2))) { 
     2191//      if( (!(connection->status.packets % 2))) { 
     2192        if( (!(connection->status.packets & 0x01))) { 
    21332193                return RAW1394_ISO_DEFER; 
    21342194        } 
     
    22112271                return RAW1394_ISO_DEFER; 
    22122272        } 
    2213         if( (!(connection->status.packets % 2))) { 
     2273//      if( (!(connection->status.packets % 2))) { 
     2274        if( (!(connection->status.packets & 0x01))) { 
    22142275                return RAW1394_ISO_DEFER; 
    22152276        } 
     
    23382399                return RAW1394_ISO_DEFER; 
    23392400        } 
    2340         if( (!(connection->status.packets % 2))) { 
     2401//      if( (!(connection->status.packets % 2))) { 
     2402        if( (!(connection->status.packets & 0x01))) { 
    23412403                return RAW1394_ISO_DEFER; 
    23422404        } 
  • trunk/libfreebob/src/libfreebobstreaming/freebob_streaming_private.h

    r159 r185  
    1 /* $Id$ */ 
    2  
    31/* 
    42 *   FreeBob Streaming API 
  • trunk/libfreebob/src/libfreebobstreaming/messagebuffer.c

    r159 r185  
    3030 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
    3131 * 
    32  *  $Id$ 
    3332 */ 
    3433 
  • trunk/libfreebob/src/libfreebobstreaming/messagebuffer.h

    r159 r185  
    3131 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
    3232 * 
    33  *  $Id$ 
    3433 */ 
    3534 
  • trunk/libfreebob/src/libfreebobstreaming/ringbuffer.h

    r159 r185  
    2323    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
    2424 
    25     $Id$ 
    2625*/ 
    2726 
  • trunk/libfreebob/src/libfreebobstreaming/thread.c

    r159 r185  
    2727  Thread creation function including workarounds for real-time scheduling 
    2828  behaviour on different glibc versions. 
    29  
    30   $Id$ 
    3129 
    3230*/ 
  • trunk/libfreebob/src/libfreebobstreaming/thread.h

    r159 r185  
    2222    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
    2323 
    24     $Id$ 
    2524*/ 
    2625 
  • trunk/libfreebob/src/Makefile.am

    r171 r185  
    11# Makefile.am - Makefile template 
    2 # Copyright (C) 2005 by Daniel Wagner. 
     2# Copyright (C) 2005,06 by Daniel Wagner. 
    33# Copyright (C) 2006 by Pieter Palmers. 
    44# 
     
    2525lib_LTLIBRARIES = libfreebob.la 
    2626 
    27 libfreebob_la_SOURCES =         \ 
    28         avdevice.cpp            \ 
    29         avdevice.h              \ 
    30         avdevicesubunit.cpp     \ 
    31         avdevicesubunit.h       \ 
    32         avdevicexml.cpp         \ 
    33         avplug.cpp              \ 
    34         avplug.h                \ 
    35         avplugxml.cpp           \ 
    36         configrom.cpp           \ 
    37         configrom.h             \ 
    38         csr1212.c               \ 
    39         csr1212.h               \ 
    40         devicemanager.cpp       \ 
    41         devicemanager.h         \ 
    42         fbtypes.h               \ 
    43         freebob.cpp             \ 
    44         functionblock.cpp       \ 
    45         functionblock.h         \ 
    46         xmlparser.c 
     27libfreebob_la_SOURCES =                         \ 
     28        configrom.h                             \ 
     29        configrom.cpp                           \ 
     30        csr1212.h                               \ 
     31        csr1212.c                               \ 
     32        devicemanager.h                         \ 
     33        devicemanager.cpp                       \ 
     34        fbtypes.h                               \ 
     35        freebob.cpp                             \ 
     36        xmlparser.c                             \ 
     37        bebob/bebob_avdevice.h                  \ 
     38        bebob/bebob_avdevice.cpp                \ 
     39        bebob/bebob_avdevice_xml.cpp            \ 
     40        bebob/bebob_avdevice_subunit.h          \ 
     41        bebob/bebob_avdevice_subunit.cpp        \ 
     42        bebob/bebob_avplug.h                    \ 
     43        bebob/bebob_avplug.cpp                  \ 
     44        bebob/bebob_avplug_xml.cpp              \ 
     45        bebob/bebob_functionblock.h             \ 
     46        bebob/bebob_functionblock.cpp           \ 
     47        bounce/bounce_avdevice.h                \ 
     48        bounce/bounce_avdevice.cpp 
     49 
     50 
    4751 
    4852libfreebob_la_LDFLAGS = -version-info $(LT_VERSION) -lpthread $(LIBSIGC_LIBS) \ 
    4953        $(LIBRAW1394_LIBS) $(LIBIEC61883_LIBS) $(LIBAVC1394_LIBS) \ 
    50         $(LIBLO_LIBS) $(LIBXML_LIBS) debugmodule/libdebugmodule.la \ 
    51         libfreebobavc/libfreebobavc.la \ 
    52        libfreebobstreaming/libfreebobstreaming.la \ 
    53         -safe-temps 
     54        $(LIBLO_LIBS) $(LIBXML_LIBS) -safe-temps 
     55 
     56libfreebob_la_LIBADD = debugmodule/libdebugmodule.la libfreebobavc/libfreebobavc.la \ 
     57        libfreebobstreaming/libfreebobstreaming.la 
    5458 
    5559 
  • trunk/libfreebob/tests/Makefile.am

    r183 r185  
    2121        $(LIBAVC1394_CFLAGS) 
    2222 
    23 noinst_PROGRAMS = test-freebob test-extplugcmd 
     23noinst_PROGRAMS = test-freebob test-extplugcmd freebob-server 
    2424noinst_HEADERS =  
    2525 
     
    3030test_extplugcmd_LDADD = $(top_builddir)/src/libfreebobavc/libfreebobavc.la -lavc1394 
    3131 
     32freebob_server_SOURCES = freebob-server.c 
     33freebob_server_LDADD   = $(top_builddir)/src/libfreebob.la $(LIBXML_LIBS) -lavc1394 -lrom1394 
     34 
     35 
    3236#TESTS_ENVIRONMENT 
    3337TEST = test-freebob 
  • trunk/libfreebob/tests/streaming/teststreaming.c

    r160 r185  
    7777        dev_options.iso_irq_interval=8; 
    7878         
    79         dev_options.port=1
     79        dev_options.port=0
    8080        dev_options.node_id=-1; 
    8181         
  • trunk/libfreebob/tests/streaming/teststreaming3.c

    r160 r185  
    4848{ 
    4949 
    50         #define PERIOD_SIZE 64 
     50        #define PERIOD_SIZE 256 
    5151 
    5252        int samplesread=0; 
     
    7676        dev_options.period_size=PERIOD_SIZE; 
    7777 
    78         dev_options.nb_buffers=2
     78        dev_options.nb_buffers=3
    7979 
    8080        dev_options.iso_buffers=40; 
     
    8282        dev_options.iso_irq_interval=2; 
    8383         
    84         dev_options.port=1
     84        dev_options.port=0
    8585        dev_options.node_id=-1; 
    8686 
     
    119119         
    120120        for (i=0;i<nb_out_channels;i++) { 
    121                 switch (freebob_streaming_get_capture_stream_type(dev,i)) { 
     121                switch (freebob_streaming_get_playback_stream_type(dev,i)) { 
    122122                        case freebob_stream_type_audio: 
    123123                                if (i<nb_in_channels) { 
  • trunk/libfreebob/tests/test-freebob.c

    r183 r185  
    252252        } 
    253253                 
    254         if ( freebob_discover_devices( fb_handle, 0 ) != 0 ) { 
     254        if ( freebob_discover_devices( fb_handle, arguments.verbose ) != 0 ) { 
    255255            fprintf( stderr, "Could not discover devices\n" ); 
    256256            freebob_destroy_handle( fb_handle ); 
     
    350350        } 
    351351                 
    352         if ( freebob_discover_devices( fb_handle, 0 ) != 0 ) { 
     352        if ( freebob_discover_devices( fb_handle, arguments.verbose ) != 0 ) { 
    353353            fprintf( stderr, "Could not discover devices\n" ); 
    354354            freebob_destroy_handle( fb_handle ); 
     
    378378        } 
    379379                 
    380         if ( freebob_discover_devices( fb_handle, 0 ) != 0 ) { 
     380        if ( freebob_discover_devices( fb_handle, arguments.verbose ) != 0 ) { 
    381381            fprintf( stderr, "Could not discover devices\n" ); 
    382382            freebob_destroy_handle( fb_handle );