Changeset 445

Show
Ignore:
Timestamp:
04/02/07 12:35:17 (17 years ago)
Author:
pieterpalmers
Message:

* name change from FreeBoB to FFADO
* replaced tabs by 4 spaces
* got rid of end-of-line spaces
* made all license and copyrights conform

library becomes LGPL, apps become GPL
explicitly state LGPL v2.1 and GPL v2 (don't like v3 draft)

copyrights are 2005-2007 Daniel & Pieter
except for the MotU stuff (C) Jonathan, Pieter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/autogen.sh

    r125 r445  
    22# Run this to generate all the initial makefiles, etc. 
    33 
    4  
    54autoreconf -f -i -s 
    6 ./configure --enable-maintainer-mode 
    7 make 
  • trunk/libffado/ChangeLog

    r336 r445  
     1REMARK: Please use the SVN commit messages as replacement for ChangeLog 
     2 
     32007-03-20  Pieter Palmers 
     4    * name change from FreeBoB to FFADO 
     5    * replaced tabs by 4 spaces 
     6    * got rid of end-of-line spaces 
     7    * made all license and copyrights conform 
     8       library becomes LGPL, apps become GPL 
     9       explicitly state LGPL v2.1 and GPL v2 (don't like v3 draft) 
     10       copyrights are 2005-2007 Daniel & Pieter 
     11       except for the MotU stuff (C) Jonathan, Pieter 
     12 
    1132006-11-20  Daniel Wagner  <wagi@monom.org> 
    214 
    3        * freebob_set_samplerate: return value consitency fix. On success 
    4        it return 0 else -1. Reported by Jamie Gennis jgennis at gmail dot com 
    5  
    6        * freebob_streaming_start: Reset the playback ringbuffer before calling  
    7        freebob_streaming_start.  
    8          
     15    * freebob_set_samplerate: return value consitency fix. On success 
     16    it return 0 else -1. Reported by Jamie Gennis jgennis at gmail dot com 
     17 
     18    * freebob_streaming_start: Reset the playback ringbuffer before calling  
     19    freebob_streaming_start.  
     20     
    9212006-11-12  Daniel Wagner  <wagi@monom.org> 
    1022 
    11        * test mixer programm added. 
    12  
    13        * basic function block AV/C commands added. 
    14        test program for setting the volume added. 
     23    * test mixer programm added. 
     24 
     25    * basic function block AV/C commands added. 
     26    test program for setting the volume added. 
    1527 
    16282006-11-11  Daniel Wagner  <wagi@monom.org> 
    1729 
    18        * src/bebob/bebob_avdevice.cpp (setSamplingFrequencyPlug): copy past 
    19        error fixed. Reported by Jamie Gennis jgennis at gmail dot com 
     30    * src/bebob/bebob_avdevice.cpp (setSamplingFrequencyPlug): copy past 
     31    error fixed. Reported by Jamie Gennis jgennis at gmail dot com 
    2032 
    21332006-08-27  Daniel Wagner  <wagi@monom.org> 
    2234 
    23        * configure.ac: Version set to 1.4.0 
    24        * maudio device support infrastructure added. Implements 
    25        IAvDevice interface, discover reads the information from 
    26        an xml file.  
     35    * configure.ac: Version set to 1.4.0 
     36    * maudio device support infrastructure added. Implements 
     37    IAvDevice interface, discover reads the information from 
     38    an xml file.  
    2739 
    28402006-08-22  Daniel Wagner  <wagi@monom.org> 
    2941 
    30        * configure.ac: Version bump to 1.3.0 
    31        * freebob_sync allows now to set the sync mode. It does not 
    32        check yet if it really could set the mode. 
     42    * configure.ac: Version bump to 1.3.0 
     43    * freebob_sync allows now to set the sync mode. It does not 
     44    check yet if it really could set the mode. 
    3345 
    34462006-07-17  Daniel Wagner  <wagi@monom.org> 
    3547 
    36        * configure.ac: Version bump to 1.2.0 
    37        * freebob_sync program added 
    38        * Basic interface added for sync info 
     48    * configure.ac: Version bump to 1.2.0 
     49    * freebob_sync program added 
     50    * Basic interface added for sync info 
    3951 
    40522006-07-02  Daniel Wagner  <wagi@monom.org> 
    4153 
    42        * firmware downloader: check device firmware compatibility 
     54    * firmware downloader: check device firmware compatibility 
    4355 
    44562006-06-27  Daniel Wagner  <wagi@monom.org> 
    4557 
    46        * configure.ac: Version bump to 1.1.0 
    47        * remove bebob_light code 
    48        * downloader various improvements 
    49        * ConfigRom::isAvcDevice() removed. Device probe code added.  
    50        Each device driver class can check if it supports a device. 
     58    * configure.ac: Version bump to 1.1.0 
     59    * remove bebob_light code 
     60    * downloader various improvements 
     61    * ConfigRom::isAvcDevice() removed. Device probe code added.  
     62    Each device driver class can check if it supports a device. 
    5163 
    52642006-06-24  Daniel Wagner  <wagi@monom.org> 
    5365 
    54        * tests/streaming/Makefile.am: Fixed build problem with missing '/'. 
     66    * tests/streaming/Makefile.am: Fixed build problem with missing '/'. 
    5567 
    56682006-06-21  Daniel Wagner  <wagi@monom.org> 
    5769 
    58        * freebob-downloader first version added 
     70    * freebob-downloader first version added 
    5971 
    60722006-06-10  Daniel Wagner  <wagi@monom.org> 
    6173 
    62        * Changed building rules: No static sub libraries 
    63        are build anymore. 
     74    * Changed building rules: No static sub libraries 
     75    are build anymore. 
    6476 
    65772006-06-01  Daniel Wagner  <wagi@monom.org> 
    6678 
    67        * configure.ac: Version bump to 1.0.0 
    68  
    69        * Changed all FreeBob to FreeBoB 
    70        * Removed all .cvsignore 
    71        * Added Pieter to AUTHORS 
    72        * Updated NEWS and README (release canditate date added) 
     79    * configure.ac: Version bump to 1.0.0 
     80 
     81    * Changed all FreeBob to FreeBoB 
     82    * Removed all .cvsignore 
     83    * Added Pieter to AUTHORS 
     84    * Updated NEWS and README (release canditate date added) 
    7385 
    74862006-05-31  Daniel Wagner  <wagi@monom.org> 
    7587 
    76        * Free all allocated asprintf buffers after xmlNewChild. 
    77        Compiler warning removed 
     88    * Free all allocated asprintf buffers after xmlNewChild. 
     89    Compiler warning removed 
    7890 
    79912006-05-31  Pieter Palmers  <pieterpalmers@users.sourceforge.net> 
     
    110122 
    1111232006-05-26  Pieter Palmers  <pieterpalmers@users.sourceforge.net> 
    112        * src/libfreebobstreaming/*:  
     124    * src/libfreebobstreaming/*:  
    113125    - added a 'verbose' option to disable/enable message output 
    114126    - removed some residual messages 
     
    131143 
    1321442006-05-12  Pieter Palmers  <pieterpalmers@users.sourceforge.net> 
    133        * src/libfreebobstreaming/*:  
    134        - Code cleanup 
    135        - Improved SSE code 
    136        - ISO connection parameters are calculated instead of being user 
    137          specified. Note: you need a new jackd backend version due to this. 
    138          
    139        * configure.ac: Version bumped to 0.8.2 
     145    * src/libfreebobstreaming/*:  
     146    - Code cleanup 
     147    - Improved SSE code 
     148    - ISO connection parameters are calculated instead of being user 
     149      specified. Note: you need a new jackd backend version due to this. 
     150     
     151    * configure.ac: Version bumped to 0.8.2 
    140152 
    1411532006-05-06  Daniel Wagner  <wagi@monom.org> 
    142154 
    143        * This patch fixes two issues when building: 
    144        - libfreebob include files aren't found when build dir != source dir 
    145        - some libraries aren't found when they're not in a system install dir 
    146  
    147        Jeremy Kerr 
     155    * This patch fixes two issues when building: 
     156    - libfreebob include files aren't found when build dir != source dir 
     157    - some libraries aren't found when they're not in a system install dir 
     158 
     159    Jeremy Kerr 
    148160 
    1491612006-05-04  Pieter Palmers  <pieterpalmers@users.sourceforge.net> 
    150162 
    151        * configure.ac: Version bumped to 0.8.1 
    152  
    153        * Introduced SSE-accellerated packet encoders/decoders 
     163    * configure.ac: Version bumped to 0.8.1 
     164 
     165    * Introduced SSE-accellerated packet encoders/decoders 
    154166 
    1551672006-05-04  Daniel Wagner  <wagi@monom.org> 
    156168 
    157        * configure.ac: Version bumped to 0.8.0 
    158  
    159        * Discovering code ported stable 0.2.0 version 
    160        to head and activated for default discovering. 
     169    * configure.ac: Version bumped to 0.8.0 
     170 
     171    * Discovering code ported stable 0.2.0 version 
     172    to head and activated for default discovering. 
    161173 
    1621742006-05-04  Daniel Wagner  <wagi@monom.org> 
    163175 
    164        * configure.ac: Version bumped to 0.7.2 
    165  
    166        * src/bebob: Some cleanup on naming and 
    167        namespaces. 
     176    * configure.ac: Version bumped to 0.7.2 
     177 
     178    * src/bebob: Some cleanup on naming and 
     179    namespaces. 
    168180 
    1691812006-05-03  Daniel Wagner  <wagi@monom.org> 
    170182 
    171        * configure.ac: Version bumped to 0.7.1 
    172  
    173        * Fixed bug in SignalSource command which 
    174        prevented one to set the samplerate. 
     183    * configure.ac: Version bumped to 0.7.1 
     184 
     185    * Fixed bug in SignalSource command which 
     186    prevented one to set the samplerate. 
    175187 
    1761882006-04-23  Daniel Wagner  <wagi@monom.org> 
    177189 
    178        * configure.ac: Version bumped to 0.7.0 
    179  
    180        * Abstract interface IAvDevice introduced.  
    181        * BeBoB device discovering code moved into bebob directory. 
    182        * Bounce device added. 
     190    * configure.ac: Version bumped to 0.7.0 
     191 
     192    * Abstract interface IAvDevice introduced.  
     193    * BeBoB device discovering code moved into bebob directory. 
     194    * Bounce device added. 
    183195 
    1841962006-04-17  Daniel Wagner  <wagi@monom.org> 
    185197 
    186        * configure.ac: Version bumped to 0.6.4 
    187  
    188        * src/libfreebobavc/avc_generic.cpp (serialize): Decode subunit_type  
    189        and subunit_id field. 
    190        (fire): avc1394_transaction_block2 inteface change update. 
    191        * src/libfreebobavc/ieee1394service.cpp (transactionBlock): Likewise. 
    192        * src/libfreebobavc/ieee1394service.h: Likewise. 
     198    * configure.ac: Version bumped to 0.6.4 
     199 
     200    * src/libfreebobavc/avc_generic.cpp (serialize): Decode subunit_type  
     201    and subunit_id field. 
     202    (fire): avc1394_transaction_block2 inteface change update. 
     203    * src/libfreebobavc/ieee1394service.cpp (transactionBlock): Likewise. 
     204    * src/libfreebobavc/ieee1394service.h: Likewise. 
    193205 
    1942062006-04-11  Daniel Wagner  <wagi@monom.org> 
    195207 
    196        * configure.ac: Version bumped to 0.6.3 
    197          
    198        * src/avdevicesubunit.cpp (discoverFunctionBlocks): reformating. 
    199        (discoverFunctionBlocksDo): Really added a correct 
    200        bugfix for the reuse of ExtendedSubunitInfoCmd. 
     208    * configure.ac: Version bumped to 0.6.3 
     209     
     210    * src/avdevicesubunit.cpp (discoverFunctionBlocks): reformating. 
     211    (discoverFunctionBlocksDo): Really added a correct 
     212    bugfix for the reuse of ExtendedSubunitInfoCmd. 
    201213 
    2022142006-04-07  Pieter Palmers <pieterpalmers@users.sourceforge.net> 
    203215 
    204        * src/avdevice.h src/avdevice.cpp: moved the include of stdint.h 
    205        from the implementation to the header, to fix certain compilation 
    206        problems wrt uint64_t. This datatype is also used in the class 
    207        definition in avdevice.h. 
     216    * src/avdevice.h src/avdevice.cpp: moved the include of stdint.h 
     217    from the implementation to the header, to fix certain compilation 
     218    problems wrt uint64_t. This datatype is also used in the class 
     219    definition in avdevice.h. 
    208220 
    2092212006-04-05  Pieter Palmers <pieterpalmers@users.sourceforge.net> 
    210222 
    211        * configure.ac: Version bump to 0.6.2 
    212  
    213        * src/freebob.cpp: Retry setting the sample rate if it fails the 
    214        first time. 
    215          
    216        * src/libfreebobstreaming/*: Added an way to choose for playback 
    217        or capture only (for ALSA plugin), using the options passed when 
    218        creating the freebob device.  * src/libfreebobstreaming/*: fixed 
    219        the bug that prevented playback only operation. 
     223    * configure.ac: Version bump to 0.6.2 
     224 
     225    * src/freebob.cpp: Retry setting the sample rate if it fails the 
     226    first time. 
     227     
     228    * src/libfreebobstreaming/*: Added an way to choose for playback 
     229    or capture only (for ALSA plugin), using the options passed when 
     230    creating the freebob device.  * src/libfreebobstreaming/*: fixed 
     231    the bug that prevented playback only operation. 
    220232 
    2212332006-04-04  Daniel Wagner  <wagi@monom.org> 
    222234 
    223        * configure.ac: Version bump to 0.6.1 
    224  
    225        * src/avdevicesubunit.cpp (discoverFunctionBlocksDo):  
    226        ExtendedSubunitInfoCmd is not reusable at this point.  
    227        Moved into its own block so that's initatilialized correctly. 
     235    * configure.ac: Version bump to 0.6.1 
     236 
     237    * src/avdevicesubunit.cpp (discoverFunctionBlocksDo):  
     238    ExtendedSubunitInfoCmd is not reusable at this point.  
     239    Moved into its own block so that's initatilialized correctly. 
    228240 
    2292412006-03-30  Daniel Wagner  <wagi@monom.org> 
    230242 
    231        * configure.ac: Version bump to 0.6.0 
    232  
    233        * src/*: Verbose bool turned int verbose level. 
    234          
    235        * src/libfreebobavc/*: Moved fire implementation to  
    236        base class (AVCCommand).  
    237          
    238        * libfreebob/freebob.h: freebob_sleep_after_avc_command 
    239        workaround added. 
    240  
    241        * tests/test-freebob.c: Verbose bool turned into verbose level. 
    242        Workaround: sleep after avc command added. 
    243  
    244        * tests/streaming/Makefile.am (*_SOURCES): Added libavc1394 to LDADD. 
    245        * tests/Makefile.am (*_SOURCES): Likewise. 
    246          
    247        * tests/streaming/teststreaming2.c (fid_in): compiler warning fixed. 
     243    * configure.ac: Version bump to 0.6.0 
     244 
     245    * src/*: Verbose bool turned int verbose level. 
     246     
     247    * src/libfreebobavc/*: Moved fire implementation to  
     248    base class (AVCCommand).  
     249     
     250    * libfreebob/freebob.h: freebob_sleep_after_avc_command 
     251    workaround added. 
     252 
     253    * tests/test-freebob.c: Verbose bool turned into verbose level. 
     254    Workaround: sleep after avc command added. 
     255 
     256    * tests/streaming/Makefile.am (*_SOURCES): Added libavc1394 to LDADD. 
     257    * tests/Makefile.am (*_SOURCES): Likewise. 
     258     
     259    * tests/streaming/teststreaming2.c (fid_in): compiler warning fixed. 
    248260 
    2492612006-03-20  Daniel Wagner  <wagi@monom.org> 
    250262 
    251        * configure.ac: Version bump to 0.5.2 
    252  
    253        * src/avplug.cpp (discoverStreamFormat): If no stream format information 
    254        is available or format hierarchy root is not Audio&Music skip plug.  
    255        (discoverSupportedStreamFormats): Added 'support' for IEC60968-3 (SPDIF transparent) 
     263    * configure.ac: Version bump to 0.5.2 
     264 
     265    * src/avplug.cpp (discoverStreamFormat): If no stream format information 
     266    is available or format hierarchy root is not Audio&Music skip plug.  
     267    (discoverSupportedStreamFormats): Added 'support' for IEC60968-3 (SPDIF transparent) 
    256268 
    2572692006-03-15  Daniel Wagner  <wagi@monom.org> 
    258270 
    259        * configure.ac: Version bump to 0.5.1 
    260          
    261        * src/libfreebobavc/avc_extended_plug_info.cpp (fire):  
    262          Handle NOT_IMPLEMENTED. 
    263          
    264        * src/avplug.h: Input and output plug discovering part 
    265        fixed. Now connection are correctly handled. 
    266        * src/avplug.cpp: Likewise. 
    267        * src/avdevicesubunit.cpp: Likewise. 
     271    * configure.ac: Version bump to 0.5.1 
     272     
     273    * src/libfreebobavc/avc_extended_plug_info.cpp (fire):  
     274      Handle NOT_IMPLEMENTED. 
     275     
     276    * src/avplug.h: Input and output plug discovering part 
     277    fixed. Now connection are correctly handled. 
     278    * src/avplug.cpp: Likewise. 
     279    * src/avdevicesubunit.cpp: Likewise. 
    268280 
    2692812006-03-12  Daniel Wagner  <wagi@monom.org> 
    270282 
    271        * src/libfreebobavc/ieee1394service.cpp (transactionBlock): Set retry 
    272        value to 10.  
     283    * src/libfreebobavc/ieee1394service.cpp (transactionBlock): Set retry 
     284    value to 10.  
    273285 
    2742862006-03-10  Daniel Wagner  <wagi@monom.org> 
    275287 
    276        * configure.ac: Version bump to 0.5.0 
    277  
    278        * src/avdevice.cpp: Plug connection discovering 
    279        finished.  
    280        * src/avdevicesubunit.cpp: Likewise. 
    281        * src/avdevicesubunit.h: Likewise. 
    282        * src/avplug.cpp: Likewise. 
    283        * src/avplug.h: Likewise. 
    284        * src/functionblock.cpp: Likewise. 
    285        * src/functionblock.h: Likewise. 
    286          
    287        * src/libfreebobavc/Makefile.am: New files added. 
    288        * src/libfreebobavc/avc_extended_subunit_info.cpp: Likewise. 
    289        * src/libfreebobavc/avc_extended_subunit_info.h: Likewise 
    290  
    291        * src/libfreebobavc/avc_definitions.h: Several small improvements. 
    292        * src/libfreebobavc/avc_extended_cmd_generic.cpp: Likewise. 
    293        * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 
    294        * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 
    295        * src/libfreebobavc/avc_generic.cpp: Likewise. 
     288    * configure.ac: Version bump to 0.5.0 
     289 
     290    * src/avdevice.cpp: Plug connection discovering 
     291    finished.  
     292    * src/avdevicesubunit.cpp: Likewise. 
     293    * src/avdevicesubunit.h: Likewise. 
     294    * src/avplug.cpp: Likewise. 
     295    * src/avplug.h: Likewise. 
     296    * src/functionblock.cpp: Likewise. 
     297    * src/functionblock.h: Likewise. 
     298     
     299    * src/libfreebobavc/Makefile.am: New files added. 
     300    * src/libfreebobavc/avc_extended_subunit_info.cpp: Likewise. 
     301    * src/libfreebobavc/avc_extended_subunit_info.h: Likewise 
     302 
     303    * src/libfreebobavc/avc_definitions.h: Several small improvements. 
     304    * src/libfreebobavc/avc_extended_cmd_generic.cpp: Likewise. 
     305    * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 
     306    * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 
     307    * src/libfreebobavc/avc_generic.cpp: Likewise. 
    296308 
    2973092006-03-05  Daniel Wagner  <wagi@monom.org> 
    298310 
    299        * src/avdevice.cpp: Plug connection discovering also on 
    300        subunits (disabled because missing funciton blocks). 
    301        Sync connections code cleanup. 
    302        * src/avdevice.h: Likewise. 
    303        * src/avdevicesubunit.cpp: Likewise. 
    304        * src/avdevicesubunit.h: Likewise. 
    305        * src/avplug.cpp: Likewise. 
    306        * src/avplug.h: Likewise. 
    307  
    308        * src/Makefile.am: Added functionblock.cpp and 
    309        functionblock.h 
    310        * src/functionblock.cpp: New file 
    311        * src/functionblock.h: Likewise. 
     311    * src/avdevice.cpp: Plug connection discovering also on 
     312    subunits (disabled because missing funciton blocks). 
     313    Sync connections code cleanup. 
     314    * src/avdevice.h: Likewise. 
     315    * src/avdevicesubunit.cpp: Likewise. 
     316    * src/avdevicesubunit.h: Likewise. 
     317    * src/avplug.cpp: Likewise. 
     318    * src/avplug.h: Likewise. 
     319 
     320    * src/Makefile.am: Added functionblock.cpp and 
     321    functionblock.h 
     322    * src/functionblock.cpp: New file 
     323    * src/functionblock.h: Likewise. 
    312324 
    3133252006-03-04  Daniel Wagner  <wagi@monom.org> 
    314326 
    315        * src/avdevice.cpp: Sync mode discovering improved. 
    316        * src/avdevice.h: Likewise. 
    317        * src/avplug.cpp: Likewise. 
    318        * src/avplug.h: Likewise. 
    319  
    320        * tests/test-freebob.c: Added 'odiscover' command which 
    321        does not print the xml stuff. 
    322  
    323        * src/avdevice.cpp: Added 'verbose' argument to constructor 
    324        and set debug level to DEBUG_LEVEL_VERBOSE if 'verbose' 
    325        is true, e.g enables verbose mode with '-v' argument passed 
    326        to test-freebob. 
    327        * src/avdevice.h: Likewsise. 
    328        * src/avdevicesubunit.cpp: Likewsise. 
    329        * src/avdevicesubunit.h: Likewsise. 
    330        * src/avplug.cpp: Likewsise. 
    331        * src/avplug.h: Likewsise. 
    332        * src/devicemanager.cpp: Likewsise. 
    333        * src/debugmodule/debugmodule.cpp: Likewsise. 
    334        * src/debugmodule/debugmodule.h: Likewsise. 
    335        * src/debugmodule/test_debugmodule.cpp: Likewsise. 
    336          
    337        * src/avdevice.cpp: eAP_* renamed into eAPA_*. 
    338        EAvPlugDirection and EAvPlugType introduced. All PlugAddress:ePD_ and  
    339        ExtendedPlugInfoPlugTypeSpecificData::eEPIPT_* exchanged with corresponding 
    340        AvPlug definitions. 
    341        * src/avdevice.h: Likewise. 
    342        * src/avdevicesubunit.cpp: Likewise. 
    343        * src/avdevicesubunit.h: Likewise. 
    344        * src/avdevicexml.cpp: Likewise. 
    345        * src/avplug.cpp: Likewise. 
    346        * src/avplug.h: Likewise. 
     327    * src/avdevice.cpp: Sync mode discovering improved. 
     328    * src/avdevice.h: Likewise. 
     329    * src/avplug.cpp: Likewise. 
     330    * src/avplug.h: Likewise. 
     331 
     332    * tests/test-freebob.c: Added 'odiscover' command which 
     333    does not print the xml stuff. 
     334 
     335    * src/avdevice.cpp: Added 'verbose' argument to constructor 
     336    and set debug level to DEBUG_LEVEL_VERBOSE if 'verbose' 
     337    is true, e.g enables verbose mode with '-v' argument passed 
     338    to test-freebob. 
     339    * src/avdevice.h: Likewsise. 
     340    * src/avdevicesubunit.cpp: Likewsise. 
     341    * src/avdevicesubunit.h: Likewsise. 
     342    * src/avplug.cpp: Likewsise. 
     343    * src/avplug.h: Likewsise. 
     344    * src/devicemanager.cpp: Likewsise. 
     345    * src/debugmodule/debugmodule.cpp: Likewsise. 
     346    * src/debugmodule/debugmodule.h: Likewsise. 
     347    * src/debugmodule/test_debugmodule.cpp: Likewsise. 
     348     
     349    * src/avdevice.cpp: eAP_* renamed into eAPA_*. 
     350    EAvPlugDirection and EAvPlugType introduced. All PlugAddress:ePD_ and  
     351    ExtendedPlugInfoPlugTypeSpecificData::eEPIPT_* exchanged with corresponding 
     352    AvPlug definitions. 
     353    * src/avdevice.h: Likewise. 
     354    * src/avdevicesubunit.cpp: Likewise. 
     355    * src/avdevicesubunit.h: Likewise. 
     356    * src/avdevicexml.cpp: Likewise. 
     357    * src/avplug.cpp: Likewise. 
     358    * src/avplug.h: Likewise. 
    347359 
    3483602006-03-02  Daniel Wagner  <wagi@monom.org> 
    349361 
    350        * src/avplug.cpp (discoverStreamFormat): Sanity check turned 
    351        into warning. 
    352  
    353        * configure.ac: bumb minor version to 0.4 
    354  
    355        * src/libfreebobavc/avc_extended_cmd_generic.h: plugAddressPlugDirectionToString 
    356        and plugAddressAddressModeToString added. 
    357        * src/libfreebobavc/avc_extended_cmd_generic.cpp: Likewise. 
    358  
    359        * src/avplug.h: Enum EAvPlugType renamed to EAvPlugAddressType. 
    360        getPlugAddressType added. getPlugType returns now real plug type. 
    361        (class AvPlugManager): getPlugByType added. 
    362  
    363        * src/avdevice.h: getPlugByType added. 
    364        * src/avdevice.cpp: Likewise. 
    365        (discoverSyncModes): Use getPlugByType instead 
    366        of hardcoded id to find sync plugs. 
    367  
    368        * src/devicemanager.h: Verbose argument not in constructor 
    369        instead in discover method. 
    370        * src/devicemanager.cpp: Likewise. 
    371  
    372        * libfreebob/freebob.h (freebob_discover_devices): Verbose argument 
    373        added. 
    374        * src/libfreebobstreaming/freebob_streaming.c: Likewise. 
    375        * src/freebob.cpp: Likewise. 
    376        * tests/test-freebob.c: Likewise. 
     362    * src/avplug.cpp (discoverStreamFormat): Sanity check turned 
     363    into warning. 
     364 
     365    * configure.ac: bumb minor version to 0.4 
     366 
     367    * src/libfreebobavc/avc_extended_cmd_generic.h: plugAddressPlugDirectionToString 
     368    and plugAddressAddressModeToString added. 
     369    * src/libfreebobavc/avc_extended_cmd_generic.cpp: Likewise. 
     370 
     371    * src/avplug.h: Enum EAvPlugType renamed to EAvPlugAddressType. 
     372    getPlugAddressType added. getPlugType returns now real plug type. 
     373    (class AvPlugManager): getPlugByType added. 
     374 
     375    * src/avdevice.h: getPlugByType added. 
     376    * src/avdevice.cpp: Likewise. 
     377    (discoverSyncModes): Use getPlugByType instead 
     378    of hardcoded id to find sync plugs. 
     379 
     380    * src/devicemanager.h: Verbose argument not in constructor 
     381    instead in discover method. 
     382    * src/devicemanager.cpp: Likewise. 
     383 
     384    * libfreebob/freebob.h (freebob_discover_devices): Verbose argument 
     385    added. 
     386    * src/libfreebobstreaming/freebob_streaming.c: Likewise. 
     387    * src/freebob.cpp: Likewise. 
     388    * tests/test-freebob.c: Likewise. 
    377389 
    3783902006-03-01  Daniel Wagner  <wagi@monom.org> 
    379391 
    380        * configure.ac: bumb minor version to 0.3 
    381  
    382        * src/avdevice.cpp: Discover connections between plugs. 
    383        * src/avdevice.h: Likewise. 
    384        * src/avdevicesubunit.cpp: Likewise. 
    385        * src/avdevicesubunit.h: Likewise. 
    386        * src/avdevicexml.cpp: Likewise. 
    387        * src/avplug.cpp: Likewise. 
    388        * src/avplug.h: Likewise. 
    389        * src/devicemanager.cpp: Likewise. 
    390        * src/devicemanager.h: Likewise. 
    391        * src/freebob.cpp: Likewise. 
    392  
    393        * src/libfreebobavc/avc_extended_cmd_generic.cpp: Give 
    394        return value to caller. New undefined plug address 
    395        introduced. Handling of response message is more rebust now. 
    396        * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 
    397        * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 
    398        * src/libfreebobavc/avc_extended_stream_format.cpp: Likewise. 
    399        * src/libfreebobavc/avc_extended_stream_format.h: Likewise. 
    400        * src/libfreebobavc/avc_plug_info.cpp: Likewise. 
    401        * src/libfreebobavc/avc_signal_source.cpp: Likewise. 
    402        * src/libfreebobavc/avc_signal_source.h: Likewise. 
    403        * src/libfreebobavc/avc_subunit_info.cpp: Likewise. 
    404        * src/libfreebobavc/avc_unit_info.cpp: Likewise. 
    405        * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 
    406        * src/libfreebobavc/avc_extended_stream_format.cpp: Likewise. 
    407        * src/libfreebobavc/avc_extended_cmd_generic.cpp: 
    408        * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 
    409  
    410        * src/libfreebobstreaming/freebob_debug.h: DEBUG is defined through --enable-debug 
    411        switch. 
    412  
    413        * src/libfreebobstreaming/freebob_connections.h: Removed double defined variable  
    414        if DEBUG is defined. 
     392    * configure.ac: bumb minor version to 0.3 
     393 
     394    * src/avdevice.cpp: Discover connections between plugs. 
     395    * src/avdevice.h: Likewise. 
     396    * src/avdevicesubunit.cpp: Likewise. 
     397    * src/avdevicesubunit.h: Likewise. 
     398    * src/avdevicexml.cpp: Likewise. 
     399    * src/avplug.cpp: Likewise. 
     400    * src/avplug.h: Likewise. 
     401    * src/devicemanager.cpp: Likewise. 
     402    * src/devicemanager.h: Likewise. 
     403    * src/freebob.cpp: Likewise. 
     404 
     405    * src/libfreebobavc/avc_extended_cmd_generic.cpp: Give 
     406    return value to caller. New undefined plug address 
     407    introduced. Handling of response message is more rebust now. 
     408    * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 
     409    * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 
     410    * src/libfreebobavc/avc_extended_stream_format.cpp: Likewise. 
     411    * src/libfreebobavc/avc_extended_stream_format.h: Likewise. 
     412    * src/libfreebobavc/avc_plug_info.cpp: Likewise. 
     413    * src/libfreebobavc/avc_signal_source.cpp: Likewise. 
     414    * src/libfreebobavc/avc_signal_source.h: Likewise. 
     415    * src/libfreebobavc/avc_subunit_info.cpp: Likewise. 
     416    * src/libfreebobavc/avc_unit_info.cpp: Likewise. 
     417    * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 
     418    * src/libfreebobavc/avc_extended_stream_format.cpp: Likewise. 
     419    * src/libfreebobavc/avc_extended_cmd_generic.cpp: 
     420    * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 
     421 
     422    * src/libfreebobstreaming/freebob_debug.h: DEBUG is defined through --enable-debug 
     423    switch. 
     424 
     425    * src/libfreebobstreaming/freebob_connections.h: Removed double defined variable  
     426    if DEBUG is defined. 
    415427 
    4164282006-02-28  Pieter Palmers <pieterpalmers@users.sourceforge.net> 
    417        * Added the streaming API that was previously hardcoded into the jackd backend 
    418          to the library as src/libfreebobstreaming. 
    419        * Added test programs for the streaming API in tests/streaming 
     429    * Added the streaming API that was previously hardcoded into the jackd backend 
     430      to the library as src/libfreebobstreaming. 
     431    * Added test programs for the streaming API in tests/streaming 
    420432 
    4214332006-02-26  Daniel Wagner  <wagi@monom.org> 
    422434 
    423        * src/avdevice.cpp: Some more refactoring (m_isoInputPlugs and m_isoOutputPlugs 
    424        unified into m_isoPlugs). Discovering of unit external plugs. 
    425        * src/avdevice.h: Likewise. 
    426        * src/avdevicexml.cpp: Likewise. 
    427        * src/avdevicesubunit.cpp: Likewise. 
    428        * src/avdevicesubunit.h: Likewise. 
    429        * src/avplug.cpp: Likewise. 
    430        * src/avplug.h: Likewise. 
    431  
    432        * src/libfreebobavc/avc_extended_cmd_generic.h (class UnitPlugAddress):  
    433        ePT_Unknown enum added. 
     435    * src/avdevice.cpp: Some more refactoring (m_isoInputPlugs and m_isoOutputPlugs 
     436    unified into m_isoPlugs). Discovering of unit external plugs. 
     437    * src/avdevice.h: Likewise. 
     438    * src/avdevicexml.cpp: Likewise. 
     439    * src/avdevicesubunit.cpp: Likewise. 
     440    * src/avdevicesubunit.h: Likewise. 
     441    * src/avplug.cpp: Likewise. 
     442    * src/avplug.h: Likewise. 
     443 
     444    * src/libfreebobavc/avc_extended_cmd_generic.h (class UnitPlugAddress):  
     445    ePT_Unknown enum added. 
    434446 
    4354472006-02-22  Daniel Wagner  <wagi@monom.org> 
    436448 
    437        *  configure.ac 
    438        src/Makefile.am 
     449    *  configure.ac 
     450    src/Makefile.am 
    439451        src/avdevice.cpp 
    440452        src/avdevice.h 
     
    443455        src/avdevicexml.cpp 
    444456        src/avplug.cpp 
    445        src/avplug.h 
     457    src/avplug.h 
    446458        src/avplugxml.cpp 
    447459        src/libfreebobavc/avc_extended_plug_info.cpp 
     
    451463        src/libfreebobavc/avc_plug_info.cpp 
    452464        src/libfreebobavc/avc_plug_info.h: 
    453        Refactoring: plug discovering is now part of AvPlug 
    454        instead of AvDevice. 
    455        All plugs of music and audio subunit are now also 
    456        discovered. 
    457        libfreebobavc: Copy constructor added. 
    458  
    459        The overhaul is not finished. This is the first 
    460        version which works again. 
     465    Refactoring: plug discovering is now part of AvPlug 
     466    instead of AvDevice. 
     467    All plugs of music and audio subunit are now also 
     468    discovered. 
     469    libfreebobavc: Copy constructor added. 
     470 
     471    The overhaul is not finished. This is the first 
     472    version which works again. 
    461473 
    4624742006-01-19  Daniel Wagner  <wagi@monom.org> 
    463475 
    464476        * This patch cleans up the external dependency detection for  
    465        libfreebob. At present, building libfreebob is not possible  
    466        if libraries are outside the system include/library paths  
    467        (ie /usr/ and /usr/local). Use the results of pkg-config to  
    468        specify the correct paths to the automake system. 
    469  
    470        Becuase we're using pkgconfig, there's no real need to use  
    471        AC_CHECK_LIB or AC_CHECK_HEADERS. However, these could  
    472        potentially be reinstated, but need to be fixed to check in  
    473        the locations specified by pkgconfig. 
    474  
    475        * It is not currently possible to build freebob in a directory  
    476        outside the source dir (ie, builddir != srcdir). This patch  
    477        fixes the include paths to allow this. (it's handy for keeping  
    478        the source tree clean, or when building on multiple architectures  
    479        - I use a build dir of $srcdir/obj-$arch-$os) 
    480  
    481        Both patches are written by Jeremy Kerr jk at ozlabs dot org 
     477    libfreebob. At present, building libfreebob is not possible  
     478    if libraries are outside the system include/library paths  
     479    (ie /usr/ and /usr/local). Use the results of pkg-config to  
     480    specify the correct paths to the automake system. 
     481 
     482    Becuase we're using pkgconfig, there's no real need to use  
     483    AC_CHECK_LIB or AC_CHECK_HEADERS. However, these could  
     484    potentially be reinstated, but need to be fixed to check in  
     485    the locations specified by pkgconfig. 
     486 
     487    * It is not currently possible to build freebob in a directory  
     488    outside the source dir (ie, builddir != srcdir). This patch  
     489    fixes the include paths to allow this. (it's handy for keeping  
     490    the source tree clean, or when building on multiple architectures  
     491    - I use a build dir of $srcdir/obj-$arch-$os) 
     492 
     493    Both patches are written by Jeremy Kerr jk at ozlabs dot org 
    482494 
    4834952006-01-12  Daniel Wagner  <wagi@monom.org> 
    484496 
    485        * src/avdevice.cpp: Include stdint.h. 
    486        Some compilers seem to need the definitions. 
     497    * src/avdevice.cpp: Include stdint.h. 
     498    Some compilers seem to need the definitions. 
    487499 
    4885002006-01-08  Daniel Wagner  <wagi@monom.org> 
    489501 
    490        *  libfreebob/freebob.h 
    491        libfreebob/xmlparser.h 
    492        src/avdevice.cpp 
    493        src/xmlparser.c 
    494        tests/test-freebob.c: 
    495        Add stream format info support. 
     502    *  libfreebob/freebob.h 
     503    libfreebob/xmlparser.h 
     504    src/avdevice.cpp 
     505    src/xmlparser.c 
     506    tests/test-freebob.c: 
     507    Add stream format info support. 
    496508 
    497509        * src/avdevice.h 
    498        src/avdevice.cpp:  
    499        Refactoring and code duplication removal. 
    500          
    501        * src/avdevice.cpp (getModelName):  
    502        Return model name and not vendor name. 
    503        (getVendorName):  
    504        Return vendor name and not model name. 
    505        (discoverStep10Plug): Implementation added. 
    506        (enumerateSubUnits): max_subunit_id removed. 
    507        (addXmlDescription): Add stream format infos. 
    508  
    509        * src/avdevice.h: discoverStep10 added. 
    510        Renaming of addPlugToXmlDescription to addXmlDescriptionPlug. 
    511        ESampleRate to ESamplingFrequency changes. 
    512  
    513        * src/avplug.cpp (getSampleRate):  
    514        Use convertESamplingFrequency instead of 
    515        local implementation. 
    516  
    517        * src/avplug.h:  
    518        ESampleRate to ESamplingFrequency changes. 
    519        Added FormatInfo struct. 
    520  
    521        * src/devicemanager.cpp (getXmlDescription):  
    522        Print GUID correctly. 
    523  
    524        * src/freebob.cpp (parseSampleRate):  
    525        Moved to avc_definitions.cpp 
    526  
    527        * src/libfreebobavc/avc_definitions.h 
    528        src/libfreebobavc/avc_definitions.cpp:  
    529        Renamed ESampleRate back to ESamlingFrequency. 
    530        Added connvert functions for ESamplingFrequency. 
    531  
    532        * configure.ac: New micro version. 
     510    src/avdevice.cpp:  
     511    Refactoring and code duplication removal. 
     512     
     513    * src/avdevice.cpp (getModelName):  
     514    Return model name and not vendor name. 
     515    (getVendorName):  
     516    Return vendor name and not model name. 
     517    (discoverStep10Plug): Implementation added. 
     518    (enumerateSubUnits): max_subunit_id removed. 
     519    (addXmlDescription): Add stream format infos. 
     520 
     521    * src/avdevice.h: discoverStep10 added. 
     522    Renaming of addPlugToXmlDescription to addXmlDescriptionPlug. 
     523    ESampleRate to ESamplingFrequency changes. 
     524 
     525    * src/avplug.cpp (getSampleRate):  
     526    Use convertESamplingFrequency instead of 
     527    local implementation. 
     528 
     529    * src/avplug.h:  
     530    ESampleRate to ESamplingFrequency changes. 
     531    Added FormatInfo struct. 
     532 
     533    * src/devicemanager.cpp (getXmlDescription):  
     534    Print GUID correctly. 
     535 
     536    * src/freebob.cpp (parseSampleRate):  
     537    Moved to avc_definitions.cpp 
     538 
     539    * src/libfreebobavc/avc_definitions.h 
     540    src/libfreebobavc/avc_definitions.cpp:  
     541    Renamed ESampleRate back to ESamlingFrequency. 
     542    Added connvert functions for ESamplingFrequency. 
     543 
     544    * configure.ac: New micro version. 
    533545 
    5345462006-01-06  Daniel Wagner  <wagi@monom.org> 
    535547 
    536        * tests/test-freebob.c (main): setsamplerate on all 
    537        devices takes now the samplerate argument. 
    538  
    539        * src/freebob.cpp (freebob_set_samplerate): After setting 
    540        sampling rate rediscover devices. 
    541  
    542        * src/devicemanager.cpp (discover): Clear vector as well after 
    543        delete all elements. Cout and cerr replaced with debugModule. 
    544  
    545        * src/avdevice.cpp (discoverStep8): Skip sync plug. 
    546        (discoverStep9): Sanity check fixed and reenabled. 
    547  
    548        * configure.ac: New micro version. 
    549  
    550        * src/avdevice.h  
    551        src/avdevice.cpp (setSampleRate): Implementation added. 
    552  
    553        * src/devicemanager.cpp  
    554        src/devicemanager.h (getAvDevice): New functions 
    555        (setNodeSampleFrequency): removed. 
    556  
    557        * src/freebob.cpp (parseSampleRate): New function. 
    558        (freebob_set_samplerate): Use AvDevice directly 
    559        for setting samplerate. 
    560  
    561        * src/libfreebobavc/avc_definitions.h 
    562        src/libfreebobavc/avc_definitions.cpp: Changed ESampleFrequency 
    563        to ESampleRate. 
    564  
    565        * tests/test-freebob.c: Info added about OPERATION arguments. 
    566        Parse sample rate for setsamplerate command. 
    567        Let emacs reindent code. Sorry Pieter :) 
     548    * tests/test-freebob.c (main): setsamplerate on all 
     549    devices takes now the samplerate argument. 
     550 
     551    * src/freebob.cpp (freebob_set_samplerate): After setting 
     552    sampling rate rediscover devices. 
     553 
     554    * src/devicemanager.cpp (discover): Clear vector as well after 
     555    delete all elements. Cout and cerr replaced with debugModule. 
     556 
     557    * src/avdevice.cpp (discoverStep8): Skip sync plug. 
     558    (discoverStep9): Sanity check fixed and reenabled. 
     559 
     560    * configure.ac: New micro version. 
     561 
     562    * src/avdevice.h  
     563    src/avdevice.cpp (setSampleRate): Implementation added. 
     564 
     565    * src/devicemanager.cpp  
     566    src/devicemanager.h (getAvDevice): New functions 
     567    (setNodeSampleFrequency): removed. 
     568 
     569    * src/freebob.cpp (parseSampleRate): New function. 
     570    (freebob_set_samplerate): Use AvDevice directly 
     571    for setting samplerate. 
     572 
     573    * src/libfreebobavc/avc_definitions.h 
     574    src/libfreebobavc/avc_definitions.cpp: Changed ESampleFrequency 
     575    to ESampleRate. 
     576 
     577    * tests/test-freebob.c: Info added about OPERATION arguments. 
     578    Parse sample rate for setsamplerate command. 
     579    Let emacs reindent code. Sorry Pieter :) 
    568580 
    5695812006-01-04  Daniel Wagner  <wagi@monom.org> 
    570582 
    571        * tests/test-extplugcmd.cpp: Changed test application 
    572        to use PlugType and PlugName command for testing. 
    573  
    574        * src/libfreebobavc/avc_extended_plug_info.cpp (serialize):  
    575        The string.length() thing did not work as expected. A workaround 
    576        added which converts the C++ string into a C string before strlen 
    577        is used. 
     583    * tests/test-extplugcmd.cpp: Changed test application 
     584    to use PlugType and PlugName command for testing. 
     585 
     586    * src/libfreebobavc/avc_extended_plug_info.cpp (serialize):  
     587    The string.length() thing did not work as expected. A workaround 
     588    added which converts the C++ string into a C string before strlen 
     589    is used. 
    578590 
    5795912006-01-03  Daniel Wagner  <wagi@monom.org> 
    580592 
    581        * src/devicemanager.cpp (discover): If config rom initializing 
    582        failes just skip this device. The PHY might be in power safe  
    583        mode and then there is no config rom to be discovered. 
     593    * src/devicemanager.cpp (discover): If config rom initializing 
     594    failes just skip this device. The PHY might be in power safe  
     595    mode and then there is no config rom to be discovered. 
    584596 
    5855972006-01-02  Pieter Palmer <pieterpalmers@users.sourceforge.net> 
    586598 
    587        * tests/test-freebob.c: Added support for scanning the whole bus. 
    588        Added xmldump operation to dump an XML description of the FW bus. 
    589  
    590        * src/freebob.cpp src/freebob.h: Added freebob_print_xml_description  
    591        to print an XML description of the bus. 
    592        Added freebob_node_is_valid_freebob_device(). 
    593        Added freebob_get_nb_devices_on_bus(). 
    594        Added freebob_get_device_node_id(). 
    595        Added freebob_set_samplerate() as a dummy (unimplemented) 
    596  
    597        * src/libfreebobavc/avc_connect.cpp  
    598        src/libfreebobavc/avc_extended_stream_format.cpp 
    599        src/libfreebobavc/avc_extended_stream_format.h 
    600        src/libfreebobavc/avc_plug_info.cpp 
    601        src/libfreebobavc/avc_signal_source.cpp 
    602        src/avcdevice.cpp  
    603        src/avdevice.h  
    604        src/avplug.cpp  
    605        src/avplug.h 
    606        src/devicemanager.cpp 
    607        src/devicemanager.h: 
    608        Fixed NodeId bug. 
    609        Commented out sanity check that failed for midi channels. 
    610        Fixed Dimension bug. 
    611        Increased all "XXX random length" requests. 
    612        Made a mess of clean code ;) 
    613  
    614        * configure.ac: Bumped library verson 
    615  
    616        * src/xmlparser.c 
    617        tests/test-freeebob.c: Added support to detect & use  
    618        multiple devices on the bus. 
    619  
    620        * src/libfreebobavc/avc_extendec_plug_info.cpp 
    621        src/configrom.cpp: 
    622        Some small memory access bugfixes. 
    623          
     599    * tests/test-freebob.c: Added support for scanning the whole bus. 
     600    Added xmldump operation to dump an XML description of the FW bus. 
     601 
     602    * src/freebob.cpp src/freebob.h: Added freebob_print_xml_description  
     603    to print an XML description of the bus. 
     604    Added freebob_node_is_valid_freebob_device(). 
     605    Added freebob_get_nb_devices_on_bus(). 
     606    Added freebob_get_device_node_id(). 
     607    Added freebob_set_samplerate() as a dummy (unimplemented) 
     608 
     609    * src/libfreebobavc/avc_connect.cpp  
     610    src/libfreebobavc/avc_extended_stream_format.cpp 
     611    src/libfreebobavc/avc_extended_stream_format.h 
     612    src/libfreebobavc/avc_plug_info.cpp 
     613    src/libfreebobavc/avc_signal_source.cpp 
     614    src/avcdevice.cpp  
     615    src/avdevice.h  
     616    src/avplug.cpp  
     617    src/avplug.h 
     618    src/devicemanager.cpp 
     619    src/devicemanager.h: 
     620    Fixed NodeId bug. 
     621    Commented out sanity check that failed for midi channels. 
     622    Fixed Dimension bug. 
     623    Increased all "XXX random length" requests. 
     624    Made a mess of clean code ;) 
     625 
     626    * configure.ac: Bumped library verson 
     627 
     628    * src/xmlparser.c 
     629    tests/test-freeebob.c: Added support to detect & use  
     630    multiple devices on the bus. 
     631 
     632    * src/libfreebobavc/avc_extendec_plug_info.cpp 
     633    src/configrom.cpp: 
     634    Some small memory access bugfixes. 
     635     
    6246362006-01-02  Daniel Wagner  <wagi@monom.org> 
    625637 
    626        * src/avdevice.cpp (discoverStep9): Sanity check: 8 logical 
    627        midi channel fit into 1 channel. 
     638    * src/avdevice.cpp (discoverStep9): Sanity check: 8 logical 
     639    midi channel fit into 1 channel. 
    628640 
    6296412005-12-31  Daniel Wagner  <wagi@monom.org> 
    630642 
    631        * src/debugmodule/debugmodule.h: debugFatal, debugError 
    632        and debugWarning declaration always declared. 
    633  
    634        * src/xmlparser.c (freebob_xmlparse_connection): Parse IsoChannel 
    635        node. 
    636  
    637        * src/freebob.cpp (freebob_print_connection_info): Print all 
    638        members from connection_spec (IsoChannel and IsMaster). 
    639  
    640        * src/avdevice.cpp (addPlugToXmlDescription): Set direction 
    641        according library interface definition and not according 
    642        avc model.  
    643        Add IsoChannel node. 
    644  
    645        * configure.ac: Version set to 0.0.2 
     643    * src/debugmodule/debugmodule.h: debugFatal, debugError 
     644    and debugWarning declaration always declared. 
     645 
     646    * src/xmlparser.c (freebob_xmlparse_connection): Parse IsoChannel 
     647    node. 
     648 
     649    * src/freebob.cpp (freebob_print_connection_info): Print all 
     650    members from connection_spec (IsoChannel and IsMaster). 
     651 
     652    * src/avdevice.cpp (addPlugToXmlDescription): Set direction 
     653    according library interface definition and not according 
     654    avc model.  
     655    Add IsoChannel node. 
     656 
     657    * configure.ac: Version set to 0.0.2 
    646658 
    6476592005-12-30  Daniel Wagner  <wagi@monom.org> 
    648660 
    649        * src/libfreebobavc/avc_extended_stream_format.cpp (fire): Buffer 
    650        length increased. 
    651  
    652        * src/avdevice.cpp (discoverStep9): Error message extended. 
    653        More debug info added. 
    654  
    655        * src/debugmodule/debugmodule.h: Enable debugFatal, debugError and  
    656        also in the release case. 
     661    * src/libfreebobavc/avc_extended_stream_format.cpp (fire): Buffer 
     662    length increased. 
     663 
     664    * src/avdevice.cpp (discoverStep9): Error message extended. 
     665    More debug info added. 
     666 
     667    * src/debugmodule/debugmodule.h: Enable debugFatal, debugError and  
     668    also in the release case. 
    657669 
    6586702005-12-28  Daniel Wagner  <wagi@monom.org> 
    659671 
    660        * tests/test-freebob.c (main): Debug info added. 
    661  
    662        * src/libfreebobavc/ieee1394service.cpp (initialize): Use  
    663        raw1394_new_handle_on_port instead of raw1394_new_handle and 
    664        raw1394_set_port. 
    665  
    666        * src/devicemanager.cpp (initialize): After deleteing 1394 service  
    667        clear also pointer. 
    668  
    669        * libfreebob/freebob.h: freebob_direction enum names changed 
    670        members which jack backed freebob needs to freebob_connection added 
    671          
    672        * configure.ac: Update library version depency. 
     672    * tests/test-freebob.c (main): Debug info added. 
     673 
     674    * src/libfreebobavc/ieee1394service.cpp (initialize): Use  
     675    raw1394_new_handle_on_port instead of raw1394_new_handle and 
     676    raw1394_set_port. 
     677 
     678    * src/devicemanager.cpp (initialize): After deleteing 1394 service  
     679    clear also pointer. 
     680 
     681    * libfreebob/freebob.h: freebob_direction enum names changed 
     682    members which jack backed freebob needs to freebob_connection added 
     683     
     684    * configure.ac: Update library version depency. 
    673685 
    6746862005-12-27  Daniel Wagner  <wagi@monom.org> 
    675687 
    676        * src/libfreebobavc/avc_extended_plug_info.cpp (serialize):  
    677        Do cast of the length field to let the compiler know which version 
    678        of the serializing code it has to take. 
     688    * src/libfreebobavc/avc_extended_plug_info.cpp (serialize):  
     689    Do cast of the length field to let the compiler know which version 
     690    of the serializing code it has to take. 
    679691 
    6806922005-12-26  Daniel Wagner  <wagi@monom.org> 
    681693 
    682        * Initial check-in and first beta relase 'late x-mass gift'. 
    683          
    684  
     694    * Initial check-in and first beta relase 'late x-mass gift'. 
     695     
     696 
  • trunk/libffado/configure.ac

    r435 r445  
    1 # configure.ac - Configure script for FreeBoB
     1# configure.ac - Configure script for FFADO
    22# Copyright (C) 2005,06 by Daniel Wagner. 
    33# Copyright (C) 2006,07 by Pieter Palmers. 
    44# 
    5 # This file is part of FreeBoB. 
     5# This file is part of FFADO. 
     6# FFADO is based upon FreeBoB. 
    67# 
    7 # FreeBoB is free software; you can redistribute it and/or modify 
     8# FFADO is free software; you can redistribute it and/or modify 
    89# it under the terms of the GNU General Public License as published by 
    910# the Free Software Foundation; either version 2 of the License, or 
    1011# (at your option) any later version. 
    11 # FreeBoB is distributed in the hope that it will be useful, 
     12# FFADO is distributed in the hope that it will be useful, 
    1213# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1314# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1415# GNU General Public License for more details. 
    1516# You should have received a copy of the GNU General Public License 
    16 # along with FreeBoB; if not, write to the Free Software 
     17# along with FFADO; if not, write to the Free Software 
    1718# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1819# 
     
    2324 
    2425 
    25 m4_define(freebob_major_version, 1) 
    26 m4_define(freebob_minor_version, 999) 
    27 m4_define(freebob_micro_version, 4) 
    28  
    29 m4_define(freebob_version, freebob_major_version.freebob_minor_version.freebob_micro_version) 
    30  
    31 AC_INIT(libfreebob, freebob_version, <freebob-devel@lists.sf.net>) 
     26m4_define(ffado_major_version, 1) 
     27m4_define(ffado_minor_version, 999) 
     28m4_define(ffado_micro_version, 4) 
     29 
     30m4_define(ffado_version, ffado_major_version.ffado_minor_version.ffado_micro_version) 
     31 
     32AC_INIT(libffado, ffado_version, <ffado-devel@lists.sf.net>) 
    3233 
    3334# Before making a release, the LT_VERSION string should be modified. 
     
    3940# - If the interface is the same as the previous version, change to C:R+1:A 
    4041 
    41 LT_VERSION=2:0:0 
     42LT_VERSION=1:0:0 
    4243AC_SUBST(LT_VERSION) 
    4344 
    44 AC_DEFINE(FREEBOB_MAJOR_VERSION, freebob_major_version,[Freebob major version]) 
    45 AC_DEFINE(FREEBOB_MINOR_VERSION, freebob_minor_version,[Freebob minor version]) 
    46 AC_DEFINE(FREEBOB_MICRO_VERSION, freebob_micro_version,[Freebob micro version]) 
    47 AC_SUBST(FREEBOB_MINOR_VERSION, freebob_minor_version) 
    48 AC_SUBST(FREEBOB_MAJOR_VERSION, freebob_major_version) 
    49 AC_SUBST(FREEBOB_MICRO_VERSION, freebob_micro_version) 
     45AC_DEFINE(FFADO_MAJOR_VERSION, ffado_major_version,[FFADO major version]) 
     46AC_DEFINE(FFADO_MINOR_VERSION, ffado_minor_version,[FFADO minor version]) 
     47AC_DEFINE(FFADO_MICRO_VERSION, ffado_micro_version,[FFADO micro version]) 
     48AC_SUBST(FFADO_MINOR_VERSION, ffado_minor_version) 
     49AC_SUBST(FFADO_MAJOR_VERSION, ffado_major_version) 
     50AC_SUBST(FFADO_MICRO_VERSION, ffado_micro_version) 
    5051 
    5152AM_INIT_AUTOMAKE([subdir-objects]) 
    5253AM_MAINTAINER_MODE 
    53 AC_CONFIG_SRCDIR([src/freebob.cpp]) 
     54AC_CONFIG_SRCDIR([src/ffado.cpp]) 
    5455AC_CONFIG_HEADER([config.h]) 
    5556AC_GNU_SOURCE 
     
    109110AC_CHECK_LIB(pthread, pthread_create,, 
    110111[ 
    111         AC_ERROR(You need the pthread library to compile freebob
     112        AC_ERROR(You need the pthread library to compile ffado
    112113]) 
    113114 
     
    181182 
    182183  if test "$target_cpu" = "i586"; then 
    183       FREEBOB_OPT_CFLAGS="-march=i586 " 
     184      FFADO_OPT_CFLAGS="-march=i586 " 
    184185  elif test "$target_cpu" = "i686"; then 
    185       FREEBOB_OPT_CFLAGS="-march=i686" 
     186      FFADO_OPT_CFLAGS="-march=i686" 
    186187  else 
    187188      : 
    188189  fi 
    189190 
    190   FREEBOB_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $FREEBOB_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS" 
     191  FFADO_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $FFADO_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS" 
    191192 
    192193 
     
    195196                   [ask the compiler for its best optimizations]), 
    196197    [ if test x$enable_optimize != xno ; then 
    197         CFLAGS="$CFLAGS $FREEBOB_OPT_CFLAGS" ; 
    198         CXXFLAGS="$CXXFLAGS $FREEBOB_OPT_CFLAGS" 
     198        CFLAGS="$CFLAGS $FFADO_OPT_CFLAGS" ; 
     199        CXXFLAGS="$CXXFLAGS $FFADO_OPT_CFLAGS" 
    199200      fi  
    200201    ] 
     
    399400                 doc/Makefile 
    400401                 doc/reference.doxygen 
    401                  libfreebob/Makefile 
     402                 libffado/Makefile 
    402403                 src/Makefile 
    403404                 tests/Makefile 
    404405                 tests/streaming/Makefile 
    405                  libfreebob.pc]) 
     406                 libffado.pc]) 
    406407 
    407408AC_OUTPUT 
     
    410411AC_MSG_RESULT([ 
    411412 
    412 FreeBoB $VERSION is now configured for $canonical_host_type 
     413FFADO $VERSION is now configured for $canonical_host_type 
    413414 
    414415  Building support for: $supported_devices 
  • trunk/libffado/doc/adding_devices.dox

    r249 r445  
    1 /* 
    2  * This is the main page of the FreeBoB reference manual, built using 
    3  * doxygen. 
    4  */ 
    5  
    61/** 
    7 @page adding_devices Adding support for new devices to LibFreeBoB 
     2@page adding_devices Adding support for new devices to libffado 
    83 
    94@author Pieter Palmers <pieterpalmers@users.sourceforge.net> 
     
    2116 Layer 2 is implemented by subclassing the StreamProcessor class in src/libstreaming/ 
    2217  
    23  Basic operation of libfreebob is: 
     18 Basic operation of libffado is: 
    2419 - Create a DeviceManager that iterates over all nodes connected to the 1394 bus.  
    2520   For every node present, it tries the probeFunctions (probeBeBoB, probeMotu, ...). 
     
    5449         the start/stop mechanism differ. 
    5550  
    56  In order to add support for a device to freebob, two things should be implemented: 
     51 In order to add support for a device to libffado, two things should be implemented: 
    5752  - an IAvDevice descendant that takes care of the device discovery & configuration 
    5853  - a StreamProcessor descendant that takes care of the device specific stream translation 
     
    6560@section streamingbaseclasses Streaming base class hierarchy and operation 
    6661 
    67 This section explains the implementation details of the streaming part of LibFreeBoB.  
     62This section explains the implementation details of the streaming part of libffado.  
    6863 
    6964The following figure shows the base class diagram, and the derrived classed that implement 
     
    8984- an IsoHandlerManager instance 
    9085 
    91 Related classes: FreebobStreaming::StreamProcessorManager 
     86Related classes: Streaming::StreamProcessorManager 
    9287 
    9388@subsection isoside The ISO side: 1394 isochronous traffic management 
     
    10398\note This abstraction is completely device independent, it only provides a mechanism to transmit or receive a certain isochronous stream. It could as well be used for video streams... 
    10499 
    105 Related classes: FreebobStreaming::IsoStream, FreebobStreaming::IsoHandlerManager, FreebobStreaming::IsoHandler 
     100Related classes: Streaming::IsoStream, Streaming::IsoHandlerManager, Streaming::IsoHandler 
    106101 
    107102@subsection audioapiside The Audio API side: port management 
     
    137132The idea is that we present a collection of ports to the Audio API side which from which it can read or to which it can write. 
    138133 
    139 Related classes: FreebobStreaming::Port, FreebobStreaming::PortManager 
     134Related classes: Streaming::Port, Streaming::PortManager 
    140135 
    141136@subsection connectingisoandaudio Connecting the ISO side with the Audio API side 
     
    161156A StreamProcessor also has the init(), prepare() and reset() calls, which are still to be documented (see later). 
    162157 
    163 Related classes: FreebobStreaming::StreamProcessor, FreebobStreaming::ReceiveStreamProcessor, FreebobStreaming::TransmitStreamProcessor, FreebobStreaming::PortManager 
     158Related classes: Streaming::StreamProcessor, Streaming::ReceiveStreamProcessor, Streaming::TransmitStreamProcessor, Streaming::PortManager 
    164159 
    165160@subsection mappingports Mapping Ports to IsoStreams 
     
    167162 
    168163@subsection puttingtogether Putting it all together 
     164 
     165@note this is outdated 
     166 
    169167The framework is completed by introducing the StreamProcessorManager. As indicated before, this class implements a 'collection of StreamProcessors' and an IsoHandlerManager.  
    170168 
    171169First of all, the StreamProcessorManager is a collection of StreamProcessors, hence it implements the  registerStreamProcessor and unregisterStreamProcessor methods. It maintains the list of StreamProcessors under it's control. When StreamProcessors are (un)registered, they are automatically (un)registered to the IsoHandlerManager too, creating IsoHandlers to handle them. Remember that StreamProcessor is a descendant of IsoStream, and can therefore be registered to an IsoHandlerManager. This results in the fact that the ISO stream the StreamProcessor is supposed to handle, will be attached to an IsoHandler. 
    172170 
    173 Furthermore StreamProcessorManager is a child of the FreebobRunnable interface, and can therefore be used as the worker class for a FreebobThread. A complicated sentence to say that the StreamProcessorManager will start up a thread that calls its Execute() function, which in its turn calls the IsoHandlerManager Exectute() method (hence iterating the IsoHandlers managed by the IsoHandlerManager). This thread also performs the synchronisation as described in the next paragraph. 
     171Furthermore StreamProcessorManager is a child of the Runnable interface, and can therefore be used as the worker class for a Thread. A complicated sentence to say that the StreamProcessorManager will start up a thread that calls its Execute() function, which in its turn calls the IsoHandlerManager Exectute() method (hence iterating the IsoHandlers managed by the IsoHandlerManager). This thread also performs the synchronisation as described in the next paragraph. 
    174172 
    175173The third function of the StreamProcessorManager is the synchronisation between the ISO side and the Audio API side. To implement this, the class provides a wait() method that waits on a synchronisation primitive. This primitive is signalled by the thread that iterates the IsoHandlerManager. This thread will signal the primitive when all StreamProcessors indicate that they have one period ready. 
     
    181179\note A blocking-read/nonblocking write (and the other way around) version of access to PacketBuffered Ports is planned. 
    182180 
    183 Related classes: FreebobStreaming::StreamProcessorManager, FreebobStreaming::IsoHandlerManager, FreebobStreaming::Port 
     181Related classes: Streaming::StreamProcessorManager, Streaming::IsoHandlerManager, Streaming::Port 
    184182 
    185183@subsection callingorder Some notes on when which method is called 
  • trunk/libffado/doc/amdtpstreamprocessor.dox

    r249 r445  
    1 /* 
    2  * This is the main page of the FreeBoB reference manual, built using 
    3  * doxygen. 
    4  */ 
    5  
    61/** 
    72@page amdtpdescription The AMDTP StreamProcessor 
  • trunk/libffado/doc/mainpage.dox

    r249 r445  
    11/* 
    2  * This is the main page of the FreeBoB reference manual, built using 
     2 * This is the main page of the FFADO reference manual, built using 
    33 * doxygen. 
    44 */ 
    55 
    66/** 
    7 @mainpage FreeBoB - Firewire (pro-)audio for Linux 
     7@mainpage FFADO - Free Firewire (pro-)Audio Drivers for Linux 
    88 
    99@author Pieter Palmers <pieterpalmers@users.sourceforge.net> 
     
    1111@section intro Introduction 
    1212 
    13 FreeBoB is intended as an intermediate layer between the Linux1394 kernel/userspace layer, and the various audio API's (ALSA, jack, ...) present. 
     13FFADO is intended as an intermediate layer between the Linux1394 kernel/userspace layer, and the various audio API's (ALSA, jack, ...) present. 
    1414 
    1515\note this is a SVN version, therefore it is highly volatile. Certain parts of the documentation can be outdated. This documentation is also auto-generated, and it can occur that unused classes and interfaces appear in the documentation. This pollution will be cleaned up as we go along. 
    1616 
    17 @see <http://freebob.sourceforge.net> 
     17@see <http://ffado.sourceforge.net> 
    1818 
    1919@section library Client side library 
    2020 
    21 FreeBoB presents an interface that can be used to implement backends for various audio 
     21FFADO presents an interface that can be used to implement backends for various audio 
    2222API's. Currently the best support is for the JACK backend. It is also intended to implement configuration applications like mixer controls etc.. 
    2323 
    24 The library API is split in two parts: 
    25         - @ref freebob.h "<libfreebob/freebob.h>" is the discovery & configuration interface 
    26         - @ref freebob_streaming.h "<libfreebob/freebob_streaming.h>" is the streaming interface 
    27  
     24The library API's external C interface is defined in: 
     25        - @ref ffado.h "<libffado/ffado.h>"  
    2826 
    2927@section devicesupport Adding support for unsupported devices 
    3028 
    31 Initial support is/was for BeBoB devices only, however the framework  
    32 is usable for all firewire audio devices. 
     29Initial support by FreeBoB was for BeBoB devices only, however the FFADO framework  
     30is usable for all FireWire audio devices. 
    3331 
    3432Take a look at the @ref adding_devices page for a detailed description. 
  • trunk/libffado/doc/reference.doxygen.in

    r250 r445  
    1818# by quotes) that should identify the project. 
    1919 
    20 PROJECT_NAME           = LIBFREEBOB 
     20PROJECT_NAME           = LIBFFADO 
    2121 
    2222# The PROJECT_NUMBER tag can be used to enter a project or revision number.  
     
    366366                         @top_srcdir@/src/ \ 
    367367                         @top_srcdir@/src/debugmodule \ 
     368                         @top_srcdir@/src/libavc \ 
     369                         @top_srcdir@/src/libieee1394 \ 
     370                         @top_srcdir@/src/libosc \ 
    368371                         @top_srcdir@/src/libstreaming \ 
    369372                         @top_srcdir@/src/libutil \ 
    370                          @top_srcdir@/src/libfreebobavc \ 
    371                          @top_srcdir@/libfreebob/ 
     373                         @top_srcdir@/src/bebob \ 
     374                         @top_srcdir@/src/bounce \ 
     375                         @top_srcdir@/src/dice \ 
     376                         @top_srcdir@/src/maudio \ 
     377                         @top_srcdir@/src/metrichalo \ 
     378                         @top_srcdir@/src/motu \ 
     379                         @top_srcdir@/src/rme \ 
     380                         @top_srcdir@/libffado/ 
     381 
    372382 
    373383# If the value of the INPUT tag contains directories, you can use the  
  • trunk/libffado/doc/streaming.xmi

    r403 r445  
    8585        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="13397" isRoot="false" isAbstract="false" name="PortVectorIterator" elementReference="13396" /> 
    8686        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="13401" isRoot="false" isAbstract="false" name="Port*" elementReference="12717" /> 
    87         <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14009" isRoot="false" isAbstract="false" name="FreebobRunnableInterface*" elementReference="14008" /> 
     87        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14009" isRoot="false" isAbstract="false" name="FFADORunnableInterface*" elementReference="14008" /> 
    8888        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14530" isRoot="false" isAbstract="false" name="unsigned char*" elementReference="14529" /> 
    8989        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14540" isRoot="false" isAbstract="false" name="unsigned int*" elementReference="12734" /> 
     
    9696        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14665" isRoot="false" isAbstract="false" name="IsoHandlerManager*" elementReference="14659" /> 
    9797        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15179" isRoot="false" isAbstract="false" name="quadlet_t*" elementReference="15178" /> 
    98         <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15190" isRoot="false" isAbstract="false" name="freebob_ringbuffer_t*" elementReference="15166" /> 
     98        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15190" isRoot="false" isAbstract="false" name="ffado_ringbuffer_t*" elementReference="15166" /> 
    9999        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15236" isRoot="false" isAbstract="false" name="IsoHandler*" elementReference="15194" /> 
    100100        <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15278" isRoot="false" isAbstract="false" name="PacketBuffer*" elementReference="15167" /> 
     
    109109      </UML:Package> 
    110110      <UML:Class comment="Id$ *//* 
    111   FreeBob Streaming API 
    112   FreeBob = Firewire (pro-)audio for linux 
     111  FFADO Streaming API 
     112  FFADO = Firewire (pro-)audio for linux 
    113113 
    114   http://freebob.sf.net 
     114  http://ffado.sf.net 
    115115 
    116116  Copyright (C) 2005,2006 Pieter Palmers &lt;pieterpalmers@users.sourceforge.net> 
     
    958958      </UML:Class> 
    959959      <UML:Class comment="Id$ *//* 
    960   FreeBob Streaming API 
    961   FreeBob = Firewire (pro-)audio for linux 
     960  FFADO Streaming API 
     961  FFADO = Firewire (pro-)audio for linux 
    962962 
    963   http://freebob.sf.net 
     963  http://ffado.sf.net 
    964964 
    965965  Copyright (C) 2005,2006 Pieter Palmers &lt;pieterpalmers@users.sourceforge.net> 
     
    10341034      <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13000" isRoot="false" isAbstract="false" name="enum E_Formats" /> 
    10351035      <UML:Class comment="Id$ *//* 
    1036   FreeBob Streaming API 
    1037   FreeBob = Firewire (pro-)audio for linux 
     1036  FFADO Streaming API 
     1037  FFADO = Firewire (pro-)audio for linux 
    10381038 
    1039   http://freebob.sf.net 
     1039  http://ffado.sf.net 
    10401040 
    10411041  Copyright (C) 2005,2006 Pieter Palmers &lt;pieterpalmers@users.sourceforge.net> 
     
    15311531      <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13991" isRoot="false" isAbstract="false" name="SInt32" /> 
    15321532      <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13992" isRoot="false" isAbstract="false" name="UInt64" /> 
    1533       <UML:Class comment="Modifications for Freebob (C) 2006, Pieter Palmers 
     1533      <UML:Class comment="Modifications for FFADO (C) 2006, Pieter Palmers 
    15341534Copied from the jackd/jackdmp sources 
    15351535function names changed in order to avoid naming problems when using this in 
     
    15491549Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
    15501550//*! 
    1551 \brief The POSIX thread base class." isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13993" isRoot="false" isAbstract="false" name="FreebobPosixThread" > 
     1551\brief The POSIX thread base class." isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13993" isRoot="false" isAbstract="false" name="FFADOPosixThread" > 
    15521552       <UML:GeneralizableElement.generalization> 
    15531553        <UML:Generalization xmi.idref="13995" /> 
     
    16601660         </UML:BehavioralFeature.parameter> 
    16611661        </UML:Operation> 
    1662         <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14007" isRoot="false" isAbstract="false" isQuery="false" name="FreebobPosixThread" > 
     1662        <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14007" isRoot="false" isAbstract="false" isQuery="false" name="FFADOPosixThread" > 
    16631663         <UML:BehavioralFeature.parameter> 
    16641664          <UML:Parameter isSpecification="false" visibility="private" xmi.id="14010" value="" type="14009" name="runnable" /> 
     
    16681668         </UML:BehavioralFeature.parameter> 
    16691669        </UML:Operation> 
    1670         <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14014" isRoot="false" isAbstract="false" isQuery="false" name="FreebobPosixThread" > 
     1670        <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14014" isRoot="false" isAbstract="false" isQuery="false" name="FFADOPosixThread" > 
    16711671         <UML:BehavioralFeature.parameter> 
    16721672          <UML:Parameter isSpecification="false" visibility="private" xmi.id="14015" value="" type="14009" name="runnable" /> 
    16731673         </UML:BehavioralFeature.parameter> 
    16741674        </UML:Operation> 
    1675         <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14016" isRoot="false" isAbstract="false" isQuery="false" name="FreebobPosixThread" > 
     1675        <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14016" isRoot="false" isAbstract="false" isQuery="false" name="FFADOPosixThread" > 
    16761676         <UML:BehavioralFeature.parameter> 
    16771677          <UML:Parameter isSpecification="false" visibility="private" xmi.id="14017" value="" type="14009" name="runnable" /> 
     
    16791679         </UML:BehavioralFeature.parameter> 
    16801680        </UML:Operation> 
    1681         <UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="14019" isRoot="false" isAbstract="false" isQuery="false" name="~ FreebobPosixThread" /> 
     1681        <UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="14019" isRoot="false" isAbstract="false" isQuery="false" name="~ FFADOPosixThread" /> 
    16821682        <UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="14020" isRoot="false" isAbstract="false" isQuery="false" name="Start" > 
    16831683         <UML:BehavioralFeature.parameter> 
     
    17181718       </UML:Classifier.feature> 
    17191719      </UML:Class> 
    1720       <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13994" isRoot="false" isAbstract="false" name="FreebobThread" /> 
     1720      <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13994" isRoot="false" isAbstract="false" name="FFADOThread" /> 
    17211721      <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13998" isRoot="false" isAbstract="false" name="pthread_t" /> 
    17221722      <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="14002" isRoot="false" isAbstract="false" name="volatile bool" /> 
    1723       <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="14008" isRoot="false" isAbstract="false" name="FreebobRunnableInterface" /> 
     1723      <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="14008" isRoot="false" isAbstract="false" name="FFADORunnableInterface" /> 
    17241724      <UML:Class comment="Id$ *//* 
    1725   FreeBob Streaming API 
    1726   FreeBob = Firewire (pro-)audio for linux 
     1725  FFADO Streaming API 
     1726  FFADO = Firewire (pro-)audio for linux 
    17271727 
    1728   http://freebob.sf.net 
     1728  http://ffado.sf.net 
    17291729 
    17301730  Copyright (C) 2005,2006 Pieter Palmers &lt;pieterpalmers@users.sourceforge.net> 
     
    25542554      </UML:Class> 
    25552555      <UML:Class comment="Id$ *//* 
    2556   FreeBob Streaming API 
    2557   FreeBob = Firewire (pro-)audio for linux 
     2556  FFADO Streaming API 
     2557  FFADO = Firewire (pro-)audio for linux 
    25582558 
    2559   http://freebob.sf.net 
     2559  http://ffado.sf.net 
    25602560 
    25612561  Copyright (C) 2005,2006 Pieter Palmers &lt;pieterpalmers@users.sourceforge.net> 
     
    35563556         </UML:BehavioralFeature.parameter> 
    35573557        </UML:Operation> 
    3558         <UML:Operation comment="// FreebobRunnableInterface interface// note that this is called in we while(running) loop" isSpecification="false" isLeaf="false" visibility="protected" xmi.id="14649" isRoot="false" isAbstract="false" isQuery="false" name="Execute" > 
     3558        <UML:Operation comment="// FFADORunnableInterface interface// note that this is called in we while(running) loop" isSpecification="false" isLeaf="false" visibility="protected" xmi.id="14649" isRoot="false" isAbstract="false" isQuery="false" name="Execute" > 
    35593559         <UML:BehavioralFeature.parameter> 
    35603560          <UML:Parameter kind="return" xmi.id="LlXy8i6aXj2o" type="12708" /> 
     
    36863686        </UML:Operation> 
    36873687        <UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="14668" isRoot="false" isAbstract="false" isQuery="false" name="~ StreamRunner" /> 
    3688         <UML:Operation comment="// FreebobRunnableInterface interface// note that this is called in we while(running) loop" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14669" isRoot="false" isAbstract="false" isQuery="false" name="Execute" > 
     3688        <UML:Operation comment="// FFADORunnableInterface interface// note that this is called in we while(running) loop" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14669" isRoot="false" isAbstract="false" isQuery="false" name="Execute" > 
    36893689         <UML:BehavioralFeature.parameter> 
    36903690          <UML:Parameter kind="return" xmi.id="9wZVdbzyKUvQ" type="12708" /> 
     
    36983698       </UML:Classifier.feature> 
    36993699      </UML:Class> 
    3700       <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="15165" isRoot="false" isAbstract="false" name="freebob_ringbuffer_data_t" /> 
    3701       <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="15166" isRoot="false" isAbstract="false" name="freebob_ringbuffer_t" /> 
     3700      <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="15165" isRoot="false" isAbstract="false" name="ffado_ringbuffer_data_t" /> 
     3701      <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="15166" isRoot="false" isAbstract="false" name="ffado_ringbuffer_t" /> 
    37023702      <UML:Class comment="Id$ *//* 
    3703   FreeBob Streaming API 
    3704   FreeBob = Firewire (pro-)audio for linux 
     3703  FFADO Streaming API 
     3704  FFADO = Firewire (pro-)audio for linux 
    37053705 
    3706   http://freebob.sf.net 
     3706  http://ffado.sf.net 
    37073707 
    37083708  Copyright (C) 2005,2006 Pieter Palmers &lt;pieterpalmers@users.sourceforge.net> 
  • trunk/libffado/libffado.pc.in

    r442 r445  
    44includedir=@includedir@ 
    55 
    6 Name: libfreebob 
    7 Description: FreeBoB 
     6Name: libffado 
     7Description: FFADO 
    88Version: @VERSION@ 
    9 Libs: -L${libdir} -lfreebob 
     9Libs: -L${libdir} -lffado 
    1010Cflags: -I${includedir} 
  • trunk/libffado/Makefile.am

    r336 r445  
    1 # Makefile.am - Makefile template 
    2 # Copyright (C) 2005 by Daniel Wagner. 
     1# Makefile.am - toplevel Makefile for FFADO 
    32# 
    4 # This file is part of FreeBoB. 
     3# Copyright (C) 2005-2007 by Daniel Wagner. 
     4# Copyright (C) 2005-2007 by Pieter Palmers. 
    55# 
    6 # FreeBoB is free software; you can redistribute it and/or modify 
    7 # it under the terms of the GNU General Public License as published by 
    8 # the Free Software Foundation; either version 2 of the License, or 
    9 # (at your option) any later version. 
    10 # FreeBoB is distributed in the hope that it will be useful, 
     6# This file is part of FFADO. 
     7# FFADO = Free Firewire (pro-)audio drivers for linux 
     8
     9# FFADO is based upon FreeBoB. 
     10
     11# FFADO is free software. 
     12
     13# you can redistribute and/or modify the library code 
     14# under the terms of the GNU Lesser General Public License  
     15# version 2.1, as published by the Free Software Foundation 
     16
     17# you can redistribute and/or modify the applications 
     18# under the terms of the GNU General Public License 
     19# version 2, as published by the Free Software Foundation 
     20
     21# FFADO is distributed in the hope that it will be useful, 
    1122# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1223# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13 # GNU General Public License for more details. 
    14 # You should have received a copy of the GNU General Public License 
    15 # along with FreeBoB; if not, write to the Free Software 
     24# GNU (Lesser) General Public License for more details. 
     25
     26# You should have received a copy of the GNU (Lesser) General Public License 
     27# along with FFADO; if not, write to the Free Software 
    1628# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1729 
    18 SUBDIRS = libfreebob src tests doc 
     30SUBDIRS = libffado src tests doc 
    1931 
    2032pkgconfigdir = $(libdir)/pkgconfig 
    21 pkgconfig_DATA = libfreebob.pc 
     33pkgconfig_DATA = libffado.pc 
    2234 
    2335$(srcdir)/configure: configure.ac aclocal.m4 
     
    3951config.status: configure 
    4052        ./config.status --recheck 
    41  
    42  
  • trunk/libffado/src/bebob-sync.cpp

    r442 r445  
    1 /* freebob-sync.cpp 
    2  * Copyright (C) 2006 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB. 
     8 * 
     9 * This is free software; you can redistribute it and/or modify 
     10 * it under the terms of the GNU General Public License version 2 
     11 * as published by the Free Software Foundation. 
     12 * 
     13 * FFADO is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1215 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     
    1417 * 
    1518 * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
     19 * along with FFADO; if not, write to the Free Software 
    1720 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    1821 * MA 02111-1307 USA. 
     
    3033// arg parsing 
    3134//////////////////////////////////////////////// 
    32 const char *argp_program_version = "freebob_sync 0.1"; 
    33 const char *argp_program_bug_address = "<freebob-devel@lists.sf.net>"; 
    34 static char doc[] = "freebob_sync -- select sync mode\n\n" 
     35const char *argp_program_version = "bebob-sync 0.1"; 
     36const char *argp_program_bug_address = "<ffado-devel@lists.sf.net>"; 
     37static char doc[] = "bebob-sync -- select sync mode on a BeBoB device\n\n" 
    3538                    "OPERATION:  set <nr>\n"; 
    3639static char args_doc[] = "NODE_ID OPERATION"; 
     
    4144}; 
    4245 
    43 IMPL_GLOBAL_DEBUG_MODULE( freebob-sync, DebugModule::eDL_Normal ); 
     46// IMPL_GLOBAL_DEBUG_MODULE( bebob-sync, DebugModule::eDL_Normal ); 
     47DECLARE_GLOBAL_DEBUG_MODULE; 
    4448 
    4549struct arguments 
     
    118122    int node_id = strtol(arguments.args[0], &tail, 0); 
    119123    if (errno) { 
    120        perror("argument parsng failed:"); 
    121        return -1; 
     124    perror("argument parsng failed:"); 
     125    return -1; 
    122126    } 
    123127 
  • trunk/libffado/src/bebob/bebob_avdevice.cpp

    r436 r445  
    1 /* bebob_avdevice.cpp 
    2  * Copyright (C) 2005,06,07 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
     
    4245{ 
    4346    {0x00000f, 0x00010065, "Mackie", "Onyx Firewire"}, 
    44      
     47 
    4548    {0x0003db, 0x00010048, "Apogee Electronics", "Rosetta 200"}, 
    4649 
     
    105108 
    106109void 
    107 AvDevice::setVerboseLevel(int l)  
     110AvDevice::setVerboseLevel(int l) 
    108111{ 
    109112//     m_pPlugManager->setVerboseLevel(l); 
    110      
     113 
    111114    IAvDevice::setVerboseLevel(l); 
    112115} 
     
    143146    { 
    144147        if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    145              && ( supportedDeviceList[i].model_id == modelId )  
     148             && ( supportedDeviceList[i].model_id == modelId ) 
    146149           ) 
    147150        { 
     
    155158                m_model->vendor_name, m_model->model_name); 
    156159    } else return false; 
    157      
     160 
    158161    if ( !enumerateSubUnits() ) { 
    159162        debugError( "Could not enumarate sub units\n" ); 
     
    709712        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
    710713    } 
    711      
     714 
    712715    if(snoopMode) { 
    713716        int current_sr=getSamplingFrequency(); 
     
    724727            return false; 
    725728        } 
    726      
     729 
    727730        if ( !setSamplingFrequencyPlug( *plug, 
    728731                                        AvPlug::eAPD_Input, 
     
    732735            return false; 
    733736        } 
    734      
     737 
    735738        plug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Output,  0 ); 
    736739        if ( !plug ) { 
     
    738741            return false; 
    739742        } 
    740      
     743 
    741744        if ( !setSamplingFrequencyPlug( *plug, 
    742745                                        AvPlug::eAPD_Output, 
     
    746749            return false; 
    747750        } 
    748      
     751 
    749752        debugOutput( DEBUG_LEVEL_VERBOSE, 
    750753                     "setSampleRate: Set sample rate to %d\n", 
     
    886889        "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 
    887890        m_nodeId); 
    888          
     891 
    889892    m_pPlugManager->showPlugs(); 
    890893} 
     
    946949        // don't lock 
    947950    } else { 
    948      
     951 
    949952    } 
    950953 
     
    962965        // don't unlock 
    963966    } else { 
    964      
     967 
    965968    } 
    966969    return true; 
     
    973976        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
    974977    } 
    975      
     978 
    976979    /////////// 
    977980    // get plugs 
     
    989992 
    990993    int samplerate=outputPlug->getSampleRate(); 
    991      
     994 
    992995    debugOutput( DEBUG_LEVEL_VERBOSE, "Initializing receive processor...\n"); 
    993996    // create & add streamprocessors 
    994997    Streaming::StreamProcessor *p; 
    995      
     998 
    996999    p=new Streaming::AmdtpReceiveStreamProcessor( 
    9971000                             m_p1394Service->getPort(), 
     
    10111014        return false; 
    10121015    } 
    1013      
     1016 
    10141017    m_receiveProcessors.push_back(p); 
    10151018 
     
    10291032                                inputPlug->getNrOfChannels()); 
    10301033    } 
    1031      
     1034 
    10321035    if(!p->init()) { 
    10331036        debugFatal("Could not initialize transmit processor %s!\n", 
     
    10501053        } 
    10511054    } 
    1052      
     1055 
    10531056    // we put this SP into the transmit SP vector, 
    10541057    // no matter if we are in snoop mode or not 
     
    10651068    Streaming::StreamProcessor *processor, 
    10661069    Streaming::AmdtpAudioPort::E_Direction direction) { 
    1067      
     1070 
    10681071    std::string id=std::string("dev?"); 
    10691072    if(!getOption("id", id)) { 
    10701073        debugWarning("Could not retrieve id parameter, defauling to 'dev?'\n"); 
    10711074    } 
    1072      
     1075 
    10731076    AvPlug::ClusterInfoVector& clusterInfos = plug.getClusterInfos(); 
    10741077    for ( AvPlug::ClusterInfoVector::const_iterator it = clusterInfos.begin(); 
     
    11731176        int n=i; 
    11741177        Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 
    1175          
     1178 
    11761179        if(snoopMode) { // a stream from the device to another host 
    11771180            // FIXME: put this into a decent framework! 
     
    11791182            struct iec61883_oPCR opcr; 
    11801183            if (iec61883_get_oPCRX( 
    1181                     m_p1394Service->getHandle(),  
     1184                    m_p1394Service->getHandle(), 
    11821185                    m_pConfigRom->getNodeId() | 0xffc0, 
    11831186                    (quadlet_t *)&opcr, 
    11841187                    n)) { 
    1185                      
     1188 
    11861189                debugWarning("Error getting the channel for SP %d\n",i); 
    11871190                return false; 
    11881191            } 
    1189              
     1192 
    11901193            iso_channel=opcr.channel; 
    11911194        } else { 
    11921195            iso_channel=m_p1394Service->allocateIsoChannelCMP( 
    1193                 m_pConfigRom->getNodeId() | 0xffc0, n,  
     1196                m_pConfigRom->getNodeId() | 0xffc0, n, 
    11941197                m_p1394Service->getLocalNodeId()| 0xffc0, -1); 
    11951198        } 
     
    11981201            return false; 
    11991202        } 
    1200          
     1203 
    12011204        debugOutput(DEBUG_LEVEL_VERBOSE, "Started SP %d on channel %d\n",i,iso_channel); 
    1202          
     1205 
    12031206        p->setChannel(iso_channel); 
    12041207        return true; 
    1205          
     1208 
    12061209    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    12071210        int n=i-m_receiveProcessors.size(); 
    12081211        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    1209          
    1210         if(snoopMode) { // a stream from another host to the device  
     1212 
     1213        if(snoopMode) { // a stream from another host to the device 
    12111214            // FIXME: put this into a decent framework! 
    12121215            // we should check the iPCR[n] on the device 
    12131216            struct iec61883_iPCR ipcr; 
    12141217            if (iec61883_get_iPCRX( 
    1215                     m_p1394Service->getHandle(),  
     1218                    m_p1394Service->getHandle(), 
    12161219                    m_pConfigRom->getNodeId() | 0xffc0, 
    12171220                    (quadlet_t *)&ipcr, 
    12181221                    n)) { 
    1219                      
     1222 
    12201223                debugWarning("Error getting the channel for SP %d\n",i); 
    12211224                return false; 
    12221225            } 
    1223              
     1226 
    12241227            iso_channel=ipcr.channel; 
    1225              
     1228 
    12261229        } else { 
    12271230            iso_channel=m_p1394Service->allocateIsoChannelCMP( 
     
    12291232                m_pConfigRom->getNodeId() | 0xffc0, n); 
    12301233        } 
    1231          
     1234 
    12321235        if (iso_channel<0) { 
    12331236            debugError("Could not allocate ISO channel for SP %d\n",i); 
    12341237            return false; 
    12351238        } 
    1236          
     1239 
    12371240        debugOutput(DEBUG_LEVEL_VERBOSE, "Started SP %d on channel %d\n",i,iso_channel); 
    1238          
     1241 
    12391242        p->setChannel(iso_channel); 
    12401243        return true; 
    12411244    } 
    1242      
     1245 
    12431246    debugError("SP index %d out of range!\n",i); 
    12441247    return false; 
     
    12661269        } 
    12671270        p->setChannel(-1); 
    1268          
     1271 
    12691272        return true; 
    1270          
     1273 
    12711274    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    12721275        int n=i-m_receiveProcessors.size(); 
    12731276        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    1274          
     1277 
    12751278        if(snoopMode) { 
    12761279 
     
    12831286        } 
    12841287        p->setChannel(-1); 
    1285          
     1288 
    12861289        return true; 
    12871290    } 
    1288      
     1291 
    12891292    debugError("SP index %d out of range!\n",i); 
    12901293    return false; 
     
    14141417                     Util::IOSerialize& ser ) const 
    14151418{ 
    1416      
     1419 
    14171420    bool result; 
    14181421    result  = m_pConfigRom->serialize( basePath + "m_pConfigRom/", ser ); 
     
    14351438        i++; 
    14361439    } 
    1437      
     1440 
    14381441    result &= serializeOptions( basePath + "Options", ser ); 
    14391442 
     
    14511454    ConfigRom *configRom = 
    14521455        ConfigRom::deserialize( basePath + "m_pConfigRom/", deser, ieee1394Service ); 
    1453          
     1456 
    14541457    if ( !configRom ) { 
    14551458        return NULL; 
     
    14571460 
    14581461    AvDevice* pDev = new AvDevice( 
    1459         std::auto_ptr<ConfigRom>(configRom),  
     1462        std::auto_ptr<ConfigRom>(configRom), 
    14601463        ieee1394Service, configRom->getNodeId()); 
    14611464 
     
    14631466        bool result; 
    14641467        result  = deser.read( basePath + "m_verboseLevel", pDev->m_verboseLevel ); 
    1465          
     1468 
    14661469        if (pDev->m_pPlugManager) delete pDev->m_pPlugManager; 
    14671470        pDev->m_pPlugManager = AvPlugManager::deserialize( basePath + "AvPlug", deser, *pDev ); 
     
    14841487            } 
    14851488        } 
    1486          
     1489 
    14871490        result &= deserializeOptions( basePath + "Options", deser, *pDev ); 
    14881491    } 
  • trunk/libffado/src/bebob/bebob_avdevice.h

    r436 r445  
    1 /* bebob_avdevice.h 
    2  * Copyright (C) 2005,06,07 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#ifndef BEBOB_AVDEVICE_H 
    2125#define BEBOB_AVDEVICE_H 
     
    5155    unsigned int model_id; 
    5256    char *vendor_name; 
    53     char *model_name;  
     57    char *model_name; 
    5458}; 
    5559 
     
    6064              int nodeId ); 
    6165    virtual ~AvDevice(); 
    62      
     66 
    6367    void setVerboseLevel(int l); 
    6468 
     
    115119    static AvDevice* deserialize( Glib::ustring basePath, 
    116120                                  Util::IODeserialize& deser, 
    117                                  Ieee1394Service& ieee1394Service ); 
     121                  Ieee1394Service& ieee1394Service ); 
    118122protected: 
    119123 
  • trunk/libffado/src/bebob/bebob_avdevice_subunit.cpp

    r420 r445  
    1 /* bebob_avdevice_subunit.cpp 
    2  * Copyright (C) 2005,06,07 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
  • trunk/libffado/src/bebob/bebob_avdevice_subunit.h

    r420 r445  
    1 /* bebob_avdevice_subunit.h 
    2  * Copyright (C) 2005,06,07 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#ifndef BEBOB_AVDEVICESUBUNIT_H 
    2125#define BEBOB_AVDEVICESUBUNIT_H 
     
    3842 public: 
    3943    AvDeviceSubunit( AvDevice& avDevice, 
    40                     AVCCommand::ESubunitType type, 
    41                     subunit_t id, 
    42                     int verboseLevel ); 
     44             AVCCommand::ESubunitType type, 
     45             subunit_t id, 
     46             int verboseLevel ); 
    4347    virtual ~AvDeviceSubunit(); 
    4448 
     
    5054 
    5155    subunit_t getSubunitId() 
    52        { return m_sbId; } 
     56    { return m_sbId; } 
    5357    AVCCommand::ESubunitType getSubunitType() 
    54        { return m_sbType; } 
     58    { return m_sbType; } 
    5559 
    5660    AvPlugVector& getPlugs() 
    57        { return m_plugs; } 
     61    { return m_plugs; } 
    5862    AvPlug* getPlug(AvPlug::EAvPlugDirection direction, plug_id_t plugId); 
    5963 
     
    6569    bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 
    6670    static AvDeviceSubunit* deserialize( Glib::ustring basePath, 
    67                                         Util::IODeserialize& deser, 
     71                    Util::IODeserialize& deser, 
    6872                                         AvDevice& avDevice ); 
    6973 protected: 
     
    98102 public: 
    99103    AvDeviceSubunitAudio( AvDevice& avDevice, 
    100                          subunit_t id, 
    101                          int verboseLevel ); 
     104              subunit_t id, 
     105              int verboseLevel ); 
    102106    AvDeviceSubunitAudio(); 
    103107    virtual ~AvDeviceSubunitAudio(); 
     
    135139 public: 
    136140    AvDeviceSubunitMusic( AvDevice& avDevice, 
    137                          subunit_t id, 
    138                          int verboseLevel ); 
     141              subunit_t id, 
     142              int verboseLevel ); 
    139143    AvDeviceSubunitMusic(); 
    140144    virtual ~AvDeviceSubunitMusic(); 
  • trunk/libffado/src/bebob/bebob_avplug.cpp

    r420 r445  
    1 /* bebob_avplug.cpp 
    2  * Copyright (C) 2005,06,07 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
  • trunk/libffado/src/bebob/bebob_avplug.h

    r435 r445  
    1 /* bebob_avplug.h 
    2  * Copyright (C) 2005,06,07 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
     
    5053 
    5154    enum EAvPlugAddressType { 
    52        eAPA_PCR, 
    53        eAPA_ExternalPlug, 
    54        eAPA_AsynchronousPlug, 
    55        eAPA_SubunitPlug, 
    56        eAPA_FunctionBlockPlug, 
    57        eAPA_Undefined, 
     55    eAPA_PCR, 
     56    eAPA_ExternalPlug, 
     57    eAPA_AsynchronousPlug, 
     58    eAPA_SubunitPlug, 
     59    eAPA_FunctionBlockPlug, 
     60    eAPA_Undefined, 
    5861    }; 
    5962 
     
    6972 
    7073    enum EAvPlugDirection { 
    71        eAPD_Input, 
    72        eAPD_Output, 
    73        eAPD_Unknown, 
     74    eAPD_Input, 
     75    eAPD_Output, 
     76    eAPD_Unknown, 
    7477    }; 
    7578 
    7679    // \todo This constructors sucks. too many parameters. fix it. 
    7780    AvPlug( Ieee1394Service& ieee1394Service, 
    78            ConfigRom& configRom, 
     81        ConfigRom& configRom, 
    7982            AvPlugManager& plugManager, 
    80            AVCCommand::ESubunitType subunitType, 
    81            subunit_id_t subunitId, 
    82            function_block_type_t functionBlockType, 
    83            function_block_type_t functionBlockId, 
    84            EAvPlugAddressType plugAddressType, 
    85            EAvPlugDirection plugDirection, 
    86            plug_id_t plugId, 
    87            int verboseLevel ); 
     83        AVCCommand::ESubunitType subunitType, 
     84        subunit_id_t subunitId, 
     85        function_block_type_t functionBlockType, 
     86        function_block_type_t functionBlockId, 
     87        EAvPlugAddressType plugAddressType, 
     88        EAvPlugDirection plugDirection, 
     89        plug_id_t plugId, 
     90        int verboseLevel ); 
    8891    AvPlug( const AvPlug& rhs ); 
    8992    virtual ~AvPlug(); 
     
    9699 
    97100    int getGlobalId() const 
    98        { return m_globalId; } 
     101        { return m_globalId; } 
    99102    plug_id_t getPlugId() const 
    100        { return m_id; } 
     103        { return m_id; } 
    101104    AVCCommand::ESubunitType getSubunitType() const 
    102        { return m_subunitType; } 
     105        { return m_subunitType; } 
    103106    subunit_id_t getSubunitId() const 
    104        { return m_subunitId; } 
     107        { return m_subunitId; } 
    105108    const char* getName() const 
    106        { return m_name.c_str(); } 
     109        { return m_name.c_str(); } 
    107110    EAvPlugDirection getPlugDirection() const 
    108        { return m_direction; } 
     111        { return m_direction; } 
    109112    sampling_frequency_t getSamplingFrequency() const 
    110        { return m_samplingFrequency; } 
     113        { return m_samplingFrequency; } 
    111114    int getSampleRate() const; // 22050, 24000, 32000, ... 
    112115    int getNrOfChannels() const; 
     
    118121        { return m_addressType; } 
    119122    EAvPlugType getPlugType() const 
    120        { return m_infoPlugType; } 
     123        { return m_infoPlugType; } 
    121124 
    122125    function_block_type_t getFunctionBlockType() const 
    123        { return m_functionBlockType; } 
     126        { return m_functionBlockType; } 
    124127    function_block_id_t getFunctionBlockId() const 
    125128        { return m_functionBlockId; } 
     
    131134 
    132135    static PlugAddress::EPlugDirection convertPlugDirection( 
    133        EAvPlugDirection direction); 
     136    EAvPlugDirection direction); 
    134137 
    135138    void showPlug() const; 
     
    148151        stream_position_t          m_streamPosition; 
    149152        stream_position_location_t m_location; 
    150        Glib::ustring              m_name; 
     153    Glib::ustring              m_name; 
    151154    }; 
    152155    typedef std::vector<ChannelInfo> ChannelInfoVector; 
    153156 
    154157    struct ClusterInfo { 
    155        int                      m_index; 
    156        port_type_t              m_portType; 
    157        Glib::ustring            m_name; 
     158    int                      m_index; 
     159    port_type_t              m_portType; 
     160    Glib::ustring            m_name; 
    158161 
    159162        nr_of_channels_t         m_nrOfChannels; 
    160163        ChannelInfoVector        m_channelInfos; 
    161        stream_format_t          m_streamFormat; 
     164    stream_format_t          m_streamFormat; 
    162165    }; 
    163166    typedef std::vector<ClusterInfo> ClusterInfoVector; 
     
    183186 
    184187    ExtendedStreamFormatCmd setPlugAddrToStreamFormatCmd( 
    185        ExtendedStreamFormatCmd::ESubFunction subFunction); 
     188    ExtendedStreamFormatCmd::ESubFunction subFunction); 
    186189 
    187190    SignalSourceCmd setSrcPlugAddrToSignalCmd(); 
    188191 
    189192    void setDestPlugAddrToSignalCmd( 
    190        SignalSourceCmd& signalSourceCmd, AvPlug& plug ); 
     193    SignalSourceCmd& signalSourceCmd, AvPlug& plug ); 
    191194 
    192195    void debugOutputClusterInfos( int debugLevel ); 
     
    245248            , m_index( 0xff ) 
    246249            {} 
    247        sampling_frequency_t  m_samplingFrequency; 
    248        bool                  m_isSyncStream; 
    249        number_of_channels_t  m_audioChannels; 
    250        number_of_channels_t  m_midiChannels; 
    251        byte_t                m_index; 
     250    sampling_frequency_t  m_samplingFrequency; 
     251    bool                  m_isSyncStream; 
     252    number_of_channels_t  m_audioChannels; 
     253    number_of_channels_t  m_midiChannels; 
     254    byte_t                m_index; 
    252255    }; 
    253256    typedef std::vector<FormatInfo> FormatInfoVector; 
     
    297300    AvPlug* getPlug( AVCCommand::ESubunitType subunitType, 
    298301                     subunit_id_t subunitId, 
    299                     function_block_type_t functionBlockType, 
    300                     function_block_id_t functionBlockId, 
     302             function_block_type_t functionBlockType, 
     303             function_block_id_t functionBlockId, 
    301304                     AvPlug::EAvPlugAddressType plugAddressType, 
    302305                     AvPlug::EAvPlugDirection plugDirection, 
     
    304307    AvPlug* getPlug( int iGlobalId ) const; 
    305308    AvPlugVector getPlugsByType( AVCCommand::ESubunitType subunitType, 
    306                                 subunit_id_t subunitId, 
    307                                 function_block_type_t functionBlockType, 
    308                                 function_block_id_t functionBlockId, 
    309                                 AvPlug::EAvPlugAddressType plugAddressType, 
    310                                 AvPlug::EAvPlugDirection plugDirection, 
    311                                 AvPlug::EAvPlugType type) const; 
     309                subunit_id_t subunitId, 
     310                function_block_type_t functionBlockType, 
     311                function_block_id_t functionBlockId, 
     312                AvPlug::EAvPlugAddressType plugAddressType, 
     313                AvPlug::EAvPlugDirection plugDirection, 
     314                AvPlug::EAvPlugType type) const; 
    312315 
    313316    bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 
     
    351354} 
    352355 
    353 #endif 
     356#endif // BEBOB_AVPLUG_H 
  • trunk/libffado/src/bebob/bebob_dl_bcd.cpp

    r407 r445  
    1 /* bebob_dl_bcd.cpp 
    2  * Copyright (C) 2006 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
  • trunk/libffado/src/bebob/bebob_dl_bcd.h

    r407 r445  
    1 /* bebob_dl_bcd.h 
    2  * Copyright (C) 2006 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#ifndef BEBOB_DL_BCD_H 
    2125#define BEBOB_DL_BCD_H 
     
    4549        fb_quadlet_t getSoftwareVersion() const 
    4650            { return m_softwareVersion; } 
    47        fb_quadlet_t getHardwareId() const 
    48            { return m_hardwareId; } 
    49        fb_quadlet_t getVendorOUI() const 
    50            { return m_vendorOUI; } 
    51          
     51    fb_quadlet_t getHardwareId() const 
     52        { return m_hardwareId; } 
     53    fb_quadlet_t getVendorOUI() const 
     54        { return m_vendorOUI; } 
     55 
    5256        fb_quadlet_t getImageBaseAddress() const 
    5357            { return m_imageBaseAddress; } 
     
    5963            { return m_imageCRC; } 
    6064 
    61        fb_quadlet_t getCnEOffset() const 
    62            { return m_cneOffset; } 
     65    fb_quadlet_t getCnEOffset() const 
     66        { return m_cneOffset; } 
    6367        fb_quadlet_t getCnELength() const 
    6468            { return m_cneLength; } 
    65        fb_quadlet_t getCnECRC() const 
    66            { return m_cneCRC; } 
     69    fb_quadlet_t getCnECRC() const 
     70        { return m_cneCRC; } 
    6771 
    6872        bool read( int addr, fb_quadlet_t* q ); 
    6973        bool read( int addr, fb_octlet_t* o ); 
    70        bool read( int addr, unsigned char* b, size_t len ); 
     74    bool read( int addr, unsigned char* b, size_t len ); 
    7175 
    72        void displayInfo(); 
     76    void displayInfo(); 
    7377 
    7478    protected: 
    7579        unsigned long crc32_table[256]; 
    76        void initCRC32Table(); 
    77        unsigned long reflect(unsigned long ref, char ch); 
    78        unsigned int getCRC(unsigned char* text, size_t len); 
     80    void initCRC32Table(); 
     81    unsigned long reflect(unsigned long ref, char ch); 
     82    unsigned int getCRC(unsigned char* text, size_t len); 
    7983        bool checkHeaderCRC( unsigned int crcOffset, 
    8084                             unsigned int headerSize ); 
     
    8993        fb_quadlet_t m_softwareId; 
    9094        fb_quadlet_t m_softwareVersion; 
    91        fb_quadlet_t m_hardwareId; 
    92        fb_quadlet_t m_vendorOUI; 
    93              
     95    fb_quadlet_t m_hardwareId; 
     96    fb_quadlet_t m_vendorOUI; 
     97 
    9498 
    9599        fb_quadlet_t m_imageBaseAddress; 
     
    99103 
    100104        fb_quadlet_t m_cneLength; 
    101        fb_quadlet_t m_cneOffset; 
    102        fb_quadlet_t m_cneCRC; 
     105    fb_quadlet_t m_cneOffset; 
     106    fb_quadlet_t m_cneCRC; 
    103107 
    104108 
    105109 
    106        DECLARE_DEBUG_MODULE; 
     110    DECLARE_DEBUG_MODULE; 
    107111    }; 
    108112 
  • trunk/libffado/src/bebob/bebob_dl_codes.cpp

    r407 r445  
    1 /* bebob_dl_codes.cpp 
    2  * Copyright (C) 2006 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#include "bebob/bebob_dl_codes.h" 
    2125#include "bebob/bebob_dl_bcd.h" 
  • trunk/libffado/src/bebob/bebob_dl_codes.h

    r420 r445  
    1 /* bebob_dl_codes.h 
    2  * Copyright (C) 2006 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
     
    6467                      fb_byte_t operandSizeRequestField, 
    6568                      fb_byte_t operandSizeResponseField ); 
    66        virtual ~CommandCodes(); 
     69    virtual ~CommandCodes(); 
    6770 
    6871        virtual bool serialize( IOSSerialize& se ); 
     
    7477            { return static_cast<EBootloaderCommandCodes>( m_commandCode ); } 
    7578 
    76        fb_byte_t getProtocolVersion() const 
    77            { return m_protocolVersion; } 
     79    fb_byte_t getProtocolVersion() const 
     80        { return m_protocolVersion; } 
    7881        size_t getMsgSize() const 
    7982            { return m_msgSize; } 
     
    163166        enum EObject { 
    164167            eO_Application    = 0, 
    165            eO_Config         = 1, 
    166            eO_Debugger       = 2, 
     168        eO_Config         = 1, 
     169        eO_Debugger       = 2, 
    167170            eO_Bootloader     = 3, 
    168            eO_WarpImage      = 4, 
    169            eO_SerialBootCode = 5, 
     171        eO_WarpImage      = 4, 
     172        eO_SerialBootCode = 5, 
    170173        }; 
    171174 
    172175        CommandCodesDownloadStart( fb_quadlet_t protocolVersion, 
    173                                     EObject object ); 
     176                     EObject object ); 
    174177        virtual ~CommandCodesDownloadStart(); 
    175178 
     
    218221        virtual bool deserialize( IISDeserialize& de ); 
    219222 
    220        bool setSeqNumber( fb_quadlet_t seqNumber ) 
    221            { m_seqNumber = seqNumber; return true; } 
    222        bool setAddress( fb_quadlet_t address ) 
     223    bool setSeqNumber( fb_quadlet_t seqNumber ) 
     224        { m_seqNumber = seqNumber; return true; } 
     225    bool setAddress( fb_quadlet_t address ) 
    223226            { m_address = address; return true; } 
    224227        bool setNumberBytes( fb_quadlet_t numByte ) 
     
    233236        fb_quadlet_t m_numBytes; 
    234237 
    235        fb_quadlet_t m_resp_seqNumber; 
    236        fb_quadlet_t m_resp_errorCode; 
     238    fb_quadlet_t m_resp_seqNumber; 
     239    fb_quadlet_t m_resp_errorCode; 
    237240    }; 
    238241 
     
    287290        enum EStartMode { 
    288291            eSM_Application = 0, 
    289            eSM_Debugger = 2, 
     292        eSM_Debugger = 2, 
    290293        }; 
    291294 
     
    306309    private: 
    307310        fb_quadlet_t m_startMode; 
    308        fb_quadlet_t m_resp_validCRC; 
     311    fb_quadlet_t m_resp_validCRC; 
    309312    }; 
    310313 
  • trunk/libffado/src/bebob/bebob_dl_mgr.cpp

    r420 r445  
    1 /* bebob_dl_mgr.cpp 
    2  * Copyright (C) 2006 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#include "bebob_dl_mgr.h" 
    2125#include "bebob_dl_codes.h" 
  • trunk/libffado/src/bebob/bebob_dl_mgr.h

    r407 r445  
    1 /* bebob_dl_mgr.h 
    2  * Copyright (C) 2006 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#ifndef BEBOB_DL_MGR_H 
    2125#define BEBOB_DL_MGR_H 
     
    5155        bool programGUID( octlet_t guid ); 
    5256 
    53        void busresetHandler(); 
     57    void busresetHandler(); 
    5458 
    55        Ieee1394Service* get1394Serivce() const 
     59    Ieee1394Service* get1394Serivce() const 
    5660            { return m_ieee1394service; } 
    5761 
    58        bool setForceOperations( bool enabled ) 
     62    bool setForceOperations( bool enabled ) 
    5963            { m_forceEnabled = enabled; return true; } 
    6064 
    61        bool setStartBootloader( bool bStartBootloader ) 
    62            { m_bStartBootloader = bStartBootloader; return true; } 
     65    bool setStartBootloader( bool bStartBootloader ) 
     66        { m_bStartBootloader = bStartBootloader; return true; } 
    6367    protected: 
    64        enum EObjectType { 
    65            eOT_Application, 
    66            eOT_CnE 
    67        }; 
     68    enum EObjectType { 
     69        eOT_Application, 
     70        eOT_CnE 
     71    }; 
    6872 
    69        void waitForBusReset(); 
     73    void waitForBusReset(); 
    7074        bool writeRequest( CommandCodes& cmd ); 
    71        bool readResponse( CommandCodes& writeRequestCmd ); 
    72        bool downloadObject( BCD& bcd, EObjectType eObject ); 
     75    bool readResponse( CommandCodes& writeRequestCmd ); 
     76    bool downloadObject( BCD& bcd, EObjectType eObject ); 
    7377 
    7478        bool programGUIDCmd( octlet_t guid ); 
    75        bool startBootloaderCmd(); 
     79    bool startBootloaderCmd(); 
    7680        bool startApplicationCmd(); 
    7781        bool initializePersParamCmd(); 
     
    111115        info_register_t    m_cachedInfoRegs; 
    112116 
    113        pthread_mutex_t m_mutex; 
    114        pthread_cond_t  m_cond; 
     117    pthread_mutex_t m_mutex; 
     118    pthread_cond_t  m_cond; 
    115119 
    116        Functor*        m_functor; 
     120    Functor*        m_functor; 
    117121 
    118122        bool            m_forceEnabled; 
    119        bool            m_bStartBootloader; 
     123    bool            m_bStartBootloader; 
    120124 
    121        DECLARE_DEBUG_MODULE; 
     125    DECLARE_DEBUG_MODULE; 
    122126    }; 
    123127} 
  • trunk/libffado/src/bebob/bebob_functionblock.cpp

    r413 r445  
    1 /* bebob_functionblock.cpp 
    2  * Copyright (C) 2006,07 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#include "bebob/bebob_functionblock.h" 
    2125#include "bebob/bebob_avdevice_subunit.h" 
  • trunk/libffado/src/bebob/bebob_functionblock.h

    r420 r445  
    1 /* bebob_functionblock.h 
    2  * Copyright (C) 2006,07 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#ifndef BEBOB_FUNCTION_BLOCK_H 
    2125#define BEBOB_FUNCTION_BLOCK_H 
     
    4751 
    4852    FunctionBlock( AvDeviceSubunit& subunit, 
    49                   function_block_type_t type, 
     53           function_block_type_t type, 
    5054                   function_block_type_t subtype, 
    5155                   function_block_id_t id, 
     
    6569    bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 
    6670    static FunctionBlock* deserialize( Glib::ustring basePath, 
    67                                       Util::IODeserialize& deser, 
    68                                       AvDevice& avDevice, 
     71                       Util::IODeserialize& deser, 
     72                       AvDevice& avDevice, 
    6973                                       AvDeviceSubunit& subunit); 
    7074protected: 
  • trunk/libffado/src/bounce/bounce_avdevice.cpp

    r436 r445  
    1 /* bounce_avdevice.cpp 
    2  * Copyright (C) 2006 by Pieter Palmers 
    3  * Copyright (C) 2006 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Pieter Palmers 
     3 * Copyright (C) 2005-2007 by Daniel Wagner 
    44 * 
    5  * This file is part of FreeBoB. 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
    67 * 
    7  * FreeBoB is free software; you can redistribute it and/or modify 
    8  * it under the terms of the GNU General Public License as published by 
    9  * the Free Software Foundation; either version 2 of the License, or 
    10  * (at your option) any later version. 
    11  * FreeBoB is distributed in the hope that it will be useful, 
     8 * FFADO is based upon FreeBoB 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
    1215 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    14  * GNU General Public License for more details. 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
    1518 * 
    16  * You should have received a copy of the GNU General Public License 
    17  * along with FreeBoB; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    19  * MA 02111-1307 USA. 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    2023 */ 
     24 
    2125#include "bounce/bounce_avdevice.h" 
    2226 
     
    4549static VendorModelEntry supportedDeviceList[] = 
    4650{ 
    47     {0x0B0001LU, 0x0B0001LU, 0x0B0001LU, "FreeBoB", "Bounce"}, 
     51    {0x0B0001LU, 0x0B0001LU, 0x0B0001LU, "FFADO", "Bounce"}, 
    4852}; 
    4953 
     
    8084          ++i ) 
    8185    { 
    82         if (  
     86        if ( 
    8387//             ( supportedDeviceList[i].vendor_id == vendorId ) 
    8488             ( supportedDeviceList[i].model_id == modelId ) 
    85              && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId )  
     89             && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 
    8690           ) 
    8791        { 
     
    98102    debugOutput( DEBUG_LEVEL_VERBOSE, "discovering BounceDevice (NodeID %d)\n", 
    99103                 m_nodeId ); 
    100                   
     104 
    101105//     unsigned int vendorId = m_pConfigRom->getNodeVendorId(); 
    102106    unsigned int modelId = m_pConfigRom->getModelId(); 
     
    108112    { 
    109113        if ( //( supportedDeviceList[i].vendor_id == vendorId ) 
    110              ( supportedDeviceList[i].model_id == modelId )  
    111              && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId )  
     114             ( supportedDeviceList[i].model_id == modelId ) 
     115             && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 
    112116           ) 
    113117        { 
     
    168172 
    169173    debugOutput(DEBUG_LEVEL_VERBOSE,"Adding ports to processor\n"); 
    170      
     174 
    171175    std::string id=std::string("dev?"); 
    172176    if(!getOption("id", id)) { 
    173177        debugWarning("Could not retrieve id parameter, defauling to 'dev?'\n"); 
    174178    } 
    175      
     179 
    176180    int i=0; 
    177181    for (i=0;i<BOUNCE_NB_AUDIO_CHANNELS;i++) { 
     
    205209        free(buff); 
    206210    } 
    207      
     211 
    208212    for (i=0;i<BOUNCE_NB_MIDI_CHANNELS;i++) { 
    209213        char *buff; 
     
    237241     } 
    238242 
    239        return true; 
     243    return true; 
    240244} 
    241245 
     
    243247BounceDevice::prepare() { 
    244248    debugOutput(DEBUG_LEVEL_NORMAL, "Preparing BounceDevice...\n" ); 
    245      
     249 
    246250    bool snoopMode=false; 
    247251    if(!getOption("snoopMode", snoopMode)) { 
     
    251255    // create & add streamprocessors 
    252256    Streaming::StreamProcessor *p; 
    253      
     257 
    254258    p=new Streaming::AmdtpReceiveStreamProcessor( 
    255259                             m_p1394Service->getPort(), 
     
    285289                                BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 
    286290    } 
    287      
     291 
    288292    if(!p->init()) { 
    289293        debugFatal("Could not initialize transmit processor %s!\n", 
     
    335339        int n=i; 
    336340        Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 
    337          
     341 
    338342        // allocate ISO channel 
    339343        int isochannel=allocateIsoChannel(p->getMaxPacketSize()); 
     
    343347        } 
    344348        p->setChannel(isochannel); 
    345          
     349 
    346350        fb_quadlet_t reg_isoch; 
    347351        // check value of ISO_CHANNEL register 
     
    358362            return false; 
    359363        } 
    360          
     364 
    361365        // write value of ISO_CHANNEL register 
    362366        reg_isoch=isochannel; 
     
    367371            return false; 
    368372        } 
    369          
     373 
    370374        return true; 
    371          
     375 
    372376    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    373377        int n=i-m_receiveProcessors.size(); 
    374378        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    375          
     379 
    376380        // allocate ISO channel 
    377381        int isochannel=allocateIsoChannel(p->getMaxPacketSize()); 
     
    381385        } 
    382386        p->setChannel(isochannel); 
    383          
     387 
    384388        fb_quadlet_t reg_isoch; 
    385389        // check value of ISO_CHANNEL register 
     
    396400            return false; 
    397401        } 
    398          
     402 
    399403        // write value of ISO_CHANNEL register 
    400404        reg_isoch=isochannel; 
     
    405409            return false; 
    406410        } 
    407          
     411 
    408412        return true; 
    409413    } 
    410      
     414 
    411415    debugError("SP index %d out of range!\n",i); 
    412      
     416 
    413417    return false; 
    414418} 
     
    420424        Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 
    421425        unsigned int isochannel=p->getChannel(); 
    422          
     426 
    423427        fb_quadlet_t reg_isoch; 
    424428        // check value of ISO_CHANNEL register 
     
    431435            return false; 
    432436        } 
    433          
     437 
    434438        // write value of ISO_CHANNEL register 
    435439        reg_isoch=0xFFFFFFFFUL; 
     
    438442            return false; 
    439443        } 
    440          
     444 
    441445        // deallocate ISO channel 
    442446        if(!deallocateIsoChannel(isochannel)) { 
     
    444448            return false; 
    445449        } 
    446          
     450 
    447451        p->setChannel(-1); 
    448452        return true; 
    449          
     453 
    450454    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    451455        int n=i-m_receiveProcessors.size(); 
    452456        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    453          
     457 
    454458        unsigned int isochannel=p->getChannel(); 
    455          
     459 
    456460        fb_quadlet_t reg_isoch; 
    457461        // check value of ISO_CHANNEL register 
     
    464468            return false; 
    465469        } 
    466          
     470 
    467471        // write value of ISO_CHANNEL register 
    468472        reg_isoch=0xFFFFFFFFUL; 
     
    471475            return false; 
    472476        } 
    473          
     477 
    474478        // deallocate ISO channel 
    475479        if(!deallocateIsoChannel(isochannel)) { 
     
    477481            return false; 
    478482        } 
    479          
     483 
    480484        p->setChannel(-1); 
    481485        return true; 
    482486    } 
    483      
     487 
    484488    debugError("SP index %d out of range!\n",i); 
    485489    return false; 
     
    491495int BounceDevice::allocateIsoChannel(unsigned int packet_size) { 
    492496    unsigned int bandwidth=8+packet_size; 
    493      
     497 
    494498    int ch=m_p1394Service->allocateIsoChannelGeneric(bandwidth); 
    495          
     499 
    496500    debugOutput(DEBUG_LEVEL_VERBOSE, "allocated channel %d, bandwidth %d\n", 
    497501        ch, bandwidth); 
    498      
     502 
    499503    return ch; 
    500504} 
     
    510514BounceDevice::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    511515    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 
    512      
     516 
    513517    if(offset >= BOUNCE_INVALID_OFFSET) { 
    514518        debugError("invalid offset: 0x%016llX\n", offset); 
    515519        return false; 
    516520    } 
    517      
     521 
    518522    fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 
    519523    fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
    520      
     524 
    521525    if(!m_p1394Service->read_quadlet( nodeId, addr, result ) ) { 
    522526        debugError("Could not read from node 0x%04X addr 0x%012X\n", nodeId, addr); 
     
    524528    } 
    525529    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08X\n", *result); 
    526     
     530 
    527531    return true; 
    528532} 
     
    530534bool 
    531535BounceDevice::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
    532     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n",   
     536    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 
    533537        offset, data); 
    534      
     538 
    535539    if(offset >= BOUNCE_INVALID_OFFSET) { 
    536540        debugError("invalid offset: 0x%016llX\n", offset); 
    537541        return false; 
    538542    } 
    539      
     543 
    540544    fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 
    541545    fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
    542      
     546 
    543547    if(!m_p1394Service->write_quadlet( nodeId, addr, data ) ) { 
    544548        debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); 
     
    548552} 
    549553 
    550 bool  
     554bool 
    551555BounceDevice::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    552     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n",  
     556    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 
    553557        offset, length); 
    554      
     558 
    555559    if(offset >= BOUNCE_INVALID_OFFSET) { 
    556560        debugError("invalid offset: 0x%016llX\n", offset); 
    557561        return false; 
    558562    } 
    559      
     563 
    560564    fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 
    561565    fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
    562      
     566 
    563567    if(!m_p1394Service->read( nodeId, addr, length, data ) ) { 
    564568        debugError("Could not read from node 0x%04X addr 0x%012llX\n", nodeId, addr); 
     
    568572} 
    569573 
    570 bool  
     574bool 
    571575BounceDevice::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    572     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n",   
     576    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 
    573577        offset, length); 
    574      
     578 
    575579    if(offset >= BOUNCE_INVALID_OFFSET) { 
    576580        debugError("invalid offset: 0x%016llX\n", offset); 
    577581        return false; 
    578582    } 
    579      
     583 
    580584    fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 
    581585    fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
  • trunk/libffado/src/bounce/bounce_avdevice.h

    r436 r445  
    1 /* bounce_avdevice.h 
    2  * Copyright (C) 2006 by Pieter Palmers 
    3  * Copyright (C) 2006 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Pieter Palmers 
     3 * Copyright (C) 2005-2007 by Daniel Wagner 
    44 * 
    5  * This file is part of FreeBoB. 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
    67 * 
    7  * FreeBoB is free software; you can redistribute it and/or modify 
    8  * it under the terms of the GNU General Public License as published by 
    9  * the Free Software Foundation; either version 2 of the License, or 
    10  * (at your option) any later version. 
    11  * FreeBoB is distributed in the hope that it will be useful, 
     8 * FFADO is based upon FreeBoB 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
    1215 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    14  * GNU General Public License for more details. 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
    1518 * 
    16  * You should have received a copy of the GNU General Public License 
    17  * along with FreeBoB; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    19  * MA 02111-1307 USA. 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    2023 */ 
     24 
    2125#ifndef BOUNCEDEVICE_H 
    2226#define BOUNCEDEVICE_H 
     
    6670public: 
    6771    BounceDevice( std::auto_ptr<ConfigRom>( configRom ), 
    68                  Ieee1394Service& ieee1394Service, 
    69                  int nodeId ); 
     72          Ieee1394Service& ieee1394Service, 
     73          int nodeId ); 
    7074    virtual ~BounceDevice(); 
    7175 
    7276    static bool probe( ConfigRom& configRom ); 
    7377    bool discover(); 
    74      
     78 
    7579    bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 
    7680    int getSamplingFrequency( ); 
    77      
     81 
    7882    bool prepare(); 
    7983    bool lock(); 
     
    8690    bool startStreamByIndex(int i); 
    8791    bool stopStreamByIndex(int i); 
    88      
     92 
    8993    void showDevice(); 
    9094 
     
    99103 
    100104    bool addPortsToProcessor( 
    101        Streaming::StreamProcessor *processor,  
     105       Streaming::StreamProcessor *processor, 
    102106       Streaming::Port::E_Direction direction); 
    103      
     107 
    104108private: // generic helpers 
    105109    int allocateIsoChannel(unsigned int packet_size); 
     
    112116    bool readRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 
    113117    bool writeRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 
    114      
     118 
    115119private: 
    116120    BounceNotifier *m_Notifier; 
    117121    /** 
    118      * this class reacts on the other side writing to the  
     122     * this class reacts on the other side writing to the 
    119123     * hosts address space 
    120124     */ 
     
    126130        BounceNotifier(BounceDevice *, nodeaddr_t start); 
    127131        virtual ~BounceNotifier(); 
    128          
     132 
    129133    private: 
    130134        BounceDevice *m_bouncedevice; 
  • trunk/libffado/src/bounce/bounce_slave_avdevice.cpp

    r435 r445  
    1 /* $Id$ */ 
    2  
    31/* 
    4  *   FreeBob Streaming API 
    5  *   FreeBob = Firewire (pro-)audio for linux 
     2 * Copyright (C) 2005-2007 by Pieter Palmers 
     3 * Copyright (C) 2005-2007 by Daniel Wagner 
    64 * 
    7  *   http://freebob.sf.net 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
    87 * 
    9  *   Copyright (C) 2007 Pieter Palmers <pieterpalmers@users.sourceforge.net> 
     8 * FFADO is based upon FreeBoB 
    109 * 
    11  *   This program is free software {} you can redistribute it and/or modify 
    12  *   it under the terms of the GNU General Public License as published by 
    13  *   the Free Software Foundation {} either version 2 of the License, or 
    14  *   (at your option) any later version. 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
    1513 * 
    16  *   This program is distributed in the hope that it will be useful, 
    17  *   but WITHOUT ANY WARRANTY {} without even the implied warranty of 
    18  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    19  *   GNU General Public License for more details. 
     14 * This library is distributed in the hope that it will be useful, 
     15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
    2018 * 
    21  *   You should have received a copy of the GNU General Public License 
    22  *   along with this program {} if not, write to the Free Software 
    23  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
    24  * 
    25  *  
    26  * 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    2723 */ 
    2824 
     
    4238{ 
    4339  //{vendor_id, model_id, unit_specifier_id, vendor_name, model_name}, 
    44     {0x0B0001, 0x0B0001, 0x0B0001, "FreeBoB", "Bounce Slave"}, 
     40    {0x0B0001, 0x0B0001, 0x0B0001, "FFADO", "Bounce Slave"}, 
    4541}; 
    4642 
     
    8076    debugOutput(DEBUG_LEVEL_VERBOSE, "Initializing memory space...\n"); 
    8177    fb_quadlet_t result=0xFFFFFFFFLU; 
    82      
     78 
    8379    // initialize the ISO channel registers 
    8480    // this will write to our own registers 
     
    9187        return false; 
    9288    } 
    93      
     89 
    9490    // set everything such that we can be discovered 
    9591    m_original_config_rom=save_config_rom( m_p1394Service->getHandle() ); 
    96      
     92 
    9793    if ( init_config_rom( m_p1394Service->getHandle() ) < 0 ) { 
    9894        debugError("Could not initalize local config rom\n"); 
    9995        return false; 
    10096    } 
    101      
     97 
    10298    // refresh our config rom cache 
    10399    if ( !m_pConfigRom->initialize() ) { 
     
    122118bool 
    123119BounceSlaveDevice::lock() { 
    124     debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n",  
     120    debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 
    125121        m_model->vendor_name, m_model->model_name, m_nodeId); 
    126      
     122 
    127123    // get a notifier to handle device notifications 
    128124    nodeaddr_t notify_address; 
     
    131127                        BOUNCE_REGISTER_LENGTH, 
    132128                        BOUNCE_REGISTER_LENGTH); 
    133      
     129 
    134130    if (notify_address == 0xFFFFFFFFFFFFFFFFLLU) { 
    135131        debugError("Could not find free ARM block for notification\n"); 
    136132        return false; 
    137133    } 
    138      
     134 
    139135    m_Notifier=new BounceSlaveDevice::BounceSlaveNotifier(this, notify_address); 
    140      
     136 
    141137    if(!m_Notifier) { 
    142138        debugError("Could not allocate notifier\n"); 
    143139        return false; 
    144140    } 
    145      
     141 
    146142    if (!m_p1394Service->registerARMHandler(m_Notifier)) { 
    147143        debugError("Could not register notifier\n"); 
     
    150146        return false; 
    151147    } 
    152      
     148 
    153149    // (re)initialize the memory space 
    154150    if (!initMemSpace()) { 
     
    156152        return false; 
    157153    } 
    158      
     154 
    159155    return true; 
    160156} 
     
    177173BounceSlaveDevice::prepare() { 
    178174    debugOutput(DEBUG_LEVEL_NORMAL, "Preparing BounceSlaveDevice...\n" ); 
    179      
     175 
    180176    // create & add streamprocessors 
    181177    Streaming::StreamProcessor *p; 
    182      
     178 
    183179    p=new Streaming::AmdtpSlaveReceiveStreamProcessor( 
    184180                             m_p1394Service->getPort(), 
     
    206202                                m_samplerate, 
    207203                                BOUNCE_NB_AUDIO_CHANNELS); 
    208      
     204 
    209205    if(!p->init()) { 
    210206        debugFatal("Could not initialize transmit processor!\n"); 
     
    227223bool 
    228224BounceSlaveDevice::startStreamByIndex(int i) { 
    229      
     225 
    230226    if (i<(int)m_receiveProcessors.size()) { 
    231227        int n=i; 
    232228        Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 
    233          
     229 
    234230        // the other side sends on this channel 
    235231        nodeaddr_t iso_channel_offset = BOUNCE_REGISTER_RX_ISOCHANNEL; 
    236232        iso_channel_offset += ((unsigned)n)*4; 
    237          
     233 
    238234        if (!waitForRegisterNotEqualTo(iso_channel_offset, 0xFFFFFFFFLU)) { 
    239235            debugError("Timeout waiting for stream %d to get an ISO channel\n",i); 
    240236            return false; 
    241237        } 
    242          
     238 
    243239        fb_quadlet_t result; 
    244240        // this will read from our own registers 
     
    247243            return false; 
    248244        } 
    249          
     245 
    250246        // set ISO channel 
    251247        p->setChannel(result); 
    252248 
    253249        return true; 
    254          
     250 
    255251    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    256252        int n=i-m_receiveProcessors.size(); 
    257253        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    258          
     254 
    259255        // the other side sends on this channel 
    260256        nodeaddr_t iso_channel_offset = BOUNCE_REGISTER_TX_ISOCHANNEL; 
    261257        iso_channel_offset += ((unsigned)n)*4; 
    262          
     258 
    263259        if (!waitForRegisterNotEqualTo(iso_channel_offset, 0xFFFFFFFF)) { 
    264260            debugError("Timeout waiting for stream %d to get an ISO channel\n",i); 
    265261            return false; 
    266262        } 
    267          
     263 
    268264        fb_quadlet_t result; 
    269265        // this will read from our own registers 
     
    272268            return false; 
    273269        } 
    274          
     270 
    275271        // set ISO channel 
    276272        p->setChannel(result); 
     
    279275 
    280276    } 
    281      
     277 
    282278    debugError("SP index %d out of range!\n",i); 
    283      
     279 
    284280    return false; 
    285281} 
     
    301297        debugWarning("Could not retrieve isoTimeoutSecs parameter, defauling to 120secs\n"); 
    302298    } 
    303      
     299 
    304300    int wait_cycles=timeoutSecs*10; // two seconds 
    305      
     301 
    306302    fb_quadlet_t reg=v; 
    307      
     303 
    308304    while ((v == reg) && wait_cycles) { 
    309305        wait_cycles--; 
     
    318314        return false; 
    319315    } 
    320      
     316 
    321317    return true; 
    322318} 
     
    326322 
    327323 
    328 struct BounceSlaveDevice::configrom_backup  
     324struct BounceSlaveDevice::configrom_backup 
    329325BounceSlaveDevice::save_config_rom(raw1394handle_t handle) 
    330326{ 
     
    333329    /* get the current rom image */ 
    334330    retval=raw1394_get_config_rom(handle, tmp.rom, 0x100, &tmp.rom_size, &tmp.rom_version); 
    335 //     tmp.rom_size=rom1394_get_size(tmp.rom); 
     331//     tmp.rom_size=rom1394_get_size(tmp.rom); 
    336332//     printf("save_config_rom get_config_rom returned %d, romsize %d, rom_version %d:\n",retval,tmp.rom_size,tmp.rom_version); 
    337333 
     
    339335} 
    340336 
    341 int  
     337int 
    342338BounceSlaveDevice::restore_config_rom(raw1394handle_t handle, struct BounceSlaveDevice::configrom_backup old) 
    343339{ 
    344340    int retval; 
    345341//     int i; 
    346      
     342 
    347343    quadlet_t current_rom[0x100]; 
    348344    size_t current_rom_size; 
     
    371367} 
    372368 
    373 int  
     369int 
    374370BounceSlaveDevice::init_config_rom(raw1394handle_t handle) 
    375371{ 
     
    380376    rom1394_directory dir; 
    381377    char *leaf; 
    382      
     378 
    383379    /* get the current rom image */ 
    384380    retval=raw1394_get_config_rom(handle, rom, 0x100, &rom_size, &rom_version); 
     
    391387//     } 
    392388//     printf("\n"); 
    393      
     389 
    394390    /* get the local directory */ 
    395391    rom1394_get_directory( handle, raw1394_get_local_id(handle) & 0x3f, &dir); 
    396      
     392 
    397393    /* change the vendor description for kicks */ 
    398394    i = strlen(dir.textual_leafs[0]); 
    399     strncpy(dir.textual_leafs[0], FREEBOB_BOUNCE_SERVER_VENDORNAME "                                          ", i); 
    400      
    401     dir.vendor_id=FREEBOB_BOUNCE_SERVER_VENDORID; 
    402     dir.model_id=FREEBOB_BOUNCE_SERVER_MODELID; 
    403      
     395    strncpy(dir.textual_leafs[0], FFADO_BOUNCE_SERVER_VENDORNAME "                                          ", i); 
     396 
     397    dir.vendor_id=FFADO_BOUNCE_SERVER_VENDORID; 
     398    dir.model_id=FFADO_BOUNCE_SERVER_MODELID; 
     399 
    404400    /* update the rom */ 
    405401    retval = rom1394_set_directory(rom, &dir); 
     
    411407//     } 
    412408//     printf("\n"); 
    413      
     409 
    414410    /* free the allocated mem for the textual leaves */ 
    415411    rom1394_free_directory( &dir); 
    416      
     412 
    417413    /* add an AV/C unit directory */ 
    418     dir.unit_spec_id    = FREEBOB_BOUNCE_SERVER_SPECID; 
     414    dir.unit_spec_id    = FFADO_BOUNCE_SERVER_SPECID; 
    419415    dir.unit_sw_version = 0x00010001; 
    420     leaf = FREEBOB_BOUNCE_SERVER_MODELNAME; 
     416    leaf = FFADO_BOUNCE_SERVER_MODELNAME; 
    421417    dir.nr_textual_leafs = 1; 
    422418    dir.textual_leafs = &leaf; 
    423      
     419 
    424420    /* manipulate the rom */ 
    425421    retval = rom1394_add_unit( rom, &dir); 
    426      
     422 
    427423    /* get the computed size of the rom image */ 
    428424    rom_size = rom1394_get_size(rom); 
    429      
     425 
    430426//     printf("rom1394_add_unit_directory returned %d, romsize %d:",retval,rom_size); 
    431427//     for (i = 0; i < rom_size; i++) 
     
    435431//     } 
    436432//     printf("\n"); 
    437 //      
     433// 
    438434    /* convert computed rom size from quadlets to bytes before update */ 
    439435    rom_size *= sizeof(quadlet_t); 
    440436    retval = raw1394_update_config_rom(handle, rom, rom_size, rom_version); 
    441437//     printf("update_config_rom returned %d\n",retval); 
    442      
     438 
    443439    retval=raw1394_get_config_rom(handle, rom, 0x100, &rom_size, &rom_version); 
    444440//     printf("get_config_rom returned %d, romsize %d, rom_version %d:",retval,rom_size,rom_version); 
     
    449445//     } 
    450446//     printf("\n"); 
    451      
    452 //     printf("You need to reload your ieee1394 modules to reset the rom.\n"); 
    453      
     447 
     448//     printf("You need to reload your ieee1394 modules to reset the rom.\n"); 
     449 
    454450    return 0; 
    455451} 
     
    459455 
    460456BounceSlaveDevice::BounceSlaveNotifier::BounceSlaveNotifier(BounceSlaveDevice *d, nodeaddr_t start) 
    461  : ARMHandler(start, BOUNCE_REGISTER_LENGTH,  
     457 : ARMHandler(start, BOUNCE_REGISTER_LENGTH, 
    462458              RAW1394_ARM_READ | RAW1394_ARM_WRITE, // allowed operations 
    463459              0, //RAW1394_ARM_READ | RAW1394_ARM_WRITE, // operations to be notified of 
     
    468464} 
    469465 
    470 BounceSlaveDevice::BounceSlaveNotifier::~BounceSlaveNotifier()  
     466BounceSlaveDevice::BounceSlaveNotifier::~BounceSlaveNotifier() 
    471467{ 
    472468 
  • trunk/libffado/src/bounce/bounce_slave_avdevice.h

    r435 r445  
    1 /* $Id$ */ 
     1/* 
     2 * Copyright (C) 2005-2007 by Pieter Palmers 
     3 * Copyright (C) 2005-2007 by Daniel Wagner 
     4 * 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
     7 * 
     8 * FFADO is based upon FreeBoB 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
     15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
     18 * 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
     23 */ 
    224 
    3 /* 
    4  *   FreeBob Streaming API 
    5  *   FreeBob = Firewire (pro-)audio for linux 
    6  * 
    7  *   http://freebob.sf.net 
    8  * 
    9  *   Copyright (C) 2007 Pieter Palmers <pieterpalmers@users.sourceforge.net> 
    10  * 
    11  *   This program is free software {} you can redistribute it and/or modify 
    12  *   it under the terms of the GNU General Public License as published by 
    13  *   the Free Software Foundation {} either version 2 of the License, or 
    14  *   (at your option) any later version. 
    15  * 
    16  *   This program is distributed in the hope that it will be useful, 
    17  *   but WITHOUT ANY WARRANTY {} without even the implied warranty of 
    18  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    19  *   GNU General Public License for more details. 
    20  * 
    21  *   You should have received a copy of the GNU General Public License 
    22  *   along with this program {} if not, write to the Free Software 
    23  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
    24  * 
    25  *  
    26  * 
    27  */ 
    28 #ifndef __FREEBOB_BOUNCESLAVEDEVICE__ 
    29 #define __FREEBOB_BOUNCESLAVEDEVICE__ 
     25#ifndef __FFADO_BOUNCESLAVEDEVICE__ 
     26#define __FFADO_BOUNCESLAVEDEVICE__ 
    3027 
    3128#include "debugmodule/debugmodule.h" 
    3229#include "bounce_avdevice.h" 
    3330 
    34 #define FREEBOB_MAX_NAME_LEN 256 
     31#define FFADO_MAX_NAME_LEN 256 
    3532 
    36 #define FREEBOB_BOUNCE_SERVER_VENDORNAME  "FreeBoB Server" 
    37 #define FREEBOB_BOUNCE_SERVER_MODELNAME   "freebob-server" 
     33#define FFADO_BOUNCE_SERVER_VENDORNAME  "FFADO Server" 
     34#define FFADO_BOUNCE_SERVER_MODELNAME   "ffado-server" 
    3835 
    3936// NOTE: this is currently free, but it is not really allowed to use 
    40 #define FREEBOB_BOUNCE_SERVER_VENDORID    0x000B0001 
    41 #define FREEBOB_BOUNCE_SERVER_MODELID     0x000B0001 
    42 #define FREEBOB_BOUNCE_SERVER_SPECID      0x000B0001 
     37#define FFADO_BOUNCE_SERVER_VENDORID    0x000B0001 
     38#define FFADO_BOUNCE_SERVER_MODELID     0x000B0001 
     39#define FFADO_BOUNCE_SERVER_SPECID      0x000B0001 
    4340 
    4441namespace Bounce { 
     
    5148          Ieee1394Service& ieee1394Service ); 
    5249    virtual ~BounceSlaveDevice(); 
    53      
     50 
    5451    static bool probe( ConfigRom& configRom ); 
    5552    bool discover(); 
     
    5754    bool lock(); 
    5855    bool unlock(); 
    59      
     56 
    6057    bool startStreamByIndex(int i); 
    6158    bool stopStreamByIndex(int i); 
     
    6562    bool initMemSpace(); 
    6663    bool restoreMemSpace(); 
    67      
     64 
    6865private: // configrom shit 
    6966 
     
    7471    }; 
    7572    struct configrom_backup m_original_config_rom; 
    76      
    77     struct configrom_backup  
     73 
     74    struct configrom_backup 
    7875        save_config_rom(raw1394handle_t handle); 
    7976    int restore_config_rom(raw1394handle_t handle, struct configrom_backup old); 
    8077    int init_config_rom(raw1394handle_t handle); 
    81      
     78 
    8279private: 
    8380    BounceSlaveNotifier *m_Notifier; 
    8481    /** 
    85      * this class reacts on the ohter side writing to the  
     82     * this class reacts on the ohter side writing to the 
    8683     * hosts address space 
    8784     */ 
     
    9188        BounceSlaveNotifier(BounceSlaveDevice *, nodeaddr_t start); 
    9289        virtual ~BounceSlaveNotifier(); 
    93          
     90 
    9491    private: 
    9592        BounceSlaveDevice *m_bounceslavedevice; 
     
    9996} // end of namespace Bounce 
    10097 
    101 #endif /* __FREEBOB_BOUNCESLAVEDEVICE__ */ 
     98#endif /* __FFADO_BOUNCESLAVEDEVICE__ */ 
    10299 
    103100 
  • trunk/libffado/src/bridgeco-downloader.cpp

    r442 r445  
    1 /* freebob-downloader.cpp 
    2  * Copyright (C) 2006 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB. 
     8 * 
     9 * This is free software; you can redistribute it and/or modify 
     10 * it under the terms of the GNU General Public License version 2 
     11 * as published by the Free Software Foundation. 
     12 * 
     13 * FFADO is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1215 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     
    1417 * 
    1518 * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
     19 * along with FFADO; if not, write to the Free Software 
    1720 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    1821 * MA 02111-1307 USA. 
     
    3235// arg parsing 
    3336//////////////////////////////////////////////// 
    34 const char *argp_program_version = "freebob_downloader 0.1"; 
    35 const char *argp_program_bug_address = "<freebob-devel@lists.sf.net>"; 
    36 static char doc[] = "freebob_downloader -- firmware downloader application\n\n" 
     37const char *argp_program_version = "bridgeco-downloader 0.1"; 
     38const char *argp_program_bug_address = "<ffado-devel@lists.sf.net>"; 
     39static char doc[] = "bridgeco-downloader -- firmware downloader application for BridgeCo devices\n\n" 
    3740                    "OPERATION: display\n" 
    3841                    "           setguid GUID\n" 
     
    135138    int node_id = strtol(arguments.args[0], &tail, 0); 
    136139    if (errno) { 
    137        perror("argument parsing failed:"); 
    138        return -1; 
     140    perror("argument parsing failed:"); 
     141    return -1; 
    139142    } 
    140143 
     
    220223    return 0; 
    221224} 
    222  
    223  
  • trunk/libffado/src/debugmodule/debugmodule.cpp

    r406 r445  
    1 /* debugmodule.cpp 
    2  * Copyright (C) 2005 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * Copyright (C) 2005-2007 by Pieter Palmers 
    34 * 
    4  * This file is part of FreeBoB. 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
    57 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     8 * FFADO is based upon FreeBoB 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
    1115 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
    1418 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    1923 */ 
    2024 
     
    5458DebugModule::~DebugModule() 
    5559{ 
    56     if ( m_level >= eDL_VeryVerbose ) { 
    57         cout << "Unregistering " 
    58              << this->getName() 
    59              << " at DebugModuleManager" 
    60              << endl; 
    61     } 
     60//     if ( m_level >= eDL_VeryVerbose ) { 
     61//         cout << "Unregistering " 
     62//              << this->getName() 
     63//              << " at DebugModuleManager" 
     64//              << endl; 
     65//     } 
    6266    if ( !DebugModuleManager::instance()->unregisterModule( *this ) ) { 
    6367        cerr << "Could not unregister DebugModule at DebugModuleManager" 
     
    99103    va_list arg; 
    100104    va_start( arg, format ); 
    101      
     105 
    102106    // remove the path info from the filename 
    103107    const char *f = file; 
     
    107111        fname=f; 
    108112    } 
    109      
     113 
    110114    DebugModuleManager::instance()->print( "%s (%s)[%4d] %s: ", getPreSequence( level ), 
    111115                 fname,  line,  function ); 
     
    149153DebugModuleManager::~DebugModuleManager() 
    150154{ 
    151        // cleanin up leftover modules 
     155    // cleanin up leftover modules 
    152156    for ( DebugModuleVectorIterator it = m_debugModules.begin(); 
    153157          it != m_debugModules.end(); 
     
    159163    } 
    160164 
    161        if (!mb_initialized) 
    162                return; 
    163  
    164        pthread_mutex_lock(&mb_write_lock); 
    165        mb_initialized = 0; 
    166        pthread_cond_signal(&mb_ready_cond); 
    167        pthread_mutex_unlock(&mb_write_lock); 
    168  
    169        pthread_join(mb_writer_thread, NULL); 
    170        mb_flush(); 
    171  
    172        if (mb_overruns) 
    173                fprintf(stderr, "WARNING: %d message buffer overruns!\n", 
    174                        mb_overruns); 
    175        else 
    176                fprintf(stderr, "no message buffer overruns\n"); 
    177  
    178        pthread_mutex_destroy(&mb_write_lock); 
    179        pthread_cond_destroy(&mb_ready_cond); 
     165    if (!mb_initialized) 
     166        return; 
     167 
     168    pthread_mutex_lock(&mb_write_lock); 
     169    mb_initialized = 0; 
     170    pthread_cond_signal(&mb_ready_cond); 
     171    pthread_mutex_unlock(&mb_write_lock); 
     172 
     173    pthread_join(mb_writer_thread, NULL); 
     174    mb_flush(); 
     175 
     176    if (mb_overruns) 
     177        fprintf(stderr, "WARNING: %d message buffer overruns!\n", 
     178            mb_overruns); 
     179    else 
     180        fprintf(stderr, "no message buffer overruns\n"); 
     181 
     182    pthread_mutex_destroy(&mb_write_lock); 
     183    pthread_cond_destroy(&mb_ready_cond); 
    180184 
    181185} 
     
    184188DebugModuleManager::init() 
    185189{ 
    186        if (mb_initialized) 
    187                return true; 
     190    if (mb_initialized) 
     191        return true; 
    188192 
    189193        // if ( m_level >= eDL_VeryVerbose ) 
    190194        //         cout << "DebugModuleManager init..." << endl; 
    191195 
    192        pthread_mutex_init(&mb_write_lock, NULL); 
    193        pthread_cond_init(&mb_ready_cond, NULL); 
    194  
    195        mb_overruns = 0; 
    196        mb_initialized = 1; 
    197  
    198        if (pthread_create(&mb_writer_thread, NULL, &mb_thread_func, (void *)this) != 0) 
    199                mb_initialized = 0; 
     196    pthread_mutex_init(&mb_write_lock, NULL); 
     197    pthread_cond_init(&mb_ready_cond, NULL); 
     198 
     199     mb_overruns = 0; 
     200     mb_initialized = 1; 
     201 
     202    if (pthread_create(&mb_writer_thread, NULL, &mb_thread_func, (void *)this) != 0) 
     203         mb_initialized = 0; 
    200204 
    201205    return true; 
     
    223227{ 
    224228    bool already_present=false; 
    225      
     229 
    226230    for ( DebugModuleVectorIterator it = m_debugModules.begin(); 
    227231          it != m_debugModules.end(); 
     
    233237        } 
    234238    } 
    235      
     239 
    236240    if (already_present) { 
    237241        cerr << "DebugModuleManager::registerModule: Module already registered: " 
     
    246250DebugModuleManager::unregisterModule( DebugModule& debugModule ) 
    247251{ 
    248      
     252 
    249253    for ( DebugModuleVectorIterator it = m_debugModules.begin(); 
    250254          it != m_debugModules.end(); 
     
    256260        } 
    257261    } 
    258      
     262 
    259263    cerr << "DebugModuleManager::unregisterModule: Could not unregister " 
    260264         << "DebugModule (" << debugModule.getName() << ")" << endl; 
     
    288292DebugModuleManager::mb_flush() 
    289293{ 
    290        /* called WITHOUT the mb_write_lock */ 
    291        while (mb_outbuffer != mb_inbuffer) { 
    292                fputs(mb_buffers[mb_outbuffer], stderr); 
    293                mb_outbuffer = MB_NEXT(mb_outbuffer); 
    294        
     294    /* called WITHOUT the mb_write_lock */ 
     295    while (mb_outbuffer != mb_inbuffer) { 
     296        fputs(mb_buffers[mb_outbuffer], stderr); 
     297        mb_outbuffer = MB_NEXT(mb_outbuffer); 
     298   
    295299} 
    296300 
     
    301305    DebugModuleManager *m=static_cast<DebugModuleManager *>(arg); 
    302306 
    303        /* The mutex is only to eliminate collisions between multiple 
    304         * writer threads and protect the condition variable. */ 
    305        pthread_mutex_lock(&m->mb_write_lock); 
    306  
    307        while (m->mb_initialized) { 
    308                pthread_cond_wait(&m->mb_ready_cond, &m->mb_write_lock); 
    309  
    310                /* releasing the mutex reduces contention */ 
    311                pthread_mutex_unlock(&m->mb_write_lock); 
    312                m->mb_flush(); 
    313                pthread_mutex_lock(&m->mb_write_lock); 
    314        
    315  
    316        pthread_mutex_unlock(&m->mb_write_lock); 
    317  
    318        return NULL; 
     307    /* The mutex is only to eliminate collisions between multiple 
     308    * writer threads and protect the condition variable. */ 
     309     pthread_mutex_lock(&m->mb_write_lock); 
     310 
     311    while (m->mb_initialized) { 
     312         pthread_cond_wait(&m->mb_ready_cond, &m->mb_write_lock); 
     313 
     314         /* releasing the mutex reduces contention */ 
     315         pthread_mutex_unlock(&m->mb_write_lock); 
     316         m->mb_flush(); 
     317         pthread_mutex_lock(&m->mb_write_lock); 
     318   
     319 
     320     pthread_mutex_unlock(&m->mb_write_lock); 
     321 
     322    return NULL; 
    319323} 
    320324 
     
    322326DebugModuleManager::print(const char *fmt, ...) 
    323327{ 
    324        char msg[MB_BUFFERSIZE]; 
    325        va_list ap; 
    326  
    327        /* format the message first, to reduce lock contention */ 
    328        va_start(ap, fmt); 
    329        vsnprintf(msg, MB_BUFFERSIZE, fmt, ap); 
    330        va_end(ap); 
    331  
    332        if (!mb_initialized) { 
    333                /* Unable to print message with realtime safety. 
    334                 * Complain and print it anyway. */ 
    335                fprintf(stderr, "ERROR: messagebuffer not initialized: %s", 
    336                        msg); 
    337                return; 
    338        
    339        if (pthread_mutex_trylock(&mb_write_lock) == 0) { 
    340                strncpy(mb_buffers[mb_inbuffer], msg, MB_BUFFERSIZE); 
    341                mb_inbuffer = MB_NEXT(mb_inbuffer); 
    342                pthread_cond_signal(&mb_ready_cond); 
    343                pthread_mutex_unlock(&mb_write_lock); 
    344        } else {                        /* lock collision */ 
    345 //             atomic_add(&mb_overruns, 1); 
    346                // FIXME: atomicity 
    347                mb_overruns++; // skip the atomicness for now 
    348        
     328    char msg[MB_BUFFERSIZE]; 
     329    va_list ap; 
     330 
     331    /* format the message first, to reduce lock contention */ 
     332    va_start(ap, fmt); 
     333    vsnprintf(msg, MB_BUFFERSIZE, fmt, ap); 
     334    va_end(ap); 
     335 
     336    if (!mb_initialized) { 
     337        /* Unable to print message with realtime safety. 
     338        * Complain and print it anyway. */ 
     339        fprintf(stderr, "ERROR: messagebuffer not initialized: %s", 
     340            msg); 
     341        return; 
     342   
     343    if (pthread_mutex_trylock(&mb_write_lock) == 0) { 
     344        strncpy(mb_buffers[mb_inbuffer], msg, MB_BUFFERSIZE); 
     345        mb_inbuffer = MB_NEXT(mb_inbuffer); 
     346        pthread_cond_signal(&mb_ready_cond); 
     347        pthread_mutex_unlock(&mb_write_lock); 
     348    } else {            /* lock collision */ 
     349//         atomic_add(&mb_overruns, 1); 
     350        // FIXME: atomicity 
     351        mb_overruns++; // skip the atomicness for now 
     352   
    349353} 
    350354 
     
    353357DebugModuleManager::va_print (const char *fmt, va_list ap) 
    354358{ 
    355        char msg[MB_BUFFERSIZE]; 
    356  
    357        /* format the message first, to reduce lock contention */ 
    358        vsnprintf(msg, MB_BUFFERSIZE, fmt, ap); 
    359  
    360        if (!mb_initialized) { 
    361                /* Unable to print message with realtime safety. 
    362                 * Complain and print it anyway. */ 
    363                fprintf(stderr, "ERROR: messagebuffer not initialized: %s", 
    364                        msg); 
    365                return; 
    366        
    367  
    368        if (pthread_mutex_trylock(&mb_write_lock) == 0) { 
    369                strncpy(mb_buffers[mb_inbuffer], msg, MB_BUFFERSIZE); 
    370                mb_inbuffer = MB_NEXT(mb_inbuffer); 
    371                pthread_cond_signal(&mb_ready_cond); 
    372                pthread_mutex_unlock(&mb_write_lock); 
    373        } else {                        /* lock collision */ 
    374 //             atomic_add(&mb_overruns, 1); 
    375                // FIXME: atomicity 
    376                mb_overruns++; // skip the atomicness for now 
    377        
     359    char msg[MB_BUFFERSIZE]; 
     360 
     361    /* format the message first, to reduce lock contention */ 
     362    vsnprintf(msg, MB_BUFFERSIZE, fmt, ap); 
     363 
     364    if (!mb_initialized) { 
     365        /* Unable to print message with realtime safety. 
     366        * Complain and print it anyway. */ 
     367        fprintf(stderr, "ERROR: messagebuffer not initialized: %s", 
     368            msg); 
     369        return; 
     370   
     371 
     372    if (pthread_mutex_trylock(&mb_write_lock) == 0) { 
     373        strncpy(mb_buffers[mb_inbuffer], msg, MB_BUFFERSIZE); 
     374        mb_inbuffer = MB_NEXT(mb_inbuffer); 
     375        pthread_cond_signal(&mb_ready_cond); 
     376        pthread_mutex_unlock(&mb_write_lock); 
     377    } else {            /* lock collision */ 
     378//         atomic_add(&mb_overruns, 1); 
     379        // FIXME: atomicity 
     380        mb_overruns++; // skip the atomicness for now 
     381   
    378382} 
    379383 
  • trunk/libffado/src/debugmodule/debugmodule.h

    r392 r445  
    1 /* debugmodule.h 
    2  * Copyright (C) 2005 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * Copyright (C) 2005-2007 by Pieter Palmers 
     4 * 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
     7 * 
     8 * FFADO is based upon FreeBoB 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
    1115 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
     18 * 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    1923 */ 
    2024 
     
    3135 
    3236/* MB_NEXT() relies on the fact that MB_BUFFERS is a power of two */ 
    33 #define MB_BUFFERS     8192 
     37#define MB_BUFFERS    8192 
    3438#define MB_NEXT(index) ((index+1) & (MB_BUFFERS-1)) 
    35 #define MB_BUFFERSIZE  256             /* message length limit */ 
     39#define MB_BUFFERSIZE    256        /* message length limit */ 
    3640 
    3741#define debugFatal( format, args... )                               \ 
     
    7882#define IMPL_GLOBAL_DEBUG_MODULE( RegisterName, Level )            \ 
    7983                DebugModule m_debugModule =                        \ 
    80                    DebugModule( #RegisterName, Level ) 
     84            DebugModule( #RegisterName, Level ) 
    8185 
    8286#define setDebugLevel( Level ) {                                    \ 
    8387                m_debugModule.setLevel( Level ); \ 
    84                                
     88               
    8589 
    8690/*                m_debugModule.print( eDL_Normal,                        \ 
     
    9094                                     "Setting debug level to %d\n",  \ 
    9195                                     Level ); \ 
    92                                }*/ 
     96                }*/ 
    9397 
    9498#define getDebugLevel(  )                                     \ 
     
    97101 
    98102#ifdef DEBUG 
    99      
     103 
    100104    #define debugOutput( level, format, args... )                  \ 
    101105                m_debugModule.print( level,                        \ 
     
    129133 
    130134#include <sys/time.h> 
    131   
     135 
    132136#ifdef DO_PREEMPTION_CHECKING 
    133137#define CHECK_PREEMPTION(onoff) \ 
    134        gettimeofday((struct timeval *)1, (struct timezone *)onoff) 
     138    gettimeofday((struct timeval *)1, (struct timezone *)onoff) 
    135139#else 
    136140#define CHECK_PREEMPTION(onoff) 
     
    196200    static DebugModuleManager* instance(); 
    197201    ~DebugModuleManager(); 
    198      
     202 
    199203    bool setMgrDebugLevel( std::string name, debug_level_t level ); 
    200204 
     
    206210 
    207211    bool init(); 
    208      
     212 
    209213    void print(const char *fmt, ...); 
    210214    void va_print(const char *fmt, va_list); 
    211      
     215 
    212216private: 
    213217    DebugModuleManager(); 
     
    227231    static void *mb_thread_func(void *arg); 
    228232    void mb_flush(); 
    229      
     233 
    230234    static DebugModuleManager* m_instance; 
    231235    DebugModuleVector          m_debugModules; 
  • trunk/libffado/src/debugmodule/test_debugmodule.cpp

    r168 r445  
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * Copyright (C) 2005-2007 by Pieter Palmers 
     4 * 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
     7 * 
     8 * FFADO is based upon FreeBoB. 
     9 * 
     10 * This is free software; you can redistribute it and/or modify 
     11 * it under the terms of the GNU General Public License version 2 
     12 * as published by the Free Software Foundation. 
     13 *  
     14 * FFADO is distributed in the hope that it will be useful, 
     15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     17 * GNU General Public License for more details. 
     18 * 
     19 * You should have received a copy of the GNU General Public License 
     20 * along with FFADO; if not, write to the Free Software 
     21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
     22 * MA 02111-1307 USA. 
     23 */ 
     24 
    125#include "debugmodule.h" 
    226 
  • trunk/libffado/src/devicemanager.cpp

    r436 r445  
    1  /* devicemanager.cpp 
    2  * Copyright (C) 2005,06,07 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * Copyright (C) 2005-2007 by Pieter Palmers 
     4 * 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
     7 * 
     8 * FFADO is based upon FreeBoB. 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
    1115 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
     18 * 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    1923 */ 
    2024 
     
    9498 
    9599void 
    96 DeviceManager::setVerboseLevel(int l)  
     100DeviceManager::setVerboseLevel(int l) 
    97101{ 
    98102    m_verboseLevel=l; 
    99103    setDebugLevel(l); 
    100      
     104 
    101105    if (m_1394Service) m_1394Service->setVerboseLevel(l); 
    102106    if (m_oscServer) m_oscServer->setVerboseLevel(l); 
    103107    OscNode::setVerboseLevel(l); 
    104      
     108 
    105109    for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 
    106110          it != m_avDevices.end(); 
     
    126130        return false; 
    127131    } 
    128      
     132 
    129133    m_oscServer = new OSC::OscServer("17820"); 
    130      
     134 
    131135    if (!m_oscServer) { 
    132136        debugFatal("failed to create osc server\n"); 
     
    135139        return false; 
    136140    } 
    137      
     141 
    138142    if (!m_oscServer->init()) { 
    139143        debugFatal("failed to init osc server\n"); 
     
    144148        return false; 
    145149    } 
    146      
     150 
    147151    if (!m_oscServer->registerAtRootNode(this)) { 
    148152        debugFatal("failed to register devicemanager at server\n"); 
     
    153157        return false; 
    154158    } 
    155      
     159 
    156160    if (!m_oscServer->start()) { 
    157161        debugFatal("failed to start osc server\n"); 
     
    162166        return false; 
    163167    } 
    164      
     168 
    165169    setVerboseLevel(m_verboseLevel); 
    166170    return true; 
     
    198202        { 
    199203            debugOutput( DEBUG_LEVEL_VERBOSE, "Probing node %d...\n", nodeId ); 
    200      
     204 
    201205            if (nodeId == m_1394Service->getLocalNodeId()) { 
    202206                debugOutput( DEBUG_LEVEL_VERBOSE, "Skipping local node (%d)...\n", nodeId ); 
    203207                continue; 
    204208            } 
    205      
     209 
    206210            std::auto_ptr<ConfigRom> configRom = 
    207211                std::auto_ptr<ConfigRom>( new ConfigRom( *m_1394Service, 
     
    219223                continue; 
    220224            } 
    221      
     225 
    222226            IAvDevice* avDevice = getDriverForDevice( configRom, 
    223227                                                      nodeId ); 
     
    228232 
    229233                avDevice->setVerboseLevel( m_verboseLevel ); 
    230                  
     234 
    231235                if ( !avDevice->discover() ) { 
    232236                    debugError( "discover: could not discover device\n" ); 
     
    238242                    debugError( "setting Id failed\n" ); 
    239243                } 
    240                  
     244 
    241245                if (snoopMode) { 
    242246                    debugOutput( DEBUG_LEVEL_VERBOSE, 
     
    249253                    } 
    250254                } 
    251                  
     255 
    252256                if ( m_verboseLevel >= DEBUG_LEVEL_VERBOSE ) { 
    253257                    avDevice->showDevice(); 
     
    255259 
    256260                m_avDevices.push_back( avDevice ); 
    257                  
     261 
    258262                if (!addChildOscNode(avDevice)) { 
    259263                    debugWarning("failed to register AvDevice at OSC server\n"); 
     
    263267        } 
    264268        return true; 
    265          
     269 
    266270    } else { // slave mode 
    267271        fb_nodeid_t nodeId = m_1394Service->getLocalNodeId(); 
     
    289293                         "discover: driver found for device %d\n", 
    290294                         nodeId ); 
    291              
     295 
    292296            avDevice->setVerboseLevel( m_verboseLevel ); 
    293297 
     
    307311            m_avDevices.push_back( avDevice ); 
    308312        } 
    309      
     313 
    310314        return true; 
    311315    } 
     
    392396 
    393397        if (avDevice->getConfigRom().getNodeId() == node) { 
    394                return true; 
    395        
     398            return true; 
     399   
    396400    } 
    397401    return false; 
     
    440444DeviceManager::getAvDeviceByIndex( int idx ) 
    441445{ 
    442        return m_avDevices.at(idx); 
     446    return m_avDevices.at(idx); 
    443447} 
    444448 
     
    446450DeviceManager::getAvDeviceCount( ) 
    447451{ 
    448        return m_avDevices.size(); 
     452    return m_avDevices.size(); 
    449453} 
    450454 
     
    465469        debugWarning("Could not retrieve slaveMode parameter, defauling to false\n"); 
    466470    } 
    467     
     471 
    468472    #warning TEST CODE FOR BOUNCE DEVICE !! 
    469473    // this makes the bounce slave use the xmit SP as sync source 
     
    473477        return device->getStreamProcessorByIndex(0); 
    474478    } 
    475      
    476479} 
    477480 
     
    487490    int i; 
    488491    i=0; // avoids unused warning 
    489      
     492 
    490493    for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 
    491494          it != m_avDevices.end(); 
     
    494497        IAvDevice* pAvDevice; 
    495498        pAvDevice = *it; // avoids unused warning 
    496          
     499 
    497500        #ifdef ENABLE_BEBOB 
    498501        BeBoB::AvDevice* pBeBoBDevice = reinterpret_cast< BeBoB::AvDevice* >( pAvDevice ); 
     
    577580    } while ( pBeBoBDevice ); 
    578581    #endif 
    579      
     582 
    580583    return true; 
    581584} 
  • trunk/libffado/src/devicemanager.h

    r436 r445  
    1 /* devicemanager.h 
    2  * Copyright (C) 2005 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * Copyright (C) 2005-2007 by Pieter Palmers 
    34 * 
    4  * This file is part of FreeBoB. 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
    57 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     8 * FFADO is based upon FreeBoB. 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
    1115 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
    1418 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    1923 */ 
    2024 
    21 #ifndef FREEBOBDEVICEMANAGER_H 
    22 #define FREEBOBDEVICEMANAGER_H 
     25#ifndef FFADODEVICEMANAGER_H 
     26#define FFADODEVICEMANAGER_H 
    2327 
    2428#include "debugmodule/debugmodule.h" 
     
    4448typedef std::vector< IAvDevice* >::iterator IAvDeviceVectorIterator; 
    4549 
    46 class DeviceManager  
     50class DeviceManager 
    4751    : public Util::OptionContainer, 
    4852      public OSC::OscNode 
     
    7882    Ieee1394Service* m_1394Service; 
    7983    IAvDeviceVector  m_avDevices; 
    80      
     84 
    8185    OSC::OscServer*  m_oscServer; 
    82      
     86 
    8387// debug stuff 
    8488public: 
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r436 r445  
    1 /* dice_avdevice.cpp 
    2  * Copyright (C) 2007 by Pieter Palmers 
     1/* 
     2 * Copyright (C) 2005-2007 by Pieter Palmers 
    33 * 
    4  * This file is part of FreeBob. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBob is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBob is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBob; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
     
    9497    { 
    9598        if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    96              && ( supportedDeviceList[i].model_id == modelId )  
     99             && ( supportedDeviceList[i].model_id == modelId ) 
    97100           ) 
    98101        { 
     
    115118    { 
    116119        if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    117              && ( supportedDeviceList[i].model_id == modelId )  
     120             && ( supportedDeviceList[i].model_id == modelId ) 
    118121           ) 
    119122        { 
     
    126129        return false; 
    127130    } 
    128      
     131 
    129132    if ( !initIoFunctions() ) { 
    130133        debugError("Could not initialize I/O functions\n"); 
     
    138141} 
    139142 
    140 int  
     143int 
    141144DiceAvDevice::getSamplingFrequency( ) { 
    142145    ESamplingFrequency samplingFrequency; 
    143      
     146 
    144147    fb_quadlet_t clockreg; 
    145148    if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg)) { 
     
    147150        return false; 
    148151    } 
    149      
     152 
    150153    clockreg = DICE_GET_RATE(clockreg); 
    151154 
     
    164167        default:                 samplingFrequency = eSF_DontCare; break; 
    165168    } 
    166      
     169 
    167170    return convertESamplingFrequency(samplingFrequency); 
    168171} 
     
    171174DiceAvDevice::setSamplingFrequency( ESamplingFrequency samplingFrequency ) 
    172175{ 
    173     debugOutput(DEBUG_LEVEL_VERBOSE, "Setting sample rate: %d\n",  
     176    debugOutput(DEBUG_LEVEL_VERBOSE, "Setting sample rate: %d\n", 
    174177        convertESamplingFrequency(samplingFrequency)); 
    175          
     178 
    176179    bool supported=false; 
    177180    fb_quadlet_t select=0x0; 
    178      
     181 
    179182    switch ( samplingFrequency ) { 
    180183    default: 
     
    236239        return false; 
    237240    } 
    238      
     241 
    239242    fb_quadlet_t clockreg; 
    240243    if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg)) { 
     
    256259        return false; 
    257260    } 
    258      
     261 
    259262    if(clockreg != clockreg_verify) { 
    260263        debugError("Samplerate register write failed\n"); 
    261264        return false; 
    262265    } 
    263      
     266 
    264267    return true; 
    265268} 
     
    270273    fb_quadlet_t tmp_quadlet; 
    271274    fb_octlet_t tmp_octlet; 
    272      
     275 
    273276    debugOutput(DEBUG_LEVEL_VERBOSE, 
    274277        "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 
     
    285288 
    286289    debugOutput(DEBUG_LEVEL_VERBOSE," Global param space:\n"); 
    287      
     290 
    288291    readGlobalRegBlock(DICE_REGISTER_GLOBAL_OWNER, (fb_quadlet_t *)&tmp_octlet,sizeof(fb_octlet_t)); 
    289292    debugOutput(DEBUG_LEVEL_VERBOSE,"  Owner            : 0x%016X\n",tmp_octlet); 
    290      
     293 
    291294    readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 
    292295    debugOutput(DEBUG_LEVEL_VERBOSE,"  Notification     : 0x%08X\n",tmp_quadlet); 
    293      
     296 
    294297    readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 
    295298    debugOutput(DEBUG_LEVEL_VERBOSE,"  Nick name        : %s\n",getDeviceNickName().c_str()); 
    296      
     299 
    297300    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &tmp_quadlet); 
    298301    debugOutput(DEBUG_LEVEL_VERBOSE,"  Clock Select     : 0x%02X 0x%02X\n", 
    299302        (tmp_quadlet>>8) & 0xFF, tmp_quadlet & 0xFF); 
    300      
     303 
    301304    readGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, &tmp_quadlet); 
    302305    debugOutput(DEBUG_LEVEL_VERBOSE,"  Enable           : %s\n", 
    303306        (tmp_quadlet&0x1?"true":"false")); 
    304      
     307 
    305308    readGlobalReg(DICE_REGISTER_GLOBAL_STATUS, &tmp_quadlet); 
    306309    debugOutput(DEBUG_LEVEL_VERBOSE,"  Clock Status     : %s 0x%02X\n", 
    307310        (tmp_quadlet&0x1?"locked":"not locked"), (tmp_quadlet>>8) & 0xFF); 
    308      
     311 
    309312    readGlobalReg(DICE_REGISTER_GLOBAL_EXTENDED_STATUS, &tmp_quadlet); 
    310313    debugOutput(DEBUG_LEVEL_VERBOSE,"  Extended Status  : 0x%08X\n",tmp_quadlet); 
    311      
     314 
    312315    readGlobalReg(DICE_REGISTER_GLOBAL_SAMPLE_RATE, &tmp_quadlet); 
    313316    debugOutput(DEBUG_LEVEL_VERBOSE,"  Samplerate       : 0x%08X (%lu)\n",tmp_quadlet,tmp_quadlet); 
    314      
     317 
    315318    readGlobalReg(DICE_REGISTER_GLOBAL_VERSION, &tmp_quadlet); 
    316319    debugOutput(DEBUG_LEVEL_VERBOSE,"  Version          : 0x%08X (%u.%u.%u.%u)\n", 
     
    321324        DICE_DRIVER_SPEC_VERSION_NUMBER_GET_D(tmp_quadlet) 
    322325        ); 
    323      
     326 
    324327    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &tmp_quadlet); 
    325328    debugOutput(DEBUG_LEVEL_VERBOSE,"  Clock caps       : 0x%08X\n",tmp_quadlet & 0x1FFF007F); 
     
    327330    diceNameVector names=getClockSourceNameString(); 
    328331    debugOutput(DEBUG_LEVEL_VERBOSE,"  Clock sources    :\n"); 
    329      
     332 
    330333    for ( diceNameVectorIterator it = names.begin(); 
    331334          it != names.end(); 
     
    334337        debugOutput(DEBUG_LEVEL_VERBOSE,"    %s\n", (*it).c_str()); 
    335338    } 
    336      
     339 
    337340    debugOutput(DEBUG_LEVEL_VERBOSE," TX param space:\n"); 
    338341    debugOutput(DEBUG_LEVEL_VERBOSE,"  Nb of xmit        : %1d\n", m_nb_tx); 
    339342    for (unsigned int i=0;i<m_nb_tx;i++) { 
    340343        debugOutput(DEBUG_LEVEL_VERBOSE,"  Transmitter %d:\n",i); 
    341          
     344 
    342345        readTxReg(i, DICE_REGISTER_TX_ISOC_BASE, &tmp_quadlet); 
    343346        debugOutput(DEBUG_LEVEL_VERBOSE,"   ISO channel       : %3d\n", tmp_quadlet); 
    344347        readTxReg(i, DICE_REGISTER_TX_SPEED_BASE, &tmp_quadlet); 
    345348        debugOutput(DEBUG_LEVEL_VERBOSE,"   ISO speed         : %3d\n", tmp_quadlet); 
    346          
     349 
    347350        readTxReg(i, DICE_REGISTER_TX_NB_AUDIO_BASE, &tmp_quadlet); 
    348351        debugOutput(DEBUG_LEVEL_VERBOSE,"   Nb audio channels : %3d\n", tmp_quadlet); 
    349352        readTxReg(i, DICE_REGISTER_TX_MIDI_BASE, &tmp_quadlet); 
    350353        debugOutput(DEBUG_LEVEL_VERBOSE,"   Nb midi channels  : %3d\n", tmp_quadlet); 
    351          
     354 
    352355        readTxReg(i, DICE_REGISTER_TX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 
    353356        debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 caps          : 0x%08X\n", tmp_quadlet); 
    354357        readTxReg(i, DICE_REGISTER_TX_AC3_ENABLE_BASE, &tmp_quadlet); 
    355358        debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 enable        : 0x%08X\n", tmp_quadlet); 
    356          
     359 
    357360        diceNameVector channel_names=getTxNameString(i); 
    358361        debugOutput(DEBUG_LEVEL_VERBOSE,"   Channel names     :\n"); 
     
    364367        } 
    365368    } 
    366      
     369 
    367370    debugOutput(DEBUG_LEVEL_VERBOSE," RX param space:\n"); 
    368371    debugOutput(DEBUG_LEVEL_VERBOSE,"  Nb of recv        : %1d\n", m_nb_tx); 
    369372    for (unsigned int i=0;i<m_nb_rx;i++) { 
    370373        debugOutput(DEBUG_LEVEL_VERBOSE,"  Receiver %d:\n",i); 
    371          
     374 
    372375        readTxReg(i, DICE_REGISTER_RX_ISOC_BASE, &tmp_quadlet); 
    373376        debugOutput(DEBUG_LEVEL_VERBOSE,"   ISO channel       : %3d\n", tmp_quadlet); 
    374377        readTxReg(i, DICE_REGISTER_RX_SEQ_START_BASE, &tmp_quadlet); 
    375378        debugOutput(DEBUG_LEVEL_VERBOSE,"   Sequence start    : %3d\n", tmp_quadlet); 
    376          
     379 
    377380        readTxReg(i, DICE_REGISTER_RX_NB_AUDIO_BASE, &tmp_quadlet); 
    378381        debugOutput(DEBUG_LEVEL_VERBOSE,"   Nb audio channels : %3d\n", tmp_quadlet); 
    379382        readTxReg(i, DICE_REGISTER_RX_MIDI_BASE, &tmp_quadlet); 
    380383        debugOutput(DEBUG_LEVEL_VERBOSE,"   Nb midi channels  : %3d\n", tmp_quadlet); 
    381          
     384 
    382385        readTxReg(i, DICE_REGISTER_RX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 
    383386        debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 caps          : 0x%08X\n", tmp_quadlet); 
    384387        readTxReg(i, DICE_REGISTER_RX_AC3_ENABLE_BASE, &tmp_quadlet); 
    385388        debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 enable        : 0x%08X\n", tmp_quadlet); 
    386          
     389 
    387390        diceNameVector channel_names=getRxNameString(i); 
    388391        debugOutput(DEBUG_LEVEL_VERBOSE,"   Channel names     :\n"); 
     
    421424        fb_quadlet_t nb_midi; 
    422425        unsigned int nb_channels=0; 
    423          
     426 
    424427        if(!readTxReg(i, DICE_REGISTER_TX_NB_AUDIO_BASE, &nb_audio)) { 
    425428            debugError("Could not read DICE_REGISTER_TX_NB_AUDIO_BASE register for ATX%u",i); 
     
    430433            continue; 
    431434        } 
    432          
     435 
    433436        // request the channel names 
    434437        diceNameVector names_audio=getTxNameString(i); 
    435          
     438 
    436439        if (names_audio.size() != nb_audio) { 
    437440            debugWarning("The audio channel name vector is incorrect, using default names\n"); 
    438441            names_audio.clear(); 
    439              
     442 
    440443            for (unsigned int j=0;j<nb_audio;j++) { 
    441444                std::ostringstream newname; 
     
    444447            } 
    445448        } 
    446          
     449 
    447450        nb_channels=nb_audio; 
    448451        if(nb_midi) nb_channels += 1; // midi-muxed counts as one 
    449          
     452 
    450453        // construct the MIDI names 
    451454        diceNameVector names_midi; 
     
    455458            names_midi.push_back(newname.str()); 
    456459        } 
    457          
     460 
    458461        // construct the streamprocessor 
    459462        Streaming::AmdtpReceiveStreamProcessor *p; 
     
    478481 
    479482            if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Capture)) { 
    480                 debugError("Could not add channel %s to StreamProcessor\n",  
     483                debugError("Could not add channel %s to StreamProcessor\n", 
    481484                    channelInfo.name.c_str()); 
    482485                continue; 
    483486            } 
    484487        } 
    485          
     488 
    486489        // add midi ports to the processor 
    487490        for (unsigned int j=0;j<nb_midi;j++) { 
     
    493496 
    494497            if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Capture)) { 
    495                 debugError("Could not add channel %s to StreamProcessor\n",  
     498                debugError("Could not add channel %s to StreamProcessor\n", 
    496499                    channelInfo.name.c_str()); 
    497500                continue; 
    498501            } 
    499502        } 
    500          
     503 
    501504        // add the SP to the vector 
    502505        m_receiveProcessors.push_back(p); 
    503506    } 
    504      
     507 
    505508    // prepare transmit SP's 
    506509    for (unsigned int i=0;i<m_nb_rx;i++) { 
     
    508511        fb_quadlet_t nb_midi; 
    509512        unsigned int nb_channels=0; 
    510          
     513 
    511514        if(!readTxReg(i, DICE_REGISTER_RX_NB_AUDIO_BASE, &nb_audio)) { 
    512515            debugError("Could not read DICE_REGISTER_RX_NB_AUDIO_BASE register for ARX%u",i); 
     
    517520            continue; 
    518521        } 
    519          
     522 
    520523        // request the channel names 
    521524        diceNameVector names_audio=getRxNameString(i); 
    522          
     525 
    523526        if (names_audio.size() != nb_audio) { 
    524527            debugWarning("The audio channel name vector is incorrect, using default names\n"); 
    525528            names_audio.clear(); 
    526              
     529 
    527530            for (unsigned int j=0;j<nb_audio;j++) { 
    528531                std::ostringstream newname; 
     
    531534            } 
    532535        } 
    533          
     536 
    534537        nb_channels=nb_audio; 
    535538        if(nb_midi) nb_channels += 1; // midi-muxed counts as one 
    536          
     539 
    537540        // construct the MIDI names 
    538541        diceNameVector names_midi; 
     
    542545            names_midi.push_back(newname.str()); 
    543546        } 
    544          
     547 
    545548        // construct the streamprocessor 
    546549        Streaming::AmdtpTransmitStreamProcessor *p; 
     
    565568 
    566569            if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Playback)) { 
    567                 debugError("Could not add channel %s to StreamProcessor\n",  
     570                debugError("Could not add channel %s to StreamProcessor\n", 
    568571                    channelInfo.name.c_str()); 
    569572                continue; 
    570573            } 
    571574        } 
    572          
     575 
    573576        // add midi ports to the processor 
    574577        for (unsigned int j=0;j<nb_midi;j++) { 
     
    580583 
    581584            if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Playback)) { 
    582                 debugError("Could not add channel %s to StreamProcessor\n",  
     585                debugError("Could not add channel %s to StreamProcessor\n", 
    583586                    channelInfo.name.c_str()); 
    584587                continue; 
    585588            } 
    586589        } 
    587          
     590 
    588591        m_transmitProcessors.push_back(p); 
    589592    } 
     
    596599    Streaming::StreamProcessor *processor, 
    597600    Streaming::Port::E_Direction direction) { 
    598      
     601 
    599602    std::string id=std::string("dev?"); 
    600603    if(!getOption("id", id)) { 
     
    609612        portname << "c"; 
    610613    } 
    611      
     614 
    612615    portname << "_" << channelInfo->name; 
    613616 
     
    655658DiceAvDevice::lock() { 
    656659    fb_octlet_t result; 
    657      
    658     debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n",  
     660 
     661    debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 
    659662        m_model->vendor_name, m_model->model_name, m_nodeId); 
    660          
     663 
    661664    // get a notifier to handle device notifications 
    662665    nodeaddr_t notify_address; 
     
    665668                        DICE_NOTIFIER_BLOCK_LENGTH, 
    666669                        DICE_NOTIFIER_BLOCK_LENGTH); 
    667      
     670 
    668671    if (notify_address == 0xFFFFFFFFFFFFFFFFLLU) { 
    669672        debugError("Could not find free ARM block for notification\n"); 
    670673        return false; 
    671674    } 
    672      
     675 
    673676    m_notifier=new DiceAvDevice::DiceNotifier(this, notify_address); 
    674      
     677 
    675678    if(!m_notifier) { 
    676679        debugError("Could not allocate notifier\n"); 
    677680        return false; 
    678681    } 
    679      
     682 
    680683    if (!m_p1394Service->registerARMHandler(m_notifier)) { 
    681684        debugError("Could not register notifier\n"); 
     
    686689 
    687690    // register this notifier 
    688     fb_nodeaddr_t addr = DICE_REGISTER_BASE  
     691    fb_nodeaddr_t addr = DICE_REGISTER_BASE 
    689692                       + m_global_reg_offset 
    690693                       + DICE_REGISTER_GLOBAL_OWNER; 
     
    696699        return false; 
    697700    } 
    698      
     701 
    699702    fb_nodeaddr_t swap_value = ((0xFFC0) | m_p1394Service->getLocalNodeId()); 
    700703    swap_value = swap_value << 48; 
    701704    swap_value |= m_notifier->getStart(); 
    702      
    703     if (!m_p1394Service->lockCompareSwap64(  m_nodeId | 0xFFC0, addr, DICE_OWNER_NO_OWNER,  
     705 
     706    if (!m_p1394Service->lockCompareSwap64(  m_nodeId | 0xFFC0, addr, DICE_OWNER_NO_OWNER, 
    704707                                       swap_value, &result )) { 
    705708        debugWarning("Could not register ourselves as device owner\n"); 
    706709    } 
    707      
     710 
    708711    if (result != DICE_OWNER_NO_OWNER) { 
    709712        debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016llX\n", result); 
     
    717720DiceAvDevice::unlock() { 
    718721    fb_octlet_t result; 
    719      
     722 
    720723    if(!m_notifier) { 
    721724        debugWarning("Request to unlock, but no notifier present!\n"); 
    722725        return false; 
    723726    } 
    724      
    725     fb_nodeaddr_t addr = DICE_REGISTER_BASE  
     727 
     728    fb_nodeaddr_t addr = DICE_REGISTER_BASE 
    726729                       + m_global_reg_offset 
    727730                       + DICE_REGISTER_GLOBAL_OWNER; 
     
    733736        return false; 
    734737    } 
    735      
     738 
    736739    fb_nodeaddr_t compare_value = ((0xFFC0) | m_p1394Service->getLocalNodeId()); 
    737     compare_value <<= 48;  
     740    compare_value <<= 48; 
    738741    compare_value |= m_notifier->getStart(); 
    739      
    740     if (!m_p1394Service->lockCompareSwap64(  m_nodeId | 0xFFC0, addr, compare_value,  
     742 
     743    if (!m_p1394Service->lockCompareSwap64(  m_nodeId | 0xFFC0, addr, compare_value, 
    741744                                       DICE_OWNER_NO_OWNER, &result )) { 
    742745        debugWarning("Could not unregister ourselves as device owner\n"); 
    743746    } 
    744      
     747 
    745748    m_p1394Service->unregisterARMHandler(m_notifier); 
    746749    delete m_notifier; 
     
    788791        int n=i; 
    789792        Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 
    790          
     793 
    791794        // allocate ISO channel 
    792795        int isochannel=allocateIsoChannel(p->getMaxPacketSize()); 
     
    796799        } 
    797800        p->setChannel(isochannel); 
    798          
     801 
    799802        fb_quadlet_t reg_isoch; 
    800803        // check value of ISO_CHANNEL register 
     
    811814            return false; 
    812815        } 
    813          
     816 
    814817        // write value of ISO_CHANNEL register 
    815818        reg_isoch=isochannel; 
     
    820823            return false; 
    821824        } 
    822          
     825 
    823826        return true; 
    824          
     827 
    825828    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    826829        int n=i-m_receiveProcessors.size(); 
    827830        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    828          
     831 
    829832        // allocate ISO channel 
    830833        int isochannel=allocateIsoChannel(p->getMaxPacketSize()); 
     
    834837        } 
    835838        p->setChannel(isochannel); 
    836          
     839 
    837840        fb_quadlet_t reg_isoch; 
    838841        // check value of ISO_CHANNEL register 
     
    849852            return false; 
    850853        } 
    851          
     854 
    852855        // write value of ISO_CHANNEL register 
    853856        reg_isoch=isochannel; 
     
    858861            return false; 
    859862        } 
    860          
     863 
    861864        return true; 
    862865    } 
    863      
     866 
    864867    debugError("SP index %d out of range!\n",i); 
    865      
     868 
    866869    return false; 
    867870} 
     
    879882        Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 
    880883        unsigned int isochannel=p->getChannel(); 
    881          
     884 
    882885        fb_quadlet_t reg_isoch; 
    883886        // check value of ISO_CHANNEL register 
     
    890893            return false; 
    891894        } 
    892          
     895 
    893896        // write value of ISO_CHANNEL register 
    894897        reg_isoch=0xFFFFFFFFUL; 
     
    897900            return false; 
    898901        } 
    899          
     902 
    900903        // deallocate ISO channel 
    901904        if(!deallocateIsoChannel(isochannel)) { 
     
    903906            return false; 
    904907        } 
    905          
     908 
    906909        p->setChannel(-1); 
    907910        return true; 
    908          
     911 
    909912    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    910913        int n=i-m_receiveProcessors.size(); 
    911914        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    912          
     915 
    913916        unsigned int isochannel=p->getChannel(); 
    914          
     917 
    915918        fb_quadlet_t reg_isoch; 
    916919        // check value of ISO_CHANNEL register 
     
    923926            return false; 
    924927        } 
    925          
     928 
    926929        // write value of ISO_CHANNEL register 
    927930        reg_isoch=0xFFFFFFFFUL; 
     
    930933            return false; 
    931934        } 
    932          
     935 
    933936        // deallocate ISO channel 
    934937        if(!deallocateIsoChannel(isochannel)) { 
     
    936939            return false; 
    937940        } 
    938          
     941 
    939942        p->setChannel(-1); 
    940943        return true; 
    941944    } 
    942      
     945 
    943946    debugError("SP index %d out of range!\n",i); 
    944      
     947 
    945948    return false; 
    946949} 
     
    951954int DiceAvDevice::allocateIsoChannel(unsigned int packet_size) { 
    952955    unsigned int bandwidth=8+packet_size; 
    953      
     956 
    954957    int ch=m_p1394Service->allocateIsoChannelGeneric(bandwidth); 
    955          
     958 
    956959    debugOutput(DEBUG_LEVEL_VERBOSE, "allocated channel %d, bandwidth %d\n", 
    957960        ch, bandwidth); 
    958      
     961 
    959962    return ch; 
    960963} 
     
    979982    fb_quadlet_t result; 
    980983    readGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, &result); 
    981     // I don't know what exactly is 'enable',  
     984    // I don't know what exactly is 'enable', 
    982985    // but disable is definately == 0 
    983986    return (result != DICE_ISOSTREAMING_DISABLE); 
     
    10071010    diceNameVector names; 
    10081011    char namestring[DICE_TX_NAMES_SIZE+1]; 
    1009      
    1010     if (!readTxRegBlock(i, DICE_REGISTER_TX_NAMES_BASE,  
     1012 
     1013    if (!readTxRegBlock(i, DICE_REGISTER_TX_NAMES_BASE, 
    10111014                        (fb_quadlet_t *)namestring, DICE_TX_NAMES_SIZE)) { 
    10121015        debugError("Could not read TX name string \n"); 
    10131016        return names; 
    10141017    } 
    1015      
     1018 
    10161019    namestring[DICE_TX_NAMES_SIZE]='\0'; 
    10171020    return splitNameString(std::string(namestring)); 
     
    10221025    diceNameVector names; 
    10231026    char namestring[DICE_RX_NAMES_SIZE+1]; 
    1024      
    1025     if (!readRxRegBlock(i, DICE_REGISTER_RX_NAMES_BASE,  
     1027 
     1028    if (!readRxRegBlock(i, DICE_REGISTER_RX_NAMES_BASE, 
    10261029                        (fb_quadlet_t *)namestring, DICE_RX_NAMES_SIZE)) { 
    10271030        debugError("Could not read RX name string \n"); 
    10281031        return names; 
    10291032    } 
    1030      
     1033 
    10311034    namestring[DICE_RX_NAMES_SIZE]='\0'; 
    10321035    return splitNameString(std::string(namestring)); 
     
    10371040    diceNameVector names; 
    10381041    char namestring[DICE_CLOCKSOURCENAMES_SIZE+1]; 
    1039      
    1040     if (!readGlobalRegBlock(DICE_REGISTER_GLOBAL_CLOCKSOURCENAMES,  
     1042 
     1043    if (!readGlobalRegBlock(DICE_REGISTER_GLOBAL_CLOCKSOURCENAMES, 
    10411044                        (fb_quadlet_t *)namestring, DICE_CLOCKSOURCENAMES_SIZE)) { 
    10421045        debugError("Could not read CLOCKSOURCE name string \n"); 
    10431046        return names; 
    10441047    } 
    1045      
     1048 
    10461049    namestring[DICE_CLOCKSOURCENAMES_SIZE]='\0'; 
    10471050    return splitNameString(std::string(namestring)); 
     
    10511054DiceAvDevice::getDeviceNickName() { 
    10521055    char namestring[DICE_NICK_NAME_SIZE+1]; 
    1053      
    1054     if (!readGlobalRegBlock(DICE_REGISTER_GLOBAL_NICK_NAME,  
     1056 
     1057    if (!readGlobalRegBlock(DICE_REGISTER_GLOBAL_NICK_NAME, 
    10551058                        (fb_quadlet_t *)namestring, DICE_NICK_NAME_SIZE)) { 
    10561059        debugError("Could not read nickname string \n"); 
    10571060        return std::string("(unknown)"); 
    10581061    } 
    1059      
     1062 
    10601063    namestring[DICE_NICK_NAME_SIZE]='\0'; 
    10611064    return std::string(namestring); 
     
    10961099    } 
    10971100    m_global_reg_offset*=4; 
    1098      
     1101 
    10991102    if(!readReg(DICE_REGISTER_GLOBAL_PAR_SPACE_SZ, &m_global_reg_size)) { 
    11001103        debugError("Could not initialize m_global_reg_size\n"); 
     
    11021105    } 
    11031106    m_global_reg_size*=4; 
    1104      
     1107 
    11051108    if(!readReg(DICE_REGISTER_TX_PAR_SPACE_OFF, &m_tx_reg_offset)) { 
    11061109        debugError("Could not initialize m_tx_reg_offset\n"); 
     
    11081111    } 
    11091112    m_tx_reg_offset*=4; 
    1110      
     1113 
    11111114    if(!readReg(DICE_REGISTER_TX_PAR_SPACE_SZ, &m_tx_reg_size)) { 
    11121115        debugError("Could not initialize m_tx_reg_size\n"); 
     
    11141117    } 
    11151118    m_tx_reg_size*=4; 
    1116      
     1119 
    11171120    if(!readReg(DICE_REGISTER_RX_PAR_SPACE_OFF, &m_rx_reg_offset)) { 
    11181121        debugError("Could not initialize m_rx_reg_offset\n"); 
     
    11201123    } 
    11211124    m_rx_reg_offset*=4; 
    1122      
     1125 
    11231126    if(!readReg(DICE_REGISTER_RX_PAR_SPACE_SZ, &m_rx_reg_size)) { 
    11241127        debugError("Could not initialize m_rx_reg_size\n"); 
     
    11261129    } 
    11271130    m_rx_reg_size*=4; 
    1128      
     1131 
    11291132    if(!readReg(DICE_REGISTER_UNUSED1_SPACE_OFF, &m_unused1_reg_offset)) { 
    11301133        debugError("Could not initialize m_unused1_reg_offset\n"); 
     
    11321135    } 
    11331136    m_unused1_reg_offset*=4; 
    1134      
     1137 
    11351138    if(!readReg(DICE_REGISTER_UNUSED1_SPACE_SZ, &m_unused1_reg_size)) { 
    11361139        debugError("Could not initialize m_unused1_reg_size\n"); 
     
    11381141    } 
    11391142    m_unused1_reg_size*=4; 
    1140      
     1143 
    11411144    if(!readReg(DICE_REGISTER_UNUSED2_SPACE_OFF, &m_unused2_reg_offset)) { 
    11421145        debugError("Could not initialize m_unused2_reg_offset\n"); 
     
    11441147    } 
    11451148    m_unused2_reg_offset*=4; 
    1146      
     1149 
    11471150    if(!readReg(DICE_REGISTER_UNUSED2_SPACE_SZ, &m_unused2_reg_size)) { 
    11481151        debugError("Could not initialize m_unused2_reg_size\n"); 
     
    11601163    } 
    11611164    m_tx_size*=4; 
    1162      
     1165 
    11631166    if(!readReg(m_tx_reg_offset + DICE_REGISTER_RX_NB_RX, &m_nb_rx)) { 
    11641167        debugError("Could not initialize m_nb_rx\n"); 
     
    11701173    } 
    11711174    m_rx_size*=4; 
    1172      
     1175 
    11731176    debugOutput(DEBUG_LEVEL_VERBOSE,"DICE Parameter Space info:\n"); 
    11741177    debugOutput(DEBUG_LEVEL_VERBOSE," Global  : offset=%04X size=%04d\n", m_global_reg_offset, m_global_reg_size); 
     
    11791182    debugOutput(DEBUG_LEVEL_VERBOSE," UNUSED1 : offset=%04X size=%04d\n", m_unused1_reg_offset, m_unused1_reg_size); 
    11801183    debugOutput(DEBUG_LEVEL_VERBOSE," UNUSED2 : offset=%04X size=%04d\n", m_unused2_reg_offset, m_unused2_reg_size); 
    1181      
     1184 
    11821185    return true; 
    11831186} 
     
    11861189DiceAvDevice::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    11871190    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 
    1188      
     1191 
    11891192    if(offset >= DICE_INVALID_OFFSET) { 
    11901193        debugError("invalid offset: 0x%016llX\n", offset); 
    11911194        return false; 
    11921195    } 
    1193      
     1196 
    11941197    fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 
    11951198    fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
    1196      
     1199 
    11971200    if(!m_p1394Service->read_quadlet( nodeId, addr, result ) ) { 
    11981201        debugError("Could not read from node 0x%04X addr 0x%012X\n", nodeId, addr); 
    11991202        return false; 
    12001203    } 
    1201      
     1204 
    12021205    *result=ntohl(*result); 
    1203      
     1206 
    12041207    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08X\n", *result); 
    1205     
     1208 
    12061209    return true; 
    12071210} 
     
    12091212bool 
    12101213DiceAvDevice::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
    1211     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n",   
     1214    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 
    12121215        offset, data); 
    1213      
     1216 
    12141217    if(offset >= DICE_INVALID_OFFSET) { 
    12151218        debugError("invalid offset: 0x%016llX\n", offset); 
    12161219        return false; 
    12171220    } 
    1218      
     1221 
    12191222    fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 
    12201223    fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
    1221      
     1224 
    12221225    if(!m_p1394Service->write_quadlet( nodeId, addr, htonl(data) ) ) { 
    12231226        debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); 
     
    12271230} 
    12281231 
    1229 bool  
     1232bool 
    12301233DiceAvDevice::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1231     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n",  
     1234    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 
    12321235        offset, length); 
    1233      
     1236 
    12341237    if(offset >= DICE_INVALID_OFFSET) { 
    12351238        debugError("invalid offset: 0x%016llX\n", offset); 
    12361239        return false; 
    12371240    } 
    1238      
     1241 
    12391242    fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 
    12401243    fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
    1241      
     1244 
    12421245    if(!m_p1394Service->read( nodeId, addr, length/4, data ) ) { 
    12431246        debugError("Could not read from node 0x%04X addr 0x%012llX\n", nodeId, addr); 
    12441247        return false; 
    12451248    } 
    1246      
     1249 
    12471250    for(unsigned int i=0;i<length/4;i++) { 
    12481251        *(data+i)=ntohl(*(data+i)); 
    12491252    } 
    1250      
     1253 
    12511254    return true; 
    12521255} 
    12531256 
    1254 bool  
     1257bool 
    12551258DiceAvDevice::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1256     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n",   
     1259    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 
    12571260        offset, length); 
    1258      
     1261 
    12591262    if(offset >= DICE_INVALID_OFFSET) { 
    12601263        debugError("invalid offset: 0x%016llX\n", offset); 
    12611264        return false; 
    12621265    } 
    1263      
     1266 
    12641267    fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 
    12651268    fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
    1266      
     1269 
    12671270    fb_quadlet_t data_out[length/4]; 
    1268      
     1271 
    12691272    for(unsigned int i=0;i<length/4;i++) { 
    12701273        data_out[i]=ntohl(*(data+i)); 
    12711274    } 
    1272      
     1275 
    12731276    if(!m_p1394Service->write( nodeId, addr, length/4, data_out ) ) { 
    12741277        debugError("Could not write to node 0x%04X addr 0x%012llX\n", nodeId, addr); 
    12751278        return false; 
    12761279    } 
    1277      
     1280 
    12781281    return true; 
    12791282} 
     
    12891292bool 
    12901293DiceAvDevice::writeGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 
    1291     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08llX, data: 0x%08X\n",   
     1294    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08llX, data: 0x%08X\n", 
    12921295        offset, data); 
    12931296 
     
    12961299} 
    12971300 
    1298 bool  
     1301bool 
    12991302DiceAvDevice::readGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1300     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n",  
     1303    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n", 
    13011304        offset, length); 
    13021305 
     
    13051308} 
    13061309 
    1307 bool  
     1310bool 
    13081311DiceAvDevice::writeGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1309     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n",  
     1312    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n", 
    13101313        offset, length); 
    13111314 
     
    13141317} 
    13151318 
    1316 fb_nodeaddr_t  
     1319fb_nodeaddr_t 
    13171320DiceAvDevice::globalOffsetGen(fb_nodeaddr_t offset, size_t length) { 
    13181321 
     
    13281331        return DICE_INVALID_OFFSET; 
    13291332    } 
    1330      
     1333 
    13311334    return offset; 
    13321335} 
     
    13351338DiceAvDevice::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    13361339    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading tx %d register offset 0x%04llX\n", i, offset); 
    1337      
     1340 
    13381341    fb_nodeaddr_t offset_tx=txOffsetGen(i, offset, sizeof(fb_quadlet_t)); 
    13391342    return readReg(m_tx_reg_offset + offset_tx, result); 
     
    13491352} 
    13501353 
    1351 bool  
     1354bool 
    13521355DiceAvDevice::readTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1353     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n",  
     1356    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 
    13541357        offset, length); 
    1355      
     1358 
    13561359    fb_nodeaddr_t offset_tx=txOffsetGen(i, offset, length); 
    13571360    return readRegBlock(m_tx_reg_offset + offset_tx, data, length); 
    13581361} 
    13591362 
    1360 bool  
     1363bool 
    13611364DiceAvDevice::writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1362     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n",  
     1365    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 
    13631366        offset, length); 
    13641367 
     
    13671370} 
    13681371 
    1369 fb_nodeaddr_t  
     1372fb_nodeaddr_t 
    13701373DiceAvDevice::txOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 
    13711374    // registry offsets should always be smaller than 0x7FFFFFFF 
     
    14021405DiceAvDevice::readRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    14031406    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx %d register offset 0x%04llX\n", i, offset); 
    1404      
     1407 
    14051408    fb_nodeaddr_t offset_rx=rxOffsetGen(i, offset, sizeof(fb_quadlet_t)); 
    14061409    return readReg(m_rx_reg_offset + offset_rx, result); 
     
    14091412bool 
    14101413DiceAvDevice::writeRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 
    1411     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08llX, data: 0x%08X\n",   
     1414    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08llX, data: 0x%08X\n", 
    14121415        offset, data); 
    1413          
     1416 
    14141417    fb_nodeaddr_t offset_rx=rxOffsetGen(i, offset, sizeof(fb_quadlet_t)); 
    14151418    return writeReg(m_rx_reg_offset + offset_rx, data); 
    14161419} 
    14171420 
    1418 bool  
     1421bool 
    14191422DiceAvDevice::readRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1420     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n",  
     1423    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 
    14211424        offset, length); 
    1422      
     1425 
    14231426    fb_nodeaddr_t offset_rx=rxOffsetGen(i, offset, length); 
    14241427    return readRegBlock(m_rx_reg_offset + offset_rx, data, length); 
    14251428} 
    14261429 
    1427 bool  
     1430bool 
    14281431DiceAvDevice::writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 
    1429     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n",  
     1432    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 
    14301433        offset, length); 
    14311434 
     
    14341437} 
    14351438 
    1436 fb_nodeaddr_t  
     1439fb_nodeaddr_t 
    14371440DiceAvDevice::rxOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 
    14381441    // registry offsets should always be smaller than 0x7FFFFFFF 
     
    14691472 
    14701473DiceAvDevice::DiceNotifier::DiceNotifier(DiceAvDevice *d, nodeaddr_t start) 
    1471  : ARMHandler(start, DICE_NOTIFIER_BLOCK_LENGTH,  
     1474 : ARMHandler(start, DICE_NOTIFIER_BLOCK_LENGTH, 
    14721475              RAW1394_ARM_READ | RAW1394_ARM_WRITE | RAW1394_ARM_LOCK, 
    14731476              RAW1394_ARM_WRITE, 0) 
     
    14771480} 
    14781481 
    1479 DiceAvDevice::DiceNotifier::~DiceNotifier()  
     1482DiceAvDevice::DiceNotifier::~DiceNotifier() 
    14801483{ 
    14811484 
  • trunk/libffado/src/dice/dice_avdevice.h

    r436 r445  
    1 /* dice_avdevice.h 
    2  * Copyright (C) 2007 by Pieter Palmers 
     1/* 
     2 * Copyright (C) 2005-2007 by Pieter Palmers 
    33 * 
    4  * This file is part of FreeBob. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBob is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBob is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBob; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#ifndef DICEDEVICE_H 
    2125#define DICEDEVICE_H 
     
    6973 
    7074    bool prepare(); 
    71      
     75 
    7276    bool lock(); 
    7377    bool unlock(); 
    74      
     78 
    7579    bool startStreamByIndex(int i); 
    7680    bool stopStreamByIndex(int i); 
    77      
     81 
    7882    bool enableStreaming(); 
    7983    bool disableStreaming(); 
    80      
     84 
    8185protected: 
    8286    struct VendorModelEntry *m_model; 
    83      
     87 
    8488    // streaming stuff 
    8589    typedef std::vector< Streaming::StreamProcessor * > StreamProcessorVector; 
    8690    StreamProcessorVector m_receiveProcessors; 
    8791    StreamProcessorVector m_transmitProcessors; 
    88      
     92 
    8993private: // streaming & port helpers 
    9094    enum EPortTypes { 
     
    9296        ePT_MIDI, 
    9397    }; 
    94      
     98 
    9599    typedef struct { 
    96100        std::string name; 
     
    98102        unsigned int streamPosition; 
    99103        unsigned int streamLocation; 
    100     } diceChannelInfo;  
    101      
    102     bool addChannelToProcessor( diceChannelInfo *,  
    103                               Streaming::StreamProcessor *,  
     104    } diceChannelInfo; 
     105 
     106    bool addChannelToProcessor( diceChannelInfo *, 
     107                              Streaming::StreamProcessor *, 
    104108                              Streaming::Port::E_Direction direction); 
    105      
     109 
    106110    int allocateIsoChannel(unsigned int packet_size); 
    107111    bool deallocateIsoChannel(int channel); 
    108      
     112 
    109113private: // helper functions 
    110114    bool enableIsoStreaming(); 
    111115    bool disableIsoStreaming(); 
    112116    bool isIsoStreamingEnabled(); 
    113      
     117 
    114118    bool maskedCheckZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask); 
    115119    bool maskedCheckNotZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask); 
    116      
     120 
    117121    typedef std::vector< std::string > diceNameVector; 
    118122    typedef std::vector< std::string >::iterator diceNameVectorIterator; 
     
    122126    diceNameVector getClockSourceNameString(); 
    123127    std::string getDeviceNickName(); 
    124      
     128 
    125129private: // register I/O routines 
    126130    bool initIoFunctions(); 
     
    130134    bool readRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 
    131135    bool writeRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 
    132      
     136 
    133137    bool readGlobalReg(fb_nodeaddr_t, fb_quadlet_t *); 
    134138    bool writeGlobalReg(fb_nodeaddr_t, fb_quadlet_t); 
     
    136140    bool writeGlobalRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 
    137141    fb_nodeaddr_t globalOffsetGen(fb_nodeaddr_t, size_t); 
    138      
     142 
    139143    bool readTxReg(unsigned int i, fb_nodeaddr_t, fb_quadlet_t *); 
    140144    bool writeTxReg(unsigned int i, fb_nodeaddr_t, fb_quadlet_t); 
     
    142146    bool writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length); 
    143147    fb_nodeaddr_t txOffsetGen(unsigned int, fb_nodeaddr_t, size_t); 
    144      
     148 
    145149    bool readRxReg(unsigned int i, fb_nodeaddr_t, fb_quadlet_t *); 
    146150    bool writeRxReg(unsigned int i, fb_nodeaddr_t, fb_quadlet_t); 
     
    148152    bool writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length); 
    149153    fb_nodeaddr_t rxOffsetGen(unsigned int, fb_nodeaddr_t, size_t); 
    150      
     154 
    151155    fb_quadlet_t m_global_reg_offset; 
    152156    fb_quadlet_t m_global_reg_size; 
     
    159163    fb_quadlet_t m_unused2_reg_offset; 
    160164    fb_quadlet_t m_unused2_reg_size; 
    161      
     165 
    162166    fb_quadlet_t m_nb_tx; 
    163167    fb_quadlet_t m_tx_size; 
    164168    fb_quadlet_t m_nb_rx; 
    165169    fb_quadlet_t m_rx_size; 
    166      
     170 
    167171private: 
    168172    // notification 
    169173    DiceNotifier *m_notifier; 
    170      
     174 
    171175    /** 
    172      * this class reacts on the DICE device writing to the  
     176     * this class reacts on the DICE device writing to the 
    173177     * hosts notify address 
    174178     */ 
     
    180184        DiceNotifier(DiceAvDevice *, nodeaddr_t start); 
    181185        virtual ~DiceNotifier(); 
    182          
     186 
    183187    private: 
    184188        DiceAvDevice *m_dicedevice; 
  • trunk/libffado/src/dice/dice_defines.h

    r436 r445  
    1 /* dice_defines.h 
    2  * Copyright (C) 2007 by Pieter Palmers 
    3  * 
    4  * This file is part of FreeBob. 
    5  * 
    6  * FreeBob is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBob is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Pieter Palmers 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBob; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
     23 
    2024#ifndef DICEDEFINES_H 
    2125#define DICEDEFINES_H 
     
    2327#define DICE_VER_1_0_4_0 
    2428// #define DICE_VER_1_0_7_0 
    25  
    2629 
    2730#define DICE_INVALID_OFFSET                  0xFFFFF00000000000ULL 
     
    138141// the format of the user messages 
    139142// however diceDriverInterface.h indicates: 
    140 // "When DD_NOTIFY_MESSAGE is set DD_NOTIFY_USER4 through  
    141 //  DD_NOTIFY_USER11 are defined as an 8 bit message so  
    142 //  you can have 256 seperate messages (like gray encoder  
     143// "When DD_NOTIFY_MESSAGE is set DD_NOTIFY_USER4 through 
     144//  DD_NOTIFY_USER11 are defined as an 8 bit message so 
     145//  you can have 256 seperate messages (like gray encoder 
    143146//  movements)." 
    144147 
     
    161164#define DICE_NOTIFY_USER_GET_MESSAGE(x) \ 
    162165                ( ((x) >> 24 ) & 0xFF ) 
    163                  
     166 
    164167//   NICK_NAME register 
    165168 
  • trunk/libffado/src/fbtypes.h

    r336 r445  
    11/* fbtypes.h 
    2  * Copyright (C) 2005 by Daniel Wagner 
     2 * Copyright (C) 2005-2007 by by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB. 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    20   
     23 
    2124#ifndef FBTYPES_H 
    2225#define FBTYPES_H 
    23   
     26 
    2427#include <libraw1394/raw1394.h> 
    25   
     28 
    2629typedef quadlet_t   fb_quadlet_t; 
    2730typedef byte_t      fb_byte_t; 
     
    3235class DeviceManager; 
    3336 
    34 struct freebob_handle { 
     37struct ffado_handle { 
    3538    DeviceManager*   m_deviceManager; 
    3639}; 
  • trunk/libffado/src/ffado.cpp

    r442 r445  
    1 /* freebob.cpp 
    2  * Copyright (C) 2005 Pieter Palmers, Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * Copyright (C) 2005-2007 by Pieter Palmers 
    34 * 
    4  * This file is part of FreeBoB 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
     7 * 
     8 * FFADO is based upon FreeBoB 
    59 * 
    610 * This library is free software; you can redistribute it and/or 
    711 * modify it under the terms of the GNU Lesser General Public 
    8  * License as published by the Free Software Foundation; either 
    9  * version 2.1 of the License, or (at your option) any later version. 
     12 * License version 2.1, as published by the Free Software Foundation; 
    1013 * 
    1114 * This library is distributed in the hope that it will be useful, 
     
    2225#include "config.h" 
    2326 
    24 #include "libfreebob/freebob.h" 
     27#include "libffado/ffado.h" 
    2528 
    2629#include "debugmodule/debugmodule.h" 
     
    3639 
    3740DECLARE_GLOBAL_DEBUG_MODULE; 
    38 IMPL_GLOBAL_DEBUG_MODULE( FreeBoB, DEBUG_LEVEL_VERBOSE ); 
     41IMPL_GLOBAL_DEBUG_MODULE( FFADO, DEBUG_LEVEL_VERBOSE ); 
    3942 
    4043#ifdef __cplusplus 
     
    4245#endif 
    4346 
    44 // this is very much nescessary, as otherwise the  
    45 // message buffer thread doesn't get killed when the  
    46 // library is dlclose()'d  
     47// this is very much nescessary, as otherwise the 
     48// message buffer thread doesn't get killed when the 
     49// library is dlclose()'d 
    4750 
    4851static void exitfunc(void) __attribute__((destructor)); 
     
    5861 
    5962const char* 
    60 freebob_get_version() { 
     63ffado_get_version() { 
    6164    return PACKAGE_STRING; 
    6265} 
     
    6467 
    6568int 
    66 freebob_get_api_version() { 
    67     return FREEBOB_API_VERSION; 
     69ffado_get_api_version() { 
     70    return FFADO_API_VERSION; 
    6871} 
    6972 
    70 freebob_handle_t 
    71 freebob_new_handle( int port ) 
     73ffado_handle_t 
     74ffado_new_handle( int port ) 
    7275{ 
    73     freebob_handle_t handle = new struct freebob_handle; 
     76    ffado_handle_t handle = new struct ffado_handle; 
    7477    if (! handle ) { 
    7578        debugFatal( "Could not allocate memory for new handle\n" ); 
     
    9396 
    9497int 
    95 freebob_destroy_handle( freebob_handle_t freebob_handle ) 
     98ffado_destroy_handle( ffado_handle_t ffado_handle ) 
    9699{ 
    97     delete freebob_handle->m_deviceManager; 
    98     delete freebob_handle; 
     100    delete ffado_handle->m_deviceManager; 
     101    delete ffado_handle; 
    99102    return 0; 
    100103} 
    101104 
    102105int 
    103 freebob_discover_devices( freebob_handle_t freebob_handle, int verbose ) 
     106ffado_discover_devices( ffado_handle_t ffado_handle, int verbose ) 
    104107{ 
    105108    if (verbose) { 
    106         freebob_handle->m_deviceManager->setVerboseLevel(DEBUG_LEVEL_VERBOSE); 
     109        ffado_handle->m_deviceManager->setVerboseLevel(DEBUG_LEVEL_VERBOSE); 
    107110   } 
    108     return freebob_handle->m_deviceManager->discover()? 0 : -1; 
     111    return ffado_handle->m_deviceManager->discover()? 0 : -1; 
    109112} 
    110113 
    111114int 
    112 freebob_node_is_valid_freebob_device( freebob_handle_t freebob_handle, int node_id ) 
     115ffado_node_is_valid_ffado_device( ffado_handle_t ffado_handle, int node_id ) 
    113116{ 
    114     return freebob_handle->m_deviceManager->isValidNode( node_id ); 
     117    return ffado_handle->m_deviceManager->isValidNode( node_id ); 
    115118} 
    116119 
    117120int 
    118 freebob_get_nb_devices_on_bus( freebob_handle_t freebob_handle ) 
     121ffado_get_nb_devices_on_bus( ffado_handle_t ffado_handle ) 
    119122{ 
    120     return freebob_handle->m_deviceManager->getNbDevices(); 
     123    return ffado_handle->m_deviceManager->getNbDevices(); 
    121124} 
    122125 
    123126int 
    124 freebob_get_device_node_id( freebob_handle_t freebob_handle, int device_nr ) 
     127ffado_get_device_node_id( ffado_handle_t ffado_handle, int device_nr ) 
    125128{ 
    126     return freebob_handle->m_deviceManager->getDeviceNodeId(device_nr); 
     129    return ffado_handle->m_deviceManager->getDeviceNodeId(device_nr); 
    127130} 
    128131 
    129132int 
    130 freebob_set_samplerate( freebob_handle_t freebob_handle, int node_id, int samplerate ) 
     133ffado_set_samplerate( ffado_handle_t ffado_handle, int node_id, int samplerate ) 
    131134{ 
    132     IAvDevice* avDevice = freebob_handle->m_deviceManager->getAvDevice( node_id ); 
     135    IAvDevice* avDevice = ffado_handle->m_deviceManager->getAvDevice( node_id ); 
    133136    if ( avDevice ) { 
    134137        if ( avDevice->setSamplingFrequency( parseSampleRate( samplerate ) ) ) { 
    135             return freebob_handle->m_deviceManager->discover()? 0 : -1; 
     138            return ffado_handle->m_deviceManager->discover()? 0 : -1; 
    136139        } 
    137140    } 
     
    139142} 
    140143 
    141 void freebob_sleep_after_avc_command( int time ) 
     144void ffado_sleep_after_avc_command( int time ) 
    142145{ 
    143146    AVCCommand::setSleepAfterAVCCommand( time ); 
  • trunk/libffado/src/ffado_streaming.cpp

    r442 r445  
    1 /* $Id$ */ 
    2  
    31/* 
    4 *   FreeBob Streaming API 
    5 *   FreeBob = Firewire (pro-)audio for linux 
    6 
    7 *   http://freebob.sf.net 
    8 
    9 *   Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> 
    10 
    11 *   This program is free software {} you can redistribute it and/or modify 
    12 *   it under the terms of the GNU General Public License as published by 
    13 *   the Free Software Foundation {} either version 2 of the License, or 
    14 *   (at your option) any later version. 
    15 
    16 *   This program is distributed in the hope that it will be useful, 
    17 *   but WITHOUT ANY WARRANTY {} without even the implied warranty of 
    18 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    19 *   GNU General Public License for more details. 
    20 
    21 *   You should have received a copy of the GNU General Public License 
    22 *   along with this program {} if not, write to the Free Software 
    23 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
    24 
    25 *  
    26 
    27 */ 
    28  
    29 /* freebob_streaming.c 
    30 
    31 * Implementation of the FreeBob Streaming API 
    32 
    33 */ 
    34  
    35 #include "libfreebob/freebob.h" 
    36 #include "libfreebob/freebob_streaming.h" 
     2 * Copyright (C) 2005-2007 by Pieter Palmers 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
     14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
     22 */ 
     23 
     24/* 
     25 * Implementation of the FFADO Streaming API 
     26 */ 
     27 
     28#include "libffado/ffado.h" 
    3729#include "devicemanager.h" 
    3830#include "iavdevice.h" 
     
    5345using namespace Streaming; 
    5446 
    55 struct _freebob_device 
     47struct _ffado_device 
    5648{ 
    5749    DeviceManager * m_deviceManager; 
    5850    StreamProcessorManager *processorManager; 
    5951 
    60     freebob_options_t options; 
    61     freebob_device_info_t device_info; 
    62 };  
    63  
    64 freebob_device_t *freebob_streaming_init (freebob_device_info_t *device_info, freebob_options_t options) { 
     52    ffado_options_t options; 
     53    ffado_device_info_t device_info; 
     54}; 
     55 
     56ffado_device_t *ffado_streaming_init (ffado_device_info_t *device_info, ffado_options_t options) { 
    6557    unsigned int i=0; 
    6658 
    67     struct _freebob_device *dev = new struct _freebob_device; 
    68  
    69     debugFatal("%s built %s %s\n", freebob_get_version(), __DATE__, __TIME__); 
     59    struct _ffado_device *dev = new struct _ffado_device; 
     60 
     61    debugFatal("%s built %s %s\n", ffado_get_version(), __DATE__, __TIME__); 
    7062 
    7163    if(!dev) { 
     
    8375            return 0; 
    8476    } 
    85      
     77 
    8678    dev->m_deviceManager->setVerboseLevel(DEBUG_LEVEL_VERBOSE); 
    8779    if ( !dev->m_deviceManager->initialize( dev->options.port ) ) { 
     
    9385 
    9486    // create a processor manager to manage the actual stream 
    95     // processors       
     87    // processors 
    9688    dev->processorManager = new StreamProcessorManager(dev->options.period_size,dev->options.nb_buffers); 
    9789    if(!dev->processorManager) { 
     
    10193            return 0; 
    10294    } 
    103      
     95 
    10496    dev->processorManager->setThreadParameters(dev->options.realtime, dev->options.packetizer_priority); 
    105      
     97 
    10698    dev->processorManager->setVerboseLevel(DEBUG_LEVEL_VERBOSE); 
    10799    if(!dev->processorManager->init()) { 
     
    112104            return 0; 
    113105    } 
    114      
     106 
    115107    // set slave mode option 
    116108    bool slaveMode=(dev->options.slave_mode != 0); 
     
    125117            debugWarning("Failed to set snoop mode option\n"); 
    126118    } 
    127      
     119 
    128120    // discover the devices on the bus 
    129121    if(!dev->m_deviceManager->discover()) { 
     
    134126            return 0; 
    135127    } 
    136      
     128 
    137129    // are there devices on the bus? 
    138130    if(dev->m_deviceManager->getAvDeviceCount()==0) { 
     
    143135            return 0; 
    144136    } 
    145      
     137 
    146138    // iterate over the found devices 
    147139    // add the stream processors of the devices to the managers 
     
    151143 
    152144        debugOutput(DEBUG_LEVEL_VERBOSE, "Locking device (%p)\n", device); 
    153          
     145 
    154146        if (!device->lock()) { 
    155147            debugWarning("Could not lock device, skipping device (%p)!\n", device); 
    156148            continue; 
    157149        } 
    158          
    159         debugOutput(DEBUG_LEVEL_VERBOSE, "Setting samplerate to %d for (%p)\n",  
     150 
     151        debugOutput(DEBUG_LEVEL_VERBOSE, "Setting samplerate to %d for (%p)\n", 
    160152                    dev->options.sample_rate, device); 
    161                      
     153 
    162154        // Set the device's sampling rate to that requested 
    163155        // FIXME: does this really belong here?  If so we need to handle errors. 
    164156        if (!device->setSamplingFrequency(parseSampleRate(dev->options.sample_rate))) { 
    165             debugOutput(DEBUG_LEVEL_VERBOSE, " => Retry setting samplerate to %d for (%p)\n",  
     157            debugOutput(DEBUG_LEVEL_VERBOSE, " => Retry setting samplerate to %d for (%p)\n", 
    166158                        dev->options.sample_rate, device); 
    167          
     159 
    168160            // try again: 
    169161            if (!device->setSamplingFrequency(parseSampleRate(dev->options.sample_rate))) { 
     
    188180        } 
    189181    } 
    190      
     182 
    191183    // set the sync source 
    192184    if (!dev->processorManager->setSyncSource(dev->m_deviceManager->getSyncSource())) { 
     
    201193} 
    202194 
    203 int freebob_streaming_prepare(freebob_device_t *dev) { 
     195int ffado_streaming_prepare(ffado_device_t *dev) { 
    204196    debugOutput(DEBUG_LEVEL_VERBOSE, "Preparing...\n"); 
    205          
     197 
    206198    if (!dev->processorManager->prepare()) { 
    207199        debugFatal("Could not prepare streaming...\n"); 
     
    212204} 
    213205 
    214 void freebob_streaming_finish(freebob_device_t *dev) { 
     206void ffado_streaming_finish(ffado_device_t *dev) { 
    215207    unsigned int i=0; 
    216      
     208 
    217209    assert(dev); 
    218      
     210 
    219211    // iterate over the found devices 
    220212    for(i=0;i<dev->m_deviceManager->getAvDeviceCount();i++) { 
     
    228220        } 
    229221    } 
    230      
     222 
    231223    delete dev->processorManager; 
    232224    delete dev->m_deviceManager; 
     
    236228} 
    237229 
    238 int freebob_streaming_start(freebob_device_t *dev) { 
     230int ffado_streaming_start(ffado_device_t *dev) { 
    239231    unsigned int i=0; 
    240232    debugOutput(DEBUG_LEVEL_VERBOSE,"------------- Start -------------\n"); 
    241      
     233 
    242234    // create the connections for all devices 
    243235    // iterate over the found devices 
     
    246238        IAvDevice *device=dev->m_deviceManager->getAvDeviceByIndex(i); 
    247239        assert(device); 
    248      
     240 
    249241        int j=0; 
    250242        for(j=0; j<device->getStreamCount();j++) { 
     
    265257        return 0; 
    266258    } else { 
    267         freebob_streaming_stop(dev); 
    268         return -1; 
    269     } 
    270 } 
    271  
    272 int freebob_streaming_stop(freebob_device_t *dev) { 
     259        ffado_streaming_stop(dev); 
     260        return -1; 
     261    } 
     262} 
     263 
     264int ffado_streaming_stop(ffado_device_t *dev) { 
    273265    unsigned int i; 
    274266    debugOutput(DEBUG_LEVEL_VERBOSE,"------------- Stop -------------\n"); 
     
    286278            debugWarning("Could not disable streaming on device %d!\n",i); 
    287279        } 
    288          
     280 
    289281        int j=0; 
    290282        for(j=0; j<device->getStreamCount();j++) { 
     
    302294} 
    303295 
    304 int freebob_streaming_reset(freebob_device_t *dev) { 
     296int ffado_streaming_reset(ffado_device_t *dev) { 
    305297    debugOutput(DEBUG_LEVEL_VERBOSE,"------------- Reset -------------\n"); 
    306298 
     
    310302} 
    311303 
    312 int freebob_streaming_wait(freebob_device_t *dev) { 
     304int ffado_streaming_wait(ffado_device_t *dev) { 
    313305    static int periods=0; 
    314306    static int periods_print=0; 
    315307    static int xruns=0; 
    316      
     308 
    317309    periods++; 
    318310    if(periods>periods_print) { 
    319         debugOutputShort(DEBUG_LEVEL_VERBOSE, "\nfreebob_streaming_wait\n"); 
     311        debugOutputShort(DEBUG_LEVEL_VERBOSE, "\nffado_streaming_wait\n"); 
    320312        debugOutputShort(DEBUG_LEVEL_VERBOSE, "============================================\n"); 
    321313        debugOutputShort(DEBUG_LEVEL_VERBOSE, "Xruns: %d\n",xruns); 
     
    325317        periods_print+=100; 
    326318    } 
    327      
     319 
    328320    if(dev->processorManager->waitForPeriod()) { 
    329321        return dev->options.period_size; 
    330322    } else { 
    331323        debugWarning("XRUN detected\n"); 
    332          
     324 
    333325        // do xrun recovery 
    334326        dev->processorManager->handleXrun(); 
     
    338330} 
    339331 
    340 int freebob_streaming_transfer_capture_buffers(freebob_device_t *dev) { 
     332int ffado_streaming_transfer_capture_buffers(ffado_device_t *dev) { 
    341333    return dev->processorManager->transfer(StreamProcessor::E_Receive); 
    342334} 
    343335 
    344 int freebob_streaming_transfer_playback_buffers(freebob_device_t *dev) { 
     336int ffado_streaming_transfer_playback_buffers(ffado_device_t *dev) { 
    345337    return dev->processorManager->transfer(StreamProcessor::E_Transmit); 
    346338} 
    347339 
    348 int freebob_streaming_transfer_buffers(freebob_device_t *dev) { 
     340int ffado_streaming_transfer_buffers(ffado_device_t *dev) { 
    349341    return dev->processorManager->transfer(); 
    350342} 
    351343 
    352344 
    353 int freebob_streaming_write(freebob_device_t *dev, int i, freebob_sample_t *buffer, int nsamples) { 
     345int ffado_streaming_write(ffado_device_t *dev, int i, ffado_sample_t *buffer, int nsamples) { 
    354346    Port *p=dev->processorManager->getPortByIndex(i, Port::E_Playback); 
    355     // use an assert here performancewise,  
     347    // use an assert here performancewise, 
    356348    // it should already have failed before, if not correct 
    357     assert(p);  
    358          
     349    assert(p); 
     350 
    359351    return p->writeEvents((void *)buffer, nsamples); 
    360352} 
    361353 
    362 int freebob_streaming_read(freebob_device_t *dev, int i, freebob_sample_t *buffer, int nsamples) { 
     354int ffado_streaming_read(ffado_device_t *dev, int i, ffado_sample_t *buffer, int nsamples) { 
    363355    Port *p=dev->processorManager->getPortByIndex(i, Port::E_Capture); 
    364     // use an assert here performancewise,  
     356    // use an assert here performancewise, 
    365357    // it should already have failed before, if not correct 
    366     assert(p);  
    367          
     358    assert(p); 
     359 
    368360    return p->readEvents((void *)buffer, nsamples); 
    369361} 
    370362 
    371 int freebob_streaming_get_nb_capture_streams(freebob_device_t *dev) { 
     363int ffado_streaming_get_nb_capture_streams(ffado_device_t *dev) { 
    372364    return dev->processorManager->getPortCount(Port::E_Capture); 
    373365} 
    374366 
    375 int freebob_streaming_get_nb_playback_streams(freebob_device_t *dev) { 
     367int ffado_streaming_get_nb_playback_streams(ffado_device_t *dev) { 
    376368    return dev->processorManager->getPortCount(Port::E_Playback); 
    377369} 
    378370 
    379 int freebob_streaming_get_capture_stream_name(freebob_device_t *dev, int i, char* buffer, size_t buffersize) { 
     371int ffado_streaming_get_capture_stream_name(ffado_device_t *dev, int i, char* buffer, size_t buffersize) { 
    380372    Port *p=dev->processorManager->getPortByIndex(i, Port::E_Capture); 
    381373    if(!p) { 
     
    391383} 
    392384 
    393 int freebob_streaming_get_playback_stream_name(freebob_device_t *dev, int i, char* buffer, size_t buffersize) { 
     385int ffado_streaming_get_playback_stream_name(ffado_device_t *dev, int i, char* buffer, size_t buffersize) { 
    394386    Port *p=dev->processorManager->getPortByIndex(i, Port::E_Playback); 
    395387    if(!p) { 
     
    405397} 
    406398 
    407 freebob_streaming_stream_type freebob_streaming_get_capture_stream_type(freebob_device_t *dev, int i) { 
     399ffado_streaming_stream_type ffado_streaming_get_capture_stream_type(ffado_device_t *dev, int i) { 
    408400    Port *p=dev->processorManager->getPortByIndex(i, Port::E_Capture); 
    409401    if(!p) { 
    410402        debugWarning("Could not get capture port at index %d\n",i); 
    411         return freebob_stream_type_invalid; 
     403        return ffado_stream_type_invalid; 
    412404    } 
    413405    switch(p->getPortType()) { 
    414406    case Port::E_Audio: 
    415         return freebob_stream_type_audio; 
     407        return ffado_stream_type_audio; 
    416408    case Port::E_Midi: 
    417         return freebob_stream_type_midi; 
     409        return ffado_stream_type_midi; 
    418410    case Port::E_Control: 
    419         return freebob_stream_type_control; 
     411        return ffado_stream_type_control; 
    420412    default: 
    421         return freebob_stream_type_unknown; 
    422     } 
    423 } 
    424  
    425 freebob_streaming_stream_type freebob_streaming_get_playback_stream_type(freebob_device_t *dev, int i) { 
     413        return ffado_stream_type_unknown; 
     414    } 
     415} 
     416 
     417ffado_streaming_stream_type ffado_streaming_get_playback_stream_type(ffado_device_t *dev, int i) { 
    426418    Port *p=dev->processorManager->getPortByIndex(i, Port::E_Playback); 
    427419    if(!p) { 
    428420        debugWarning("Could not get playback port at index %d\n",i); 
    429         return freebob_stream_type_invalid; 
     421        return ffado_stream_type_invalid; 
    430422    } 
    431423    switch(p->getPortType()) { 
    432424    case Port::E_Audio: 
    433         return freebob_stream_type_audio; 
     425        return ffado_stream_type_audio; 
    434426    case Port::E_Midi: 
    435         return freebob_stream_type_midi; 
     427        return ffado_stream_type_midi; 
    436428    case Port::E_Control: 
    437         return freebob_stream_type_control; 
     429        return ffado_stream_type_control; 
    438430    default: 
    439         return freebob_stream_type_unknown; 
    440     } 
    441 } 
    442  
    443 int freebob_streaming_set_stream_buffer_type(freebob_device_t *dev, int i,  
    444     freebob_streaming_buffer_type t, enum Port::E_Direction direction) { 
     431        return ffado_stream_type_unknown; 
     432    } 
     433} 
     434 
     435int ffado_streaming_set_stream_buffer_type(ffado_device_t *dev, int i, 
     436    ffado_streaming_buffer_type t, enum Port::E_Direction direction) { 
    445437 
    446438    Port *p=dev->processorManager->getPortByIndex(i, direction); 
     
    450442        return -1; 
    451443    } 
    452          
     444 
    453445    switch(t) { 
    454     case freebob_buffer_type_int24: 
     446    case ffado_buffer_type_int24: 
    455447        if (!p->setDataType(Port::E_Int24)) { 
    456448            debugWarning("%s: Could not set data type to Int24\n",p->getName().c_str()); 
     
    462454        } 
    463455        break; 
    464     case freebob_buffer_type_float: 
     456    case ffado_buffer_type_float: 
    465457        if (!p->setDataType(Port::E_Float)) { 
    466458            debugWarning("%s: Could not set data type to Float\n",p->getName().c_str()); 
     
    472464        } 
    473465        break; 
    474     case freebob_buffer_type_midi: 
     466    case ffado_buffer_type_midi: 
    475467        if (!p->setDataType(Port::E_MidiEvent)) { 
    476468            debugWarning("%s: Could not set data type to MidiEvent\n",p->getName().c_str()); 
     
    490482} 
    491483 
    492 int freebob_streaming_set_playback_buffer_type(freebob_device_t *dev, int i, freebob_streaming_buffer_type t) { 
    493     return freebob_streaming_set_stream_buffer_type(dev, i, t, Port::E_Playback); 
    494 } 
    495  
    496 int freebob_streaming_set_capture_buffer_type(freebob_device_t *dev, int i, freebob_streaming_buffer_type t) { 
    497     return freebob_streaming_set_stream_buffer_type(dev, i, t, Port::E_Capture); 
    498 } 
    499  
    500 int freebob_streaming_stream_onoff(freebob_device_t *dev, int i,  
     484int ffado_streaming_set_playback_buffer_type(ffado_device_t *dev, int i, ffado_streaming_buffer_type t) { 
     485    return ffado_streaming_set_stream_buffer_type(dev, i, t, Port::E_Playback); 
     486} 
     487 
     488int ffado_streaming_set_capture_buffer_type(ffado_device_t *dev, int i, ffado_streaming_buffer_type t) { 
     489    return ffado_streaming_set_stream_buffer_type(dev, i, t, Port::E_Capture); 
     490} 
     491 
     492int ffado_streaming_stream_onoff(ffado_device_t *dev, int i, 
    501493    int on, enum Port::E_Direction direction) { 
    502494    Port *p=dev->processorManager->getPortByIndex(i, direction); 
     
    514506} 
    515507 
    516 int freebob_streaming_playback_stream_onoff(freebob_device_t *dev, int number, int on) { 
    517     return freebob_streaming_stream_onoff(dev, number, on, Port::E_Playback); 
    518 } 
    519  
    520 int freebob_streaming_capture_stream_onoff(freebob_device_t *dev, int number, int on) { 
    521     return freebob_streaming_stream_onoff(dev, number, on, Port::E_Capture); 
     508int ffado_streaming_playback_stream_onoff(ffado_device_t *dev, int number, int on) { 
     509    return ffado_streaming_stream_onoff(dev, number, on, Port::E_Playback); 
     510} 
     511 
     512int ffado_streaming_capture_stream_onoff(ffado_device_t *dev, int number, int on) { 
     513    return ffado_streaming_stream_onoff(dev, number, on, Port::E_Capture); 
    522514} 
    523515 
    524516// TODO: the way port buffers are set in the C api doesn't satisfy me 
    525 int freebob_streaming_set_capture_stream_buffer(freebob_device_t *dev, int i, char *buff) { 
     517int ffado_streaming_set_capture_stream_buffer(ffado_device_t *dev, int i, char *buff) { 
    526518        Port *p=dev->processorManager->getPortByIndex(i, Port::E_Capture); 
    527          
    528         // use an assert here performancewise,  
     519 
     520        // use an assert here performancewise, 
    529521        // it should already have failed before, if not correct 
    530         assert(p);  
    531          
     522        assert(p); 
     523 
    532524        p->useExternalBuffer(true); 
    533525        p->setExternalBufferAddress((void *)buff); 
     
    537529} 
    538530 
    539 int freebob_streaming_set_playback_stream_buffer(freebob_device_t *dev, int i, char *buff) { 
     531int ffado_streaming_set_playback_stream_buffer(ffado_device_t *dev, int i, char *buff) { 
    540532        Port *p=dev->processorManager->getPortByIndex(i, Port::E_Playback); 
    541         // use an assert here performancewise,  
     533        // use an assert here performancewise, 
    542534        // it should already have failed before, if not correct 
    543         assert(p);  
    544          
     535        assert(p); 
     536 
    545537        p->useExternalBuffer(true); 
    546538        p->setExternalBufferAddress((void *)buff); 
  • trunk/libffado/src/iavdevice.cpp

    r436 r445  
    1 /* iavdevice.h 
    2  * Copyright (C) 2006 by Daniel Wagner 
    3  * Copyright (C) 2007 by Pieter Palmers 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * Copyright (C) 2005-2007 by Pieter Palmers 
    44 * 
    5  * This file is part of FreeBoB. 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
    67 * 
    7  * FreeBoB is free software; you can redistribute it and/or modify 
    8  * it under the terms of the GNU General Public License as published by 
    9  * the Free Software Foundation; either version 2 of the License, or 
    10  * (at your option) any later version. 
    11  * FreeBoB is distributed in the hope that it will be useful, 
     8 * FFADO is based upon FreeBoB 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
    1215 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    14  * GNU General Public License for more details. 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
    1518 * 
    16  * You should have received a copy of the GNU General Public License 
    17  * along with FreeBoB; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    19  * MA 02111-1307 USA. 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    2023 */ 
    2124 
     
    4043{ 
    4144    addOption(Util::OptionContainer::Option("id",std::string("dev?"))); 
    42      
     45 
    4346    std::ostringstream nodestr; 
    4447    nodestr << "node" << nodeId; 
    4548    setOscBase(nodestr.str()); 
    4649    ConfigRom& c = getConfigRom(); 
    47      
     50 
    4851    addChildOscNode(&c); 
    4952} 
     
    6871 
    6972void 
    70 IAvDevice::setVerboseLevel(int l)  
     73IAvDevice::setVerboseLevel(int l) 
    7174{ 
    7275    m_verboseLevel=l; 
  • trunk/libffado/src/iavdevice.h

    r436 r445  
    1 /* iavdevice.h 
    2  * Copyright (C) 2006 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * Copyright (C) 2005-2007 by Pieter Palmers 
     4 * 
     5 * This file is part of FFADO 
     6 * FFADO = Free Firewire (pro-)audio drivers for linux 
     7 * 
     8 * FFADO is based upon FreeBoB 
     9 * 
     10 * This library is free software; you can redistribute it and/or 
     11 * modify it under the terms of the GNU Lesser General Public 
     12 * License version 2.1, as published by the Free Software Foundation; 
     13 * 
     14 * This library is distributed in the hope that it will be useful, 
    1115 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17 * Lesser General Public License for more details. 
     18 * 
     19 * You should have received a copy of the GNU Lesser General Public 
     20 * License along with this library; if not, write to the Free Software 
     21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     22 * MA 02110-1301 USA 
    1923 */ 
    2024 
     
    3539@brief Base class for device support 
    3640 
    37  This class should be subclassed to implement freebob support  
     41 This class should be subclassed to implement ffado support 
    3842 for a specific device. 
    3943 
    4044*/ 
    41 class IAvDevice  
     45class IAvDevice 
    4246    : public Util::OptionContainer, 
    4347      public OSC::OscNode 
    4448{ 
    4549public: 
    46        IAvDevice( std::auto_ptr< ConfigRom >( configRom ), 
     50    IAvDevice( std::auto_ptr< ConfigRom >( configRom ), 
    4751                    Ieee1394Service& ieee1394service, 
    4852                    int nodeId ); 
    49          
    50        virtual ~IAvDevice() {}; 
    51          
    52        /// Returns the ConfigRom object of the device node. 
    53        ConfigRom& getConfigRom() const; 
    54          
    55        /** 
    56         * @brief This is called by the DeviceManager to discover & configure the device 
    57          *  
    58         * @return true if the device was discovered successfuly 
    59         */ 
    60        virtual bool discover() = 0; 
    61          
    62        /** 
    63         * @brief Set the samping frequency 
    64          * @param samplingFrequency  
    65         * @return true if successful 
    66         */ 
    67        virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ) = 0; 
    68        /** 
    69         * @brief get the samplingfrequency as an integer 
    70         * @return the sampling frequency as integer 
    71         */ 
    72        virtual int getSamplingFrequency( ) = 0; 
    73          
     53 
     54    virtual ~IAvDevice() {}; 
     55 
     56    /// Returns the ConfigRom object of the device node. 
     57    ConfigRom& getConfigRom() const; 
     58 
     59    /** 
     60    * @brief This is called by the DeviceManager to discover & configure the device 
     61     * 
     62    * @return true if the device was discovered successfuly 
     63    */ 
     64    virtual bool discover() = 0; 
     65 
     66    /** 
     67    * @brief Set the samping frequency 
     68     * @param samplingFrequency 
     69    * @return true if successful 
     70    */ 
     71    virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ) = 0; 
     72    /** 
     73    * @brief get the samplingfrequency as an integer 
     74    * @return the sampling frequency as integer 
     75    */ 
     76    virtual int getSamplingFrequency( ) = 0; 
     77 
    7478    /** 
    7579     * @brief This is called by the device manager to give the device a unique ID. 
     
    8791     * 
    8892     * @note Currently this is a simple integer that is equal to 
    89      *       the position of the device in the devicemanager's  
     93     *       the position of the device in the devicemanager's 
    9094     *       device list. Therefore it is dependant on the order 
    9195     *       in which the devices are detected. The side-effect 
     
    9397     *       and history (e.g. busresets etc). This makes that 
    9498     *       these ID's are not fixed to a specific physical device. 
    95      *       At some point, we will replaced this with a GUID based  
     99     *       At some point, we will replaced this with a GUID based 
    96100     *       approach, which is tied to a physiscal device and is 
    97      *       bus & time independant.  
    98      * 
    99      * @param id  
     101     *       bus & time independant. 
     102     * 
     103     * @param id 
    100104     * @return true if successful 
    101105     */ 
    102106    bool setId(unsigned int id); 
    103          
    104        /** 
    105         * @brief Outputs the device configuration to stderr/stdout [debug helper] 
    106        
    107          * This function prints out a (detailed) description of the  
    108         * device detected, and its configuration. 
    109         */ 
    110        virtual void showDevice() = 0; 
    111  
    112         /**  
    113         * @brief Lock the device 
    114        
    115         * This is called by the streaming layer before we start manipulating 
    116         * and/or using the device. 
    117        
    118          * It should implement the mechanisms provided by the device to  
    119         * make sure that no other controller claims control of the device. 
    120        
    121         * @return true if successful, false if not 
    122         */ 
    123        virtual bool lock() = 0; 
    124          
    125         /**  
    126         * @brief Unlock the device 
    127        
    128         * This is called by the streaming layer after we finish manipulating 
    129         * and/or using the device. 
    130        
    131          * It should implement the mechanisms provided by the device to  
    132         * give up exclusive control of the device. 
    133        
    134         * @return true if successful, false if not 
    135         */ 
    136        virtual bool unlock() = 0; 
    137  
    138     /**  
     107 
     108    /** 
     109    * @brief Outputs the device configuration to stderr/stdout [debug helper] 
     110   
     111     * This function prints out a (detailed) description of the 
     112    * device detected, and its configuration. 
     113    */ 
     114    virtual void showDevice() = 0; 
     115 
     116    /** 
     117    * @brief Lock the device 
     118   
     119    * This is called by the streaming layer before we start manipulating 
     120    * and/or using the device. 
     121   
     122     * It should implement the mechanisms provided by the device to 
     123    * make sure that no other controller claims control of the device. 
     124   
     125    * @return true if successful, false if not 
     126    */ 
     127    virtual bool lock() = 0; 
     128 
     129    /** 
     130    * @brief Unlock the device 
     131   
     132    * This is called by the streaming layer after we finish manipulating 
     133    * and/or using the device. 
     134   
     135     * It should implement the mechanisms provided by the device to 
     136    * give up exclusive control of the device. 
     137   
     138    * @return true if successful, false if not 
     139    */ 
     140    virtual bool unlock() = 0; 
     141 
     142    /** 
    139143     * @brief Enable streaming on all 'started' streams 
    140144     * 
     
    146150     */ 
    147151    virtual bool enableStreaming(); 
    148      
    149     /**  
     152 
     153    /** 
    150154     * @brief Disable streaming on all streams 
    151155     * 
     
    158162    virtual bool disableStreaming(); 
    159163 
    160         /**  
    161         * @brief Prepare the device 
    162        
    163          * This is called by the streaming layer after the configuration  
    164          * parameters (e.g. sample rate) are set, and before  
    165         * getStreamProcessor[*] functions are called. 
    166        
    167         * It should be used to prepare the device's streamprocessors 
    168         * based upon the device's current configuration. Normally 
    169         * the streaming layer will not change the device's configuration 
    170         * after calling this function. 
    171        
    172         * @return true if successful, false if not 
    173         */ 
    174        virtual bool prepare() = 0; 
    175          
    176        /** 
    177         * @brief Returns the number of ISO streams implemented/used by this device 
    178        
    179         * Most likely this is 2 streams, i.e. one transmit stream and one 
    180          * receive stream. However there are devices that implement more, for  
    181          * example BeBoB's implement 4 streams:  
    182         * - 2 audio streams (1 xmit/1 recv) 
    183         * - 2 sync streams (1 xmit/1 recv), which are an optional sync source 
    184         *   for the device. 
    185        
    186         * @note you have to have a StreamProcessor for every stream. I.e. 
    187         *       getStreamProcessorByIndex(i) should return a valid StreamProcessor 
    188         *       for i=0 to i=getStreamCount()-1 
    189        
    190         * @return number of streams available (both transmit and receive) 
    191         */ 
    192        virtual int getStreamCount() = 0; 
    193          
    194         /**  
    195         * @brief Returns the StreamProcessor object for the stream with index i 
    196        
    197         * @note a streamprocessor returned by getStreamProcessorByIndex(i) 
    198         *       cannot be the same object as one returned by 
    199         *       getStreamProcessorByIndex(j) if i isn't equal to j 
    200         * @note you cannot have two streamprocessors handling the same ISO 
    201         *       channel (on the same port) 
    202        
    203         * @param i : Stream index 
    204         * @pre @ref i smaller than getStreamCount() 
    205         * @return a StreamProcessor object if successful, NULL otherwise 
    206         */ 
    207        virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i) = 0; 
    208          
    209         /**  
    210         * @brief starts the stream with index i 
    211        
    212         * This function is called by the streaming layer when this stream should 
    213          * be started, i.e. the device should start sending data or should be prepared to  
    214         * be ready to receive data. 
    215        
    216         * It returns the channel number that was assigned for this stream. 
    217         * Channel allocation should be done using the allocation functions provided by the 
    218         * Ieee1394Service object that is passed in the constructor. 
    219        
    220         * @param i : Stream index 
    221         * @pre @ref i smaller than getStreamCount() 
    222         * @return true if successful, false if not 
    223         */ 
    224        virtual bool startStreamByIndex(int i) = 0; 
    225          
    226         /**  
    227         * @brief stops the stream with index @ref i 
    228        
    229         * @param i : Stream index 
    230         * @pre @ref i smaller than getStreamCount() 
    231         * @return true if successful, false if not 
    232         */ 
    233        virtual bool stopStreamByIndex(int i) = 0; 
     164    /** 
     165    * @brief Prepare the device 
     166   
     167     * This is called by the streaming layer after the configuration 
     168     * parameters (e.g. sample rate) are set, and before 
     169    * getStreamProcessor[*] functions are called. 
     170   
     171    * It should be used to prepare the device's streamprocessors 
     172    * based upon the device's current configuration. Normally 
     173    * the streaming layer will not change the device's configuration 
     174    * after calling this function. 
     175   
     176    * @return true if successful, false if not 
     177    */ 
     178    virtual bool prepare() = 0; 
     179 
     180    /** 
     181    * @brief Returns the number of ISO streams implemented/used by this device 
     182   
     183    * Most likely this is 2 streams, i.e. one transmit stream and one 
     184     * receive stream. However there are devices that implement more, for 
     185     * example BeBoB's implement 4 streams: 
     186    * - 2 audio streams (1 xmit/1 recv) 
     187    * - 2 sync streams (1 xmit/1 recv), which are an optional sync source 
     188    *   for the device. 
     189   
     190    * @note you have to have a StreamProcessor for every stream. I.e. 
     191    *       getStreamProcessorByIndex(i) should return a valid StreamProcessor 
     192    *       for i=0 to i=getStreamCount()-1 
     193   
     194    * @return number of streams available (both transmit and receive) 
     195    */ 
     196    virtual int getStreamCount() = 0; 
     197 
     198    /** 
     199    * @brief Returns the StreamProcessor object for the stream with index i 
     200   
     201    * @note a streamprocessor returned by getStreamProcessorByIndex(i) 
     202    *       cannot be the same object as one returned by 
     203    *       getStreamProcessorByIndex(j) if i isn't equal to j 
     204    * @note you cannot have two streamprocessors handling the same ISO 
     205    *       channel (on the same port) 
     206   
     207    * @param i : Stream index 
     208    * @pre @ref i smaller than getStreamCount() 
     209    * @return a StreamProcessor object if successful, NULL otherwise 
     210    */ 
     211    virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i) = 0; 
     212 
     213    /** 
     214    * @brief starts the stream with index i 
     215   
     216    * This function is called by the streaming layer when this stream should 
     217     * be started, i.e. the device should start sending data or should be prepared to 
     218    * be ready to receive data. 
     219   
     220    * It returns the channel number that was assigned for this stream. 
     221    * Channel allocation should be done using the allocation functions provided by the 
     222    * Ieee1394Service object that is passed in the constructor. 
     223   
     224    * @param i : Stream index 
     225    * @pre @ref i smaller than getStreamCount() 
     226    * @return true if successful, false if not 
     227    */ 
     228    virtual bool startStreamByIndex(int i) = 0; 
     229 
     230    /** 
     231    * @brief stops the stream with index @ref i 
     232   
     233    * @param i : Stream index 
     234    * @pre @ref i smaller than getStreamCount() 
     235    * @return true if successful, false if not 
     236    */ 
     237    virtual bool stopStreamByIndex(int i) = 0; 
    234238 
    235239    /** 
  • trunk/libffado/src/libavc/avc_connect.cpp

    r413 r445  
    1 /* avc_connect.cpp 
    2  * Copyright (C) 2005 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
  • trunk/libffado/src/libavc/avc_connect.h

    r375 r445  
    1 /* avc_connect.h 
    2  * Copyright (C) 2005 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
    21 #ifndef AVCConnect_h 
    22 #define AVCConnect_h 
     24#ifndef AVCCONNECT_H 
     25#define AVCCONNECT_H 
    2326 
    2427#include "avc_generic.h" 
     
    3639 
    3740    virtual const char* getCmdName() const 
    38        { return "ConnectCmd"; } 
     41    { return "ConnectCmd"; } 
    3942}; 
    4043 
    4144 
    42 #endif // AVCConnect_h 
     45#endif // AVCCONNECT_H 
  • trunk/libffado/src/libavc/avc_definitions.cpp

    r415 r445  
    1 /* avc_defintions.cpp 
    2  * Copyright (C) 2005 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
  • trunk/libffado/src/libavc/avc_definitions.h

    r415 r445  
    1 /* avc_definitions.h 
    2  * Copyright (C) 2005 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
    21 #ifndef AVCDefinitions_h 
    22 #define AVCDefinitions_h 
     24#ifndef AVDDEFINITIONS_H 
     25#define AVDDEFINITIONS_H 
    2326 
    2427#include <libavc1394/avc1394.h> 
     
    7073typedef byte_t control_selector_t; 
    7174typedef byte_t control_data_length_t; 
     75typedef uint16_t control_data_ext_length_t; 
     76typedef uint16_t mixer_level_t; 
     77typedef byte_t mixer_programmable_state_t; 
    7278typedef byte_t input_fb_plug_number_t; 
    7379typedef byte_t input_audio_channel_number_t; 
     
    99105/** 
    100106 * \brief Convert from ESamplingFrequency to an integer 
    101  * @param freq  
    102  * @return  
     107 * @param freq 
     108 * @return 
    103109 */ 
    104110int convertESamplingFrequency(ESamplingFrequency freq); 
    105111/** 
    106112 * \brief Convert from integer to ESamplingFrequency 
    107  * @param sampleRate  
    108  * @return  
     113 * @param sampleRate 
     114 * @return 
    109115 */ 
    110116ESamplingFrequency parseSampleRate( int sampleRate ); 
     
    123129#define AVC1394_SUBUNIT_ID_RESERVED 0x06 
    124130 
    125 #endif // AVCDefinitions_h 
     131#endif // AVDDEFINITIONS_H 
  • trunk/libffado/src/libavc/avc_extended_cmd_generic.cpp

    r413 r445  
    1 /* avc_extended_cmd_generic.cpp 
    2  * Copyright (C) 2005 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
     
    461464 
    462465PlugAddressSpecificData::PlugAddressSpecificData( EPlugDirection plugDirection, 
    463                                                  EPlugAddressMode plugAddressMode, 
    464                                                  UnitPlugSpecificDataPlugAddress& unitPlugAddress ) 
     466                          EPlugAddressMode plugAddressMode, 
     467                          UnitPlugSpecificDataPlugAddress& unitPlugAddress ) 
    465468    : m_plugDirection( plugDirection ) 
    466469    , m_addressMode( plugAddressMode ) 
     
    470473 
    471474PlugAddressSpecificData::PlugAddressSpecificData( EPlugDirection plugDirection, 
    472                                                  EPlugAddressMode plugAddressMode, 
    473                                                  SubunitPlugSpecificDataPlugAddress& subUnitPlugAddress ) 
     475                          EPlugAddressMode plugAddressMode, 
     476                          SubunitPlugSpecificDataPlugAddress& subUnitPlugAddress ) 
    474477    : m_plugDirection( plugDirection ) 
    475478    , m_addressMode( plugAddressMode ) 
     
    479482 
    480483PlugAddressSpecificData::PlugAddressSpecificData( EPlugDirection plugDirection, 
    481                                                  EPlugAddressMode plugAddressMode, 
    482                                                  FunctionBlockPlugSpecificDataPlugAddress& functionBlockPlugAddress ) 
     484                          EPlugAddressMode plugAddressMode, 
     485                          FunctionBlockPlugSpecificDataPlugAddress& functionBlockPlugAddress ) 
    483486    : m_plugDirection( plugDirection ) 
    484487    , m_addressMode( plugAddressMode ) 
  • trunk/libffado/src/libavc/avc_extended_cmd_generic.h

    r336 r445  
    1 /* avc_extended_cmd_generic.h 
    2  * Copyright (C) 2005 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
     
    3841        ePT_ExternalPlug     = 0x01, 
    3942        ePT_AsynchronousPlug = 0x02, 
    40        ePT_Unknown          = 0xff, 
     43    ePT_Unknown          = 0xff, 
    4144    }; 
    4245 
     
    205208        ePD_Input     = 0x00, 
    206209        ePD_Output    = 0x01, 
    207        ePD_Undefined = 0xff, 
     210    ePD_Undefined = 0xff, 
    208211    }; 
    209212 
     
    212215        ePAM_Subunit       = 0x01, 
    213216        ePAM_FunctionBlock = 0x02, 
    214        ePAM_Undefined     = 0xff, 
     217    ePAM_Undefined     = 0xff, 
    215218    }; 
    216219 
     
    259262 
    260263    PlugAddressSpecificData( EPlugDirection plugDirection, 
    261                             EPlugAddressMode plugAddressMode, 
    262                             UnitPlugSpecificDataPlugAddress& unitPlugAddress ); 
    263     PlugAddressSpecificData( EPlugDirection plugDirection, 
    264                             EPlugAddressMode plugAddressMode, 
    265                             SubunitPlugSpecificDataPlugAddress& subUnitPlugAddress ); 
    266     PlugAddressSpecificData( EPlugDirection plugDirection, 
    267                             EPlugAddressMode plugAddressMode, 
    268                             FunctionBlockPlugSpecificDataPlugAddress& functionBlockPlugAddress ); 
    269     PlugAddressSpecificData( EPlugDirection plugDirection, 
    270                             EPlugAddressMode plugAddressMode ); 
     264                 EPlugAddressMode plugAddressMode, 
     265                 UnitPlugSpecificDataPlugAddress& unitPlugAddress ); 
     266    PlugAddressSpecificData( EPlugDirection plugDirection, 
     267                 EPlugAddressMode plugAddressMode, 
     268                 SubunitPlugSpecificDataPlugAddress& subUnitPlugAddress ); 
     269    PlugAddressSpecificData( EPlugDirection plugDirection, 
     270                 EPlugAddressMode plugAddressMode, 
     271                 FunctionBlockPlugSpecificDataPlugAddress& functionBlockPlugAddress ); 
     272    PlugAddressSpecificData( EPlugDirection plugDirection, 
     273                 EPlugAddressMode plugAddressMode ); 
    271274    PlugAddressSpecificData( const  PlugAddressSpecificData& pa ); 
    272275 
  • trunk/libffado/src/libavc/avc_extended_plug_info.cpp

    r413 r445  
    1 /* avc_extended_plug_info.cpp 
    2  * Copyright (C) 2005 by Daniel Wagner 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
    33 * 
    4  * This file is part of FreeBoB. 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
    56 * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
    1417 * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
  • trunk/libffado/src/libavc/avc_extended_plug_info.h

    r375 r445  
    1 /* avc_extended_plug_info.h 
    2  * Copyright (C) 2005 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
     
    285288public: 
    286289    enum ESubFunction { 
    287        eSF_ExtendedPlugInfoCmd                  = AVC1394_PLUG_INFO_SUBFUNCTION_EXTENDED_PLUG_INFO_CMD, 
     290    eSF_ExtendedPlugInfoCmd                  = AVC1394_PLUG_INFO_SUBFUNCTION_EXTENDED_PLUG_INFO_CMD, 
    288291        eSF_NotUsed                              = AVC1394_PLUG_INFO_SUBFUNCTION_SERIAL_BUS_NOT_USED, 
    289292    }; 
     
    301304    bool setInfoType( const ExtendedPlugInfoInfoType& infoType ); 
    302305    ExtendedPlugInfoInfoType* getInfoType() 
    303        { return m_infoType; } 
     306    { return m_infoType; } 
    304307 
    305308    virtual const char* getCmdName() const 
    306        { return "ExtendedPlugInfoCmd"; } 
     309    { return "ExtendedPlugInfoCmd"; } 
    307310 
    308311protected: 
  • trunk/libffado/src/libavc/avc_extended_stream_format.cpp

    r413 r445  
    1 /* avc_extended_stream_format.cpp 
    2  * Copyright (C) 2005 by Daniel Wagner 
    3  * 
    4  * This file is part of FreeBoB. 
    5  * 
    6  * FreeBoB is free software; you can redistribute it and/or modify 
    7  * it under the terms of the GNU General Public License as published by 
    8  * the Free Software Foundation; either version 2 of the License, or 
    9  * (at your option) any later version. 
    10  * FreeBoB is distributed in the hope that it will be useful, 
     1/* 
     2 * Copyright (C) 2005-2007 by Daniel Wagner 
     3 * 
     4 * This file is part of FFADO 
     5 * FFADO = Free Firewire (pro-)audio drivers for linux 
     6 * 
     7 * FFADO is based upon FreeBoB 
     8 * 
     9 * This library is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU Lesser General Public 
     11 * License version 2.1, as published by the Free Software Foundation; 
     12 * 
     13 * This library is distributed in the hope that it will be useful, 
    1114 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    13  * GNU General Public License for more details. 
    14  * 
    15  * You should have received a copy of the GNU General Public License 
    16  * along with FreeBoB; if not, write to the Free Software 
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
    18  * MA 02111-1307 USA. 
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     16 * Lesser General Public License for more details. 
     17 * 
     18 * You should have received a copy of the GNU Lesser General Public 
     19 * License along with this library; if not, write to the Free Software 
     20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     21 * MA 02110-1301 USA 
    1922 */ 
    2023 
     
    3841           << ", midi channels: " << info.m_midiChannels << ")"; 
    3942*/ 
    40        stream << "  NbChannels " << (int)info.m_numberOfChannels << ", Format " << (int)info.m_streamFormat; 
     43     stream << "  NbChannels " << (int)info.m_numberOfChannels << ", Format " << (int)info.m_streamFormat; 
    4144    return stream; 
    4245} 
     
    120123{ 
    121124    stream << (int)info.m_samplingFrequency << " Hz (rate control: "; 
    122        stream << (int)info.m_rateControl << ")" << std::endl; 
    123  
    124        for ( FormatInformationStreamsCompound::StreamFormatInfoVector::iterator it = info.m_streamFormatInfos.begin(); 
    125                it != info.m_streamFormatInfos.end(); 
    126                ++it ) 
    127        
    128                StreamFormatInfo* sfi=*it; 
    129                stream << "     > " << *sfi << std::endl; 
    130        
     125    stream << (int)info.m_rateControl << ")" << std::endl; 
     126 
     127    for ( FormatInformationStreamsCompound::StreamF