Changeset 336
- Timestamp:
- 12/25/06 07:42:25 (16 years ago)
- Files:
-
- branches/libfreebob-2.0/.cvsignore (deleted)
- branches/libfreebob-2.0/AUTHORS (modified) (1 diff)
- branches/libfreebob-2.0/ChangeLog (modified) (2 diffs)
- branches/libfreebob-2.0/configure.ac (modified) (6 diffs)
- branches/libfreebob-2.0/libfreebob.pc.in (modified) (1 diff)
- branches/libfreebob-2.0/libfreebob/.cvsignore (deleted)
- branches/libfreebob-2.0/libfreebob/freebob_streaming.h (modified) (6 diffs)
- branches/libfreebob-2.0/libfreebob/Makefile.am (modified) (1 diff)
- branches/libfreebob-2.0/Makefile.am (modified) (1 diff)
- branches/libfreebob-2.0/NEWS (modified) (1 diff)
- branches/libfreebob-2.0/README (modified) (5 diffs)
- branches/libfreebob-2.0/src/.cvsignore (deleted)
- branches/libfreebob-2.0/src/bebob/bebob_avdevice.cpp (modified) (17 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_avdevice.h (modified) (7 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_avdevice_subunit.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_avdevice_subunit.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_avdevice_xml.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_avplug.cpp (modified) (6 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_avplug.h (modified) (5 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_avplug_xml.cpp (modified) (16 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_dl_bcd.cpp (copied) (copied from trunk/libfreebob/src/bebob/bebob_dl_bcd.cpp)
- branches/libfreebob-2.0/src/bebob/bebob_dl_bcd.h (copied) (copied from trunk/libfreebob/src/bebob/bebob_dl_bcd.h)
- branches/libfreebob-2.0/src/bebob/bebob_dl_codes.cpp (copied) (copied from trunk/libfreebob/src/bebob/bebob_dl_codes.cpp)
- branches/libfreebob-2.0/src/bebob/bebob_dl_codes.h (copied) (copied from trunk/libfreebob/src/bebob/bebob_dl_codes.h)
- branches/libfreebob-2.0/src/bebob/bebob_dl_mgr.cpp (copied) (copied from trunk/libfreebob/src/bebob/bebob_dl_mgr.cpp)
- branches/libfreebob-2.0/src/bebob/bebob_dl_mgr.h (copied) (copied from trunk/libfreebob/src/bebob/bebob_dl_mgr.h)
- branches/libfreebob-2.0/src/bebob/bebob_functionblock.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/bebob/bebob_functionblock.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/bebob_light (deleted)
- branches/libfreebob-2.0/src/bounce/bounce_avdevice.cpp (modified) (5 diffs)
- branches/libfreebob-2.0/src/bounce/bounce_avdevice.h (modified) (6 diffs)
- branches/libfreebob-2.0/src/configrom.cpp (modified) (10 diffs)
- branches/libfreebob-2.0/src/configrom.h (modified) (4 diffs)
- branches/libfreebob-2.0/src/debugmodule/.cvsignore (deleted)
- branches/libfreebob-2.0/src/debugmodule/debugmodule.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/debugmodule/debugmodule.h (modified) (6 diffs)
- branches/libfreebob-2.0/src/debugmodule/Makefile.am (deleted)
- branches/libfreebob-2.0/src/devicemanager.cpp (modified) (11 diffs)
- branches/libfreebob-2.0/src/devicemanager.h (modified) (5 diffs)
- branches/libfreebob-2.0/src/fbtypes.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/freebob-downloader.cpp (copied) (copied from trunk/libfreebob/src/freebob-downloader.cpp)
- branches/libfreebob-2.0/src/freebob-sync.cpp (copied) (copied from trunk/libfreebob/src/freebob-sync.cpp)
- branches/libfreebob-2.0/src/freebob.cpp (modified) (3 diffs)
- branches/libfreebob-2.0/src/iavdevice.h (modified) (3 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/.cvsignore (deleted)
- branches/libfreebob-2.0/src/libfreebobavc/avc_connect.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_connect.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_definitions.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_definitions.h (modified) (4 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_extended_cmd_generic.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_extended_cmd_generic.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_extended_plug_info.cpp (modified) (3 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_extended_plug_info.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_extended_stream_format.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_extended_stream_format.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_extended_subunit_info.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_extended_subunit_info.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_function_block.cpp (copied) (copied from trunk/libfreebob/src/libfreebobavc/avc_function_block.cpp)
- branches/libfreebob-2.0/src/libfreebobavc/avc_function_block.h (copied) (copied from trunk/libfreebob/src/libfreebobavc/avc_function_block.h)
- branches/libfreebob-2.0/src/libfreebobavc/avc_generic.cpp (modified) (13 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_generic.h (modified) (5 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_plug_info.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_plug_info.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_signal_source.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_signal_source.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_subunit_info.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_subunit_info.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_unit_info.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/avc_unit_info.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/ieee1394service.cpp (modified) (9 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/ieee1394service.h (modified) (7 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/Makefile.am (deleted)
- branches/libfreebob-2.0/src/libfreebobavc/serialize.cpp (modified) (4 diffs)
- branches/libfreebob-2.0/src/libfreebobavc/serialize.h (modified) (4 diffs)
- branches/libfreebob-2.0/src/libstreaming/freebob_streaming.cpp (modified) (1 diff)
- branches/libfreebob-2.0/src/libstreaming/Makefile.am (deleted)
- branches/libfreebob-2.0/src/libutil/Makefile.am (deleted)
- branches/libfreebob-2.0/src/Makefile.am (modified) (3 diffs)
- branches/libfreebob-2.0/src/maudio (copied) (copied from trunk/libfreebob/src/maudio)
- branches/libfreebob-2.0/src/maudio/maudio_avdevice.cpp (modified) (3 diffs)
- branches/libfreebob-2.0/src/maudio/maudio_avdevice.h (modified) (3 diffs)
- branches/libfreebob-2.0/src/motu/motu_avdevice.cpp (modified) (4 diffs)
- branches/libfreebob-2.0/src/motu/motu_avdevice.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/rme/rme_avdevice.cpp (modified) (4 diffs)
- branches/libfreebob-2.0/src/rme/rme_avdevice.h (modified) (2 diffs)
- branches/libfreebob-2.0/src/threads.h (copied) (copied from trunk/libfreebob/src/threads.h)
- branches/libfreebob-2.0/src/xmlparser.c (modified) (4 diffs)
- branches/libfreebob-2.0/tests/.cvsignore (deleted)
- branches/libfreebob-2.0/tests/Makefile.am (modified) (3 diffs)
- branches/libfreebob-2.0/tests/test-extplugcmd.cpp (modified) (2 diffs)
- branches/libfreebob-2.0/tests/test-freebob.c (modified) (5 diffs)
- branches/libfreebob-2.0/tests/test-fw410.cpp (copied) (copied from trunk/libfreebob/tests/test-fw410.cpp)
- branches/libfreebob-2.0/tests/test-mixer.cpp (copied) (copied from trunk/libfreebob/tests/test-mixer.cpp)
- branches/libfreebob-2.0/tests/test-volume.cpp (copied) (copied from trunk/libfreebob/tests/test-volume.cpp)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libfreebob-2.0/AUTHORS
r125 r336 1 Pieter Palmers <pieterpalmers@users.sourceforge.net> 1 2 Daniel Wagner <wagi@monom.org> 3 Pieter Palmers <pieterpalmers@users.sourceforge.net> 4 Jonathan Woithe <jwoithe@physics.adelaide.edu.au> branches/libfreebob-2.0/ChangeLog
r194 r336 1 2006-11-20 Daniel Wagner <wagi@monom.org> 2 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 9 2006-11-12 Daniel Wagner <wagi@monom.org> 10 11 * test mixer programm added. 12 13 * basic function block AV/C commands added. 14 test program for setting the volume added. 15 16 2006-11-11 Daniel Wagner <wagi@monom.org> 17 18 * src/bebob/bebob_avdevice.cpp (setSamplingFrequencyPlug): copy past 19 error fixed. Reported by Jamie Gennis jgennis at gmail dot com 20 21 2006-08-27 Daniel Wagner <wagi@monom.org> 22 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. 27 28 2006-08-22 Daniel Wagner <wagi@monom.org> 29 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. 33 34 2006-07-17 Daniel Wagner <wagi@monom.org> 35 36 * configure.ac: Version bump to 1.2.0 37 * freebob_sync program added 38 * Basic interface added for sync info 39 40 2006-07-02 Daniel Wagner <wagi@monom.org> 41 42 * firmware downloader: check device firmware compatibility 43 44 2006-06-27 Daniel Wagner <wagi@monom.org> 45 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. 51 52 2006-06-24 Daniel Wagner <wagi@monom.org> 53 54 * tests/streaming/Makefile.am: Fixed build problem with missing '/'. 55 56 2006-06-21 Daniel Wagner <wagi@monom.org> 57 58 * freebob-downloader first version added 59 60 2006-06-10 Daniel Wagner <wagi@monom.org> 61 62 * Changed building rules: No static sub libraries 63 are build anymore. 64 65 2006-06-01 Daniel Wagner <wagi@monom.org> 66 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) 73 74 2006-05-31 Daniel Wagner <wagi@monom.org> 75 76 * Free all allocated asprintf buffers after xmlNewChild. 77 Compiler warning removed 78 79 2006-05-31 Pieter Palmers <pieterpalmers@users.sourceforge.net> 80 * src/devicemanager.cpp: 81 - fixed some memory leaks 82 * src/bebob_light/bebob_light_avdevice.cpp: 83 - fixed some memory leaks 84 - implemented a test to see if the correct AVC subunits are 85 present 86 - fixed a bug that added NULL to the subunit list when an 87 unsupported AVC subunit was found. 88 * src/libfreebobavc/avc_generic.cpp: 89 - fixed memory leak 90 * src/libfreebobavc/ieee1394service.cpp: 91 - fixed memory leak 92 * src/libfreebobavc/avc_extended_plug_info.cpp: 93 - fixed memory leak 94 * src/libfreebobstreaming/messagebuffer.h: 95 - add extern "C" 96 * src/libfreebobstreaming/freebob_streaming.c: 97 - fixed problem with verbosity setting not being passed on 98 - reformatted some error/debug messages 99 * configure.ac: version bump to 0.9.4 100 101 2006-05-29 Pieter Palmers <pieterpalmers@users.sourceforge.net> 102 - implemented a hacked solution to the naming problem when 103 using 2 identical devices. Now the port name is prefixed 104 with "dev#?" with # being the device number (in order of 105 discovery), and the ? being either "c" or "p", meaning 106 "capture" or "playback". Note however that there is no 107 guarantee that device 1 will be the same device next time 108 you start up. This will have to change in 2.0. 109 * configure.ac: version bump to 0.9.3 110 111 2006-05-26 Pieter Palmers <pieterpalmers@users.sourceforge.net> 112 * src/libfreebobstreaming/*: 113 - added a 'verbose' option to disable/enable message output 114 - removed some residual messages 115 * configure.ac: version bump to 0.9.2 116 117 2006-05-24 Pieter Palmers <pieterpalmers@users.sourceforge.net> 118 * README: 119 - updated readme to reflect recent changes 120 * src/libfreebobstreaming/*: 121 - message buffer fix 122 * configure.ac: 123 - Made -O2 the default for non-debug builds 124 - Version bump to 0.9.1 125 126 2006-05-22 Pieter Palmers <pieterpalmers@users.sourceforge.net> 127 * */Makefile.am: 128 - fixed some problems wrt missing files in SVN and in make dist 129 130 * configure.ac: version bump to 0.9.0 (release candidate 1) 131 1 132 2006-05-12 Pieter Palmers <pieterpalmers@users.sourceforge.net> 2 133 * src/libfreebobstreaming/*: … … 348 479 - I use a build dir of $srcdir/obj-$arch-$os) 349 480 350 Both patches are written by Jeremy Kerr <jk@ozlabs.org>481 Both patches are written by Jeremy Kerr jk at ozlabs dot org 351 482 352 483 2006-01-12 Daniel Wagner <wagi@monom.org> branches/libfreebob-2.0/configure.ac
r333 r336 1 # configure.ac - Configure script for FreeBo b.1 # configure.ac - Configure script for FreeBoB. 2 2 # Copyright (C) 2005,06 by Daniel Wagner. 3 3 # Copyright (C) 2006 by Pieter Palmers. 4 4 # 5 # This file is part of FreeBo b.5 # This file is part of FreeBoB. 6 6 # 7 # FreeBo bis free software; you can redistribute it and/or modify7 # FreeBoB is free software; you can redistribute it and/or modify 8 8 # it under the terms of the GNU General Public License as published by 9 9 # the Free Software Foundation; either version 2 of the License, or 10 10 # (at your option) any later version. 11 # FreeBo bis distributed in the hope that it will be useful,11 # FreeBoB is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 15 # You should have received a copy of the GNU General Public License 16 # along with FreeBo b; if not, write to the Free Software16 # along with FreeBoB; if not, write to the Free Software 17 17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 # … … 21 21 22 22 AC_PREREQ(2.57) 23 23 24 24 25 m4_define(freebob_major_version, 1) … … 113 114 # Check for dependencies 114 115 PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.1) 115 PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1. 1.0)116 PKG_CHECK_MODULES(LIBAVC1394, libavc1394 >= 0.5. 2)116 PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1.0.0) 117 PKG_CHECK_MODULES(LIBAVC1394, libavc1394 >= 0.5.3) 117 118 PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0) 118 119 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0) … … 197 198 ) 198 199 199 200 200 CFLAGS="$CFLAGS -Wall -std=gnu99" 201 CXXFLAGS="$CXXFLAGS -Wall "201 CXXFLAGS="$CXXFLAGS -Wall -DDATADIR=\\\"\$(datadir)\\\"" 202 202 203 203 if test "${debug}" = true; then 204 204 CFLAGS="$CFLAGS -g -DDEBUG" 205 205 CXXFLAGS="$CXXFLAGS -g -DDEBUG" 206 else 207 CFLAGS="$CFLAGS -O2" 208 CXXFLAGS="$CXXFLAGS -O2" 206 209 fi; 207 210 … … 230 233 doc/reference.doxygen 231 234 libfreebob/Makefile 232 src/debugmodule/Makefile233 src/libfreebobavc/Makefile234 src/libstreaming/Makefile235 src/libutil/Makefile236 235 src/Makefile 237 236 tests/Makefile … … 244 243 AC_MSG_RESULT([ 245 244 246 FreeBo b$VERSION is now configured for $canonical_host_type245 FreeBoB $VERSION is now configured for $canonical_host_type 247 246 248 247 Source directory: $srcdir branches/libfreebob-2.0/libfreebob.pc.in
r125 r336 5 5 6 6 Name: libfreebob 7 Description: FreeBo b7 Description: FreeBoB 8 8 Version: @VERSION@ 9 9 Libs: -L${libdir} -lfreebob branches/libfreebob-2.0/libfreebob/freebob_streaming.h
r235 r336 1 1 /* 2 * FreeBo bStreaming API3 * FreeBo b= Firewire (pro-)audio for linux2 * FreeBoB Streaming API 3 * FreeBoB = Firewire (pro-)audio for linux 4 4 * 5 5 * http://freebob.sf.net … … 27 27 /* freebob_streaming.h 28 28 * 29 * Specification for the FreeBo bStreaming API29 * Specification for the FreeBoB Streaming API 30 30 * 31 31 */ … … 161 161 162 162 /** 163 * Initializes the streaming from/to a FreeBo b device. A FreeBobdevice163 * Initializes the streaming from/to a FreeBoB device. A FreeBoB device 164 164 * is a virtual device composed of several BeBoB or compatible devices, 165 165 * linked together in one sync domain. … … 189 189 190 190 /** 191 * Finishes the FreeBo bstreaming. Cleans up all internal data structures191 * Finishes the FreeBoB streaming. Cleans up all internal data structures 192 192 * and terminates connections. 193 193 * … … 314 314 315 315 /** 316 * Starts the streaming operation. This initiates the connections to the FreeBo bdevices and316 * Starts the streaming operation. This initiates the connections to the FreeBoB devices and 317 317 * starts the packet handling thread(s). This has to be called before any I/O can occur. 318 318 * … … 324 324 325 325 /** 326 * Stops the streaming operation. This closes the connections to the FreeBo bdevices and326 * Stops the streaming operation. This closes the connections to the FreeBoB devices and 327 327 * stops the packet handling thread(s). 328 328 * branches/libfreebob-2.0/libfreebob/Makefile.am
r222 r336 2 2 # Copyright (C) 2005 by Daniel Wagner. 3 3 # 4 # This file is part of FreeBo b.4 # This file is part of FreeBoB. 5 5 # 6 # FreeBo bis free software; you can redistribute it and/or modify6 # FreeBoB is free software; you can redistribute it and/or modify 7 7 # it under the terms of the GNU General Public License as published by 8 8 # the Free Software Foundation; either version 2 of the License, or 9 9 # (at your option) any later version. 10 # FreeBo bis distributed in the hope that it will be useful,10 # FreeBoB is distributed in the hope that it will be useful, 11 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 13 # GNU General Public License for more details. 14 14 # You should have received a copy of the GNU General Public License 15 # along with FreeBo b; if not, write to the Free Software15 # along with FreeBoB; if not, write to the Free Software 16 16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 18 18 19 19 libfreebobincludedir = $(includedir)/libfreebob 20 20 21 libfreebobinclude_HEADERS = freebob.h freebob_streaming.h xmlparser.h freebob_bounce.h 21 branches/libfreebob-2.0/Makefile.am
r245 r336 2 2 # Copyright (C) 2005 by Daniel Wagner. 3 3 # 4 # This file is part of FreeBo b.4 # This file is part of FreeBoB. 5 5 # 6 # FreeBo bis free software; you can redistribute it and/or modify6 # FreeBoB is free software; you can redistribute it and/or modify 7 7 # it under the terms of the GNU General Public License as published by 8 8 # the Free Software Foundation; either version 2 of the License, or 9 9 # (at your option) any later version. 10 # FreeBo bis distributed in the hope that it will be useful,10 # FreeBoB is distributed in the hope that it will be useful, 11 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 13 # GNU General Public License for more details. 14 14 # You should have received a copy of the GNU General Public License 15 # along with FreeBo b; if not, write to the Free Software15 # along with FreeBoB; if not, write to the Free Software 16 16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 branches/libfreebob-2.0/NEWS
r125 r336 1 01.06.2006: 1.0.0 release candidate of libfreebob called 'Take it away Genghis' release. 1 2 26.12.2005: First beta release of libfreebob called 'late x-mass gift' release. branches/libfreebob-2.0/README
r125 r336 1 FreeBo b version 0.0.11 FreeBoB version 1.0.0 2 2 ===================== 3 3 4 4 This project aims to provide a free driver implemenation for the BeBoB 5 platform. The BeBo bis used in many available IEEE 1394 based break-out5 platform. The BeBoB is used in many available IEEE 1394 based break-out 6 6 boxes. 7 8 This is the first beta release of libfreebob. Currently it depends9 still on the old streaming backend driver from the prealpha-release 2.1.10 In order to use libfreebob you need to download and install it this11 special version.12 13 The device discovering is done completely different to the14 prealpha-release version of freebob. In the old version15 it is done using the descriptors. But this version has several sever16 drawbacks, e.g. not every BeBoB device is supported. This implemention17 now uses a some extended commands like the extended plug info command.18 This allows to discover any BeBoB device. Furthermore it provides19 more information and it is extremly faster... which is of course20 not very important because it is only device discovering and not21 streaming :)22 7 23 8 Dependencies 24 9 ------------ 25 10 26 To build libfreebob you need several libraries. For all libraries a version 27 is provided which is a 'known good' version (all tested with a debian testing 28 installation). The first few libraries it seems it is not necessary that 29 the version must match. The chances that it works also with an older versions 30 are good: 31 32 alsa (>= 1.0.11) 33 libxml2 (>= 2.6.22) 11 To build libfreebob you need several libraries. For all libraries a 12 version is provided which is a 'known good' version. The first few 13 libraries it seems it is not necessary that the version must 14 match. The chances that it works also with an older versions are good: 15 16 alsa (>= 1.0.0) 17 libxml2 (>= 2.6.0) 34 18 libpthread (>= 2.3.5) 35 19 36 20 These libraries here should be at least the version listed: 37 21 38 libraw1394 (>= 1.2.0), http://www.linux1394.org 39 libiec61883 (>= 1.1.0), http://www.linux1394.org 40 libavc1394 (>= 0.5.1), http://sourceforge.net/projects/libavc1394 41 42 And finally, you need the special jackd version which uses libfreebob. 43 It can be downloaded from sf.net as well. 44 22 libraw1394 (>= 1.2.1), http://www.linux1394.org 23 libiec61883 (>= 1.0.0), http://www.linux1394.org 24 libavc1394 (>= 0.5.3), http://sourceforge.net/projects/libavc1394 25 26 Currently only the jackd audio server is supported. 27 28 jackd (>= 0.102.5), http://jackaudio.org 29 30 Optionally, but recommended is that you install qjackctl: 31 32 qjackctl (>= 0.2.20.10), http://sourceforge.net/projects/qjackctl 45 33 46 34 How to build … … 56 44 $ export LD_LIBRARY_PATH=/usr/local/lib 57 45 58 If you want to build the release version you can do following (CVS checkout) 59 60 $ ./autogen.sh 61 $ make install 62 63 If you have not a CVS checkout you can do following: 46 If you want to build the release version you can do following: 64 47 65 48 $ ./configure … … 74 57 $ make install 75 58 76 After you have install libfreebob you can start building the 77 special jack version with the iec61883 backend driver which is using 78 libfreebob. 79 80 81 Testing 82 ------- 83 84 Under the tests directory there is a test program. You should first 85 try to run this. 86 87 If you don't have installed libfreebob then you can adapt your 88 LD_LIBRARY_PATH environment variable to 89 90 $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../src/.libs 91 92 Then you can try running the program without having to install it. 93 94 With the release version you see something like this (note that you 95 have to provide the correct node id, in this example '-n 0'): 96 97 wagi@cruxam:~/src/libfreebob/tests$ ./test-freebob -n 0 discover 98 Using freebob library version: libfreebob 0.0.1 99 100 Direction: 0 (capture) 101 102 Connection Info 103 =============== 104 105 Number of connections: 1 106 107 Connection 0 108 ------------- 109 [ 0] Id: 0 110 [ 0] Port: 0 111 [ 0] Node: 0 112 [ 0] Plug: 0 113 [ 0] Dimension: 7 114 [ 0] Samplerate: 48000 115 [ 0] Number of stream infos: 7 116 117 StreamId Position Location Format Type DPort Name 118 -------------------------------------------------- 119 [ 0]:[ 0] 0x01 0x01 0x06 0x03 0x00 LineOut 1+2 left 120 [ 0]:[ 1] 0x04 0x02 0x06 0x03 0x00 LineOut 1+2 right 121 [ 0]:[ 2] 0x02 0x01 0x06 0x03 0x00 LineOut 3+4 left 122 [ 0]:[ 3] 0x05 0x02 0x06 0x03 0x00 LineOut 3+4 right 123 [ 0]:[ 4] 0x00 0x01 0x06 0x04 0x00 SpdifOut left 124 [ 0]:[ 5] 0x03 0x02 0x06 0x04 0x00 SpdifOut right 125 [ 0]:[ 6] 0x06 0x01 0x0d 0x0a 0x00 MidiPort_1 126 127 128 Direction: 1 (playback) 129 130 Connection Info 131 =============== 132 133 Number of connections: 1 134 135 Connection 0 136 ------------- 137 [ 0] Id: 0 138 [ 0] Port: 0 139 [ 0] Node: 0 140 [ 0] Plug: 0 141 [ 0] Dimension: 7 142 [ 0] Samplerate: 48000 143 [ 0] Number of stream infos: 7 144 145 StreamId Position Location Format Type DPort Name 146 -------------------------------------------------- 147 [ 0]:[ 0] 0x01 0x01 0x06 0x02 0x00 MicIn1 left 148 [ 0]:[ 1] 0x04 0x02 0x06 0x02 0x00 MicIn1 right 149 [ 0]:[ 2] 0x02 0x01 0x06 0x03 0x00 LineIn 3+4 left 150 [ 0]:[ 3] 0x05 0x02 0x06 0x03 0x00 LineIn 3+4 right 151 [ 0]:[ 4] 0x00 0x01 0x06 0x04 0x00 SpdifIn left 152 [ 0]:[ 5] 0x03 0x02 0x06 0x04 0x00 SpdifIn right 153 [ 0]:[ 6] 0x06 0x01 0x0d 0x0a 0x00 MidiPort_1 154 155 156 To impress friends you need of course to use the debug version 157 which looks like this: 158 159 wagi@cruxam:~/src/libfreebob/tests$ ./test-freebob -n 0 discover 160 Using freebob library version: libfreebob 0.0.1 161 162 Debug (avdevice.cpp)[47] AvDevice: Found AvDevice (NodeID 0) 163 Debug (avdevice.cpp)[1262] enumerateSubUnits: subunit_id = 0, subunit_type = 1 (Audio), max_subunit_ID = 0 164 Debug (avdevice.cpp)[1262] enumerateSubUnits: subunit_id = 0, subunit_type = 12 (Music), max_subunit_ID = 0 165 Debug (avdevice.cpp)[169] discoverStep1: number of iso input plugs = 2, number of iso output plugs = 2 166 Debug (avdevice.cpp)[214] discoverStep2: number of output plugs is 1 for iso input plug 0 167 Debug (avdevice.cpp)[251] discoverStep2: output plug 0 is owned by subunit_type 12, subunit_id = 0 168 Debug (avdevice.cpp)[1203] discoverPlugConnection: IsoStreamInput plug 0 has a valid connection to plug 0 of MusicSubunit subunit 0 169 Debug (avdevice.cpp)[214] discoverStep2: number of output plugs is 0 for iso input plug 1 170 Debug (avdevice.cpp)[339] discoverStep3: output plug 0 is owned by subunit_type 12, subunit_id 0 171 Debug (avdevice.cpp)[1203] discoverPlugConnection: IsoStreamOutput plug 0 has a valid connection to plug 0 of MusicSubunit subunit 0 172 Debug (avdevice.cpp)[339] discoverStep3: output plug 5 is owned by subunit_type 12, subunit_id 0 173 Debug (avdevice.cpp)[1203] discoverPlugConnection: IsoStreamOutput plug 1 has a valid connection to plug 5 of MusicSubunit subunit 0 174 Debug (avdevice.cpp)[416] discoverStep4: iso input plug 0 is of type 0 (IsoStream) 175 Debug (avdevice.cpp)[383] discoverStep4: iso input plug 1 has no valid connecton -> skip 176 Debug (avdevice.cpp)[465] discoverStep4: iso output plug 0 is of type 0 (IsoStream) 177 Debug (avdevice.cpp)[465] discoverStep4: iso output plug 1 is of type 3 (Sync) 178 Debug (avdevice.cpp)[524] discoverStep5: iso input plug 0 has 7 channels 179 Debug (avdevice.cpp)[491] discoverStep5: iso input plug 1 has no valid connecton -> skip 180 Debug (avdevice.cpp)[573] discoverStep5: iso output plug 0 has 7 channels 181 Debug (avdevice.cpp)[573] discoverStep5: iso output plug 1 has 2 channels 182 Debug (avdevice.cpp)[636] discoverStep6: iso input plug 0: channel position information retrieved 183 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 184 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 2 185 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 186 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 5 187 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 188 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 189 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 3 190 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 191 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 6 192 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 193 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 194 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 1 195 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 196 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 4 197 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 198 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 1 199 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 7 200 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 201 Debug (avdevice.cpp)[598] discoverStep6: iso input plug 1 has no valid connecton -> skip 202 Debug (avdevice.cpp)[690] discoverStep6: iso output plug 0: channel position information retrieved 203 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 204 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 2 205 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 206 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 5 207 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 208 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 209 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 3 210 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 211 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 6 212 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 213 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 214 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 1 215 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 216 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 4 217 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 218 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 1 219 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 7 220 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 221 Debug (avdevice.cpp)[690] discoverStep6: iso output plug 1: channel position information retrieved 222 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 223 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 1 224 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 225 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 2 226 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 227 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 2: channel name = LineOut 1+2 left 228 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 5: channel name = LineOut 1+2 right 229 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 3: channel name = LineOut 3+4 left 230 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 6: channel name = LineOut 3+4 right 231 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 1: channel name = SpdifOut left 232 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 4: channel name = SpdifOut right 233 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 7: channel name = MidiPort_1 234 Debug (avdevice.cpp)[716] discoverStep7: iso input plug 1 has no valid connecton -> skip 235 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 2: channel name = MicIn1 left 236 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 5: channel name = MicIn1 right 237 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 3: channel name = LineIn 3+4 left 238 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 6: channel name = LineIn 3+4 right 239 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 1: channel name = SpdifIn left 240 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 4: channel name = SpdifIn right 241 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 7: channel name = MidiPort_1 242 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 1 stream position 1: channel name = SynchChannel1 243 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 1 stream position 2: channel name = SynchChannel2 244 Debug (avdevice.cpp)[910] discoverStep8: iso input plug 0: cluster index = 1, portType Line, cluster name = LineOut 1+2 245 Debug (avdevice.cpp)[910] discoverStep8: iso input plug 0: cluster index = 2, portType Line, cluster name = LineOut 3+4 246 Debug (avdevice.cpp)[910] discoverStep8: iso input plug 0: cluster index = 3, portType SPDIF, cluster name = SpdifOut 247 Debug (avdevice.cpp)[910] discoverStep8: iso input plug 0: cluster index = 4, portType MIDI, cluster name = MidiSection.0 248 Debug (avdevice.cpp)[866] discoverStep8: iso input plug 1 has no valid connecton -> skip 249 Debug (avdevice.cpp)[980] discoverStep8: iso output plug 0: cluster index = 1, portType Microphone, cluster name = MicIn1 250 Debug (avdevice.cpp)[980] discoverStep8: iso output plug 0: cluster index = 2, portType Line, cluster name = LineIn 3+4 251 Debug (avdevice.cpp)[980] discoverStep8: iso output plug 0: cluster index = 3, portType SPDIF, cluster name = SpdifIn 252 Debug (avdevice.cpp)[980] discoverStep8: iso output plug 0: cluster index = 4, portType MIDI, cluster name = MidiSection.0 253 Warning (avdevice.cpp)[936] discoverStep8: Skipping plugs with id > 0. Further investigation needed 254 Debug (avdevice.cpp)[1040] discoverStep9: discoverStep9: iso input plug 0 uses sampling frequency 4 255 Debug (avdevice.cpp)[1070] discoverStep9: iso input plug 0 cluster info 1: stream format 6 256 Debug (avdevice.cpp)[1070] discoverStep9: iso input plug 0 cluster info 2: stream format 6 257 Debug (avdevice.cpp)[1070] discoverStep9: iso input plug 0 cluster info 3: stream format 6 258 Debug (avdevice.cpp)[1070] discoverStep9: iso input plug 0 cluster info 4: stream format 13 259 Debug (avdevice.cpp)[1008] discoverStep9: iso input plug 1 has no valid connecton -> skip 260 Debug (avdevice.cpp)[1134] discoverStep9: discoverStep9: iso output plug 0 uses sampling frequency 4 261 Debug (avdevice.cpp)[1164] discoverStep9: iso output plug 0 cluster info 1: stream format 6 262 Debug (avdevice.cpp)[1164] discoverStep9: iso output plug 0 cluster info 2: stream format 6 263 Debug (avdevice.cpp)[1164] discoverStep9: iso output plug 0 cluster info 3: stream format 6 264 Debug (avdevice.cpp)[1164] discoverStep9: iso output plug 0 cluster info 4: stream format 13 265 Debug (avdevice.cpp)[1177] discoverStep9: iso output plug 1 is sync stream with sampling frequency 4 266 Direction: 0 (capture) 267 268 Connection Info 269 =============== 270 271 Number of connections: 1 272 273 Connection 0 274 ------------- 275 [ 0] Id: 0 276 [ 0] Port: 0 277 [ 0] Node: 0 278 [ 0] Plug: 0 279 [ 0] Dimension: 7 280 [ 0] Samplerate: 48000 281 [ 0] Number of stream infos: 7 282 283 StreamId Position Location Format Type DPort Name 284 -------------------------------------------------- 285 [ 0]:[ 0] 0x01 0x01 0x06 0x03 0x00 LineOut 1+2 left 286 [ 0]:[ 1] 0x04 0x02 0x06 0x03 0x00 LineOut 1+2 right 287 [ 0]:[ 2] 0x02 0x01 0x06 0x03 0x00 LineOut 3+4 left 288 [ 0]:[ 3] 0x05 0x02 0x06 0x03 0x00 LineOut 3+4 right 289 [ 0]:[ 4] 0x00 0x01 0x06 0x04 0x00 SpdifOut left 290 [ 0]:[ 5] 0x03 0x02 0x06 0x04 0x00 SpdifOut right 291 [ 0]:[ 6] 0x06 0x01 0x0d 0x0a 0x00 MidiPort_1 292 293 294 Direction: 1 (playback) 295 296 Connection Info 297 =============== 298 299 Number of connections: 1 300 301 Connection 0 302 ------------- 303 [ 0] Id: 0 304 [ 0] Port: 0 305 [ 0] Node: 0 306 [ 0] Plug: 0 307 [ 0] Dimension: 7 308 [ 0] Samplerate: 48000 309 [ 0] Number of stream infos: 7 310 311 StreamId Position Location Format Type DPort Name 312 -------------------------------------------------- 313 [ 0]:[ 0] 0x01 0x01 0x06 0x02 0x00 MicIn1 left 314 [ 0]:[ 1] 0x04 0x02 0x06 0x02 0x00 MicIn1 right 315 [ 0]:[ 2] 0x02 0x01 0x06 0x03 0x00 LineIn 3+4 left 316 [ 0]:[ 3] 0x05 0x02 0x06 0x03 0x00 LineIn 3+4 right 317 [ 0]:[ 4] 0x00 0x01 0x06 0x04 0x00 SpdifIn left 318 [ 0]:[ 5] 0x03 0x02 0x06 0x04 0x00 SpdifIn right 319 [ 0]:[ 6] 0x06 0x01 0x0d 0x0a 0x00 MidiPort_1 59 NOTE: In order to build jackd with freebob support, you have 60 to install libfreebob before you build jackd. 320 61 321 62 … … 323 64 ------------- 324 65 325 In order to get it running you need to provide some arguments to 326 jackd, e.g. 327 328 $ jackd -d iec61883 -n 1 -d 0 -p 512 -b 1000 -b 1000 -i 20 -r 8192 329 330 Note that '-n' most be addapted to your local 1394 bus configuraiton. 331 This is the node number of the device. 332 333 On my screen I get: 334 335 wagi@cruxam:~/src/jack-audio-connection-kit+freebob-0.100.0$ jackd -d iec61883 -n 1 -d 0 -p 512 -b 1000 -b 1000 -i 20 -r 8192 336 jackd 0.100.0 66 The easiest way to run this is using qjackctl. There are only minor 67 differences with the other backends, however you should change some 68 of the default values: 69 - The 'interface' field should contain only a number. This number is 70 the port number of the IEEE1394 host controller the audio device 71 is connected to. For most people this will be '0', but if you have 72 multiple controllers, you have to change this number. 73 - The 'Input channels' and 'Output channels' fields indicate if the 74 backend should provide capture and/or playback channels. If you set 75 these to 0, no channels are created. In order to enable capture and/or 76 playback, you have to set them to a nonzero value. 77 - It is recommended to change the 'periods/buffer' field to 3, especially 78 if you use low period sizes (=< 128) 79 - It is recommended to raise the RT priority to 70. 80 81 In order to get it running from the command line, you need to provide some 82 arguments to jackd. 83 84 Run 85 86 $ jackd -d freebob --help 87 88 to see the backend options. You can easily figure out how to set them using 89 the remarks given above (for qjackctl). 90 91 For the other aspects of jackd usage, consult the jackd documentation. 92 93 Here is a sample session (without realtime support enabled): 94 95 [wagi@halo ~]$ jackd -d freebob 96 jackd 0.102.9 337 97 Copyright 2001-2005 Paul Davis and others. 338 98 jackd comes with ABSOLUTELY NO WARRANTY … … 342 102 JACK compiled with System V SHM support. 343 103 loading driver .. 344 IEC61883: Using libfreebob version libfreebob 0.0.1 345 Debug (avdevice.cpp)[47] AvDevice: Found AvDevice (NodeID 1) 346 Debug (avdevice.cpp)[1262] enumerateSubUnits: subunit_id = 0, subunit_type = 1 (Audio), max_subunit_ID = 0 347 Debug (avdevice.cpp)[1262] enumerateSubUnits: subunit_id = 0, subunit_type = 12 (Music), max_subunit_ID = 0 348 Debug (avdevice.cpp)[169] discoverStep1: number of iso input plugs = 2, number of iso output plugs = 2 349 Debug (avdevice.cpp)[214] discoverStep2: number of output plugs is 1 for iso input plug 0 350 Debug (avdevice.cpp)[251] discoverStep2: output plug 0 is owned by subunit_type 12, subunit_id = 0 351 Debug (avdevice.cpp)[1203] discoverPlugConnection: IsoStreamInput plug 0 has a valid connection to plug 0 of MusicSubunit subunit 0 352 Debug (avdevice.cpp)[214] discoverStep2: number of output plugs is 0 for iso input plug 1 353 Debug (avdevice.cpp)[339] discoverStep3: output plug 0 is owned by subunit_type 12, subunit_id 0 354 Debug (avdevice.cpp)[1203] discoverPlugConnection: IsoStreamOutput plug 0 has a valid connection to plug 0 of MusicSubunit subunit 0 355 Debug (avdevice.cpp)[339] discoverStep3: output plug 5 is owned by subunit_type 12, subunit_id 0 356 Debug (avdevice.cpp)[1203] discoverPlugConnection: IsoStreamOutput plug 1 has a valid connection to plug 5 of MusicSubunit subunit 0 357 Debug (avdevice.cpp)[416] discoverStep4: iso input plug 0 is of type 0 (IsoStream) 358 Debug (avdevice.cpp)[383] discoverStep4: iso input plug 1 has no valid connecton -> skip 359 Debug (avdevice.cpp)[465] discoverStep4: iso output plug 0 is of type 0 (IsoStream) 360 Debug (avdevice.cpp)[465] discoverStep4: iso output plug 1 is of type 3 (Sync) 361 Debug (avdevice.cpp)[524] discoverStep5: iso input plug 0 has 7 channels 362 Debug (avdevice.cpp)[491] discoverStep5: iso input plug 1 has no valid connecton -> skip 363 Debug (avdevice.cpp)[573] discoverStep5: iso output plug 0 has 7 channels 364 Debug (avdevice.cpp)[573] discoverStep5: iso output plug 1 has 2 channels 365 Debug (avdevice.cpp)[636] discoverStep6: iso input plug 0: channel position information retrieved 366 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 367 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 2 368 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 369 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 5 370 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 371 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 372 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 3 373 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 374 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 6 375 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 376 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 377 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 1 378 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 379 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 4 380 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 381 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 1 382 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 7 383 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 384 Debug (avdevice.cpp)[598] discoverStep6: iso input plug 1 has no valid connecton -> skip 385 Debug (avdevice.cpp)[690] discoverStep6: iso output plug 0: channel position information retrieved 386 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 387 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 2 388 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 389 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 5 390 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 391 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 392 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 3 393 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 394 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 6 395 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 396 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 397 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 1 398 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 399 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 4 400 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 401 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 1 402 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 7 403 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 404 Debug (avdevice.cpp)[690] discoverStep6: iso output plug 1: channel position information retrieved 405 Debug (avplug.cpp)[105] debugOutputClusterInfos: number of channels: 2 406 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 1 407 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 1 408 Debug (avplug.cpp)[115] debugOutputClusterInfos: stream position: 2 409 Debug (avplug.cpp)[118] debugOutputClusterInfos: location: 2 410 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 2: channel name = LineOut 1+2 left 411 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 5: channel name = LineOut 1+2 right 412 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 3: channel name = LineOut 3+4 left 413 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 6: channel name = LineOut 3+4 right 414 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 1: channel name = SpdifOut left 415 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 4: channel name = SpdifOut right 416 Debug (avdevice.cpp)[767] discoverStep7: iso input plug 0 stream position 7: channel name = MidiPort_1 417 Debug (avdevice.cpp)[716] discoverStep7: iso input plug 1 has no valid connecton -> skip 418 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 2: channel name = MicIn1 left 419 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 5: channel name = MicIn1 right 420 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 3: channel name = LineIn 3+4 left 421 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 6: channel name = LineIn 3+4 right 422 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 1: channel name = SpdifIn left 423 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 4: channel name = SpdifIn right 424 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 0 stream position 7: channel name = MidiPort_1 425 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 1 stream position 1: channel name = SynchChannel1 426 Debug (avdevice.cpp)[838] discoverStep7: iso output plug 1 stream position 2: channel name = SynchChannel2 427 Debug (avdevice.cpp)[910] discoverStep8: iso input plug 0: cluster index = 1, portType Line, cluster name = LineOut 1+2 428 Debug (avdevice.cpp)[910] discoverStep8: iso input plug 0: cluster index = 2, portType Line, cluster name = LineOut 3+4 429 Debug (avdevice.cpp)[910] discoverStep8: iso input plug 0: cluster index = 3, portType SPDIF, cluster name = SpdifOut 430 Debug (avdevice.cpp)[910] discoverStep8: iso input plug 0: cluster index = 4, portType MIDI, cluster name = MidiSection.0 431 Debug (avdevice.cpp)[866] discoverStep8: iso input plug 1 has no valid connecton -> skip 432 Debug (avdevice.cpp)[980] discoverStep8: iso output plug 0: cluster index = 1, portType Microphone, cluster name = MicIn1 433 Debug (avdevice.cpp)[980] discoverStep8: iso output plug 0: cluster index = 2, portType Line, cluster name = LineIn 3+4 434 Debug (avdevice.cpp)[980] discoverStep8: iso output plug 0: cluster index = 3, portType SPDIF, cluster name = SpdifIn 435 Debug (avdevice.cpp)[980] discoverStep8: iso output plug 0: cluster index = 4, portType MIDI, cluster name = MidiSection.0 436 Warning (avdevice.cpp)[936] discoverStep8: Skipping plugs with id > 0. Further investigation needed 437 Debug (avdevice.cpp)[1040] discoverStep9: discoverStep9: iso input plug 0 uses sampling frequency 4 438 Debug (avdevice.cpp)[1070] discoverStep9: iso input plug 0 cluster info 1: stream format 6 439 Debug (avdevice.cpp)[1070] discoverStep9: iso input plug 0 cluster info 2: stream format 6 440 Debug (avdevice.cpp)[1070] discoverStep9: iso input plug 0 cluster info 3: stream format 6 441 Debug (avdevice.cpp)[1070] discoverStep9: iso input plug 0 cluster info 4: stream format 13 442 Debug (avdevice.cpp)[1008] discoverStep9: iso input plug 1 has no valid connecton -> skip 443 Debug (avdevice.cpp)[1134] discoverStep9: discoverStep9: iso output plug 0 uses sampling frequency 4 444 Debug (avdevice.cpp)[1164] discoverStep9: iso output plug 0 cluster info 1: stream format 6 445 Debug (avdevice.cpp)[1164] discoverStep9: iso output plug 0 cluster info 2: stream format 6 446 Debug (avdevice.cpp)[1164] discoverStep9: iso output plug 0 cluster info 3: stream format 6 447 Debug (avdevice.cpp)[1164] discoverStep9: iso output plug 0 cluster info 4: stream format 13 448 Debug (avdevice.cpp)[1177] discoverStep9: iso output plug 1 is sync stream with sampling frequency 4 449 IEC61883: Adding 1 capture connection(s)... 450 IEC61883: capture connection 0: 0 streams, dim 1 from (0,7,7) 451 IEC61883: adding stream 0: (1,1) 0x06 0x03 -> 0 (LineOut 1+2 left) 452 IEC61883: adding stream 1: (4,2) 0x06 0x03 -> 0 (LineOut 1+2 right) 453 IEC61883: adding stream 2: (2,1) 0x06 0x03 -> 0 (LineOut 3+4 left) 454 IEC61883: adding stream 3: (5,2) 0x06 0x03 -> 0 (LineOut 3+4 right) 455 IEC61883: adding stream 4: (0,1) 0x06 0x04 -> 0 (SpdifOut left) 456 IEC61883: adding stream 5: (3,2) 0x06 0x04 -> 0 (SpdifOut right) 457 IEC61883: adding stream 6: (6,1) 0x0D 0x0A -> 0 (MidiPort_1) 458 IEC61883: Adding 1 playback connection(s)... 459 IEC61883: playback connection 0: 0 streams, dim 1 to (0,7,7) 460 IEC61883: adding stream 0: (1,1) 0x06 0x02 -> 0 (MicIn1 left) 461 IEC61883: adding stream 1: (4,2) 0x06 0x02 -> 0 (MicIn1 right) 462 IEC61883: adding stream 2: (2,1) 0x06 0x03 -> 0 (LineIn 3+4 left) 463 IEC61883: adding stream 3: (5,2) 0x06 0x03 -> 0 (LineIn 3+4 right) 464 IEC61883: adding stream 4: (0,1) 0x06 0x04 -> 0 (SpdifIn left) 465 IEC61883: adding stream 5: (3,2) 0x06 0x04 -> 0 (SpdifIn right) 466 IEC61883: adding stream 6: (6,1) 0x0D 0x0A -> 0 (MidiPort_1) 467 IEC61883D: Creating driver (period_size=512, ringbuffer_size=8192) 468 Creating IEC61883 client... 512/8192/48000 469 poll timeout = 10 ms 470 Creating 7 buffers of 8192 quadlets... 471 IEC61883C: Creating playback connection from node 65473, plug 0 472 prebuffers=0, buffers=1000, irq_interval=20 473 Creating 7 buffers of 8192 quadlets... 474 IEC61883 Client created... 475 IEC61883CM: registered jack port cap_0_1_0_LineOut 1+2 left 476 IEC61883CM: registered jack port cap_0_1_0_LineOut 1+2 right 477 IEC61883CM: registered jack port cap_0_1_0_LineOut 3+4 left 478 IEC61883CM: registered jack port cap_0_1_0_LineOut 3+4 right 479 IEC61883CM: registered jack port cap_0_1_0_SpdifOut left 480 IEC61883CM: registered jack port cap_0_1_0_SpdifOut right 481 IEC61883CM: registered midi port MidiIn_0_1_0_MidiPort_1_1 as 128:0 482 IEC61883CM: registered jack port pbk_0_1_0_MicIn1 left 483 IEC61883CM: registered jack port pbk_0_1_0_MicIn1 right 484 IEC61883CM: registered jack port pbk_0_1_0_LineIn 3+4 left 485 IEC61883CM: registered jack port pbk_0_1_0_LineIn 3+4 right 486 IEC61883CM: registered jack port pbk_0_1_0_SpdifIn left 487 IEC61883CM: registered jack port pbk_0_1_0_SpdifIn right 488 IEC61883CM: registered midi port MidiOut_0_1_0_MidiPort_1_1 as 128:1 489 Client start... 490 creating capture connections... 104 Freebob using Firewire port 0, node -1 491 105 libiec61883 warning: Established connection on channel 0. 492 106 You may need to manually set the channel on the receiving node. 493 Init ISO master receive handler on channel 0...494 (BUFFER=1000,PACKET_MAX=2048,IRQ=20)...495 Start ISO master receive...496 creating playback connections...497 107 libiec61883 warning: Established connection on channel 1. 498 108 You may need to manually set the channel on the transmitting node. 499 Init ISO slave transmit handler on channel 1... 500 other mode (BUFFER=1000,PACKET_MAX=2048,IRQ=20)... 501 Start ISO slave transmit... PREBUFFER=0 502 -> 2618k Packets, Bufferfill (I: 512, O: 0), Packets dropped (I: 0, O: 11), XRUNS ( 0)(1, 8/0) 503 109 110 In case of problems 111 ------------------- 112 113 Under the tests directory there is a test program. You should first 114 try to run this. 115 116 If you don't have installed libfreebob then you can adapt your 117 LD_LIBRARY_PATH environment variable to 118 119 $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../src/.libs 120 121 Then you can try running the program without having to install it. 122 123 With the release version you see something like this: 124 125 wagi@cruxam:~/src/libfreebob/tests$ ./test-freebob discover 126 verbose level = 0 127 Using freebob library version: libfreebob 0.9.0 128 129 port = 2, devices_on_bus = 1 130 get info for device = 0, node = 1 131 Direction: 0 (capture) 132 133 Connection Info 134 =============== 135 136 Number of connections: 1 137 138 Connection 0 139 ------------- 140 [ 0] Id: 0 141 [ 0] Port: 2 142 [ 0] Node: 1 143 [ 0] Plug: 0 144 [ 0] Dimension: 7 145 [ 0] Samplerate: 44100 146 [ 0] IsoChannel: -1 147 [ 0] IsMaster: 0 148 [ 0] Number of stream infos: 8 149 150 StreamId Position Location Format Type DPort Name 151 -------------------------------------------------- 152 [ 0]:[ 0] 0x01 0x01 0x06 0x02 0x00 MicIn 1+2 left 153 [ 0]:[ 1] 0x04 0x02 0x06 0x02 0x00 MicIn 1+2 right 154 [ 0]:[ 2] 0x02 0x01 0x06 0x03 0x00 LineIn 1+2 left 155 [ 0]:[ 3] 0x05 0x02 0x06 0x03 0x00 LineIn 1+2 right 156 [ 0]:[ 4] 0x00 0x01 0x06 0x04 0x00 SpdifIn 1 left 157 [ 0]:[ 5] 0x03 0x02 0x06 0x04 0x00 SpdifIn 1 right 158 [ 0]:[ 6] 0x06 0x01 0x0d 0x0a 0x00 MidiIn2 159 [ 0]:[ 7] 0x06 0x02 0x0d 0x0a 0x00 MidiIn2 160 161 162 Direction: 1 (playback) 163 164 Connection Info 165 =============== 166 167 Number of connections: 1 168 169 Connection 0 170 ------------- 171 [ 0] Id: 0 172 [ 0] Port: 2 173 [ 0] Node: 1 174 [ 0] Plug: 0 175 [ 0] Dimension: 11 176 [ 0] Samplerate: 44100 177 [ 0] IsoChannel: -1 178 [ 0] IsMaster: 0 179 [ 0] Number of stream infos: 12 180 181 StreamId Position Location Format Type DPort Name 182 -------------------------------------------------- 183 [ 0]:[ 0] 0x01 0x01 0x06 0x03 0x00 MultiChannel 7.1 Front left 184 [ 0]:[ 1] 0x06 0x02 0x06 0x03 0x00 MultiChannel 7.1 Front right 185 [ 0]:[ 2] 0x02 0x03 0x06 0x03 0x00 MultiChannel 7.1 Center 186 [ 0]:[ 3] 0x07 0x04 0x06 0x03 0x00 MultiChannel 7.1 Subwoofer 187 [ 0]:[ 4] 0x03 0x05 0x06 0x03 0x00 MultiChannel 7.1 Rear left 188 [ 0]:[ 5] 0x08 0x06 0x06 0x03 0x00 MultiChannel 7.1 Rear right 189 [ 0]:[ 6] 0x04 0x07 0x06 0x03 0x00 MultiChannel 7.1 Surround left 190 [ 0]:[ 7] 0x09 0x08 0x06 0x03 0x00 MultiChannel 7.1 Surround right 191 [ 0]:[ 8] 0x00 0x01 0x06 0x04 0x00 SpdifOut 1 left 192 [ 0]:[ 9] 0x05 0x02 0x06 0x04 0x00 SpdifOut 1 right 193 [ 0]:[10] 0x0a 0x01 0x0d 0x0a 0x00 MidiOut2 194 [ 0]:[11] 0x0a 0x02 0x0d 0x0a 0x00 MidiOut2 195 196 197 If you don't get this, check if you have multiple host controllers, and 198 use the -p parameter to specify them. If you get any error messages, the 199 best way to help us figure out what the problem might be is to build the 200 debug version (./configure --enable-debug). You can then rerun the test 201 application and send us its output. 202 branches/libfreebob-2.0/src/bebob/bebob_avdevice.cpp
r187 r336 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 34 34 35 35 #include <iostream> 36 #include <sstream> 36 37 37 38 namespace BeBoB { … … 39 40 IMPL_DEBUG_MODULE( AvDevice, AvDevice, DEBUG_LEVEL_NORMAL ); 40 41 41 AvDevice::AvDevice( Ieee1394Service& ieee1394service, 42 AvDevice::AvDevice( std::auto_ptr< ConfigRom >( configRom ), 43 Ieee1394Service& ieee1394service, 42 44 int nodeId, 43 45 int verboseLevel ) 44 : m_1394Service( &ieee1394service ) 46 : m_configRom( configRom ) 47 , m_1394Service( &ieee1394service ) 45 48 , m_nodeId( nodeId ) 46 49 , m_verboseLevel( verboseLevel ) 47 50 , m_plugManager( verboseLevel ) 48 { 49 if ( m_verboseLevel ) { 50 setDebugLevel( DEBUG_LEVEL_VERBOSE ); 51 } 51 , m_activeSyncInfo( 0 ) 52 , m_id(0) 53 , m_receiveProcessor ( 0 ) 54 , m_receiveProcessorBandwidth ( -1 ) 55 , m_transmitProcessor ( 0 ) 56 , m_transmitProcessorBandwidth ( -1 ) 57 { 58 setDebugLevel( verboseLevel ); 52 59 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::AvDevice (NodeID %d)\n", 53 60 nodeId ); 54 55 m_configRom = new ConfigRom( m_1394Service, m_nodeId );56 m_configRom->initialize();57 61 } 58 62 59 63 AvDevice::~AvDevice() 60 64 { 61 delete m_configRom;62 65 for ( AvDeviceSubunitVector::iterator it = m_subunits.begin(); 63 66 it != m_subunits.end(); … … 90 93 { 91 94 return *m_configRom; 95 } 96 97 struct VendorModelEntry { 98 unsigned int vendor_id; 99 unsigned int model_id; 100 }; 101 102 static VendorModelEntry supportedDeviceList[] = 103 { 104 {0x00000f, 0x00010065}, // Mackie, Onyx Firewire 105 106 {0x0003db, 0x00010048}, // Apogee Electronics, Rosetta 200 107 108 {0x0007f5, 0x00010048}, // BridgeCo, RD Audio1 109 110 {0x000a92, 0x00010066}, // Presonous FirePOD 111 112 {0x000aac, 0x00000004}, // TerraTec Electronic GmbH, Phase X24 FW (model version 4) 113 {0x000aac, 0x00000007}, // TerraTec Electronic GmbH, Phase X24 FW (model version 7) 114 115 {0x000f1b, 0x00010064}, // ESI, Quatafire 610 116 117 {0x0040ab, 0x00010048}, // EDIROL, FA-101 118 {0x0040ab, 0x00010049}, // EDIROL, FA-66 119 120 {0x00130e, 0x00000003}, // Focusrite, Pro26IO (Saffire 26) 121 }; 122 123 bool 124 AvDevice::probe( ConfigRom& configRom ) 125 { 126 unsigned int vendorId = configRom.getNodeVendorId(); 127 unsigned int modelId = configRom.getModelId(); 128 129 for ( unsigned int i = 0; 130 i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 131 ++i ) 132 { 133 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 134 && ( supportedDeviceList[i].model_id == modelId ) ) 135 { 136 return true; 137 } 138 } 139 140 return false; 92 141 } 93 142 … … 385 434 // Check all possible PCR input to MSU input connections 386 435 // -> sync stream input 387 checkSyncConnections( syncPCRInputPlugs, syncMSUInputPlugs ); 436 checkSyncConnectionsAndAddToList( syncPCRInputPlugs, 437 syncMSUInputPlugs, 438 "Sync Stream Input" ); 388 439 389 440 // Check all possible MSU output to PCR output connections 390 441 // -> sync stream output 391 checkSyncConnections( syncMSUOutputPlugs, syncPCROutputPlugs ); 442 checkSyncConnectionsAndAddToList( syncMSUOutputPlugs, 443 syncPCROutputPlugs, 444 "Sync Stream Output" ); 392 445 393 446 // Check all PCR iso input to MSU input connections 394 447 // -> SYT match 395 checkSyncConnections( isoPCRInputPlugs, syncMSUInputPlugs ); 448 checkSyncConnectionsAndAddToList( isoPCRInputPlugs, 449 syncMSUInputPlugs, 450 "Syt Match" ); 396 451 397 452 // Check all MSU sync output to MSU input connections 398 453 // -> CSP 399 checkSyncConnections( syncMSUOutputPlugs, syncMSUInputPlugs ); 454 checkSyncConnectionsAndAddToList( syncMSUOutputPlugs, 455 syncMSUInputPlugs, 456 "Internal (CSP)" ); 400 457 401 458 // Check all external PCR digital input to MSU input connections 402 459 // -> SPDIF/ADAT sync 403 checkSyncConnections( digitalPCRInputPlugs, syncMSUInputPlugs ); 404 405 406 // Currently active connection signal sourqce cmd, command type 460 checkSyncConnectionsAndAddToList( digitalPCRInputPlugs, 461 syncMSUInputPlugs, 462 "Digital Input Sync" ); 463 464 // Currently active connection signal source cmd, command type 407 465 // status, source unknown, destination MSU sync input plug 408 466 … … 418 476 { 419 477 AvPlug* plug = *jt; 420 plug = plug; // disable compiler warning in release mode 421 // will be optimized away 478 479 for ( SyncInfoVector::iterator it = m_syncInfos.begin(); 480 it != m_syncInfos.end(); 481 ++it ) 482 { 483 SyncInfo* pSyncInfo = &*it; 484 if ( ( pSyncInfo->m_source == plug ) 485 && ( pSyncInfo->m_destination == msuPlug ) ) 486 { 487 m_activeSyncInfo = pSyncInfo; 488 break; 489 } 490 } 422 491 debugOutput( DEBUG_LEVEL_NORMAL, 423 492 "Active Sync Connection: '%s' -> '%s'\n", 424 msuPlug->getName(),425 plug->getName() );493 plug->getName(), 494 msuPlug->getName() ); 426 495 } 427 496 } … … 433 502 AvDevice::enumerateSubUnits() 434 503 { 504 bool musicSubunitFound=false; 505 bool audioSubunitFound=false; 506 435 507 SubUnitInfoCmd subUnitInfoCmd( m_1394Service ); 436 508 //subUnitInfoCmd.setVerbose( 1 ); 437 509 subUnitInfoCmd.setCommandType( AVCCommand::eCT_Status ); 438 510 439 // BeBo bhas always exactly one audio and one music subunit. This511 // BeBoB has always exactly one audio and one music subunit. This 440 512 // means is fits into the first page of the SubUnitInfo command. 441 513 // So there is no need to do more than needed … … 446 518 if ( !subUnitInfoCmd.fire() ) { 447 519 debugError( "Subunit info command failed\n" ); 520 // shouldn't this be an error situation? 521 return false; 448 522 } 449 523 … … 469 543 return false; 470 544 } 545 546 m_subunits.push_back( subunit ); 547 audioSubunitFound=true; 548 471 549 break; 472 550 case AVCCommand::eST_Music: … … 477 555 return false; 478 556 } 557 558 m_subunits.push_back( subunit ); 559 musicSubunitFound=true; 560 479 561 break; 480 562 default: … … 496 578 return false; 497 579 } 498 m_subunits.push_back( subunit ); 499 } 500 501 return true; 580 581 } 582 583 // a BeBoB always has an audio and a music subunit 584 return (musicSubunitFound && audioSubunitFound); 502 585 } 503 586 … … 643 726 return true; 644 727 } 728 729 int 730 AvDevice::getSamplingFrequency( ) { 731 AvPlug* inputPlug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Input, 0 ); 732 if ( !inputPlug ) { 733 debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); 734 return false; 735 } 736 AvPlug* outputPlug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Output, 0 ); 737 if ( !outputPlug ) { 738 debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); 739 return false; 740 } 741 742 int samplerate_playback=inputPlug->getSampleRate(); 743 int samplerate_capture=outputPlug->getSampleRate(); 744 745 if (samplerate_playback != samplerate_capture) { 746 debugWarning("Samplerates for capture and playback differ!\n"); 747 } 748 return samplerate_capture; 749 } 750 645 751 646 752 bool … … 699 805 foundFreq = 700 806 static_cast<ESamplingFrequency>( 701 compoundStream->m_samplingFrequency );807 syncStream->m_samplingFrequency ); 702 808 } 703 809 … … 768 874 769 875 bool 770 AvDevice::checkSyncConnections( AvPlugVector& plhs, AvPlugVector& prhs ) 876 AvDevice::checkSyncConnectionsAndAddToList( AvPlugVector& plhs, 877 AvPlugVector& prhs, 878 std::string syncDescription ) 771 879 { 772 880 for ( AvPlugVector::iterator plIt = plhs.begin(); … … 781 889 AvPlug* pr = *prIt; 782 890 if ( pl->inquireConnnection( *pr ) ) { 891 m_syncInfos.push_back( SyncInfo( *pl, *pr, syncDescription ) ); 783 892 debugOutput( DEBUG_LEVEL_NORMAL, 784 893 "Sync connection '%s' -> '%s'\n", … … 791 900 } 792 901 793 } 902 bool AvDevice::setActiveSync(const SyncInfo& syncInfo) 903 { 904 return syncInfo.m_source->setConnection( *syncInfo.m_destination ); 905 } 906 907 bool AvDevice::setId( unsigned int id) 908 { 909 // FIXME: decent ID system nescessary 910 m_id=id; 911 return true; 912 } 913 914 bool 915 AvDevice::prepare() { 916 /////////// 917 // get plugs 918 919 AvPlug* inputPlug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Input, 0 ); 920 if ( !inputPlug ) { 921 debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); 922 return false; 923 } 924 AvPlug* outputPlug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Output, 0 ); 925 if ( !outputPlug ) { 926 debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); 927 return false; 928 } 929 930 int samplerate=outputPlug->getSampleRate(); 931 m_receiveProcessor=new FreebobStreaming::AmdtpReceiveStreamProcessor( 932 m_1394Service->getPort(), 933 samplerate, 934 outputPlug->getNrOfChannels()); 935 936 if(!m_receiveProcessor->init()) { 937 debugFatal("Could not initialize receive processor!\n"); 938 return false; 939 } 940 941 if (!addPlugToProcessor(*outputPlug,m_receiveProcessor, 942 FreebobStreaming::AmdtpAudioPort::E_Capture)) { 943 debugFatal("Could not add plug to processor!\n"); 944 return false; 945 } 946 947 // do the transmit processor 948 // if (m_snoopMode) { 949 // // we are snooping, so these are receive too. 950 // samplerate=inputPlug->getSampleRate(); 951 // m_receiveProcessor2=new FreebobStreaming::AmdtpReceiveStreamProcessor( 952 // channel, 953 // m_1394Service->getPort(), 954 // samplerate, 955 // inputPlug->getNrOfChannels()); 956 // 957 // if(!m_receiveProcessor2->init()) { 958 // debugFatal("Could not initialize snooping receive processor!\n"); 959 // return false; 960 // } 961 // if (!addPlugToProcessor(*inputPlug,m_receiveProcessor2, 962 // FreebobStreaming::AmdtpAudioPort::E_Capture)) { 963 // debugFatal("Could not add plug to processor!\n"); 964 // return false; 965 // } 966 // } else { 967 // do the transmit processor 968 samplerate=inputPlug->getSampleRate(); 969 m_transmitProcessor=new FreebobStreaming::AmdtpTransmitStreamProcessor( 970 m_1394Service->getPort(), 971 samplerate, 972 inputPlug->getNrOfChannels()); 973 974 if(!m_transmitProcessor->init()) { 975 debugFatal("Could not initialize transmit processor!\n"); 976 return false; 977 978 } 979 980 // FIXME: do this the proper way! 981 m_transmitProcessor->syncmaster=m_receiveProcessor; 982 983 if (!addPlugToProcessor(*inputPlug,m_transmitProcessor, 984 FreebobStreaming::AmdtpAudioPort::E_Playback)) { 985 debugFatal("Could not add plug to processor!\n"); 986 return false; 987 } 988 // } 989 990 return true; 991 } 992 993 bool 994 AvDevice::addPlugToProcessor( 995 AvPlug& plug, 996 FreebobStreaming::StreamProcessor *processor, 997 FreebobStreaming::AmdtpAudioPort::E_Direction direction) { 998 999 AvPlug::ClusterInfoVector& clusterInfos = plug.getClusterInfos(); 1000 for ( AvPlug::ClusterInfoVector::const_iterator it = clusterInfos.begin(); 1001 it != clusterInfos.end(); 1002 ++it ) 1003 { 1004 const AvPlug::ClusterInfo* clusterInfo = &( *it ); 1005 1006 AvPlug::ChannelInfoVector channelInfos = clusterInfo->m_channelInfos; 1007 for ( AvPlug::ChannelInfoVector::const_iterator it = channelInfos.begin(); 1008 it != channelInfos.end(); 1009 ++it ) 1010 { 1011 const AvPlug::ChannelInfo* channelInfo = &( *it ); 1012 std::ostringstream portname; 1013 1014 portname << "dev" << m_id << "_" << channelInfo->m_name; 1015 1016 FreebobStreaming::Port *p=NULL; 1017 switch(clusterInfo->m_portType) { 1018 case ExtendedPlugInfoClusterInfoSpecificData::ePT_Speaker: 1019 case ExtendedPlugInfoClusterInfoSpecificData::ePT_Headphone: 1020 case ExtendedPlugInfoClusterInfoSpecificData::ePT_Microphone: 1021 case ExtendedPlugInfoClusterInfoSpecificData::ePT_Line: 1022 case ExtendedPlugInfoClusterInfoSpecificData::ePT_Analog: 1023 p=new FreebobStreaming::AmdtpAudioPort( 1024 portname.str(), 1025 direction, 1026 // \todo: streaming backend expects indexing starting from 0 1027 // but bebob reports it starting from 1. Decide where 1028 // and how to handle this (pp: here) 1029 channelInfo->m_streamPosition - 1, 1030 channelInfo->m_location, 1031 FreebobStreaming::AmdtpPortInfo::E_MBLA, 1032 clusterInfo->m_portType 1033 ); 1034 break; 1035 1036 case ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI: 1037 p=new FreebobStreaming::AmdtpMidiPort( 1038 portname.str(), 1039 direction, 1040 // \todo: streaming backend expects indexing starting from 0 1041 // but bebob reports it starting from 1. Decide where 1042 // and how to handle this (pp: here) 1043 channelInfo->m_streamPosition - 1, 1044 channelInfo->m_location, 1045 FreebobStreaming::AmdtpPortInfo::E_Midi, 1046 clusterInfo->m_portType 1047 ); 1048 1049 break; 1050 case ExtendedPlugInfoClusterInfoSpecificData::ePT_SPDIF: 1051 case ExtendedPlugInfoClusterInfoSpecificData::ePT_ADAT: 1052 case ExtendedPlugInfoClusterInfoSpecificData::ePT_TDIF: 1053 case ExtendedPlugInfoClusterInfoSpecificData::ePT_MADI: 1054 case ExtendedPlugInfoClusterInfoSpecificData::ePT_Digital: 1055 case ExtendedPlugInfoClusterInfoSpecificData::ePT_NoType: 1056 default: 1057 // unsupported 1058 break; 1059 } 1060 1061 if (!p) { 1062 debugOutput(DEBUG_LEVEL_VERBOSE, "Skipped port %s\n",channelInfo->m_name.c_str()); 1063 } else { 1064 1065 if (!processor->addPort(p)) { 1066 debugWarning("Could not register port with stream processor\n"); 1067 return false; 1068 } 1069 } 1070 } 1071 } 1072 return true; 1073 } 1074 1075 int 1076 AvDevice::getStreamCount() { 1077 return 2; // one receive, one transmit 1078 } 1079 1080 FreebobStreaming::StreamProcessor * 1081 AvDevice::getStreamProcessorByIndex(int i) { 1082 switch (i) { 1083 case 0: 1084 return m_receiveProcessor; 1085 case 1: 1086 // if (m_snoopMode) { 1087 // return m_receiveProcessor2; 1088 // } else { 1089 return m_transmitProcessor; 1090 // } 1091 default: 1092 return NULL; 1093 } 1094 return 0; 1095 } 1096 1097 int 1098 AvDevice::startStreamByIndex(int i) { 1099 int iso_channel=0; 1100 int plug=0; 1101 int hostplug=-1; 1102 1103 // if (m_snoopMode) { 1104 // 1105 // switch (i) { 1106 // case 0: 1107 // // snooping doesn't use CMP, but obtains the info of the channel 1108 // // from the target plug 1109 // 1110 // // TODO: get isochannel from plug 1111 // 1112 // // set the channel obtained by the connection management 1113 // m_receiveProcessor->setChannel(iso_channel); 1114 // break; 1115 // case 1: 1116 // // snooping doesn't use CMP, but obtains the info of the channel 1117 // // from the target plug 1118 // 1119 // // TODO: get isochannel from plug 1120 // 1121 // // set the channel obtained by the connection management 1122 // m_receiveProcessor2->setChannel(iso_channel); 1123 // 1124 // break; 1125 // default: 1126 // return 0; 1127 // } 1128 // } else { 1129 1130 switch (i) { 1131 case 0: 1132 // do connection management: make connection 1133 iso_channel = iec61883_cmp_connect( 1134 m_1394Service->getHandle(), 1135 m_nodeId | 0xffc0, 1136 &plug, 1137 raw1394_get_local_id (m_1394Service->getHandle()), 1138 &hostplug, 1139 &m_receiveProcessorBandwidth); 1140 1141 // set the channel obtained by the connection management 1142 m_receiveProcessor->setChannel(iso_channel); 1143 break; 1144 case 1: 1145 // do connection management: make connection 1146 iso_channel = iec61883_cmp_connect( 1147 m_1394Service->getHandle(), 1148 raw1394_get_local_id (m_1394Service->getHandle()), 1149 &hostplug, 1150 m_nodeId | 0xffc0, 1151 &plug, 1152 &m_transmitProcessorBandwidth); 1153 1154 // set the channel obtained by the connection management 1155 m_transmitProcessor->setChannel(iso_channel); 1156 break; 1157 default: 1158 return 0; 1159 } 1160 // } 1161 1162 return 0; 1163 1164 } 1165 1166 int 1167 AvDevice::stopStreamByIndex(int i) { 1168 // do connection management: break connection 1169 1170 int plug=0; 1171 int hostplug=-1; 1172 // if (m_snoopMode) { 1173 // switch (i) { 1174 // case 0: 1175 // // do connection management: break connection 1176 // 1177 // break; 1178 // case 1: 1179 // // do connection management: break connection 1180 // 1181 // break; 1182 // default: 1183 // return 0; 1184 // } 1185 // } else { 1186 switch (i) { 1187 case 0: 1188 // do connection management: break connection 1189 iec61883_cmp_disconnect( 1190 m_1394Service->getHandle(), 1191 m_nodeId | 0xffc0, 1192 plug, 1193 raw1394_get_local_id (m_1394Service->getHandle()), 1194 hostplug, 1195 m_receiveProcessor->getChannel(), 1196 m_receiveProcessorBandwidth); 1197 1198 break; 1199 case 1: 1200 // do connection management: break connection 1201 iec61883_cmp_disconnect( 1202 m_1394Service->getHandle(), 1203 raw1394_get_local_id (m_1394Service->getHandle()), 1204 hostplug, 1205 m_nodeId | 0xffc0, 1206 plug, 1207 m_transmitProcessor->getChannel(), 1208 m_transmitProcessorBandwidth); 1209 1210 break; 1211 default: 1212 return 0; 1213 } 1214 // } 1215 1216 return 0; 1217 } 1218 1219 1220 } // end of namespace branches/libfreebob-2.0/src/bebob/bebob_avdevice.h
r187 r336 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 32 32 #include "bebob/bebob_avdevice_subunit.h" 33 33 34 #include "libstreaming/AmdtpStreamProcessor.h" 35 #include "libstreaming/AmdtpPort.h" 36 #include "libstreaming/AmdtpPortInfo.h" 37 34 38 #include "iavdevice.h" 35 39 … … 42 46 class AvDevice : public IAvDevice { 43 47 public: 44 AvDevice( Ieee1394Service& ieee1394Service, 48 AvDevice( std::auto_ptr<ConfigRom>( configRom ), 49 Ieee1394Service& ieee1394Service, 45 50 int nodeId, 46 51 int verboseLevel ); 47 52 virtual ~AvDevice(); 48 53 54 static bool probe( ConfigRom& configRom ); 49 55 virtual bool discover(); 50 56 virtual ConfigRom& getConfigRom() const; 57 58 virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 59 virtual int getSamplingFrequency( ); 60 61 virtual int getStreamCount(); 62 virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i); 63 64 virtual bool prepare(); 65 66 virtual int startStreamByIndex(int i); 67 virtual int stopStreamByIndex(int i); 68 51 69 virtual bool addXmlDescription( xmlNodePtr deviceNode ); 52 virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency );53 70 virtual void showDevice() const; 71 virtual bool setId(unsigned int id); 54 72 55 73 Ieee1394Service* get1394Service() 56 74 { return m_1394Service; } 57 75 58 76 AvPlugManager& getPlugManager() 59 { return m_plugManager; } 77 { return m_plugManager; } 78 79 struct SyncInfo { 80 SyncInfo( AvPlug& source, 81 AvPlug& destination, 82 std::string description ) 83 : m_source( &source ) 84 , m_destination( &destination ) 85 , m_description( description ) 86 {} 87 AvPlug* m_source; 88 AvPlug* m_destination; 89 std::string m_description; 90 }; 91 92 typedef std::vector<SyncInfo> SyncInfoVector; 93 const SyncInfoVector& getSyncInfos() const 94 { return m_syncInfos; } 95 const SyncInfo* getActiveSyncInfo() const 96 { return m_activeSyncInfo; } 97 bool setActiveSync( const SyncInfo& syncInfo ); 60 98 61 99 protected: … … 83 121 int id ); 84 122 AvPlugVector getPlugsByType( AvPlugVector& plugs, 85 AvPlug::EAvPlugDirection plugDirection, 86 AvPlug::EAvPlugType type); 123 AvPlug::EAvPlugDirection plugDirection, 124 AvPlug::EAvPlugType type); 125 126 bool addPlugToProcessor( AvPlug& plug, FreebobStreaming::StreamProcessor *processor, 127 FreebobStreaming::AmdtpAudioPort::E_Direction direction); 87 128 88 129 bool setSamplingFrequencyPlug( AvPlug& plug, … … 92 133 void showAvPlugs( AvPlugVector& plugs ) const; 93 134 94 bool checkSyncConnections( AvPlugVector& plhs, AvPlugVector& prhs ); 135 bool checkSyncConnectionsAndAddToList( AvPlugVector& plhs, 136 AvPlugVector& prhs, 137 std::string syncDescription ); 95 138 protected: 139 std::auto_ptr<ConfigRom>( m_configRom ); 96 140 Ieee1394Service* m_1394Service; 97 ConfigRom* m_configRom;98 141 int m_nodeId; 99 142 int m_verboseLevel; … … 108 151 AvPlugManager m_plugManager; 109 152 153 SyncInfoVector m_syncInfos; 154 SyncInfo* m_activeSyncInfo; 155 156 unsigned int m_id; 157 158 // streaming stuff 159 FreebobStreaming::AmdtpReceiveStreamProcessor *m_receiveProcessor; 160 int m_receiveProcessorBandwidth; 161 162 FreebobStreaming::AmdtpTransmitStreamProcessor *m_transmitProcessor; 163 int m_transmitProcessorBandwidth; 164 110 165 DECLARE_DEBUG_MODULE; 111 166 }; branches/libfreebob-2.0/src/bebob/bebob_avdevice_subunit.cpp
r187 r336 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/bebob/bebob_avdevice_subunit.h
r187 r336 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/bebob/bebob_avdevice_xml.cpp
r187 r336 2 2 * Copyright (C) 2006 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/bebob/bebob_avplug.cpp
r187 r336 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 95 95 if ( m_verboseLevel ) { 96 96 setDebugLevel( DEBUG_LEVEL_VERBOSE ); 97 }97 } 98 98 } 99 99 … … 174 174 SignalSourceCmd signalSourceCmd = setSrcPlugAddrToSignalCmd(); 175 175 setDestPlugAddrToSignalCmd( signalSourceCmd, plug ); 176 signalSourceCmd.setCommandType( AVCCommand::eCT_SpecificInquiry ); 176 177 signalSourceCmd.setVerbose( m_verboseLevel ); 177 178 … … 190 191 debugOutput( DEBUG_LEVEL_VERBOSE, 191 192 "Connection not possible between '%s' and '%s'\n", 193 getName(), plug.getName() ); 194 return false; 195 } 196 197 bool 198 AvPlug::setConnection( AvPlug& plug ) 199 { 200 SignalSourceCmd signalSourceCmd = setSrcPlugAddrToSignalCmd(); 201 setDestPlugAddrToSignalCmd( signalSourceCmd, plug ); 202 signalSourceCmd.setCommandType( AVCCommand::eCT_Control ); 203 signalSourceCmd.setVerbose( m_verboseLevel ); 204 205 if ( !signalSourceCmd.fire() ) { 206 debugError( "Could not set connection between '%s' and '%s'\n", 207 getName(), plug.getName() ); 208 return false; 209 } 210 211 if ( signalSourceCmd.getResponse() == AVCCommand::eR_Accepted ) { 212 debugOutput( DEBUG_LEVEL_VERBOSE, 213 "Could set connection between '%s' and '%s'\n", 214 getName(), plug.getName() ); 215 return true; 216 } 217 debugOutput( DEBUG_LEVEL_VERBOSE, 218 "Could not set connection between '%s' and '%s'\n", 192 219 getName(), plug.getName() ); 193 220 return false; … … 1077 1104 1078 1105 signalSourceCmd.setNodeId( m_nodeId ); 1079 signalSourceCmd.setCommandType( AVCCommand::eCT_SpecificInquiry );1080 1106 signalSourceCmd.setSubunitType( AVCCommand::eST_Unit ); 1081 1107 signalSourceCmd.setSubunitId( 0xff ); branches/libfreebob-2.0/src/bebob/bebob_avplug.h
r187 r336 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 88 88 89 89 bool inquireConnnection( AvPlug& plug ); 90 bool setConnection( AvPlug& plug ); 90 91 91 92 int getGlobalId() const … … 131 132 132 133 void showPlug() const; 134 135 136 struct ChannelInfo { 137 stream_position_t m_streamPosition; 138 stream_position_location_t m_location; 139 std::string m_name; 140 }; 141 typedef std::vector<ChannelInfo> ChannelInfoVector; 142 143 struct ClusterInfo { 144 int m_index; 145 port_type_t m_portType; 146 std::string m_name; 147 148 nr_of_channels_t m_nrOfChannels; 149 ChannelInfoVector m_channelInfos; 150 stream_format_t m_streamFormat; 151 }; 152 typedef std::vector<ClusterInfo> ClusterInfoVector; 153 ClusterInfoVector& getClusterInfos() 154 { return m_clusterInfos; } 133 155 134 156 protected: … … 194 216 195 217 // Channel & Cluster Info 196 struct ChannelInfo {197 stream_position_t m_streamPosition;198 stream_position_location_t m_location;199 std::string m_name;200 };201 typedef std::vector<ChannelInfo> ChannelInfoVector;202 203 struct ClusterInfo {204 int m_index;205 port_type_t m_portType;206 std::string m_name;207 208 nr_of_channels_t m_nrOfChannels;209 ChannelInfoVector m_channelInfos;210 stream_format_t m_streamFormat;211 };212 typedef std::vector<ClusterInfo> ClusterInfoVector;213 218 214 219 ClusterInfoVector m_clusterInfos; branches/libfreebob-2.0/src/bebob/bebob_avplug_xml.cpp
r187 r336 2 2 * Copyright (C) 2006 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 53 53 { 54 54 debugError( "Couldn't create 'Direction' node\n" ); 55 return false; 56 } 55 free( result ); 56 return false; 57 } 58 free( result ); 57 59 58 60 xmlNodePtr connection = xmlNewChild( connectionSet, 0, … … 79 81 BAD_CAST "Port", BAD_CAST result ) ) { 80 82 debugError( "Couldn't create 'Port' node\n" ); 81 return false; 82 } 83 free( result ); 84 return false; 85 } 86 free( result ); 83 87 84 88 asprintf( &result, "%d", m_nodeId); … … 86 90 BAD_CAST "Node", BAD_CAST result ) ) { 87 91 debugError( "Couldn't create 'Node' node\n" ); 88 return false; 89 } 92 free( result ); 93 return false; 94 } 95 free( result ); 96 90 97 91 98 asprintf( &result, "%d", m_nrOfChannels ); … … 93 100 BAD_CAST "Dimension", BAD_CAST result ) ) { 94 101 debugError( "Couldn't create 'Dimension' node\n" ); 95 return false; 96 } 102 free( result ); 103 return false; 104 } 105 free( result ); 97 106 98 107 asprintf( &result, "%d", getSampleRate() ); … … 100 109 BAD_CAST "Samplerate", BAD_CAST result ) ) { 101 110 debugError( "Couldn't create 'Samplerate' node\n" ); 102 return false; 103 } 111 free( result ); 112 return false; 113 } 114 free( result ); 104 115 105 116 if ( !xmlNewChild( connection, 0, … … 146 157 { 147 158 debugError( "Couldn't create 'Position' node" ); 148 return false; 149 } 159 free( result ); 160 return false; 161 } 162 free( result ); 150 163 151 164 asprintf( &result, "%d", channelInfo->m_location ); … … 154 167 { 155 168 debugError( "Couldn't create 'Location' node" ); 156 return false; 157 } 169 free( result ); 170 return false; 171 } 172 free( result ); 158 173 159 174 asprintf( &result, "%d", clusterInfo->m_streamFormat ); … … 162 177 { 163 178 debugError( "Couldn't create 'Format' node" ); 164 return false; 165 } 179 free( result ); 180 return false; 181 } 182 free( result ); 166 183 167 184 asprintf( &result, "%d", clusterInfo->m_portType ); … … 170 187 { 171 188 debugError( "Couldn't create 'Type' node" ); 172 return false; 173 } 189 free( result ); 190 return false; 191 } 192 free( result ); 193 174 194 175 195 // \todo XXX: What do to do with DestinationPort value?? … … 179 199 { 180 200 debugError( "Couldn't create 'DestinationPort' node" ); 181 return false; 182 } 201 free( result ); 202 return false; 203 } 204 free( result ); 183 205 184 206 if ( !xmlNewChild( stream, 0, … … 221 243 { 222 244 debugError( "addXmlDescriptionStreamFormats: Could not create 'Direction' node\n" ); 223 return false; 224 } 245 free( result ); 246 return false; 247 } 248 free( result ); 249 225 250 226 251 for ( FormatInfoVector::iterator it = … … 243 268 { 244 269 debugError( "Couldn't create 'Samplerate' node\n" ); 245 return false; 246 } 270 free( result ); 271 return false; 272 } 273 free( result ); 247 274 248 275 asprintf( &result, "%d", formatInfo.m_audioChannels ); … … 251 278 { 252 279 debugError( "Couldn't create 'AudioChannels' node\n" ); 253 return false; 254 } 280 free( result ); 281 return false; 282 } 283 free( result ); 255 284 256 285 asprintf( &result, "%d", formatInfo.m_midiChannels ); … … 259 288 { 260 289 debugError( "Couldn't create 'MidiChannels' node\n" ); 290 free( result ); 261 291 return false; 262 292 } branches/libfreebob-2.0/src/bebob/bebob_functionblock.cpp
r187 r336 2 2 * Copyright (C) 2006 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/bebob/bebob_functionblock.h
r187 r336 2 2 * Copyright (C) 2006 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/bounce/bounce_avdevice.cpp
r242 r336 3 3 * Copyright (C) 2006 by Daniel Wagner 4 4 * 5 * This file is part of FreeBo b.5 * This file is part of FreeBoB. 6 6 * 7 * FreeBo bis free software; you can redistribute it and/or modify7 * FreeBoB is free software; you can redistribute it and/or modify 8 8 * it under the terms of the GNU General Public License as published by 9 9 * the Free Software Foundation; either version 2 of the License, or 10 10 * (at your option) any later version. 11 * FreeBo bis distributed in the hope that it will be useful,11 * FreeBoB is distributed in the hope that it will be useful, 12 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 15 15 * 16 16 * You should have received a copy of the GNU General Public License 17 * along with FreeBo b; if not, write to the Free Software17 * along with FreeBoB; if not, write to the Free Software 18 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 19 19 * MA 02111-1307 USA. … … 44 44 IMPL_DEBUG_MODULE( BounceDevice, BounceDevice, DEBUG_LEVEL_VERBOSE ); 45 45 46 BounceDevice::BounceDevice( Ieee1394Service& ieee1394service, 46 47 BounceDevice::BounceDevice( std::auto_ptr< ConfigRom >( configRom ), 48 Ieee1394Service& ieee1394service, 47 49 int nodeId, 48 50 int verboseLevel ) 49 : m_1394Service( &ieee1394service ) 51 : m_configRom( configRom ) 52 , m_1394Service( &ieee1394service ) 50 53 , m_nodeId( nodeId ) 51 54 , m_verboseLevel( verboseLevel ) … … 57 60 , m_transmitProcessorBandwidth ( -1 ) 58 61 { 59 setDebugLevel( m_verboseLevel );62 setDebugLevel( verboseLevel ); 60 63 61 64 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Bounce::BounceDevice (NodeID %d)\n", 62 65 nodeId ); 63 m_configRom = new ConfigRom( m_1394Service, m_nodeId );64 m_configRom->initialize();65 66 } 66 67 67 68 BounceDevice::~BounceDevice() 68 69 { 69 delete m_configRom; 70 70 71 } 71 72 … … 74 75 { 75 76 return *m_configRom; 77 } 78 79 struct VendorModelEntry { 80 unsigned int vendor_id; 81 unsigned int model_id; 82 }; 83 84 static VendorModelEntry supportedDeviceList[] = 85 { 86 // {0x0000, 0x000000}, 87 }; 88 89 bool 90 BounceDevice::probe( ConfigRom& configRom ) 91 { 92 unsigned int vendorId = configRom.getNodeVendorId(); 93 unsigned int modelId = configRom.getModelId(); 94 95 for ( unsigned int i = 0; 96 i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 97 ++i ) 98 { 99 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 100 && ( supportedDeviceList[i].model_id == modelId ) 101 ) 102 { 103 return true; 104 } 105 } 106 107 return false; 76 108 } 77 109 branches/libfreebob-2.0/src/bounce/bounce_avdevice.h
r242 r336 3 3 * Copyright (C) 2006 by Daniel Wagner 4 4 * 5 * This file is part of FreeBo b.5 * This file is part of FreeBoB. 6 6 * 7 * FreeBo bis free software; you can redistribute it and/or modify7 * FreeBoB is free software; you can redistribute it and/or modify 8 8 * it under the terms of the GNU General Public License as published by 9 9 * the Free Software Foundation; either version 2 of the License, or 10 10 * (at your option) any later version. 11 * FreeBo bis distributed in the hope that it will be useful,11 * FreeBoB is distributed in the hope that it will be useful, 12 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 15 15 * 16 16 * You should have received a copy of the GNU General Public License 17 * along with FreeBo b; if not, write to the Free Software17 * along with FreeBoB; if not, write to the Free Software 18 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 19 19 * MA 02111-1307 USA. … … 27 27 #include "libfreebobavc/avc_extended_cmd_generic.h" 28 28 #include "libfreebob/xmlparser.h" 29 30 #include "bebob_light/bebob_light_avplug.h"31 #include "bebob_light/bebob_light_avdevicesubunit.h"32 29 33 30 #include "libstreaming/AmdtpStreamProcessor.h" … … 45 42 class BounceDevice : public IAvDevice { 46 43 public: 47 BounceDevice( Ieee1394Service& ieee1394Service, 44 BounceDevice( std::auto_ptr<ConfigRom>( configRom ), 45 Ieee1394Service& ieee1394Service, 48 46 int nodeId, 49 47 int verboseLevel ); 50 48 virtual ~BounceDevice(); 51 49 50 static bool probe( ConfigRom& configRom ); 52 51 virtual bool discover(); 53 52 virtual ConfigRom& getConfigRom() const; … … 58 57 virtual int getSamplingFrequency( ); 59 58 60 virtual bool setId(unsigned int id);61 62 59 virtual bool prepare(); 63 60 … … 71 68 72 69 virtual void showDevice() const; 70 virtual bool setId(unsigned int id); 73 71 74 72 protected: 73 std::auto_ptr<ConfigRom>( m_configRom ); 75 74 Ieee1394Service* m_1394Service; 76 ConfigRom* m_configRom;77 75 int m_nodeId; 78 76 int m_verboseLevel; branches/libfreebob-2.0/src/configrom.cpp
r262 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 26 26 27 27 #include <iostream> 28 #include <iomanip> 28 29 29 30 using namespace std; … … 54 55 //------------------------------------------------------------- 55 56 56 ConfigRom::ConfigRom( Ieee1394Service *ieee1394service, fb_nodeid_t nodeId )57 : m_1394Service( ieee1394service )57 ConfigRom::ConfigRom( Ieee1394Service& ieee1394service, fb_nodeid_t nodeId ) 58 : m_1394Service( &ieee1394service ) 58 59 , m_nodeId( nodeId ) 59 60 , m_avcDevice( false ) … … 61 62 , m_vendorName( "" ) 62 63 , m_modelName( "" ) 64 , m_vendorId( 0 ) 65 , m_modelId( 0 ) 63 66 , m_unit_specifier_id( 0 ) 64 67 , m_unit_version( 0 ) 68 , m_isIsoResourceManager( false ) 69 , m_isCycleMasterCapable( false ) 70 , m_isSupportIsoOperations( false ) 71 , m_isBusManagerCapable( false ) 72 , m_cycleClkAcc( 0 ) 73 , m_maxRec( 0 ) 74 , m_nodeVendorId( 0 ) 75 , m_chipIdHi( 0 ) 76 , m_chipIdLow( 0 ) 65 77 , m_vendorNameKv( 0 ) 66 78 , m_modelNameKv( 0 ) … … 84 96 &csr_info ); 85 97 if (!m_csr || csr1212_parse_csr( m_csr ) != CSR1212_SUCCESS) { 86 debugError( "Could not parse config rom ");98 debugError( "Could not parse config rom of node %d on port %d", m_nodeId, m_1394Service->getPort() ); 87 99 if (m_csr) { 88 100 csr1212_destroy_csr(m_csr); … … 92 104 } 93 105 106 // Process Bus_Info_Block 107 m_isIsoResourceManager = CSR1212_BE32_TO_CPU(m_csr->bus_info_data[2] ) >> 31; 108 m_isCycleMasterCapable = ( CSR1212_BE32_TO_CPU(m_csr->bus_info_data[2] ) >> 30 ) & 0x1; 109 m_isSupportIsoOperations = ( CSR1212_BE32_TO_CPU(m_csr->bus_info_data[2] ) >> 29 ) & 0x1; 110 m_isBusManagerCapable = ( CSR1212_BE32_TO_CPU(m_csr->bus_info_data[2] ) >> 28 ) & 0x1; 111 m_cycleClkAcc = ( CSR1212_BE32_TO_CPU(m_csr->bus_info_data[2] ) >> 16 ) & 0xff; 112 m_maxRec = ( CSR1212_BE32_TO_CPU( m_csr->bus_info_data[2] ) >> 12 ) & 0xf; 113 m_nodeVendorId = ( CSR1212_BE32_TO_CPU( m_csr->bus_info_data[3] ) >> 8 ); 114 m_chipIdHi = ( CSR1212_BE32_TO_CPU( m_csr->bus_info_data[3] ) ) & 0xff; 115 m_chipIdLow = CSR1212_BE32_TO_CPU( m_csr->bus_info_data[4] ); 116 117 // Process Root Directory 94 118 processRootDirectory(m_csr); 95 119 … … 151 175 } 152 176 153 const bool154 ConfigRom::isAvcDevice() const155 {156 return m_avcDevice;157 }158 159 // XXX This might work only for the M-Audio Audiophile160 // but can easily extended.161 #define VENDOR_ID_MAUDIO 0x00000d6c162 #define MODEL_ID_MAUDIO_BOOTLOADER 0x00010060163 164 const bool165 ConfigRom::isBootloader() const166 {167 if ( ( m_vendorId == VENDOR_ID_MAUDIO )168 && ( m_modelId == MODEL_ID_MAUDIO_BOOTLOADER ) )169 {170 return true;171 }172 return false;173 }174 175 177 static int 176 178 busRead( struct csr1212_csr* csr, … … 182 184 struct config_csr_info* csr_info = (struct config_csr_info*) private_data; 183 185 184 if ( csr_info->service->read( csr_info->nodeId,185 addr,186 length,187 ( quadlet_t* )buffer) )186 if ( !csr_info->service->read( csr_info->nodeId, 187 addr, 188 length/4, 189 ( quadlet_t* )buffer) ) 188 190 { 189 //debugOutput( DEBUG_LEVEL_VERBOSE, "ConfigRom: Read failed\n");191 //debugOutput( DEBUG_LEVEL_VERBOSE, "ConfigRom: Read failed\n"); 190 192 return -1; 191 193 } … … 380 382 return m_unit_version; 381 383 } 384 385 bool 386 ConfigRom::updatedNodeId() 387 { 388 struct csr1212_csr* csr = 0; 389 for ( fb_nodeid_t nodeId = 0; 390 nodeId < m_1394Service->getNodeCount(); 391 ++nodeId ) 392 { 393 struct config_csr_info csr_info; 394 csr_info.service = m_1394Service; 395 csr_info.nodeId = 0xffc0 | nodeId; 396 397 csr = csr1212_create_csr( &configrom_csr1212_ops, 398 5 * sizeof(fb_quadlet_t), // XXX Why 5 ?!? 399 &csr_info ); 400 401 if (!csr || csr1212_parse_csr( csr ) != CSR1212_SUCCESS) { 402 if (csr) { 403 csr1212_destroy_csr(csr); 404 } 405 continue; 406 } 407 408 409 octlet_t guid = 410 ((u_int64_t)CSR1212_BE32_TO_CPU(csr->bus_info_data[3]) << 32) 411 | CSR1212_BE32_TO_CPU(csr->bus_info_data[4]); 412 413 if ( guid == getGuid() ) { 414 if ( nodeId != getNodeId() ) { 415 debugOutput( DEBUG_LEVEL_VERBOSE, 416 "Device with GUID 0x%08x%08x changed node id " 417 "from %d to %d\n", 418 ( unsigned int ) ( getGuid() >> 32 ), 419 ( unsigned int ) ( getGuid() & 0xffffffff ), 420 getNodeId(), 421 nodeId ); 422 m_nodeId = nodeId; 423 } 424 if (csr) { 425 csr1212_destroy_csr(csr); 426 } 427 return true; 428 } 429 } 430 431 if (csr) { 432 csr1212_destroy_csr(csr); 433 } 434 435 debugOutput( DEBUG_LEVEL_NORMAL, 436 "Device with GUID 0x%08x%08x could not be found on " 437 "the bus anymore (removed?)\n", 438 m_guid >> 32, 439 m_guid & 0xffffffff ); 440 return false; 441 } 442 443 void 444 ConfigRom::printConfigRom() const 445 { 446 using namespace std; 447 printf( "Config ROM\n" ); 448 printf( "\tCurrent Node Id:\t%d\n", getNodeId() ); 449 printf( "\tGUID:\t\t\t0x%08x%08x\n", 450 ( unsigned int )( getGuid() >> 32 ), 451 ( unsigned int ) ( getGuid() & 0xffffffff ) ); 452 printf( "\tVendor Name:\t\t%s\n", getVendorName().c_str() ); 453 printf( "\tModel Name:\t\t%s\n", getModelName().c_str() ); 454 printf( "\tNode Vendor ID:\t\t0x%06x\n", getNodeVendorId() ); 455 printf( "\tModel Id:\t\t0x%08x\n", getModelId() ); 456 printf( "\tISO resource manager:\t%d\n", isIsoResourseManager() ); 457 printf( "\tCycle master capable:\t%d\n", isSupportsIsoOperations() ); 458 printf( "\tBus manager capable:\t%d\n", isBusManagerCapable() ); 459 printf( "\tCycle clock accurancy:\t%d\n", getCycleClockAccurancy() ); 460 printf( "\tMax rec:\t\t%d (max asy payload: %d bytes)\n", 461 getMaxRec(), getAsyMaxPayload() ); 462 } 463 464 unsigned short 465 ConfigRom::getAsyMaxPayload() const 466 { 467 // XXX use pow instead? 468 return 1 << ( m_maxRec + 1 ); 469 } branches/libfreebob-2.0/src/configrom.h
r262 r336 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 33 33 class ConfigRom { 34 34 public: 35 ConfigRom( Ieee1394Service *ieee1394service, fb_nodeid_t nodeId );35 ConfigRom( Ieee1394Service& ieee1394service, fb_nodeid_t nodeId ); 36 36 virtual ~ConfigRom(); 37 37 38 38 bool initialize(); 39 39 40 const bool isAvcDevice() const;41 const bool isBootloader() const;42 40 const fb_nodeid_t getNodeId() const; 43 41 const fb_octlet_t getGuid() const; 44 42 const std::string getModelName() const; 45 43 const std::string getVendorName() const; 44 46 45 const unsigned int getModelId() const; 47 46 const unsigned int getVendorId() const; 48 47 const unsigned int getUnitSpecifierId() const; 49 48 const unsigned int getUnitVersion() const; 50 49 50 bool isIsoResourseManager() const 51 { return m_isIsoResourceManager; } 52 bool isCycleMasterCapable() const 53 { return m_isCycleMasterCapable; } 54 bool isSupportsIsoOperations() const 55 { return m_isSupportIsoOperations; } 56 bool isBusManagerCapable() const 57 { return m_isBusManagerCapable; } 58 fb_byte_t getCycleClockAccurancy() const 59 { return m_cycleClkAcc; } 60 fb_byte_t getMaxRec() const 61 { return m_maxRec; } 62 unsigned short getAsyMaxPayload() const; 63 64 fb_quadlet_t getNodeVendorId() const 65 { return m_nodeVendorId; } 66 67 bool updatedNodeId(); 68 69 void printConfigRom() const; 70 51 71 protected: 52 72 void processUnitDirectory( struct csr1212_csr* csr, … … 66 86 unsigned int m_unit_specifier_id; 67 87 unsigned int m_unit_version; 88 bool m_isIsoResourceManager; 89 bool m_isCycleMasterCapable; 90 bool m_isSupportIsoOperations; 91 bool m_isBusManagerCapable; 92 fb_byte_t m_cycleClkAcc; 93 fb_byte_t m_maxRec; 94 fb_quadlet_t m_nodeVendorId; 95 fb_byte_t m_chipIdHi; 96 fb_quadlet_t m_chipIdLow; 68 97 69 98 /* only used during parsing */ branches/libfreebob-2.0/src/debugmodule/debugmodule.cpp
r253 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/debugmodule/debugmodule.h
r266 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.5 * 6 * FreeBo bis free software; you can redistribute it and/or modify4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 82 82 #define setDebugLevel( Level ) { \ 83 83 m_debugModule.setLevel( Level ); \ 84 m_debugModule.print( Level, \ 84 } 85 86 /* m_debugModule.print( eDL_Normal, \ 85 87 __FILE__, \ 86 88 __FUNCTION__, \ … … 88 90 "Setting debug level to %d\n", \ 89 91 Level ); \ 90 } 91 #define getDebugLevel( Level ) \ 92 }*/ 93 94 #define getDebugLevel( ) \ 92 95 m_debugModule.getLevel( ) 93 96 … … 167 170 eDL_Warning = 2, 168 171 eDL_Normal = 3, 169 eDL_Verbose = 4, 170 eDL_VeryVerbose = 5, 172 eDL_Info = 4, 173 eDL_Verbose = 5, 174 eDL_VeryVerbose = 6, 171 175 } EDebugLevel; 172 176 … … 202 206 203 207 #define DEBUG_LEVEL_NORMAL DebugModule::eDL_Normal 208 #define DEBUG_LEVEL_INFO DebugModule::eDL_Info 204 209 #define DEBUG_LEVEL_VERBOSE DebugModule::eDL_Verbose 205 210 #define DEBUG_LEVEL_VERY_VERBOSE DebugModule::eDL_VeryVerbose branches/libfreebob-2.0/src/devicemanager.cpp
r331 r336 1 /* devicemanager.cpp1 /* devicemanager.cpp 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 28 28 #include "debugmodule/debugmodule.h" 29 29 #include "bebob/bebob_avdevice.h" 30 #include "bebob_light/bebob_light_avdevice.h"31 30 #include "bounce/bounce_avdevice.h" 32 31 #include "motu/motu_avdevice.h" 33 32 #include "rme/rme_avdevice.h" 33 #include "maudio/maudio_avdevice.h" 34 34 35 35 #include <iostream> … … 53 53 : m_1394Service( 0 ) 54 54 { 55 m_probeList.push_back( probeBeBoB ); 56 m_probeList.push_back( probeMotu ); 57 m_probeList.push_back( probeRme ); 58 m_probeList.push_back( probeBounce ); 55 59 56 } 60 57 … … 93 90 DeviceManager::discover( int verboseLevel ) 94 91 { 95 if ( verboseLevel ) { 92 switch ( verboseLevel ) { 93 case 3: 94 m_1394Service->setVerbose( true ); 95 case 1: 96 96 setDebugLevel( DEBUG_LEVEL_VERBOSE ); 97 97 } 98 98 99 for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 99 100 it != m_avDevices.end(); … … 109 110 { 110 111 debugOutput( DEBUG_LEVEL_VERBOSE, "Probing node %d...\n", nodeId ); 111 112 ConfigRom configRom( m_1394Service, nodeId ); 113 if ( !configRom.initialize() ) { 114 // \todo If a PHY on the bus in power safe mode than 112 113 std::auto_ptr<ConfigRom> configRom = 114 std::auto_ptr<ConfigRom>( new ConfigRom( *m_1394Service, 115 nodeId ) ); 116 if ( !configRom->initialize() ) { 117 // \todo If a PHY on the bus is in power safe mode then 115 118 // the config rom is missing. So this might be just 116 // such acase and we can safely skip it. But it might119 // such this case and we can safely skip it. But it might 117 120 // be there is a real software problem on our side. 118 121 // This should be handled more carefuly. … … 124 127 } 125 128 126 for ( ProbeFunctionVector::iterator it = m_probeList.begin(); 127 it != m_probeList.end(); 128 ++it ) 129 { 130 ProbeFunction func = *it; 131 IAvDevice* avDevice = func(*m_1394Service, configRom, nodeId, verboseLevel); 132 if ( avDevice ) { 133 m_avDevices.push_back( avDevice ); 134 if (!avDevice->setId(m_avDevices.size())) { 135 debugError("Could not set Id of AvDevice\n"); 136 } 137 if ( verboseLevel ) { 138 avDevice->showDevice(); 139 } 140 break; 129 IAvDevice* avDevice = getDriverForDevice( configRom, 130 nodeId, 131 verboseLevel ); 132 if ( avDevice ) { 133 debugOutput( DEBUG_LEVEL_NORMAL, 134 "discover: driver found for device %d\n", 135 nodeId ); 136 137 if ( !avDevice->discover() ) { 138 debugError( "discover: could not discover device\n" ); 139 delete avDevice; 140 continue; 141 141 } 142 } 143 142 143 if ( !avDevice->setId( m_avDevices.size() ) ) { 144 debugError( "setting Id failed\n" ); 145 } 146 if ( verboseLevel ) { 147 avDevice->showDevice(); 148 } 149 150 m_avDevices.push_back( avDevice ); 151 } 144 152 } 145 153 … … 149 157 150 158 IAvDevice* 151 DeviceManager::probeBeBoB(Ieee1394Service& service, ConfigRom& configRom, int id, int level) 152 { 153 IAvDevice* avDevice; 154 155 // All BeBob devices have predictable unit specifier/version fields 156 if (configRom.getUnitSpecifierId() != BEBOB_AVCDEVICE_UNIT_SPECIFIER || 157 configRom.getUnitVersion() != BEBOB_AVCDEVICE_UNIT_VERSION) { 158 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a BeBoB device, fails ConfigRom test...\n" ); 159 return NULL; 160 } 161 162 avDevice = new BeBoB_Light::AvDevice( service, id, level ); 163 if ( !avDevice ) { 164 return NULL; 165 } 166 167 if ( !avDevice->discover() ) { 168 delete avDevice; 169 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a BeBoB device, fails discovery...\n" ); 170 return NULL; 171 } 172 debugOutput( DEBUG_LEVEL_VERBOSE, "BeBoB device discovered...\n" ); 173 return avDevice; 174 } 175 176 IAvDevice* 177 DeviceManager::probeBounce(Ieee1394Service& service, ConfigRom& configRom, int id, int level) 178 { 179 IAvDevice* avDevice; 180 181 // All Bounce devices have predictable unit specifier/version fields 182 if (configRom.getUnitSpecifierId() != BEBOB_AVCDEVICE_UNIT_SPECIFIER || 183 configRom.getUnitVersion() == BEBOB_AVCDEVICE_UNIT_VERSION) { 184 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a Bounce device...\n" ); 185 return NULL; 186 } 187 188 avDevice = new Bounce::BounceDevice( service, id, level ); 189 if ( !avDevice ) { 190 return NULL; 191 } 192 193 if ( !avDevice->discover() ) { 194 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a Bounce device...\n"); 195 delete avDevice; 196 return NULL; 197 } 198 debugOutput( DEBUG_LEVEL_VERBOSE, "Bounce device discovered...\n"); 199 200 return avDevice; 201 } 202 203 IAvDevice* 204 DeviceManager::probeMotu(Ieee1394Service& service, ConfigRom& configRom, int id, int level) 205 { 206 IAvDevice* avDevice; 207 208 // Do a first-pass test to see if it's likely that this device is a MOTU 209 if (configRom.getUnitSpecifierId() != MOTU_VENDOR_ID) { 210 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a MOTU device...\n"); 211 return NULL; 212 } 213 214 avDevice = new Motu::MotuDevice( service, id, level ); 215 if ( !avDevice ) { 216 return NULL; 217 } 218 219 // MOTU's discover() needs to differentiate between different models, so 220 // for now keep all probing code in there since it's very intermingled. 221 // By this point it's fairly certain that we are dealing with a MOTU but 222 // in any case the code is robust in the event that the device isn't a 223 // MOTU, so at this stage there seems no reason to do otherwise. 224 if ( !avDevice->discover() ) { 225 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a MOTU device...\n"); 226 delete avDevice; 227 return NULL; 228 } 229 debugOutput( DEBUG_LEVEL_VERBOSE, "MOTU device discovered...\n"); 230 231 return avDevice; 232 } 233 234 IAvDevice* 235 DeviceManager::probeRme(Ieee1394Service& service, ConfigRom& configRom, int id, int level) 236 { 237 IAvDevice* avDevice; 238 239 // Do a first-pass test to see if it's likely that this device is a RME 240 if (configRom.getUnitSpecifierId() != RME_VENDOR_ID) { 241 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a RME device...\n"); 242 return NULL; 243 } 244 245 avDevice = new Rme::RmeDevice( service, id, level ); 246 if ( !avDevice ) { 247 return NULL; 248 } 249 250 // RME's discover() needs to differentiate between different models, so 251 // for now keep all probing code in there since that's how we had to 252 // do it for MOTU. If RME turns out to be simpler we could move the 253 // logic into here. 254 if ( !avDevice->discover() ) { 255 debugOutput( DEBUG_LEVEL_VERBOSE, "Not a RME device...\n"); 256 delete avDevice; 257 return NULL; 258 } 259 debugOutput( DEBUG_LEVEL_VERBOSE, "RME device discovered...\n"); 260 261 return avDevice; 159 DeviceManager::getDriverForDevice( std::auto_ptr<ConfigRom>( configRom ), 160 int id, int level ) 161 { 162 if ( BeBoB::AvDevice::probe( *configRom.get() ) ) { 163 return new BeBoB::AvDevice( configRom, *m_1394Service, id, level ); 164 } 165 166 if ( MAudio::AvDevice::probe( *configRom.get() ) ) { 167 return new MAudio::AvDevice( configRom, *m_1394Service, id, level ); 168 } 169 170 if ( Motu::MotuDevice::probe( *configRom.get() ) ) { 171 return new Motu::MotuDevice( configRom, *m_1394Service, id, level ); 172 } 173 174 if ( Rme::RmeDevice::probe( *configRom.get() ) ) { 175 return new Rme::RmeDevice( configRom, *m_1394Service, id, level ); 176 } 177 178 if ( Bounce::BounceDevice::probe( *configRom.get() ) ) { 179 return new Bounce::BounceDevice( configRom, *m_1394Service, id, level ); 180 } 181 182 return 0; 262 183 } 263 184 … … 338 259 } 339 260 340 xmlNodePtr rootNode = xmlNewNode( 0, BAD_CAST "FreeBo bConnectionInfo" );261 xmlNodePtr rootNode = xmlNewNode( 0, BAD_CAST "FreeBoBConnectionInfo" ); 341 262 if ( !rootNode ) { 342 263 debugError( "Couldn't create root node\n" ); … … 369 290 debugError( "Couldn't create 'NodeId' node" ); 370 291 free(result); 371 return false; 372 } 292 return 0; 293 } 294 free( result ); 373 295 374 296 std::string res = "Connection Information for " … … 422 344 xmlFreeDoc( doc ); 423 345 xmlCleanupParser(); 424 free(result); 425 return false; 426 } 346 347 free(result); 348 return 0; 349 } 350 free( result ); 351 427 352 428 353 if ( !avDevice->addXmlDescription( deviceNode ) ) { branches/libfreebob-2.0/src/devicemanager.h
r331 r336 1 /* template.cpp1 /* devicemanager.h 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 21 21 #ifndef FREEBOBDEVICEMANAGER_H 22 22 #define FREEBOBDEVICEMANAGER_H 23 24 #include "configrom.h"25 23 26 24 #include "debugmodule/debugmodule.h" … … 36 34 typedef std::vector< IAvDevice* >::iterator IAvDeviceVectorIterator; 37 35 38 typedef IAvDevice* (*ProbeFunction)(Ieee1394Service&, ConfigRom&, int, int); 39 typedef std::vector<ProbeFunction> ProbeFunctionVector; 40 typedef std::vector<ProbeFunction>::iterator ProbeFunctionVectorIterator; 36 class ConfigRom; 37 41 38 42 39 class DeviceManager{ … … 61 58 62 59 protected: 63 static IAvDevice* probeBeBoB(Ieee1394Service& service, ConfigRom& configRom, int id, int level); 64 static IAvDevice* probeBounce(Ieee1394Service& service, ConfigRom& configRom, int id, int level); 65 static IAvDevice* probeMotu(Ieee1394Service& service, ConfigRom& configRom, int id, int level); 66 static IAvDevice* probeRme(Ieee1394Service& service, ConfigRom& configRom, int id, int level); 60 IAvDevice* getDriverForDevice( std::auto_ptr<ConfigRom>( configRom ), 61 int id, 62 int level ); 67 63 68 64 protected: 69 65 Ieee1394Service* m_1394Service; 70 66 IAvDeviceVector m_avDevices; 71 ProbeFunctionVector m_probeList;72 67 73 68 DECLARE_DEBUG_MODULE; branches/libfreebob-2.0/src/fbtypes.h
r125 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/freebob.cpp
r248 r336 39 39 40 40 DECLARE_GLOBAL_DEBUG_MODULE; 41 IMPL_GLOBAL_DEBUG_MODULE( FreeBo b, DEBUG_LEVEL_VERBOSE );41 IMPL_GLOBAL_DEBUG_MODULE( FreeBoB, DEBUG_LEVEL_VERBOSE ); 42 42 43 43 #ifdef __cplusplus … … 64 64 return PACKAGE_STRING; 65 65 } 66 66 67 67 68 const int … … 162 163 if ( avDevice ) { 163 164 if ( avDevice->setSamplingFrequency( parseSampleRate( samplerate ) ) ) { 164 return freebob_handle->m_deviceManager->discover(0)? 1 : 0; 165 } else { 166 return -1; 167 } 165 return freebob_handle->m_deviceManager->discover(0)? 0 : -1; 166 } 168 167 } 169 168 return -1; branches/libfreebob-2.0/src/iavdevice.h
r245 r336 2 2 * Copyright (C) 2006 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 188 188 */ 189 189 virtual int stopStreamByIndex(int i) = 0; 190 190 191 191 }; 192 192 branches/libfreebob-2.0/src/libfreebobavc/avc_connect.cpp
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_connect.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_definitions.cpp
r151 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_definitions.h
r245 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 35 35 typedef byte_t function_block_type_t; 36 36 typedef byte_t function_block_id_t; 37 typedef byte_t control_attribute_t; 37 38 typedef byte_t plug_direction_t; 38 39 typedef byte_t plug_address_mode_t; … … 65 66 typedef byte_t no_of_output_plugs_t; 66 67 typedef byte_t info_type_t; 68 typedef byte_t audio_channel_number_t; 69 typedef byte_t selector_length_t; 70 typedef byte_t control_selector_t; 71 typedef byte_t control_data_length_t; 72 typedef byte_t input_fb_plug_number_t; 73 typedef byte_t input_audio_channel_number_t; 74 typedef byte_t output_audio_channel_number_t; 75 typedef byte_t status_selector_t; 67 76 68 77 typedef quadlet_t company_id_t; branches/libfreebob-2.0/src/libfreebobavc/avc_extended_cmd_generic.cpp
r172 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_extended_cmd_generic.h
r172 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_extended_plug_info.cpp
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 626 626 se.write( m_infoType, buf ); 627 627 628 free(buf); 629 628 630 switch ( m_infoType ) { 629 631 case eIT_PlugType: branches/libfreebob-2.0/src/libfreebobavc/avc_extended_plug_info.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_extended_stream_format.cpp
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_extended_stream_format.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_extended_subunit_info.cpp
r183 r336 2 2 * Copyright (C) 2006 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_extended_subunit_info.h
r183 r336 2 2 * Copyright (C) 2006 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_generic.cpp
r242 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 23 23 #include "ieee1394service.h" 24 24 25 #include "debugmodule/debugmodule.h" 26 25 27 #include <netinet/in.h> 26 28 27 #define DEBUG_EXTRA_VERBOSE 2 29 #define DEBUG_EXTRA_VERBOSE 5 30 31 IMPL_DEBUG_MODULE( AVCCommand, AVCCommand, DEBUG_LEVEL_NORMAL ); 28 32 29 33 int AVCCommand::m_time = 0; … … 37 41 , m_opcode( opcode ) 38 42 , m_eResponse( eR_Unknown ) 39 , m_verboseLevel( 0 ) 40 { 43 { 44 41 45 } 42 46 … … 44 48 AVCCommand::serialize( IOSSerialize& se ) 45 49 { 46 se.write( m_ctype, "AVCCommand ctype" );47 50 // XXX \todo improve IOSSerialize::write interface 48 51 char* buf; 52 asprintf( &buf, "AVCCommand ctype ('%s')", 53 responseToString( static_cast<AVCCommand::EResponse>( m_ctype ) ) ); 54 se.write( m_ctype, buf ); 55 free( buf ); 56 49 57 asprintf( &buf, "AVCCommand subunit (subunit_type = %d, subunit_id = %d)", 50 58 getSubunitType(), getSubunitId() ); 51 59 se.write( m_subunit, buf ); 52 free(buf); 60 free( buf ); 61 53 62 se.write( m_opcode, "AVCCommand opcode" ); 54 63 return true; … … 122 131 AVCCommand::setVerbose( int verboseLevel ) 123 132 { 124 m_verboseLevel = verboseLevel;133 setDebugLevel(verboseLevel); 125 134 return true; 126 135 } … … 129 138 AVCCommand::getVerboseLevel() 130 139 { 131 return m_verboseLevel;140 return getDebugLevel(); 132 141 } 133 142 … … 140 149 if ( ( i % 16 ) == 0 ) { 141 150 if ( i > 0 ) { 142 printf("\n" );151 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "\n" ); 143 152 } 144 printf(" %3d:\t", i );153 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, " %3d:\t", i ); 145 154 } else if ( ( i % 4 ) == 0 ) { 146 printf(" " );155 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, " " ); 147 156 } 148 printf("%02x ", buf[i] );149 } 150 printf("\n" );157 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "%02x ", buf[i] ); 158 } 159 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "\n" ); 151 160 } 152 161 … … 158 167 BufferSerialize se( m_fcpFrame, sizeof( m_fcpFrame ) ); 159 168 if ( !serialize( se ) ) { 160 printf( "ExtendedPlugInfoCmd::fire: Could not serialize\n" );169 debugFatal( "ExtendedPlugInfoCmd::fire: Could not serialize\n" ); 161 170 return false; 162 171 } … … 164 173 unsigned short fcpFrameSize = se.getNrOfProducesBytes(); 165 174 166 if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE) {167 printf("%s:\n", getCmdName() );168 puts(" Request:");175 if (getDebugLevel() >= DEBUG_LEVEL_VERY_VERBOSE) { 176 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "%s:\n", getCmdName() ); 177 debugOutput( DEBUG_LEVEL_VERY_VERBOSE, " Request:"); 169 178 showFcpFrame( m_fcpFrame, fcpFrameSize ); 170 171 CoutSerializer se; 172 serialize( se ); 179 180 StringSerializer se_dbg; 181 serialize( se_dbg ); 182 183 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "%s", 184 se_dbg.getString().c_str()); 173 185 } 174 186 … … 186 198 switch ( m_eResponse ) 187 199 { 200 case eR_Accepted: 188 201 case eR_Implemented: 189 202 case eR_Rejected: … … 193 206 result = deserialize( de ); 194 207 195 if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE) { 196 puts(" Response:"); 197 showFcpFrame( buf, de.getNrOfConsumedBytes() ); 198 199 CoutSerializer se; 200 serialize( se ); 201 } 208 debugOutput( DEBUG_LEVEL_VERY_VERBOSE," Response:"); 209 showFcpFrame( buf, de.getNrOfConsumedBytes() ); 210 211 StringSerializer se_dbg; 212 serialize( se_dbg ); 213 214 debugOutputShort(DEBUG_LEVEL_VERY_VERBOSE, "%s", 215 se_dbg.getString().c_str()); 202 216 } 203 217 break; 204 218 default: 205 printf( "unexpected response received (0x%x)\n", m_eResponse ); 206 if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE) { 207 puts(" Response:"); 208 BufferDeserialize de( buf, resp_len ); 209 deserialize( de ); 210 211 showFcpFrame( buf, resp_len ); 212 } 219 debugWarning( "unexpected response received (0x%x)\n", m_eResponse ); 220 debugOutput( DEBUG_LEVEL_VERY_VERBOSE," Response:"); 221 222 BufferDeserialize de( buf, resp_len ); 223 deserialize( de ); 224 225 showFcpFrame( buf, de.getNrOfConsumedBytes() ); 213 226 214 227 } 215 228 } else { 216 printf( "no response\n" ); 217 } 218 219 if ( getVerboseLevel() >= DEBUG_EXTRA_VERBOSE ) { 220 printf( "\n" ); 221 } 229 debugWarning( "no response\n" ); 230 } 231 232 debugOutputShort( DEBUG_LEVEL_VERY_VERBOSE, "\n" ); 222 233 223 234 m_1394Service->transactionBlockClose(); … … 264 275 } 265 276 } 277 278 const char* responseToStrings[] = 279 { 280 "control", 281 "status", 282 "specific inquiry", 283 "notify", 284 "general inquiry", 285 "reserved for future specification", 286 "reserved for future specification", 287 "reserved for future specification", 288 "not implemented", 289 "accepted", 290 "rejected", 291 "in transition", 292 "implemented/stable", 293 "changed" 294 "reserved for future specification", 295 "interim", 296 }; 297 298 const char* 299 responseToString( AVCCommand::EResponse eResponse ) 300 { 301 if ( eResponse > ( int )( sizeof( responseToStrings ) / sizeof( responseToStrings[0] ) ) ) { 302 return "unknown"; 303 } 304 return responseToStrings[eResponse]; 305 } branches/libfreebob-2.0/src/libfreebobavc/avc_generic.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 23 23 24 24 #include "avc_definitions.h" 25 #include "debugmodule/debugmodule.h" 25 26 26 27 #include "../fbtypes.h" … … 105 106 bool setVerbose( int verboseLevel ); 106 107 int getVerboseLevel(); 107 108 108 109 virtual const char* getCmdName() const = 0; 109 110 … … 130 131 opcode_t m_opcode; 131 132 EResponse m_eResponse; 132 int m_verboseLevel;133 133 ECommandType m_commandType; 134 134 static int m_time; 135 136 DECLARE_DEBUG_MODULE; 135 137 }; 136 138 137 139 138 140 const char* subunitTypeToString( subunit_type_t subunitType ); 141 const char* responseToString( AVCCommand::EResponse eResponse ); 139 142 140 143 #endif // AVCGeneric_h branches/libfreebob-2.0/src/libfreebobavc/avc_plug_info.cpp
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_plug_info.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_signal_source.cpp
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_signal_source.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_subunit_info.cpp
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_subunit_info.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_unit_info.cpp
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/avc_unit_info.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/src/libfreebobavc/ieee1394service.cpp
r242 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 26 26 27 27 #include <iostream> 28 29 using namespace std; 28 #include <iomanip> 29 30 30 31 31 Ieee1394Service::Ieee1394Service() 32 32 : m_handle( 0 ) 33 33 , m_port( -1 ) 34 { 34 , m_verbose( false ) 35 , m_threadRunning( false ) 36 { 37 pthread_mutex_init( &m_mutex, 0 ); 35 38 } 36 39 37 40 Ieee1394Service::~Ieee1394Service() 38 41 { 39 if (m_handle) { 40 raw1394_destroy_handle(m_handle); 42 stopRHThread(); 43 44 if ( m_handle ) { 45 raw1394_destroy_handle( m_handle ); 46 } 47 if ( m_resetHandle ) { 48 raw1394_destroy_handle( m_resetHandle ); 41 49 } 42 50 } … … 45 53 Ieee1394Service::initialize( int port ) 46 54 { 55 using namespace std; 56 47 57 m_handle = raw1394_new_handle_on_port( port ); 48 58 if ( !m_handle ) { … … 56 66 } 57 67 68 m_resetHandle = raw1394_new_handle_on_port( port ); 69 if ( !m_handle ) { 70 if ( !errno ) { 71 cerr << "libraw1394 not compatible" << endl; 72 } else { 73 perror( "Ieee1394Service::initialize: Could not get 1394 handle" ); 74 cerr << "Is ieee1394 and raw1394 driver loaded?" << endl; 75 } 76 return false; 77 } 78 58 79 m_port = port; 80 81 raw1394_set_userdata( m_handle, this ); 82 raw1394_set_userdata( m_resetHandle, this ); 83 raw1394_set_bus_reset_handler( m_resetHandle, 84 this->resetHandlerLowLevel ); 85 startRHThread(); 86 59 87 return true; 60 88 } … … 69 97 Ieee1394Service::read( fb_nodeid_t nodeId, 70 98 fb_nodeaddr_t addr, 71 size_t size,99 size_t length, 72 100 fb_quadlet_t* buffer ) 73 101 { 74 return raw1394_read( m_handle, nodeId, addr, size, buffer ) != 0; 75 } 76 77 bool 78 Ieee1394Service::write( fb_nodeid_t nodeId, 102 using namespace std; 103 if ( raw1394_read( m_handle, nodeId, addr, length*4, buffer ) == 0 ) { 104 105 #ifdef DEBUG 106 if ( m_verbose ) { 107 cout << "read: node 0x" << hex << nodeId <<", addr = 0x" 108 << setfill( '0' ) << setw( 16 ) << addr 109 << ", length = " << dec << length << " quadlets" << endl; 110 printBuffer( length, buffer ); 111 } 112 #endif 113 114 return true; 115 } else { 116 #ifdef DEBUG 117 if ( m_verbose ) { 118 cerr << "raw1394_read failed: node 0x" << hex << nodeId 119 << ", addr 0x" << setfill( '0' ) << setw( 16 ) << addr 120 << ", length = " << dec << length << " quadlets" << endl; 121 } 122 #endif 123 124 return false; 125 } 126 } 127 128 129 bool 130 Ieee1394Service::read_quadlet( fb_nodeid_t nodeId, 131 fb_nodeaddr_t addr, 132 fb_quadlet_t* buffer ) 133 { 134 return read( nodeId, addr, sizeof( *buffer )/4, buffer ); 135 } 136 137 bool 138 Ieee1394Service::read_octlet( fb_nodeid_t nodeId, 139 fb_nodeaddr_t addr, 140 fb_octlet_t* buffer ) 141 { 142 return read( nodeId, addr, sizeof( *buffer )/4, 143 reinterpret_cast<fb_quadlet_t*>( buffer ) ); 144 } 145 146 147 bool 148 Ieee1394Service::write( fb_nodeid_t nodeId, 79 149 fb_nodeaddr_t addr, 80 size_t length, 81 fb_quadlet_t *data ) 82 { 83 return raw1394_write( m_handle, nodeId, addr, length, data ) != 0; 150 size_t length, 151 fb_quadlet_t* data ) 152 { 153 using namespace std; 154 155 #ifdef DEBUG 156 if ( m_verbose ) { 157 cout << "write: node 0x" << hex << nodeId << ", addr = 0x" 158 << setfill( '0' ) << setw( 16 ) << addr 159 << ", length = " << dec << length << " quadlets" << endl; 160 printBuffer( length, data ); 161 } 162 #endif 163 164 return raw1394_write( m_handle, nodeId, addr, length*4, data ) == 0; 165 } 166 167 168 bool 169 Ieee1394Service::write_quadlet( fb_nodeid_t nodeId, 170 fb_nodeaddr_t addr, 171 fb_quadlet_t data ) 172 { 173 return write( nodeId, addr, sizeof( data )/4, &data ); 174 } 175 176 bool 177 Ieee1394Service::write_octlet( fb_nodeid_t nodeId, 178 fb_nodeaddr_t addr, 179 fb_octlet_t data ) 180 { 181 return write( nodeId, addr, sizeof( data )/4, 182 reinterpret_cast<fb_quadlet_t*>( &data ) ); 84 183 } 85 184 … … 93 192 buf[i] = ntohl( buf[i] ); 94 193 } 194 195 #ifdef DEBUG 196 if ( m_verbose ) { 197 printf( "pre avc1394_transaction_block2\n" ); 198 printBuffer( len, buf ); 199 } 200 #endif 95 201 96 202 fb_quadlet_t* result = … … 102 208 10 ); 103 209 210 #ifdef DEBUG 211 if ( m_verbose ) { 212 printf( "post avc1394_transaction_block2\n" ); 213 printBuffer( *resp_len, result ); 214 } 215 #endif 216 104 217 for ( unsigned int i = 0; i < *resp_len; ++i ) { 105 218 result[i] = htonl( result[i] ); … … 116 229 return true; 117 230 } 231 232 void 233 Ieee1394Service::setVerbose( bool isVerbose ) 234 { 235 m_verbose = isVerbose; 236 } 237 238 void 239 Ieee1394Service::printBuffer( size_t length, fb_quadlet_t* buffer ) const 240 { 241 using namespace std; 242 243 for ( unsigned int i=0; i < length; ++i ) { 244 if ( ( i % 4 ) == 0 ) { 245 if ( i > 0 ) { 246 cout << endl; 247 } 248 cout << setfill( ' ' ) << setw( 4 ) << i*4 << ": "; 249 } 250 cout << setfill( '0' ) << setw( 8 ) << hex << buffer[i] << " "; 251 } 252 cout << endl; 253 } 254 255 int 256 Ieee1394Service::resetHandlerLowLevel( raw1394handle_t handle, 257 unsigned int generation ) 258 { 259 raw1394_update_generation ( handle, generation ); 260 Ieee1394Service* instance 261 = (Ieee1394Service*) raw1394_get_userdata( handle ); 262 instance->resetHandler( generation ); 263 264 return 0; 265 } 266 267 bool 268 Ieee1394Service::resetHandler( unsigned int generation ) 269 { 270 m_generation = generation; 271 272 for ( reset_handler_vec_t::iterator it = m_busResetHandlers.begin(); 273 it != m_busResetHandlers.end(); 274 ++it ) 275 { 276 Functor* func = *it; 277 ( *func )(); 278 } 279 280 return true; 281 } 282 283 bool 284 Ieee1394Service::startRHThread() 285 { 286 if ( m_threadRunning ) { 287 return true; 288 } 289 pthread_mutex_lock( &m_mutex ); 290 pthread_create( &m_thread, 0, rHThread, this ); 291 pthread_mutex_unlock( &m_mutex ); 292 m_threadRunning = true; 293 294 return true; 295 } 296 297 void 298 Ieee1394Service::stopRHThread() 299 { 300 if ( m_threadRunning ) { 301 pthread_mutex_lock (&m_mutex); 302 pthread_cancel (m_thread); 303 pthread_join (m_thread, 0); 304 pthread_mutex_unlock (&m_mutex); 305 m_threadRunning = false; 306 } 307 } 308 309 void* 310 Ieee1394Service::rHThread( void* arg ) 311 { 312 Ieee1394Service* pIeee1394Service = (Ieee1394Service*) arg; 313 314 while (true) { 315 raw1394_loop_iterate (pIeee1394Service->m_resetHandle); 316 pthread_testcancel (); 317 } 318 319 return 0; 320 } 321 322 bool 323 Ieee1394Service::addBusResetHandler( Functor* functor ) 324 { 325 m_busResetHandlers.push_back( functor ); 326 return true; 327 } 328 329 bool 330 Ieee1394Service::remBusResetHandler( Functor* functor ) 331 { 332 for ( reset_handler_vec_t::iterator it = m_busResetHandlers.begin(); 333 it != m_busResetHandlers.end(); 334 ++it ) 335 { 336 if ( *it == functor ) { 337 m_busResetHandlers.erase( it ); 338 return true; 339 } 340 } 341 return false; 342 } branches/libfreebob-2.0/src/libfreebobavc/ieee1394service.h
r221 r336 1 1 /* Ieee1394Service.cpp 2 * Copyright (C) 2005 by Daniel Wagner2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 23 23 24 24 #include "fbtypes.h" 25 #include "threads.h" 25 26 26 27 #include <libraw1394/raw1394.h> 28 #include <pthread.h> 29 30 #include <vector> 27 31 28 32 class Ieee1394Service{ … … 49 53 /** 50 54 * read - send async read request to a node and wait for response. 51 * @node: target node 55 * @node: target node (\XXX needs 0xffc0 stuff) 52 56 * @addr: address to read from 53 57 * @length: amount of data to read in quadlets … … 56 60 * This does the complete transaction and will return when it's finished. 57 61 * 58 * Returns: true eon success or false on failure (sets errno)62 * Returns: true on success or false on failure (sets errno) 59 63 */ 60 64 bool read( fb_nodeid_t nodeId, 61 65 fb_nodeaddr_t addr, 62 size_t size,66 size_t length, 63 67 fb_quadlet_t* buffer ); 64 68 65 /** 69 bool read_quadlet( fb_nodeid_t nodeId, 70 fb_nodeaddr_t addr, 71 fb_quadlet_t* buffer ); 72 73 bool read_octlet( fb_nodeid_t nodeId, 74 fb_nodeaddr_t addr, 75 fb_octlet_t* buffer ); 76 77 /** 66 78 * write - send async write request to a node and wait for response. 67 * @node: target node 79 * @node: target node (\XXX needs 0xffc0 stuff) 68 80 * @addr: address to write to 69 81 * @length: amount of data to write in quadlets … … 74 86 * Returns: true on success or false on failure (sets errno) 75 87 */ 76 bool write( fb_nodeid_t 88 bool write( fb_nodeid_t nodeId, 77 89 fb_nodeaddr_t addr, 78 size_t 79 fb_quadlet_t *data );90 size_t length, 91 fb_quadlet_t* data ); 80 92 93 bool write_quadlet( fb_nodeid_t nodeId, 94 fb_nodeaddr_t addr, 95 fb_quadlet_t data ); 96 97 bool write_octlet( fb_nodeid_t nodeId, 98 fb_nodeaddr_t addr, 99 fb_octlet_t data ); 81 100 82 101 fb_quadlet_t* transactionBlock( fb_nodeid_t nodeId, … … 89 108 raw1394handle_t getHandle() {return m_handle;}; 90 109 91 110 void setVerbose( bool isVerbose ); 111 112 113 bool addBusResetHandler( Functor* functor ); 114 bool remBusResetHandler( Functor* functor ); 115 92 116 private: 117 118 bool startRHThread(); 119 void stopRHThread(); 120 static void* rHThread( void* arg ); 121 122 void printBuffer( size_t length, fb_quadlet_t* buffer ) const; 123 124 static int resetHandlerLowLevel( raw1394handle_t handle, 125 unsigned int generation ); 126 bool resetHandler( unsigned int generation ); 127 93 128 raw1394handle_t m_handle; 129 raw1394handle_t m_resetHandle; 94 130 int m_port; 131 bool m_verbose; 132 unsigned int m_generation; 133 134 pthread_t m_thread; 135 pthread_mutex_t m_mutex; 136 bool m_threadRunning; 137 138 typedef std::vector< Functor* > reset_handler_vec_t; 139 reset_handler_vec_t m_busResetHandlers; 95 140 }; 96 141 branches/libfreebob-2.0/src/libfreebobavc/serialize.cpp
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 39 39 { 40 40 printf( " %3d:\t0x%08x\t%s\n", m_cnt, d, name ); 41 m_cnt += sizeof( quadlet_t ); 42 return true; 43 } 44 45 ////////////////////////////////////////////////// 46 47 bool 48 StringSerializer::write( byte_t d, const char* name ) 49 { 50 char* result; 51 asprintf( &result, " %3d:\t0x%02x\t%s\n", m_cnt, d, name ); 52 53 m_string += result; 54 free( result ); 55 56 m_cnt += sizeof( byte_t ); 57 58 return true; 59 } 60 61 bool 62 StringSerializer::write( quadlet_t d, const char* name ) 63 { 64 char* result; 65 asprintf( &result, " %3d:\t0x%08x\t%s\n", m_cnt, d, name ); 66 67 m_string += result; 68 free( result ); 69 41 70 m_cnt += sizeof( quadlet_t ); 42 71 return true; … … 97 126 bool result = false; 98 127 if ( isCurPosValid() ) { 99 *value = * m_curPos;128 *value = *( ( quadlet_t* )m_curPos ); 100 129 m_curPos += sizeof( quadlet_t ); 101 130 result = true; branches/libfreebob-2.0/src/libfreebobavc/serialize.h
r183 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 23 23 24 24 #include <libraw1394/raw1394.h> // byte_t and quadlet_t declaration 25 #include <string> 25 26 26 27 // Interfaces … … 61 62 private: 62 63 unsigned int m_cnt; 64 65 }; 66 67 class StringSerializer: public IOSSerialize { 68 public: 69 StringSerializer() 70 : IOSSerialize() 71 , m_cnt( 0 ) 72 {} 73 virtual ~StringSerializer() {} 74 75 virtual bool write( byte_t value, const char* name = "" ); 76 virtual bool write( quadlet_t value, const char* name = "" ); 77 virtual std::string getString( ) { return m_string;}; 78 79 private: 80 unsigned int m_cnt; 81 std::string m_string; 63 82 64 83 }; branches/libfreebob-2.0/src/libstreaming/freebob_streaming.cpp
r302 r336 118 118 119 119 // discover the devices on the bus 120 if(!dev->m_deviceManager->discover(DEBUG_LEVEL_ VERBOSE)) {120 if(!dev->m_deviceManager->discover(DEBUG_LEVEL_NORMAL)) { 121 121 debugOutput(DEBUG_LEVEL_VERBOSE, "Could not discover devices\n"); 122 122 return 0; branches/libfreebob-2.0/src/Makefile.am
r331 r336 3 3 # Copyright (C) 2006 by Pieter Palmers. 4 4 # 5 # This file is part of FreeBo b.5 # This file is part of FreeBoB. 6 6 # 7 # FreeBo bis free software; you can redistribute it and/or modify7 # FreeBoB is free software; you can redistribute it and/or modify 8 8 # it under the terms of the GNU General Public License as published by 9 9 # the Free Software Foundation; either version 2 of the License, or 10 10 # (at your option) any later version. 11 # FreeBo bis distributed in the hope that it will be useful,11 # FreeBoB is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 15 # You should have received a copy of the GNU General Public License 16 # along with FreeBo b; if not, write to the Free Software16 # along with FreeBoB; if not, write to the Free Software 17 17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 19 SUBDIRS = debugmodule libfreebobavc libstreaming libutil 20 21 INCLUDES = $(LIBSIGC_CFLAGS) $(LIBRAW1394_CFLAGS) $(LIBIEC61883_CFLAGS) \ 22 $(LIBAVC1394_CFLAGS) $(LIBLO_CFLAGS) $(LIBXML_CFLAGS) \ 19 INCLUDES = \ 20 $(LIBRAW1394_CFLAGS) $(LIBIEC61883_CFLAGS) \ 21 $(LIBAVC1394_CFLAGS) $(LIBXML_CFLAGS) \ 23 22 -I$(top_srcdir) -I$(top_srcdir)/src 24 23 … … 29 28 devicemanager.h \ 30 29 fbtypes.h \ 31 bebob_light/bebob_light_avdevice.h \32 bebob_light/bebob_light_avdevicesubunit.h \33 bebob_light/bebob_light_avplug.h \34 30 bounce/bounce_avdevice.h \ 35 31 motu/motu_avdevice.h \ 36 32 rme/rme_avdevice.h 37 # bebob/bebob_avdevice.h \38 # bebob/bebob_avdevice_subunit.h \39 # bebob/bebob_avplug.h \40 # bebob/bebob_functionblock.h41 33 42 34 libfreebob_la_SOURCES = \ 35 iavdevice.h \ 43 36 configrom.cpp \ 44 37 csr1212.c \ … … 46 39 freebob.cpp \ 47 40 xmlparser.c \ 48 bebob_light/bebob_light_avdevice.cpp \ 49 bebob_light/bebob_light_avdevicesubunit.cpp \ 50 bebob_light/bebob_light_avplug.cpp \ 51 bounce/bounce_avdevice.cpp \ 41 threads.h \ 42 bebob/bebob_avdevice.h \ 43 bebob/bebob_avdevice.cpp \ 44 bebob/bebob_avdevice_xml.cpp \ 45 bebob/bebob_avdevice_subunit.h \ 46 bebob/bebob_avdevice_subunit.cpp \ 47 bebob/bebob_avplug.h \ 48 bebob/bebob_avplug.cpp \ 49 bebob/bebob_avplug_xml.cpp \ 50 bebob/bebob_functionblock.h \ 51 bebob/bebob_functionblock.cpp \ 52 bebob/bebob_dl_mgr.h \ 53 bebob/bebob_dl_mgr.cpp \ 54 bebob/bebob_dl_codes.h \ 55 bebob/bebob_dl_codes.cpp \ 56 bebob/bebob_dl_bcd.h \ 57 bebob/bebob_dl_bcd.cpp \ 52 58 motu/motu_avdevice.cpp \ 53 rme/rme_avdevice.cpp 59 motu/motu_avdevice.h \ 60 rme/rme_avdevice.cpp \ 61 rme/rme_avdevice.h \ 62 bounce/bounce_avdevice.h \ 63 bounce/bounce_avdevice.cpp \ 64 maudio/maudio_avdevice.h \ 65 maudio/maudio_avdevice.cpp \ 66 libfreebobavc/avc_connect.cpp \ 67 libfreebobavc/avc_definitions.cpp \ 68 libfreebobavc/avc_extended_cmd_generic.cpp \ 69 libfreebobavc/avc_extended_plug_info.cpp \ 70 libfreebobavc/avc_extended_stream_format.cpp \ 71 libfreebobavc/avc_extended_subunit_info.cpp \ 72 libfreebobavc/avc_function_block.cpp \ 73 libfreebobavc/avc_function_block.h \ 74 libfreebobavc/avc_generic.cpp \ 75 libfreebobavc/avc_plug_info.cpp \ 76 libfreebobavc/avc_signal_source.cpp \ 77 libfreebobavc/avc_subunit_info.cpp \ 78 libfreebobavc/avc_unit_info.cpp \ 79 libfreebobavc/ieee1394service.cpp \ 80 libfreebobavc/serialize.cpp \ 81 libfreebobavc/avc_connect.h \ 82 libfreebobavc/avc_definitions.h \ 83 libfreebobavc/avc_extended_cmd_generic.h \ 84 libfreebobavc/avc_extended_plug_info.h \ 85 libfreebobavc/avc_extended_stream_format.h \ 86 libfreebobavc/avc_extended_subunit_info.h \ 87 libfreebobavc/avc_generic.h \ 88 libfreebobavc/avc_plug_info.h \ 89 libfreebobavc/avc_signal_source.h \ 90 libfreebobavc/avc_subunit_info.h \ 91 libfreebobavc/avc_unit_info.h \ 92 libfreebobavc/ieee1394service.h \ 93 libfreebobavc/serialize.h \ 94 debugmodule/debugmodule.h \ 95 debugmodule/debugmodule.cpp \ 96 libstreaming/cip.c \ 97 libstreaming/freebob_streaming.cpp \ 98 libstreaming/IsoHandler.cpp \ 99 libstreaming/IsoHandlerManager.cpp \ 100 libstreaming/IsoStream.cpp \ 101 libstreaming/PacketBuffer.cpp \ 102 libstreaming/PortManager.cpp \ 103 libstreaming/Port.cpp \ 104 libstreaming/StreamProcessor.cpp \ 105 libstreaming/StreamProcessorManager.cpp \ 106 libstreaming/AmdtpPortInfo.cpp \ 107 libstreaming/AmdtpPort.cpp \ 108 libstreaming/AmdtpStreamProcessor.cpp \ 109 libstreaming/ringbuffer.c \ 110 libstreaming/streamstatistics.cpp \ 111 libstreaming/MotuStreamProcessor.cpp \ 112 libstreaming/MotuPort.cpp \ 113 libstreaming/MotuPortInfo.cpp \ 114 libutil/DelayLockedLoop.h \ 115 libutil/Atomic.h \ 116 libutil/PosixThread.h \ 117 libutil/Thread.h \ 118 libutil/DelayLockedLoop.cpp \ 119 libutil/PosixThread.cpp 54 120 55 # bebob/bebob_avdevice.cpp \ 56 # bebob/bebob_avdevice_xml.cpp \ 57 # bebob/bebob_avdevice_subunit.cpp \ 58 # bebob/bebob_avplug.cpp \ 59 # bebob/bebob_avplug_xml.cpp \ 60 # bebob/bebob_functionblock.cpp 121 libfreebob_la_LDFLAGS = \ 122 -version-info $(LT_VERSION) $(LIBRAW1394_LIBS) \ 123 $(LIBIEC61883_LIBS) $(LIBAVC1394_LIBS) \ 124 $(LIBXML_LIBS) -lpthread 61 125 62 libfreebob_la_LDFLAGS = -version-info $(LT_VERSION) -lpthread $(LIBSIGC_LIBS)\63 $(LIBRAW1394_LIBS) $(LIBIEC61883_LIBS) $(LIBAVC1394_LIBS)\64 $(LIBLO_LIBS) $(LIBXML_LIBS) -safe-temps126 nobase_dist_pkgdata_DATA = \ 127 maudio/refdesign.xml \ 128 maudio/fw410.xml 65 129 66 libfreebob_la_LIBADD = debugmodule/libdebugmodule.la libfreebobavc/libfreebobavc.la \ 67 libstreaming/libstreaming.la libutil/libutil.la 130 bin_PROGRAMS = freebob_downloader freebob_sync 68 131 132 freebob_downloader_SOURCES = \ 133 freebob-downloader.cpp 134 freebob_downloader_LDADD = \ 135 libfreebob.la \ 136 $(LIBRAW1394_LIBS) \ 137 $(LIBIEC61883_LIBS) \ 138 $(LIBAVC1394_LIBS) \ 139 -lpthread 140 141 freebob_sync_SOURCES = \ 142 freebob-sync.cpp 143 freebob_sync_LDADD = \ 144 libfreebob.la \ 145 $(LIBRAW1394_LIBS) \ 146 $(LIBIEC61883_LIBS) \ 147 $(LIBAVC1394_LIBS) \ 148 -lpthread 149 150 noinst_PROGRAMS = test-dll test-debugmodule 151 152 test_dll_SOURCES = libutil/test-dll.cpp 153 test_dll_LDADD = libfreebob.la 154 155 test_debugmodule_SOURCES = debugmodule/test_debugmodule.cpp 156 test_debugmodule_LDADD = libfreebob.la branches/libfreebob-2.0/src/maudio/maudio_avdevice.cpp
r319 r336 46 46 , m_iVerboseLevel( iVerboseLevel ) 47 47 , m_pFilename( 0 ) 48 { 49 if ( m_iVerboseLevel ) { 50 setDebugLevel( DEBUG_LEVEL_VERBOSE ); 51 } 48 , m_id(0) 49 , m_receiveProcessor ( 0 ) 50 , m_receiveProcessorBandwidth ( -1 ) 51 , m_transmitProcessor ( 0 ) 52 , m_transmitProcessorBandwidth ( -1 ) 53 { 54 setDebugLevel( iVerboseLevel ); 55 52 56 debugOutput( DEBUG_LEVEL_VERBOSE, "Created MAudio::AvDevice (NodeID %d)\n", 53 57 iNodeId ); … … 124 128 return false; 125 129 } 130 131 int AvDevice::getSamplingFrequency( ) { 132 return 44100; 133 } 134 126 135 127 136 void … … 219 228 } 220 229 230 bool AvDevice::setId( unsigned int id) 231 { 232 // FIXME: decent ID system nescessary 233 m_id=id; 234 return true; 235 } 236 221 237 bool 222 AvDevice::setId(unsigned int id) 223 { 224 return true; 225 } 226 227 } 238 AvDevice::prepare() { 239 /* /////////// 240 // get plugs 241 242 AvPlug* inputplug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Input, 0 ); 243 if ( !inputplug ) { 244 debugError( "setSampleRate: Could not retrieve iso input plug 0\n" ); 245 return false; 246 } 247 AvPlug* outputPlug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Output, 0 ); 248 if ( !inputplug ) { 249 debugError( "setSampleRate: Could not retrieve iso output plug 0\n" ); 250 return false; 251 } 252 253 int samplerate=outputPlug->getSampleRate(); 254 m_receiveProcessor=new FreebobStreaming::AmdtpReceiveStreamProcessor( 255 m_p1394Service->getPort(), 256 samplerate, 257 outputPlug->getNrOfChannels()); 258 259 if(!m_receiveProcessor->init()) { 260 debugFatal("Could not initialize receive processor!\n"); 261 return false; 262 } 263 264 if (!addPlugToProcessor(*outputPlug,m_receiveProcessor, 265 FreebobStreaming::AmdtpAudioPort::E_Capture)) { 266 debugFatal("Could not add plug to processor!\n"); 267 return false; 268 } 269 270 // do the transmit processor 271 // if (m_snoopMode) { 272 // // we are snooping, so these are receive too. 273 // samplerate=inputPlug->getSampleRate(); 274 // m_receiveProcessor2=new FreebobStreaming::AmdtpReceiveStreamProcessor( 275 // channel, 276 // m_p1394Service->getPort(), 277 // samplerate, 278 // inputPlug->getNrOfChannels()); 279 // 280 // if(!m_receiveProcessor2->init()) { 281 // debugFatal("Could not initialize snooping receive processor!\n"); 282 // return false; 283 // } 284 // if (!addPlugToProcessor(*inputPlug,m_receiveProcessor2, 285 // FreebobStreaming::AmdtpAudioPort::E_Capture)) { 286 // debugFatal("Could not add plug to processor!\n"); 287 // return false; 288 // } 289 // } else { 290 // do the transmit processor 291 samplerate=inputPlug->getSampleRate(); 292 m_transmitProcessor=new FreebobStreaming::AmdtpTransmitStreamProcessor( 293 m_p1394Service->getPort(), 294 samplerate, 295 inputPlug->getNrOfChannels()); 296 297 if(!m_transmitProcessor->init()) { 298 debugFatal("Could not initialize transmit processor!\n"); 299 return false; 300 301 } 302 303 // FIXME: do this the proper way! 304 m_transmitProcessor->syncmaster=m_receiveProcessor; 305 306 if (!addPlugToProcessor(*inputPlug,m_transmitProcessor, 307 FreebobStreaming::AmdtpAudioPort::E_Playback)) { 308 debugFatal("Could not add plug to processor!\n"); 309 return false; 310 } 311 // } 312 313 return true;*/ 314 } 315 316 // bool 317 // AvDevice::addPlugToProcessor( 318 // AvPlug& plug, 319 // FreebobStreaming::StreamProcessor *processor, 320 // FreebobStreaming::AmdtpAudioPort::E_Direction direction) { 321 // 322 // AvPlug::ClusterInfoVector& clusterInfos = plug.getClusterInfos(); 323 // for ( AvPlug::ClusterInfoVector::const_iterator it = clusterInfos.begin(); 324 // it != clusterInfos.end(); 325 // ++it ) 326 // { 327 // const AvPlug::ClusterInfo* clusterInfo = &( *it ); 328 // 329 // AvPlug::ChannelInfoVector channelInfos = clusterInfo->m_channelInfos; 330 // for ( AvPlug::ChannelInfoVector::const_iterator it = channelInfos.begin(); 331 // it != channelInfos.end(); 332 // ++it ) 333 // { 334 // const AvPlug::ChannelInfo* channelInfo = &( *it ); 335 // std::ostringstream portname; 336 // 337 // portname << "dev" << m_id << "_" << channelInfo->m_name; 338 // 339 // FreebobStreaming::Port *p=NULL; 340 // switch(clusterInfo->m_portType) { 341 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_Speaker: 342 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_Headphone: 343 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_Microphone: 344 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_Line: 345 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_Analog: 346 // p=new FreebobStreaming::AmdtpAudioPort( 347 // portname.str(), 348 // direction, 349 // // \todo: streaming backend expects indexing starting from 0 350 // // but bebob reports it starting from 1. Decide where 351 // // and how to handle this (pp: here) 352 // channelInfo->m_streamPosition - 1, 353 // channelInfo->m_location, 354 // FreebobStreaming::AmdtpPortInfo::E_MBLA, 355 // clusterInfo->m_portType 356 // ); 357 // break; 358 // 359 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI: 360 // p=new FreebobStreaming::AmdtpMidiPort( 361 // portname.str(), 362 // direction, 363 // // \todo: streaming backend expects indexing starting from 0 364 // // but bebob reports it starting from 1. Decide where 365 // // and how to handle this (pp: here) 366 // channelInfo->m_streamPosition - 1, 367 // channelInfo->m_location, 368 // FreebobStreaming::AmdtpPortInfo::E_Midi, 369 // clusterInfo->m_portType 370 // ); 371 // 372 // break; 373 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_SPDIF: 374 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_ADAT: 375 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_TDIF: 376 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_MADI: 377 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_Digital: 378 // case ExtendedPlugInfoClusterInfoSpecificData::ePT_NoType: 379 // default: 380 // // unsupported 381 // break; 382 // } 383 // 384 // if (!p) { 385 // debugOutput(DEBUG_LEVEL_VERBOSE, "Skipped port %s\n",channelInfo->m_name.c_str()); 386 // } else { 387 // 388 // if (!processor->addPort(p)) { 389 // debugWarning("Could not register port with stream processor\n"); 390 // return false; 391 // } 392 // } 393 // } 394 // } 395 // return true; 396 // } 397 398 int 399 AvDevice::getStreamCount() { 400 return 0; 401 // return 2; // one receive, one transmit 402 } 403 404 FreebobStreaming::StreamProcessor * 405 AvDevice::getStreamProcessorByIndex(int i) { 406 switch (i) { 407 case 0: 408 return m_receiveProcessor; 409 case 1: 410 // if (m_snoopMode) { 411 // return m_receiveProcessor2; 412 // } else { 413 return m_transmitProcessor; 414 // } 415 default: 416 return NULL; 417 } 418 return 0; 419 } 420 421 int 422 AvDevice::startStreamByIndex(int i) { 423 int iso_channel=0; 424 int plug=0; 425 int hostplug=-1; 426 427 // if (m_snoopMode) { 428 // 429 // switch (i) { 430 // case 0: 431 // // snooping doesn't use CMP, but obtains the info of the channel 432 // // from the target plug 433 // 434 // // TODO: get isochannel from plug 435 // 436 // // set the channel obtained by the connection management 437 // m_receiveProcessor->setChannel(iso_channel); 438 // break; 439 // case 1: 440 // // snooping doesn't use CMP, but obtains the info of the channel 441 // // from the target plug 442 // 443 // // TODO: get isochannel from plug 444 // 445 // // set the channel obtained by the connection management 446 // m_receiveProcessor2->setChannel(iso_channel); 447 // 448 // break; 449 // default: 450 // return 0; 451 // } 452 // } else { 453 454 switch (i) { 455 case 0: 456 // do connection management: make connection 457 iso_channel = iec61883_cmp_connect( 458 m_p1394Service->getHandle(), 459 m_iNodeId | 0xffc0, 460 &plug, 461 raw1394_get_local_id (m_p1394Service->getHandle()), 462 &hostplug, 463 &m_receiveProcessorBandwidth); 464 465 // set the channel obtained by the connection management 466 m_receiveProcessor->setChannel(iso_channel); 467 break; 468 case 1: 469 // do connection management: make connection 470 iso_channel = iec61883_cmp_connect( 471 m_p1394Service->getHandle(), 472 raw1394_get_local_id (m_p1394Service->getHandle()), 473 &hostplug, 474 m_iNodeId | 0xffc0, 475 &plug, 476 &m_transmitProcessorBandwidth); 477 478 // set the channel obtained by the connection management 479 m_transmitProcessor->setChannel(iso_channel); 480 break; 481 default: 482 return 0; 483 } 484 // } 485 486 return 0; 487 488 } 489 490 int 491 AvDevice::stopStreamByIndex(int i) { 492 // do connection management: break connection 493 494 int plug=0; 495 int hostplug=-1; 496 // if (m_snoopMode) { 497 // switch (i) { 498 // case 0: 499 // // do connection management: break connection 500 // 501 // break; 502 // case 1: 503 // // do connection management: break connection 504 // 505 // break; 506 // default: 507 // return 0; 508 // } 509 // } else { 510 switch (i) { 511 case 0: 512 // do connection management: break connection 513 iec61883_cmp_disconnect( 514 m_p1394Service->getHandle(), 515 m_iNodeId | 0xffc0, 516 plug, 517 raw1394_get_local_id (m_p1394Service->getHandle()), 518 hostplug, 519 m_receiveProcessor->getChannel(), 520 m_receiveProcessorBandwidth); 521 522 break; 523 case 1: 524 // do connection management: break connection 525 iec61883_cmp_disconnect( 526 m_p1394Service->getHandle(), 527 raw1394_get_local_id (m_p1394Service->getHandle()), 528 hostplug, 529 m_iNodeId | 0xffc0, 530 plug, 531 m_transmitProcessor->getChannel(), 532 m_transmitProcessorBandwidth); 533 534 break; 535 default: 536 return 0; 537 } 538 // } 539 540 return 0; 541 } 542 543 } branches/libfreebob-2.0/src/maudio/maudio_avdevice.h
r298 r336 22 22 #define MAUDIODEVICE_H 23 23 24 #include "iavdevice.h"25 26 24 #include "debugmodule/debugmodule.h" 27 25 #include "libfreebobavc/avc_definitions.h" 28 26 #include "libfreebobavc/avc_extended_cmd_generic.h" 29 27 #include "libfreebob/xmlparser.h" 28 29 #include "libstreaming/AmdtpStreamProcessor.h" 30 #include "libstreaming/AmdtpPort.h" 31 #include "libstreaming/AmdtpPortInfo.h" 32 33 #include "iavdevice.h" 30 34 31 35 class ConfigRom; … … 46 50 virtual ConfigRom& getConfigRom() const; 47 51 virtual bool addXmlDescription( xmlNodePtr pDeviceNode ); 48 virtual bool setSamplingFrequency( ESamplingFrequency eSamplingFrequency );49 52 virtual void showDevice() const; 50 virtual bool setId(unsigned int iId); 53 54 virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 55 virtual int getSamplingFrequency( ); 56 57 virtual bool setId(unsigned int id); 58 59 virtual int getStreamCount(); 60 virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i); 61 62 virtual bool prepare(); 63 64 virtual int startStreamByIndex(int i); 65 virtual int stopStreamByIndex(int i); 51 66 52 67 protected: … … 56 71 int m_iVerboseLevel; 57 72 const char* m_pFilename; 73 74 unsigned int m_id; 58 75 76 // streaming stuff 77 FreebobStreaming::AmdtpReceiveStreamProcessor *m_receiveProcessor; 78 int m_receiveProcessorBandwidth; 79 80 FreebobStreaming::AmdtpTransmitStreamProcessor *m_transmitProcessor; 81 int m_transmitProcessorBandwidth; 82 59 83 DECLARE_DEBUG_MODULE; 60 84 }; branches/libfreebob-2.0/src/motu/motu_avdevice.cpp
r312 r336 96 96 /* ======================================================================= */ 97 97 98 MotuDevice::MotuDevice( Ieee1394Service& ieee1394service, 99 int nodeId, 100 int verboseLevel ) 101 : m_1394Service( &ieee1394service ) 98 MotuDevice::MotuDevice( std::auto_ptr< ConfigRom >( configRom ), 99 Ieee1394Service& ieee1394service, 100 int nodeId, 101 int verboseLevel ) 102 : m_configRom( configRom ) 103 , m_1394Service( &ieee1394service ) 102 104 , m_motu_model( MOTUFW_MODEL_NONE ) 103 105 , m_nodeId( nodeId ) … … 111 113 112 114 { 113 if ( m_verboseLevel ) { 114 setDebugLevel( DEBUG_LEVEL_VERBOSE ); 115 } 115 setDebugLevel( verboseLevel ); 116 116 117 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Motu::MotuDevice (NodeID %d)\n", 117 118 nodeId ); 118 m_configRom = new ConfigRom( m_1394Service, m_nodeId );119 m_configRom->initialize();120 119 121 120 } … … 136 135 debugOutput(DEBUG_LEVEL_VERBOSE, "Could not free send iso channel %d\n", m_iso_send_channel); 137 136 } 138 delete m_configRom;139 137 } 140 138 … … 143 141 { 144 142 return *m_configRom; 143 } 144 145 struct VendorModelEntry { 146 unsigned int vendor_id; 147 unsigned int model_id; 148 }; 149 150 static VendorModelEntry supportedDeviceList[] = 151 { 152 {0x000000, 0x000001f2}, // Motu device, model entry not used 153 154 }; 155 156 bool 157 MotuDevice::probe( ConfigRom& configRom ) 158 { 159 unsigned int vendorId = configRom.getNodeVendorId(); 160 unsigned int modelId = configRom.getModelId(); 161 162 for ( unsigned int i = 0; 163 i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 164 ++i ) 165 { 166 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 167 //&& ( supportedDeviceList[i].model_id == modelId ) 168 ) 169 { 170 switch (configRom.getUnitVersion()) { 171 case MOTUFW_UNITVER_828mkII: 172 return true; 173 case MOTUFW_UNITVER_TRAVELER: 174 return true; 175 } 176 } 177 } 178 179 return false; 145 180 } 146 181 branches/libfreebob-2.0/src/motu/motu_avdevice.h
r310 r336 81 81 }; 82 82 83 MotuDevice( Ieee1394Service& ieee1394Service, 83 MotuDevice( std::auto_ptr<ConfigRom>( configRom ), 84 Ieee1394Service& ieee1394Service, 84 85 int nodeId, 85 86 int verboseLevel ); 86 87 virtual ~MotuDevice(); 87 88 89 static bool probe( ConfigRom& configRom ); 88 90 virtual bool discover(); 89 91 virtual ConfigRom& getConfigRom() const; … … 115 117 116 118 protected: 119 std::auto_ptr<ConfigRom>( m_configRom ); 117 120 Ieee1394Service* m_1394Service; 118 ConfigRom* m_configRom;121 119 122 signed int m_motu_model; 120 123 int m_nodeId; branches/libfreebob-2.0/src/rme/rme_avdevice.cpp
r332 r336 96 96 /* ======================================================================= */ 97 97 98 RmeDevice::RmeDevice( Ieee1394Service& ieee1394service, 99 int nodeId, 100 int verboseLevel ) 101 : m_1394Service( &ieee1394service ) 98 RmeDevice::RmeDevice( std::auto_ptr< ConfigRom >( configRom ), 99 Ieee1394Service& ieee1394service, 100 int nodeId, 101 int verboseLevel ) 102 : m_configRom( configRom ) 103 , m_1394Service( &ieee1394service ) 102 104 , m_rme_model( RME_MODEL_NONE ) 103 105 , m_nodeId( nodeId ) … … 111 113 112 114 { 113 if ( m_verboseLevel ) { 114 setDebugLevel( DEBUG_LEVEL_VERBOSE ); 115 } 115 setDebugLevel( verboseLevel ); 116 116 117 debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme::RmeDevice (NodeID %d)\n", 117 118 nodeId ); 118 m_configRom = new ConfigRom( m_1394Service, m_nodeId );119 m_configRom->initialize();120 119 121 120 } … … 136 135 debugOutput(DEBUG_LEVEL_VERBOSE, "Could not free send iso channel %d\n", m_iso_send_channel); 137 136 } 138 delete m_configRom; 137 139 138 } 140 139 … … 143 142 { 144 143 return *m_configRom; 144 } 145 146 struct VendorModelEntry { 147 unsigned int vendor_id; 148 unsigned int model_id; 149 }; 150 151 static VendorModelEntry supportedDeviceList[] = 152 { 153 {0x0001, 0x00000a35}, // RME Fireface-800 154 155 }; 156 157 bool 158 RmeDevice::probe( ConfigRom& configRom ) 159 { 160 unsigned int vendorId = configRom.getNodeVendorId(); 161 unsigned int modelId = configRom.getModelId(); 162 163 for ( unsigned int i = 0; 164 i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 165 ++i ) 166 { 167 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 168 && ( supportedDeviceList[i].model_id == modelId ) 169 ) 170 { 171 return true; 172 } 173 } 174 175 return false; 145 176 } 146 177 branches/libfreebob-2.0/src/rme/rme_avdevice.h
r332 r336 43 43 }; 44 44 45 RmeDevice( Ieee1394Service& ieee1394Service, 45 RmeDevice( std::auto_ptr<ConfigRom>( configRom ), 46 Ieee1394Service& ieee1394Service, 46 47 int nodeId, 47 48 int verboseLevel ); 48 49 virtual ~RmeDevice(); 49 50 51 static bool probe( ConfigRom& configRom ); 50 52 virtual bool discover(); 51 53 virtual ConfigRom& getConfigRom() const; … … 75 77 76 78 protected: 79 std::auto_ptr<ConfigRom>( m_configRom ); 77 80 Ieee1394Service* m_1394Service; 78 ConfigRom* m_configRom;81 79 82 signed int m_rme_model; 80 83 int m_nodeId; branches/libfreebob-2.0/src/xmlparser.c
r153 r336 177 177 ConnectionSpecParseNode( "Dimension", dimension ); 178 178 ConnectionSpecParseNode( "Samplerate", samplerate ); 179 ConnectionSpecParseNode( "IsoChannel", iso_channel ); 179 ConnectionSpecParseNode( "IsoChannel", iso_channel ); 180 ConnectionSpecParseNode( "Master", is_master ); 180 181 181 182 if ( !xmlStrcmp( cur->name, (const xmlChar*) "Streams" ) ) { … … 673 674 } 674 675 675 if ( xmlStrcmp( base->name, (const xmlChar*) "FreeBo bConnectionInfo") ) {676 if ( xmlStrcmp( base->name, (const xmlChar*) "FreeBoBConnectionInfo") ) { 676 677 fprintf( stderr, 677 678 "document of the wrong type, root node " 678 "!= FreeBo bConnectionInfo\n" );679 "!= FreeBoBConnectionInfo\n" ); 679 680 return 0; 680 681 } … … 712 713 int nb_devices=freebob_xmlparse_get_nb_devices(doc, base); 713 714 714 fprintf( stderr,715 /* fprintf( stderr, 715 716 "Nb devices %d\n", 716 nb_devices ); 717 nb_devices );*/ 717 718 718 719 for(device_nr=0;device_nr<nb_devices;device_nr++) { … … 754 755 } 755 756 756 if ( xmlStrcmp( base->name, (const xmlChar*) "FreeBo bConnectionInfo") ) {757 if ( xmlStrcmp( base->name, (const xmlChar*) "FreeBoBConnectionInfo") ) { 757 758 fprintf( stderr, 758 759 "document of the wrong type, root node " 759 "!= FreeBo bConnectionInfo\n" );760 "!= FreeBoBConnectionInfo\n" ); 760 761 return 0; 761 762 } branches/libfreebob-2.0/tests/Makefile.am
r262 r336 1 1 # Makefile.am - Makefile template 2 # Copyright (C) 2005 by Daniel Wagner.2 # Copyright (C) 2005,06 by Daniel Wagner. 3 3 # 4 # This file is part of FreeBo b.4 # This file is part of FreeBoB. 5 5 # 6 # FreeBo bis free software; you can redistribute it and/or modify6 # FreeBoB is free software; you can redistribute it and/or modify 7 7 # it under the terms of the GNU General Public License as published by 8 8 # the Free Software Foundation; either version 2 of the License, or 9 9 # (at your option) any later version. 10 # FreeBo bis distributed in the hope that it will be useful,10 # FreeBoB is distributed in the hope that it will be useful, 11 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 13 # GNU General Public License for more details. 14 14 # You should have received a copy of the GNU General Public License 15 # along with FreeBo b; if not, write to the Free Software15 # along with FreeBoB; if not, write to the Free Software 16 16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 … … 21 21 $(LIBAVC1394_CFLAGS) 22 22 23 # noinst_PROGRAMS = # test-freebob test-extplugcmd freebob-server 24 noinst_PROGRAMS = test-freebob 23 noinst_PROGRAMS = test-freebob test-extplugcmd test-fw410 freebob-server \ 24 test-volume test-mixer 25 25 noinst_HEADERS = 26 26 … … 28 28 test_freebob_LDADD = $(top_builddir)/src/libfreebob.la \ 29 29 $(LIBXML_LIBS) $(LIBAVC1394_LIBS) $(LIBIEC61883_LIBS) 30 # 31 # test_extplugcmd_SOURCES = test-extplugcmd.cpp 32 # test_extplugcmd_LDADD = $(top_builddir)/src/libfreebobavc/libfreebobavc.la \ 33 # $(LIBAVC1394_LIBS) 34 # 35 # freebob_server_SOURCES = freebob-server.c 36 # freebob_server_LDADD = $(top_builddir)/src/libfreebob.la $(LIBXML_LIBS) \ 37 # $(LIBAVC1394_LIBS) $(LIBIEC61883_LIBS) -lrom1394 30 31 test_extplugcmd_SOURCES = test-extplugcmd.cpp 32 test_extplugcmd_LDADD = $(top_builddir)/src/libfreebob.la \ 33 $(LIBAVC1394_LIBS) 34 35 test_volume_SOURCES = test-volume.cpp 36 test_volume_LDADD = $(top_builddir)/src/libfreebob.la \ 37 $(LIBAVC1394_LIBS) 38 39 test_mixer_SOURCES = test-mixer.cpp 40 test_mixer_LDADD = $(top_builddir)/src/libfreebob.la \ 41 $(LIBAVC1394_LIBS) 42 43 test_fw410_SOURCES = test-fw410.cpp 44 test_fw410_LDADD = $(LIBAVC1394_LIBS) $(LIBIEC61883_LIBS) -lrom1394 45 46 freebob_server_SOURCES = freebob-server.c 47 freebob_server_LDADD = $(top_builddir)/src/libfreebob.la $(LIBXML_LIBS) \ 48 $(LIBAVC1394_LIBS) $(LIBIEC61883_LIBS) -lrom1394 38 49 39 50 40 # 51 #TESTS_ENVIRONMENT 41 52 TEST = test-freebob branches/libfreebob-2.0/tests/test-extplugcmd.cpp
r155 r336 2 2 * Copyright (C) 2005,06 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. branches/libfreebob-2.0/tests/test-freebob.c
r199 r336 2 2 * Copyright (C) 2005 by Daniel Wagner 3 3 * 4 * This file is part of FreeBo b.4 * This file is part of FreeBoB. 5 5 * 6 * FreeBo bis free software; you can redistribute it and/or modify6 * FreeBoB is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 * FreeBo bis distributed in the hope that it will be useful,10 * FreeBoB is distributed in the hope that it will be useful, 11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 14 * 15 15 * You should have received a copy of the GNU General Public License 16 * along with FreeBo b; if not, write to the Free Software16 * along with FreeBoB; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 18 * MA 02111-1307 USA. … … 29 29 #include <string.h> 30 30 31 #define FREEBOB_BOUNCE_SERVER_GETXMLDESCRIPTION_CMD 32 #define AVC1394_SUBUNIT_TYPE_FREEBOB_BOUNCE_SERVER 0x0D 33 31 34 const char *argp_program_version = PACKAGE_STRING; 32 35 const char *argp_program_bug_address = PACKAGE_BUGREPORT; 33 36 34 37 // Program documentation. 35 static char doc[] = "FreeBo b -- a driver for BeBobdevices (test application)\n\n"38 static char doc[] = "FreeBoB -- a driver for BeBoB devices (test application)\n\n" 36 39 "OPERATION: discover\n" 37 40 " odisocver\n" … … 260 263 261 264 if(arguments.node_id_set) { 262 if ( ! freebob_set_samplerate(fb_handle, arguments.node_id, samplerate)) {263 264 265 266 265 if (freebob_set_samplerate(fb_handle, arguments.node_id, samplerate) != 0) { 266 fprintf( stderr, "Could not set samplerate\n" ); 267 freebob_destroy_handle( fb_handle ); 268 return -1; 269 } 267 270 268 271 } else { … … 273 276 274 277 for(i=0;i<devices_on_bus;i++) { 275 276 277 278 if (! freebob_set_samplerate(fb_handle, node_id, samplerate)) {279 280 281 282 283 278 int node_id=freebob_get_device_node_id(fb_handle, i); 279 printf(" set samplerate for device = %d, node = %d\n", i, node_id); 280 281 if (freebob_set_samplerate(fb_handle, node_id, samplerate) != 0) { 282 fprintf( stderr, "Could not set samplerate\n" ); 283 freebob_destroy_handle( fb_handle ); 284 return -1; 285 } 286 } 284 287 285 288 }