Changeset 445
- Timestamp:
- 04/02/07 12:35:17 (16 years ago)
- Files:
-
- trunk/libffado/autogen.sh (modified) (1 diff)
- trunk/libffado/ChangeLog (modified) (5 diffs)
- trunk/libffado/configure.ac (modified) (8 diffs)
- trunk/libffado/doc/adding_devices.dox (modified) (10 diffs)
- trunk/libffado/doc/amdtpstreamprocessor.dox (modified) (1 diff)
- trunk/libffado/doc/mainpage.dox (modified) (2 diffs)
- trunk/libffado/doc/reference.doxygen.in (modified) (2 diffs)
- trunk/libffado/doc/streaming.xmi (modified) (15 diffs)
- trunk/libffado/libffado.pc.in (modified) (1 diff)
- trunk/libffado/Makefile.am (modified) (2 diffs)
- trunk/libffado/src/bebob-sync.cpp (modified) (5 diffs)
- trunk/libffado/src/bebob/bebob_avdevice.cpp (modified) (31 diffs)
- trunk/libffado/src/bebob/bebob_avdevice.h (modified) (4 diffs)
- trunk/libffado/src/bebob/bebob_avdevice_subunit.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_avdevice_subunit.h (modified) (6 diffs)
- trunk/libffado/src/bebob/bebob_avplug.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_avplug.h (modified) (12 diffs)
- trunk/libffado/src/bebob/bebob_dl_bcd.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_dl_bcd.h (modified) (5 diffs)
- trunk/libffado/src/bebob/bebob_dl_codes.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_dl_codes.h (modified) (8 diffs)
- trunk/libffado/src/bebob/bebob_dl_mgr.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_dl_mgr.h (modified) (3 diffs)
- trunk/libffado/src/bebob/bebob_functionblock.cpp (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_functionblock.h (modified) (3 diffs)
- trunk/libffado/src/bounce/bounce_avdevice.cpp (modified) (31 diffs)
- trunk/libffado/src/bounce/bounce_avdevice.h (modified) (6 diffs)
- trunk/libffado/src/bounce/bounce_slave_avdevice.cpp (modified) (27 diffs)
- trunk/libffado/src/bounce/bounce_slave_avdevice.h (modified) (7 diffs)
- trunk/libffado/src/bridgeco-downloader.cpp (modified) (5 diffs)
- trunk/libffado/src/debugmodule/debugmodule.cpp (modified) (15 diffs)
- trunk/libffado/src/debugmodule/debugmodule.h (modified) (9 diffs)
- trunk/libffado/src/debugmodule/test_debugmodule.cpp (modified) (1 diff)
- trunk/libffado/src/devicemanager.cpp (modified) (24 diffs)
- trunk/libffado/src/devicemanager.h (modified) (3 diffs)
- trunk/libffado/src/dice/dice_avdevice.cpp (modified) (84 diffs)
- trunk/libffado/src/dice/dice_avdevice.h (modified) (11 diffs)
- trunk/libffado/src/dice/dice_defines.h (modified) (4 diffs)
- trunk/libffado/src/fbtypes.h (modified) (2 diffs)
- trunk/libffado/src/ffado.cpp (modified) (8 diffs)
- trunk/libffado/src/ffado_streaming.cpp (modified) (30 diffs)
- trunk/libffado/src/iavdevice.cpp (modified) (3 diffs)
- trunk/libffado/src/iavdevice.h (modified) (6 diffs)
- trunk/libffado/src/libavc/avc_connect.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/avc_connect.h (modified) (2 diffs)
- trunk/libffado/src/libavc/avc_definitions.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/avc_definitions.h (modified) (4 diffs)
- trunk/libffado/src/libavc/avc_extended_cmd_generic.cpp (modified) (4 diffs)
- trunk/libffado/src/libavc/avc_extended_cmd_generic.h (modified) (5 diffs)
- trunk/libffado/src/libavc/avc_extended_plug_info.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/avc_extended_plug_info.h (modified) (3 diffs)
- trunk/libffado/src/libavc/avc_extended_stream_format.cpp (modified) (3 diffs)
- trunk/libffado/src/libavc/avc_extended_stream_format.h (modified) (3 diffs)
- trunk/libffado/src/libavc/avc_extended_subunit_info.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/avc_extended_subunit_info.h (modified) (3 diffs)
- trunk/libffado/src/libavc/avc_function_block.cpp (modified) (6 diffs)
- trunk/libffado/src/libavc/avc_function_block.h (modified) (3 diffs)
- trunk/libffado/src/libavc/avc_generic.cpp (modified) (3 diffs)
- trunk/libffado/src/libavc/avc_generic.h (modified) (6 diffs)
- trunk/libffado/src/libavc/avc_plug_info.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/avc_plug_info.h (modified) (4 diffs)
- trunk/libffado/src/libavc/avc_serialize.cpp (modified) (3 diffs)
- trunk/libffado/src/libavc/avc_serialize.h (modified) (4 diffs)
- trunk/libffado/src/libavc/avc_signal_source.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/avc_signal_source.h (modified) (3 diffs)
- trunk/libffado/src/libavc/avc_subunit_info.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/avc_subunit_info.h (modified) (4 diffs)
- trunk/libffado/src/libavc/avc_unit_info.cpp (modified) (1 diff)
- trunk/libffado/src/libavc/avc_unit_info.h (modified) (3 diffs)
- trunk/libffado/src/libieee1394/ARMHandler.cpp (modified) (5 diffs)
- trunk/libffado/src/libieee1394/ARMHandler.h (modified) (6 diffs)
- trunk/libffado/src/libieee1394/configrom.cpp (modified) (10 diffs)
- trunk/libffado/src/libieee1394/configrom.h (modified) (4 diffs)
- trunk/libffado/src/libieee1394/IEC61883.cpp (modified) (1 diff)
- trunk/libffado/src/libieee1394/IEC61883.h (modified) (5 diffs)
- trunk/libffado/src/libieee1394/ieee1394service.cpp (modified) (32 diffs)
- trunk/libffado/src/libieee1394/ieee1394service.h (modified) (14 diffs)
- trunk/libffado/src/libosc/OscArgument.cpp (modified) (5 diffs)
- trunk/libffado/src/libosc/OscArgument.h (modified) (4 diffs)
- trunk/libffado/src/libosc/OscMessage.cpp (modified) (3 diffs)
- trunk/libffado/src/libosc/OscMessage.h (modified) (3 diffs)
- trunk/libffado/src/libosc/OscNode.cpp (modified) (13 diffs)
- trunk/libffado/src/libosc/OscNode.h (modified) (4 diffs)
- trunk/libffado/src/libosc/OscResponse.cpp (modified) (1 diff)
- trunk/libffado/src/libosc/OscResponse.h (modified) (4 diffs)
- trunk/libffado/src/libosc/OscServer.cpp (modified) (6 diffs)
- trunk/libffado/src/libosc/OscServer.h (modified) (3 diffs)
- trunk/libffado/src/libosc/unittests.cpp (modified) (13 diffs)
- trunk/libffado/src/libstreaming/AmdtpPort.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/AmdtpPort.h (modified) (3 diffs)
- trunk/libffado/src/libstreaming/AmdtpPortInfo.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/AmdtpPortInfo.h (modified) (4 diffs)
- trunk/libffado/src/libstreaming/AmdtpSlaveStreamProcessor.cpp (modified) (24 diffs)
- trunk/libffado/src/libstreaming/AmdtpSlaveStreamProcessor.h (modified) (7 diffs)
- trunk/libffado/src/libstreaming/AmdtpStreamProcessor.cpp (modified) (61 diffs)
- trunk/libffado/src/libstreaming/AmdtpStreamProcessor.h (modified) (13 diffs)
- trunk/libffado/src/libstreaming/cip.h (modified) (6 diffs)
- trunk/libffado/src/libstreaming/cycletimer.h (modified) (25 diffs)
- trunk/libffado/src/libstreaming/IsoHandler.cpp (modified) (41 diffs)
- trunk/libffado/src/libstreaming/IsoHandler.h (modified) (12 diffs)
- trunk/libffado/src/libstreaming/IsoHandlerManager.cpp (modified) (22 diffs)
- trunk/libffado/src/libstreaming/IsoHandlerManager.h (modified) (7 diffs)
- trunk/libffado/src/libstreaming/IsoStream.cpp (modified) (3 diffs)
- trunk/libffado/src/libstreaming/IsoStream.h (modified) (6 diffs)
- trunk/libffado/src/libstreaming/MotuPort.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/MotuPort.h (modified) (4 diffs)
- trunk/libffado/src/libstreaming/MotuPortInfo.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/MotuPortInfo.h (modified) (4 diffs)
- trunk/libffado/src/libstreaming/MotuStreamProcessor.cpp (modified) (42 diffs)
- trunk/libffado/src/libstreaming/MotuStreamProcessor.h (modified) (4 diffs)
- trunk/libffado/src/libstreaming/Port.cpp (modified) (5 diffs)
- trunk/libffado/src/libstreaming/Port.h (modified) (7 diffs)
- trunk/libffado/src/libstreaming/PortManager.cpp (modified) (5 diffs)
- trunk/libffado/src/libstreaming/PortManager.h (modified) (4 diffs)
- trunk/libffado/src/libstreaming/StreamProcessor.cpp (modified) (19 diffs)
- trunk/libffado/src/libstreaming/StreamProcessor.h (modified) (15 diffs)
- trunk/libffado/src/libstreaming/StreamProcessorManager.cpp (modified) (47 diffs)
- trunk/libffado/src/libstreaming/StreamProcessorManager.h (modified) (9 diffs)
- trunk/libffado/src/libutil/Atomic.h (modified) (10 diffs)
- trunk/libffado/src/libutil/cycles.h (modified) (7 diffs)
- trunk/libffado/src/libutil/DelayLockedLoop.cpp (modified) (20 diffs)
- trunk/libffado/src/libutil/DelayLockedLoop.h (modified) (3 diffs)
- trunk/libffado/src/libutil/OptionContainer.cpp (modified) (11 diffs)
- trunk/libffado/src/libutil/OptionContainer.h (modified) (14 diffs)
- trunk/libffado/src/libutil/PacketBuffer.cpp (modified) (4 diffs)
- trunk/libffado/src/libutil/PacketBuffer.h (modified) (3 diffs)
- trunk/libffado/src/libutil/PosixThread.cpp (modified) (6 diffs)
- trunk/libffado/src/libutil/PosixThread.h (modified) (6 diffs)
- trunk/libffado/src/libutil/ringbuffer.c (modified) (17 diffs)
- trunk/libffado/src/libutil/ringbuffer.h (modified) (16 diffs)
- trunk/libffado/src/libutil/serialize.cpp (modified) (3 diffs)
- trunk/libffado/src/libutil/serialize.h (modified) (1 diff)
- trunk/libffado/src/libutil/StreamStatistics.cpp (modified) (1 diff)
- trunk/libffado/src/libutil/StreamStatistics.h (modified) (3 diffs)
- trunk/libffado/src/libutil/SystemTimeSource.cpp (modified) (2 diffs)
- trunk/libffado/src/libutil/SystemTimeSource.h (modified) (4 diffs)
- trunk/libffado/src/libutil/test-dll.cpp (modified) (4 diffs)
- trunk/libffado/src/libutil/Thread.h (modified) (3 diffs)
- trunk/libffado/src/libutil/Time.c (modified) (2 diffs)
- trunk/libffado/src/libutil/Time.h (modified) (3 diffs)
- trunk/libffado/src/libutil/TimeSource.cpp (modified) (15 diffs)
- trunk/libffado/src/libutil/TimeSource.h (modified) (6 diffs)
- trunk/libffado/src/libutil/TimestampedBuffer.cpp (modified) (59 diffs)
- trunk/libffado/src/libutil/TimestampedBuffer.h (modified) (11 diffs)
- trunk/libffado/src/libutil/unittests.cpp (modified) (10 diffs)
- trunk/libffado/src/Makefile.am (modified) (11 diffs)
- trunk/libffado/src/maudio/fw410.xml (modified) (2 diffs)
- trunk/libffado/src/maudio/fwap.xml (modified) (2 diffs)
- trunk/libffado/src/maudio/maudio_avdevice.cpp (modified) (3 diffs)
- trunk/libffado/src/maudio/maudio_avdevice.h (modified) (4 diffs)
- trunk/libffado/src/maudio/refdesign.xml (modified) (2 diffs)
- trunk/libffado/src/metrichalo/mh_avdevice.cpp (modified) (6 diffs)
- trunk/libffado/src/metrichalo/mh_avdevice.h (modified) (3 diffs)
- trunk/libffado/src/motu/motu_avdevice.cpp (modified) (19 diffs)
- trunk/libffado/src/motu/motu_avdevice.h (modified) (6 diffs)
- trunk/libffado/src/rme/rme_avdevice.cpp (modified) (1 diff)
- trunk/libffado/src/rme/rme_avdevice.h (modified) (1 diff)
- trunk/libffado/src/ser.cpp (modified) (3 diffs)
- trunk/libffado/src/threads.h (modified) (7 diffs)
- trunk/libffado/support/jack/ffado_driver.c (modified) (68 diffs)
- trunk/libffado/support/jack/ffado_driver.h (modified) (12 diffs)
- trunk/libffado/tests/Makefile.am (modified) (2 diffs)
- trunk/libffado/tests/streaming/debugtools.c (modified) (1 diff)
- trunk/libffado/tests/streaming/debugtools.h (modified) (1 diff)
- trunk/libffado/tests/streaming/Makefile.am (modified) (2 diffs)
- trunk/libffado/tests/streaming/test-isohandling.cpp (modified) (3 diffs)
- trunk/libffado/tests/streaming/testmidistreaming1.c (modified) (1 diff)
- trunk/libffado/tests/streaming/teststreaming.c (modified) (1 diff)
- trunk/libffado/tests/streaming/teststreaming2.c (modified) (1 diff)
- trunk/libffado/tests/streaming/teststreaming3.c (modified) (1 diff)
- trunk/libffado/tests/SytMonitor.cpp (modified) (5 diffs)
- trunk/libffado/tests/SytMonitor.h (modified) (3 diffs)
- trunk/libffado/tests/test-cycletimer.cpp (modified) (12 diffs)
- trunk/libffado/tests/test-extplugcmd.cpp (modified) (4 diffs)
- trunk/libffado/tests/test-ffado.cpp (modified) (24 diffs)
- trunk/libffado/tests/test-freebob.cpp (deleted)
- trunk/libffado/tests/test-fw410.cpp (modified) (5 diffs)
- trunk/libffado/tests/test-ieee1394service.cpp (modified) (5 diffs)
- trunk/libffado/tests/test-mixer.cpp (modified) (2 diffs)
- trunk/libffado/tests/test-sytmonitor.cpp (modified) (21 diffs)
- trunk/libffado/tests/test-timestampedbuffer.cpp (modified) (27 diffs)
- trunk/libffado/tests/test-volume.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/autogen.sh
r125 r445 2 2 # Run this to generate all the initial makefiles, etc. 3 3 4 5 4 autoreconf -f -i -s 6 ./configure --enable-maintainer-mode7 maketrunk/libffado/ChangeLog
r336 r445 1 REMARK: Please use the SVN commit messages as replacement for ChangeLog 2 3 2007-03-20 Pieter Palmers 4 * name change from FreeBoB to FFADO 5 * replaced tabs by 4 spaces 6 * got rid of end-of-line spaces 7 * made all license and copyrights conform 8 library becomes LGPL, apps become GPL 9 explicitly state LGPL v2.1 and GPL v2 (don't like v3 draft) 10 copyrights are 2005-2007 Daniel & Pieter 11 except for the MotU stuff (C) Jonathan, Pieter 12 1 13 2006-11-20 Daniel Wagner <wagi@monom.org> 2 14 3 4 5 6 7 8 15 * freebob_set_samplerate: return value consitency fix. On success 16 it return 0 else -1. Reported by Jamie Gennis jgennis at gmail dot com 17 18 * freebob_streaming_start: Reset the playback ringbuffer before calling 19 freebob_streaming_start. 20 9 21 2006-11-12 Daniel Wagner <wagi@monom.org> 10 22 11 12 13 14 23 * test mixer programm added. 24 25 * basic function block AV/C commands added. 26 test program for setting the volume added. 15 27 16 28 2006-11-11 Daniel Wagner <wagi@monom.org> 17 29 18 19 30 * src/bebob/bebob_avdevice.cpp (setSamplingFrequencyPlug): copy past 31 error fixed. Reported by Jamie Gennis jgennis at gmail dot com 20 32 21 33 2006-08-27 Daniel Wagner <wagi@monom.org> 22 34 23 24 25 26 35 * configure.ac: Version set to 1.4.0 36 * maudio device support infrastructure added. Implements 37 IAvDevice interface, discover reads the information from 38 an xml file. 27 39 28 40 2006-08-22 Daniel Wagner <wagi@monom.org> 29 41 30 31 32 42 * configure.ac: Version bump to 1.3.0 43 * freebob_sync allows now to set the sync mode. It does not 44 check yet if it really could set the mode. 33 45 34 46 2006-07-17 Daniel Wagner <wagi@monom.org> 35 47 36 37 38 48 * configure.ac: Version bump to 1.2.0 49 * freebob_sync program added 50 * Basic interface added for sync info 39 51 40 52 2006-07-02 Daniel Wagner <wagi@monom.org> 41 53 42 54 * firmware downloader: check device firmware compatibility 43 55 44 56 2006-06-27 Daniel Wagner <wagi@monom.org> 45 57 46 47 48 49 50 58 * configure.ac: Version bump to 1.1.0 59 * remove bebob_light code 60 * downloader various improvements 61 * ConfigRom::isAvcDevice() removed. Device probe code added. 62 Each device driver class can check if it supports a device. 51 63 52 64 2006-06-24 Daniel Wagner <wagi@monom.org> 53 65 54 66 * tests/streaming/Makefile.am: Fixed build problem with missing '/'. 55 67 56 68 2006-06-21 Daniel Wagner <wagi@monom.org> 57 69 58 70 * freebob-downloader first version added 59 71 60 72 2006-06-10 Daniel Wagner <wagi@monom.org> 61 73 62 63 74 * Changed building rules: No static sub libraries 75 are build anymore. 64 76 65 77 2006-06-01 Daniel Wagner <wagi@monom.org> 66 78 67 68 69 70 71 72 79 * configure.ac: Version bump to 1.0.0 80 81 * Changed all FreeBob to FreeBoB 82 * Removed all .cvsignore 83 * Added Pieter to AUTHORS 84 * Updated NEWS and README (release canditate date added) 73 85 74 86 2006-05-31 Daniel Wagner <wagi@monom.org> 75 87 76 77 88 * Free all allocated asprintf buffers after xmlNewChild. 89 Compiler warning removed 78 90 79 91 2006-05-31 Pieter Palmers <pieterpalmers@users.sourceforge.net> … … 110 122 111 123 2006-05-26 Pieter Palmers <pieterpalmers@users.sourceforge.net> 112 124 * src/libfreebobstreaming/*: 113 125 - added a 'verbose' option to disable/enable message output 114 126 - removed some residual messages … … 131 143 132 144 2006-05-12 Pieter Palmers <pieterpalmers@users.sourceforge.net> 133 134 135 136 137 138 139 145 * src/libfreebobstreaming/*: 146 - Code cleanup 147 - Improved SSE code 148 - ISO connection parameters are calculated instead of being user 149 specified. Note: you need a new jackd backend version due to this. 150 151 * configure.ac: Version bumped to 0.8.2 140 152 141 153 2006-05-06 Daniel Wagner <wagi@monom.org> 142 154 143 144 145 146 147 155 * This patch fixes two issues when building: 156 - libfreebob include files aren't found when build dir != source dir 157 - some libraries aren't found when they're not in a system install dir 158 159 Jeremy Kerr 148 160 149 161 2006-05-04 Pieter Palmers <pieterpalmers@users.sourceforge.net> 150 162 151 152 153 163 * configure.ac: Version bumped to 0.8.1 164 165 * Introduced SSE-accellerated packet encoders/decoders 154 166 155 167 2006-05-04 Daniel Wagner <wagi@monom.org> 156 168 157 158 159 160 169 * configure.ac: Version bumped to 0.8.0 170 171 * Discovering code ported stable 0.2.0 version 172 to head and activated for default discovering. 161 173 162 174 2006-05-04 Daniel Wagner <wagi@monom.org> 163 175 164 165 166 167 176 * configure.ac: Version bumped to 0.7.2 177 178 * src/bebob: Some cleanup on naming and 179 namespaces. 168 180 169 181 2006-05-03 Daniel Wagner <wagi@monom.org> 170 182 171 172 173 174 183 * configure.ac: Version bumped to 0.7.1 184 185 * Fixed bug in SignalSource command which 186 prevented one to set the samplerate. 175 187 176 188 2006-04-23 Daniel Wagner <wagi@monom.org> 177 189 178 179 180 181 182 190 * configure.ac: Version bumped to 0.7.0 191 192 * Abstract interface IAvDevice introduced. 193 * BeBoB device discovering code moved into bebob directory. 194 * Bounce device added. 183 195 184 196 2006-04-17 Daniel Wagner <wagi@monom.org> 185 197 186 187 188 189 190 191 192 198 * configure.ac: Version bumped to 0.6.4 199 200 * src/libfreebobavc/avc_generic.cpp (serialize): Decode subunit_type 201 and subunit_id field. 202 (fire): avc1394_transaction_block2 inteface change update. 203 * src/libfreebobavc/ieee1394service.cpp (transactionBlock): Likewise. 204 * src/libfreebobavc/ieee1394service.h: Likewise. 193 205 194 206 2006-04-11 Daniel Wagner <wagi@monom.org> 195 207 196 197 198 199 200 208 * configure.ac: Version bumped to 0.6.3 209 210 * src/avdevicesubunit.cpp (discoverFunctionBlocks): reformating. 211 (discoverFunctionBlocksDo): Really added a correct 212 bugfix for the reuse of ExtendedSubunitInfoCmd. 201 213 202 214 2006-04-07 Pieter Palmers <pieterpalmers@users.sourceforge.net> 203 215 204 205 206 207 216 * src/avdevice.h src/avdevice.cpp: moved the include of stdint.h 217 from the implementation to the header, to fix certain compilation 218 problems wrt uint64_t. This datatype is also used in the class 219 definition in avdevice.h. 208 220 209 221 2006-04-05 Pieter Palmers <pieterpalmers@users.sourceforge.net> 210 222 211 212 213 214 215 216 217 218 219 223 * configure.ac: Version bump to 0.6.2 224 225 * src/freebob.cpp: Retry setting the sample rate if it fails the 226 first time. 227 228 * src/libfreebobstreaming/*: Added an way to choose for playback 229 or capture only (for ALSA plugin), using the options passed when 230 creating the freebob device. * src/libfreebobstreaming/*: fixed 231 the bug that prevented playback only operation. 220 232 221 233 2006-04-04 Daniel Wagner <wagi@monom.org> 222 234 223 224 225 226 227 235 * configure.ac: Version bump to 0.6.1 236 237 * src/avdevicesubunit.cpp (discoverFunctionBlocksDo): 238 ExtendedSubunitInfoCmd is not reusable at this point. 239 Moved into its own block so that's initatilialized correctly. 228 240 229 241 2006-03-30 Daniel Wagner <wagi@monom.org> 230 242 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 243 * configure.ac: Version bump to 0.6.0 244 245 * src/*: Verbose bool turned int verbose level. 246 247 * src/libfreebobavc/*: Moved fire implementation to 248 base class (AVCCommand). 249 250 * libfreebob/freebob.h: freebob_sleep_after_avc_command 251 workaround added. 252 253 * tests/test-freebob.c: Verbose bool turned into verbose level. 254 Workaround: sleep after avc command added. 255 256 * tests/streaming/Makefile.am (*_SOURCES): Added libavc1394 to LDADD. 257 * tests/Makefile.am (*_SOURCES): Likewise. 258 259 * tests/streaming/teststreaming2.c (fid_in): compiler warning fixed. 248 260 249 261 2006-03-20 Daniel Wagner <wagi@monom.org> 250 262 251 252 253 254 255 263 * configure.ac: Version bump to 0.5.2 264 265 * src/avplug.cpp (discoverStreamFormat): If no stream format information 266 is available or format hierarchy root is not Audio&Music skip plug. 267 (discoverSupportedStreamFormats): Added 'support' for IEC60968-3 (SPDIF transparent) 256 268 257 269 2006-03-15 Daniel Wagner <wagi@monom.org> 258 270 259 260 261 262 263 264 265 266 267 271 * configure.ac: Version bump to 0.5.1 272 273 * src/libfreebobavc/avc_extended_plug_info.cpp (fire): 274 Handle NOT_IMPLEMENTED. 275 276 * src/avplug.h: Input and output plug discovering part 277 fixed. Now connection are correctly handled. 278 * src/avplug.cpp: Likewise. 279 * src/avdevicesubunit.cpp: Likewise. 268 280 269 281 2006-03-12 Daniel Wagner <wagi@monom.org> 270 282 271 272 283 * src/libfreebobavc/ieee1394service.cpp (transactionBlock): Set retry 284 value to 10. 273 285 274 286 2006-03-10 Daniel Wagner <wagi@monom.org> 275 287 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 288 * configure.ac: Version bump to 0.5.0 289 290 * src/avdevice.cpp: Plug connection discovering 291 finished. 292 * src/avdevicesubunit.cpp: Likewise. 293 * src/avdevicesubunit.h: Likewise. 294 * src/avplug.cpp: Likewise. 295 * src/avplug.h: Likewise. 296 * src/functionblock.cpp: Likewise. 297 * src/functionblock.h: Likewise. 298 299 * src/libfreebobavc/Makefile.am: New files added. 300 * src/libfreebobavc/avc_extended_subunit_info.cpp: Likewise. 301 * src/libfreebobavc/avc_extended_subunit_info.h: Likewise 302 303 * src/libfreebobavc/avc_definitions.h: Several small improvements. 304 * src/libfreebobavc/avc_extended_cmd_generic.cpp: Likewise. 305 * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 306 * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 307 * src/libfreebobavc/avc_generic.cpp: Likewise. 296 308 297 309 2006-03-05 Daniel Wagner <wagi@monom.org> 298 310 299 300 301 302 303 304 305 306 307 308 309 310 311 311 * src/avdevice.cpp: Plug connection discovering also on 312 subunits (disabled because missing funciton blocks). 313 Sync connections code cleanup. 314 * src/avdevice.h: Likewise. 315 * src/avdevicesubunit.cpp: Likewise. 316 * src/avdevicesubunit.h: Likewise. 317 * src/avplug.cpp: Likewise. 318 * src/avplug.h: Likewise. 319 320 * src/Makefile.am: Added functionblock.cpp and 321 functionblock.h 322 * src/functionblock.cpp: New file 323 * src/functionblock.h: Likewise. 312 324 313 325 2006-03-04 Daniel Wagner <wagi@monom.org> 314 326 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 327 * src/avdevice.cpp: Sync mode discovering improved. 328 * src/avdevice.h: Likewise. 329 * src/avplug.cpp: Likewise. 330 * src/avplug.h: Likewise. 331 332 * tests/test-freebob.c: Added 'odiscover' command which 333 does not print the xml stuff. 334 335 * src/avdevice.cpp: Added 'verbose' argument to constructor 336 and set debug level to DEBUG_LEVEL_VERBOSE if 'verbose' 337 is true, e.g enables verbose mode with '-v' argument passed 338 to test-freebob. 339 * src/avdevice.h: Likewsise. 340 * src/avdevicesubunit.cpp: Likewsise. 341 * src/avdevicesubunit.h: Likewsise. 342 * src/avplug.cpp: Likewsise. 343 * src/avplug.h: Likewsise. 344 * src/devicemanager.cpp: Likewsise. 345 * src/debugmodule/debugmodule.cpp: Likewsise. 346 * src/debugmodule/debugmodule.h: Likewsise. 347 * src/debugmodule/test_debugmodule.cpp: Likewsise. 348 349 * src/avdevice.cpp: eAP_* renamed into eAPA_*. 350 EAvPlugDirection and EAvPlugType introduced. All PlugAddress:ePD_ and 351 ExtendedPlugInfoPlugTypeSpecificData::eEPIPT_* exchanged with corresponding 352 AvPlug definitions. 353 * src/avdevice.h: Likewise. 354 * src/avdevicesubunit.cpp: Likewise. 355 * src/avdevicesubunit.h: Likewise. 356 * src/avdevicexml.cpp: Likewise. 357 * src/avplug.cpp: Likewise. 358 * src/avplug.h: Likewise. 347 359 348 360 2006-03-02 Daniel Wagner <wagi@monom.org> 349 361 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 362 * src/avplug.cpp (discoverStreamFormat): Sanity check turned 363 into warning. 364 365 * configure.ac: bumb minor version to 0.4 366 367 * src/libfreebobavc/avc_extended_cmd_generic.h: plugAddressPlugDirectionToString 368 and plugAddressAddressModeToString added. 369 * src/libfreebobavc/avc_extended_cmd_generic.cpp: Likewise. 370 371 * src/avplug.h: Enum EAvPlugType renamed to EAvPlugAddressType. 372 getPlugAddressType added. getPlugType returns now real plug type. 373 (class AvPlugManager): getPlugByType added. 374 375 * src/avdevice.h: getPlugByType added. 376 * src/avdevice.cpp: Likewise. 377 (discoverSyncModes): Use getPlugByType instead 378 of hardcoded id to find sync plugs. 379 380 * src/devicemanager.h: Verbose argument not in constructor 381 instead in discover method. 382 * src/devicemanager.cpp: Likewise. 383 384 * libfreebob/freebob.h (freebob_discover_devices): Verbose argument 385 added. 386 * src/libfreebobstreaming/freebob_streaming.c: Likewise. 387 * src/freebob.cpp: Likewise. 388 * tests/test-freebob.c: Likewise. 377 389 378 390 2006-03-01 Daniel Wagner <wagi@monom.org> 379 391 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 392 * configure.ac: bumb minor version to 0.3 393 394 * src/avdevice.cpp: Discover connections between plugs. 395 * src/avdevice.h: Likewise. 396 * src/avdevicesubunit.cpp: Likewise. 397 * src/avdevicesubunit.h: Likewise. 398 * src/avdevicexml.cpp: Likewise. 399 * src/avplug.cpp: Likewise. 400 * src/avplug.h: Likewise. 401 * src/devicemanager.cpp: Likewise. 402 * src/devicemanager.h: Likewise. 403 * src/freebob.cpp: Likewise. 404 405 * src/libfreebobavc/avc_extended_cmd_generic.cpp: Give 406 return value to caller. New undefined plug address 407 introduced. Handling of response message is more rebust now. 408 * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 409 * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 410 * src/libfreebobavc/avc_extended_stream_format.cpp: Likewise. 411 * src/libfreebobavc/avc_extended_stream_format.h: Likewise. 412 * src/libfreebobavc/avc_plug_info.cpp: Likewise. 413 * src/libfreebobavc/avc_signal_source.cpp: Likewise. 414 * src/libfreebobavc/avc_signal_source.h: Likewise. 415 * src/libfreebobavc/avc_subunit_info.cpp: Likewise. 416 * src/libfreebobavc/avc_unit_info.cpp: Likewise. 417 * src/libfreebobavc/avc_extended_plug_info.cpp: Likewise. 418 * src/libfreebobavc/avc_extended_stream_format.cpp: Likewise. 419 * src/libfreebobavc/avc_extended_cmd_generic.cpp: 420 * src/libfreebobavc/avc_extended_cmd_generic.h: Likewise. 421 422 * src/libfreebobstreaming/freebob_debug.h: DEBUG is defined through --enable-debug 423 switch. 424 425 * src/libfreebobstreaming/freebob_connections.h: Removed double defined variable 426 if DEBUG is defined. 415 427 416 428 2006-02-28 Pieter Palmers <pieterpalmers@users.sourceforge.net> 417 418 419 429 * Added the streaming API that was previously hardcoded into the jackd backend 430 to the library as src/libfreebobstreaming. 431 * Added test programs for the streaming API in tests/streaming 420 432 421 433 2006-02-26 Daniel Wagner <wagi@monom.org> 422 434 423 424 425 426 427 428 429 430 431 432 433 435 * src/avdevice.cpp: Some more refactoring (m_isoInputPlugs and m_isoOutputPlugs 436 unified into m_isoPlugs). Discovering of unit external plugs. 437 * src/avdevice.h: Likewise. 438 * src/avdevicexml.cpp: Likewise. 439 * src/avdevicesubunit.cpp: Likewise. 440 * src/avdevicesubunit.h: Likewise. 441 * src/avplug.cpp: Likewise. 442 * src/avplug.h: Likewise. 443 444 * src/libfreebobavc/avc_extended_cmd_generic.h (class UnitPlugAddress): 445 ePT_Unknown enum added. 434 446 435 447 2006-02-22 Daniel Wagner <wagi@monom.org> 436 448 437 438 449 * configure.ac 450 src/Makefile.am 439 451 src/avdevice.cpp 440 452 src/avdevice.h … … 443 455 src/avdevicexml.cpp 444 456 src/avplug.cpp 445 457 src/avplug.h 446 458 src/avplugxml.cpp 447 459 src/libfreebobavc/avc_extended_plug_info.cpp … … 451 463 src/libfreebobavc/avc_plug_info.cpp 452 464 src/libfreebobavc/avc_plug_info.h: 453 454 455 456 457 458 459 460 465 Refactoring: plug discovering is now part of AvPlug 466 instead of AvDevice. 467 All plugs of music and audio subunit are now also 468 discovered. 469 libfreebobavc: Copy constructor added. 470 471 The overhaul is not finished. This is the first 472 version which works again. 461 473 462 474 2006-01-19 Daniel Wagner <wagi@monom.org> 463 475 464 476 * This patch cleans up the external dependency detection for 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 477 libfreebob. At present, building libfreebob is not possible 478 if libraries are outside the system include/library paths 479 (ie /usr/ and /usr/local). Use the results of pkg-config to 480 specify the correct paths to the automake system. 481 482 Becuase we're using pkgconfig, there's no real need to use 483 AC_CHECK_LIB or AC_CHECK_HEADERS. However, these could 484 potentially be reinstated, but need to be fixed to check in 485 the locations specified by pkgconfig. 486 487 * It is not currently possible to build freebob in a directory 488 outside the source dir (ie, builddir != srcdir). This patch 489 fixes the include paths to allow this. (it's handy for keeping 490 the source tree clean, or when building on multiple architectures 491 - I use a build dir of $srcdir/obj-$arch-$os) 492 493 Both patches are written by Jeremy Kerr jk at ozlabs dot org 482 494 483 495 2006-01-12 Daniel Wagner <wagi@monom.org> 484 496 485 486 497 * src/avdevice.cpp: Include stdint.h. 498 Some compilers seem to need the definitions. 487 499 488 500 2006-01-08 Daniel Wagner <wagi@monom.org> 489 501 490 491 492 493 494 495 502 * libfreebob/freebob.h 503 libfreebob/xmlparser.h 504 src/avdevice.cpp 505 src/xmlparser.c 506 tests/test-freebob.c: 507 Add stream format info support. 496 508 497 509 * src/avdevice.h 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 510 src/avdevice.cpp: 511 Refactoring and code duplication removal. 512 513 * src/avdevice.cpp (getModelName): 514 Return model name and not vendor name. 515 (getVendorName): 516 Return vendor name and not model name. 517 (discoverStep10Plug): Implementation added. 518 (enumerateSubUnits): max_subunit_id removed. 519 (addXmlDescription): Add stream format infos. 520 521 * src/avdevice.h: discoverStep10 added. 522 Renaming of addPlugToXmlDescription to addXmlDescriptionPlug. 523 ESampleRate to ESamplingFrequency changes. 524 525 * src/avplug.cpp (getSampleRate): 526 Use convertESamplingFrequency instead of 527 local implementation. 528 529 * src/avplug.h: 530 ESampleRate to ESamplingFrequency changes. 531 Added FormatInfo struct. 532 533 * src/devicemanager.cpp (getXmlDescription): 534 Print GUID correctly. 535 536 * src/freebob.cpp (parseSampleRate): 537 Moved to avc_definitions.cpp 538 539 * src/libfreebobavc/avc_definitions.h 540 src/libfreebobavc/avc_definitions.cpp: 541 Renamed ESampleRate back to ESamlingFrequency. 542 Added connvert functions for ESamplingFrequency. 543 544 * configure.ac: New micro version. 533 545 534 546 2006-01-06 Daniel Wagner <wagi@monom.org> 535 547 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 548 * tests/test-freebob.c (main): setsamplerate on all 549 devices takes now the samplerate argument. 550 551 * src/freebob.cpp (freebob_set_samplerate): After setting 552 sampling rate rediscover devices. 553 554 * src/devicemanager.cpp (discover): Clear vector as well after 555 delete all elements. Cout and cerr replaced with debugModule. 556 557 * src/avdevice.cpp (discoverStep8): Skip sync plug. 558 (discoverStep9): Sanity check fixed and reenabled. 559 560 * configure.ac: New micro version. 561 562 * src/avdevice.h 563 src/avdevice.cpp (setSampleRate): Implementation added. 564 565 * src/devicemanager.cpp 566 src/devicemanager.h (getAvDevice): New functions 567 (setNodeSampleFrequency): removed. 568 569 * src/freebob.cpp (parseSampleRate): New function. 570 (freebob_set_samplerate): Use AvDevice directly 571 for setting samplerate. 572 573 * src/libfreebobavc/avc_definitions.h 574 src/libfreebobavc/avc_definitions.cpp: Changed ESampleFrequency 575 to ESampleRate. 576 577 * tests/test-freebob.c: Info added about OPERATION arguments. 578 Parse sample rate for setsamplerate command. 579 Let emacs reindent code. Sorry Pieter :) 568 580 569 581 2006-01-04 Daniel Wagner <wagi@monom.org> 570 582 571 572 573 574 575 576 577 583 * tests/test-extplugcmd.cpp: Changed test application 584 to use PlugType and PlugName command for testing. 585 586 * src/libfreebobavc/avc_extended_plug_info.cpp (serialize): 587 The string.length() thing did not work as expected. A workaround 588 added which converts the C++ string into a C string before strlen 589 is used. 578 590 579 591 2006-01-03 Daniel Wagner <wagi@monom.org> 580 592 581 582 583 593 * src/devicemanager.cpp (discover): If config rom initializing 594 failes just skip this device. The PHY might be in power safe 595 mode and then there is no config rom to be discovered. 584 596 585 597 2006-01-02 Pieter Palmer <pieterpalmers@users.sourceforge.net> 586 598 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 599 * tests/test-freebob.c: Added support for scanning the whole bus. 600 Added xmldump operation to dump an XML description of the FW bus. 601 602 * src/freebob.cpp src/freebob.h: Added freebob_print_xml_description 603 to print an XML description of the bus. 604 Added freebob_node_is_valid_freebob_device(). 605 Added freebob_get_nb_devices_on_bus(). 606 Added freebob_get_device_node_id(). 607 Added freebob_set_samplerate() as a dummy (unimplemented) 608 609 * src/libfreebobavc/avc_connect.cpp 610 src/libfreebobavc/avc_extended_stream_format.cpp 611 src/libfreebobavc/avc_extended_stream_format.h 612 src/libfreebobavc/avc_plug_info.cpp 613 src/libfreebobavc/avc_signal_source.cpp 614 src/avcdevice.cpp 615 src/avdevice.h 616 src/avplug.cpp 617 src/avplug.h 618 src/devicemanager.cpp 619 src/devicemanager.h: 620 Fixed NodeId bug. 621 Commented out sanity check that failed for midi channels. 622 Fixed Dimension bug. 623 Increased all "XXX random length" requests. 624 Made a mess of clean code ;) 625 626 * configure.ac: Bumped library verson 627 628 * src/xmlparser.c 629 tests/test-freeebob.c: Added support to detect & use 630 multiple devices on the bus. 631 632 * src/libfreebobavc/avc_extendec_plug_info.cpp 633 src/configrom.cpp: 634 Some small memory access bugfixes. 635 624 636 2006-01-02 Daniel Wagner <wagi@monom.org> 625 637 626 627 638 * src/avdevice.cpp (discoverStep9): Sanity check: 8 logical 639 midi channel fit into 1 channel. 628 640 629 641 2005-12-31 Daniel Wagner <wagi@monom.org> 630 642 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 643 * src/debugmodule/debugmodule.h: debugFatal, debugError 644 and debugWarning declaration always declared. 645 646 * src/xmlparser.c (freebob_xmlparse_connection): Parse IsoChannel 647 node. 648 649 * src/freebob.cpp (freebob_print_connection_info): Print all 650 members from connection_spec (IsoChannel and IsMaster). 651 652 * src/avdevice.cpp (addPlugToXmlDescription): Set direction 653 according library interface definition and not according 654 avc model. 655 Add IsoChannel node. 656 657 * configure.ac: Version set to 0.0.2 646 658 647 659 2005-12-30 Daniel Wagner <wagi@monom.org> 648 660 649 650 651 652 653 654 655 656 661 * src/libfreebobavc/avc_extended_stream_format.cpp (fire): Buffer 662 length increased. 663 664 * src/avdevice.cpp (discoverStep9): Error message extended. 665 More debug info added. 666 667 * src/debugmodule/debugmodule.h: Enable debugFatal, debugError and 668 also in the release case. 657 669 658 670 2005-12-28 Daniel Wagner <wagi@monom.org> 659 671 660 661 662 663 664 665 666 667 668 669 670 671 672 672 * tests/test-freebob.c (main): Debug info added. 673 674 * src/libfreebobavc/ieee1394service.cpp (initialize): Use 675 raw1394_new_handle_on_port instead of raw1394_new_handle and 676 raw1394_set_port. 677 678 * src/devicemanager.cpp (initialize): After deleteing 1394 service 679 clear also pointer. 680 681 * libfreebob/freebob.h: freebob_direction enum names changed 682 members which jack backed freebob needs to freebob_connection added 683 684 * configure.ac: Update library version depency. 673 685 674 686 2005-12-27 Daniel Wagner <wagi@monom.org> 675 687 676 677 678 688 * src/libfreebobavc/avc_extended_plug_info.cpp (serialize): 689 Do cast of the length field to let the compiler know which version 690 of the serializing code it has to take. 679 691 680 692 2005-12-26 Daniel Wagner <wagi@monom.org> 681 693 682 683 684 694 * Initial check-in and first beta relase 'late x-mass gift'. 695 696 trunk/libffado/configure.ac
r435 r445 1 # configure.ac - Configure script for F reeBoB.1 # configure.ac - Configure script for FFADO. 2 2 # Copyright (C) 2005,06 by Daniel Wagner. 3 3 # Copyright (C) 2006,07 by Pieter Palmers. 4 4 # 5 # This file is part of FreeBoB. 5 # This file is part of FFADO. 6 # FFADO is based upon FreeBoB. 6 7 # 7 # F reeBoBis free software; you can redistribute it and/or modify8 # FFADO is free software; you can redistribute it and/or modify 8 9 # it under the terms of the GNU General Public License as published by 9 10 # the Free Software Foundation; either version 2 of the License, or 10 11 # (at your option) any later version. 11 # F reeBoBis distributed in the hope that it will be useful,12 # FFADO is distributed in the hope that it will be useful, 12 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 15 # GNU General Public License for more details. 15 16 # You should have received a copy of the GNU General Public License 16 # along with F reeBoB; if not, write to the Free Software17 # along with FFADO; if not, write to the Free Software 17 18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 # … … 23 24 24 25 25 m4_define(f reebob_major_version, 1)26 m4_define(f reebob_minor_version, 999)27 m4_define(f reebob_micro_version, 4)28 29 m4_define(f reebob_version, freebob_major_version.freebob_minor_version.freebob_micro_version)30 31 AC_INIT(libf reebob, freebob_version, <freebob-devel@lists.sf.net>)26 m4_define(ffado_major_version, 1) 27 m4_define(ffado_minor_version, 999) 28 m4_define(ffado_micro_version, 4) 29 30 m4_define(ffado_version, ffado_major_version.ffado_minor_version.ffado_micro_version) 31 32 AC_INIT(libffado, ffado_version, <ffado-devel@lists.sf.net>) 32 33 33 34 # Before making a release, the LT_VERSION string should be modified. … … 39 40 # - If the interface is the same as the previous version, change to C:R+1:A 40 41 41 LT_VERSION= 2:0:042 LT_VERSION=1:0:0 42 43 AC_SUBST(LT_VERSION) 43 44 44 AC_DEFINE(F REEBOB_MAJOR_VERSION, freebob_major_version,[Freebobmajor version])45 AC_DEFINE(F REEBOB_MINOR_VERSION, freebob_minor_version,[Freebobminor version])46 AC_DEFINE(F REEBOB_MICRO_VERSION, freebob_micro_version,[Freebobmicro version])47 AC_SUBST(F REEBOB_MINOR_VERSION, freebob_minor_version)48 AC_SUBST(F REEBOB_MAJOR_VERSION, freebob_major_version)49 AC_SUBST(F REEBOB_MICRO_VERSION, freebob_micro_version)45 AC_DEFINE(FFADO_MAJOR_VERSION, ffado_major_version,[FFADO major version]) 46 AC_DEFINE(FFADO_MINOR_VERSION, ffado_minor_version,[FFADO minor version]) 47 AC_DEFINE(FFADO_MICRO_VERSION, ffado_micro_version,[FFADO micro version]) 48 AC_SUBST(FFADO_MINOR_VERSION, ffado_minor_version) 49 AC_SUBST(FFADO_MAJOR_VERSION, ffado_major_version) 50 AC_SUBST(FFADO_MICRO_VERSION, ffado_micro_version) 50 51 51 52 AM_INIT_AUTOMAKE([subdir-objects]) 52 53 AM_MAINTAINER_MODE 53 AC_CONFIG_SRCDIR([src/f reebob.cpp])54 AC_CONFIG_SRCDIR([src/ffado.cpp]) 54 55 AC_CONFIG_HEADER([config.h]) 55 56 AC_GNU_SOURCE … … 109 110 AC_CHECK_LIB(pthread, pthread_create,, 110 111 [ 111 AC_ERROR(You need the pthread library to compile f reebob)112 AC_ERROR(You need the pthread library to compile ffado) 112 113 ]) 113 114 … … 181 182 182 183 if test "$target_cpu" = "i586"; then 183 F REEBOB_OPT_CFLAGS="-march=i586 "184 FFADO_OPT_CFLAGS="-march=i586 " 184 185 elif test "$target_cpu" = "i686"; then 185 F REEBOB_OPT_CFLAGS="-march=i686"186 FFADO_OPT_CFLAGS="-march=i686" 186 187 else 187 188 : 188 189 fi 189 190 190 F REEBOB_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $FREEBOB_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS"191 FFADO_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $FFADO_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS" 191 192 192 193 … … 195 196 [ask the compiler for its best optimizations]), 196 197 [ if test x$enable_optimize != xno ; then 197 CFLAGS="$CFLAGS $F REEBOB_OPT_CFLAGS" ;198 CXXFLAGS="$CXXFLAGS $F REEBOB_OPT_CFLAGS"198 CFLAGS="$CFLAGS $FFADO_OPT_CFLAGS" ; 199 CXXFLAGS="$CXXFLAGS $FFADO_OPT_CFLAGS" 199 200 fi 200 201 ] … … 399 400 doc/Makefile 400 401 doc/reference.doxygen 401 libf reebob/Makefile402 libffado/Makefile 402 403 src/Makefile 403 404 tests/Makefile 404 405 tests/streaming/Makefile 405 libf reebob.pc])406 libffado.pc]) 406 407 407 408 AC_OUTPUT … … 410 411 AC_MSG_RESULT([ 411 412 412 F reeBoB$VERSION is now configured for $canonical_host_type413 FFADO $VERSION is now configured for $canonical_host_type 413 414 414 415 Building support for: $supported_devices trunk/libffado/doc/adding_devices.dox
r249 r445 1 /*2 * This is the main page of the FreeBoB reference manual, built using3 * doxygen.4 */5 6 1 /** 7 @page adding_devices Adding support for new devices to LibFreeBoB2 @page adding_devices Adding support for new devices to libffado 8 3 9 4 @author Pieter Palmers <pieterpalmers@users.sourceforge.net> … … 21 16 Layer 2 is implemented by subclassing the StreamProcessor class in src/libstreaming/ 22 17 23 Basic operation of libf reebobis:18 Basic operation of libffado is: 24 19 - Create a DeviceManager that iterates over all nodes connected to the 1394 bus. 25 20 For every node present, it tries the probeFunctions (probeBeBoB, probeMotu, ...). … … 54 49 the start/stop mechanism differ. 55 50 56 In order to add support for a device to freebob, two things should be implemented:51 In order to add support for a device to libffado, two things should be implemented: 57 52 - an IAvDevice descendant that takes care of the device discovery & configuration 58 53 - a StreamProcessor descendant that takes care of the device specific stream translation … … 65 60 @section streamingbaseclasses Streaming base class hierarchy and operation 66 61 67 This section explains the implementation details of the streaming part of LibFreeBoB.62 This section explains the implementation details of the streaming part of libffado. 68 63 69 64 The following figure shows the base class diagram, and the derrived classed that implement … … 89 84 - an IsoHandlerManager instance 90 85 91 Related classes: FreebobStreaming::StreamProcessorManager86 Related classes: Streaming::StreamProcessorManager 92 87 93 88 @subsection isoside The ISO side: 1394 isochronous traffic management … … 103 98 \note This abstraction is completely device independent, it only provides a mechanism to transmit or receive a certain isochronous stream. It could as well be used for video streams... 104 99 105 Related classes: FreebobStreaming::IsoStream, FreebobStreaming::IsoHandlerManager, FreebobStreaming::IsoHandler100 Related classes: Streaming::IsoStream, Streaming::IsoHandlerManager, Streaming::IsoHandler 106 101 107 102 @subsection audioapiside The Audio API side: port management … … 137 132 The idea is that we present a collection of ports to the Audio API side which from which it can read or to which it can write. 138 133 139 Related classes: FreebobStreaming::Port, FreebobStreaming::PortManager134 Related classes: Streaming::Port, Streaming::PortManager 140 135 141 136 @subsection connectingisoandaudio Connecting the ISO side with the Audio API side … … 161 156 A StreamProcessor also has the init(), prepare() and reset() calls, which are still to be documented (see later). 162 157 163 Related classes: FreebobStreaming::StreamProcessor, FreebobStreaming::ReceiveStreamProcessor, FreebobStreaming::TransmitStreamProcessor, FreebobStreaming::PortManager158 Related classes: Streaming::StreamProcessor, Streaming::ReceiveStreamProcessor, Streaming::TransmitStreamProcessor, Streaming::PortManager 164 159 165 160 @subsection mappingports Mapping Ports to IsoStreams … … 167 162 168 163 @subsection puttingtogether Putting it all together 164 165 @note this is outdated 166 169 167 The framework is completed by introducing the StreamProcessorManager. As indicated before, this class implements a 'collection of StreamProcessors' and an IsoHandlerManager. 170 168 171 169 First of all, the StreamProcessorManager is a collection of StreamProcessors, hence it implements the registerStreamProcessor and unregisterStreamProcessor methods. It maintains the list of StreamProcessors under it's control. When StreamProcessors are (un)registered, they are automatically (un)registered to the IsoHandlerManager too, creating IsoHandlers to handle them. Remember that StreamProcessor is a descendant of IsoStream, and can therefore be registered to an IsoHandlerManager. This results in the fact that the ISO stream the StreamProcessor is supposed to handle, will be attached to an IsoHandler. 172 170 173 Furthermore StreamProcessorManager is a child of the FreebobRunnable interface, and can therefore be used as the worker class for a FreebobThread. A complicated sentence to say that the StreamProcessorManager will start up a thread that calls its Execute() function, which in its turn calls the IsoHandlerManager Exectute() method (hence iterating the IsoHandlers managed by the IsoHandlerManager). This thread also performs the synchronisation as described in the next paragraph.171 Furthermore StreamProcessorManager is a child of the Runnable interface, and can therefore be used as the worker class for a Thread. A complicated sentence to say that the StreamProcessorManager will start up a thread that calls its Execute() function, which in its turn calls the IsoHandlerManager Exectute() method (hence iterating the IsoHandlers managed by the IsoHandlerManager). This thread also performs the synchronisation as described in the next paragraph. 174 172 175 173 The third function of the StreamProcessorManager is the synchronisation between the ISO side and the Audio API side. To implement this, the class provides a wait() method that waits on a synchronisation primitive. This primitive is signalled by the thread that iterates the IsoHandlerManager. This thread will signal the primitive when all StreamProcessors indicate that they have one period ready. … … 181 179 \note A blocking-read/nonblocking write (and the other way around) version of access to PacketBuffered Ports is planned. 182 180 183 Related classes: FreebobStreaming::StreamProcessorManager, FreebobStreaming::IsoHandlerManager, FreebobStreaming::Port181 Related classes: Streaming::StreamProcessorManager, Streaming::IsoHandlerManager, Streaming::Port 184 182 185 183 @subsection callingorder Some notes on when which method is called trunk/libffado/doc/amdtpstreamprocessor.dox
r249 r445 1 /*2 * This is the main page of the FreeBoB reference manual, built using3 * doxygen.4 */5 6 1 /** 7 2 @page amdtpdescription The AMDTP StreamProcessor trunk/libffado/doc/mainpage.dox
r249 r445 1 1 /* 2 * This is the main page of the F reeBoBreference manual, built using2 * This is the main page of the FFADO reference manual, built using 3 3 * doxygen. 4 4 */ 5 5 6 6 /** 7 @mainpage F reeBoB - Firewire (pro-)audiofor Linux7 @mainpage FFADO - Free Firewire (pro-)Audio Drivers for Linux 8 8 9 9 @author Pieter Palmers <pieterpalmers@users.sourceforge.net> … … 11 11 @section intro Introduction 12 12 13 F reeBoBis intended as an intermediate layer between the Linux1394 kernel/userspace layer, and the various audio API's (ALSA, jack, ...) present.13 FFADO is intended as an intermediate layer between the Linux1394 kernel/userspace layer, and the various audio API's (ALSA, jack, ...) present. 14 14 15 15 \note this is a SVN version, therefore it is highly volatile. Certain parts of the documentation can be outdated. This documentation is also auto-generated, and it can occur that unused classes and interfaces appear in the documentation. This pollution will be cleaned up as we go along. 16 16 17 @see <http://f reebob.sourceforge.net>17 @see <http://ffado.sourceforge.net> 18 18 19 19 @section library Client side library 20 20 21 F reeBoBpresents an interface that can be used to implement backends for various audio21 FFADO presents an interface that can be used to implement backends for various audio 22 22 API's. Currently the best support is for the JACK backend. It is also intended to implement configuration applications like mixer controls etc.. 23 23 24 The library API is split in two parts: 25 - @ref freebob.h "<libfreebob/freebob.h>" is the discovery & configuration interface 26 - @ref freebob_streaming.h "<libfreebob/freebob_streaming.h>" is the streaming interface 27 24 The library API's external C interface is defined in: 25 - @ref ffado.h "<libffado/ffado.h>" 28 26 29 27 @section devicesupport Adding support for unsupported devices 30 28 31 Initial support is/was for BeBoB devices only, however theframework32 is usable for all firewire audio devices.29 Initial support by FreeBoB was for BeBoB devices only, however the FFADO framework 30 is usable for all FireWire audio devices. 33 31 34 32 Take a look at the @ref adding_devices page for a detailed description. trunk/libffado/doc/reference.doxygen.in
r250 r445 18 18 # by quotes) that should identify the project. 19 19 20 PROJECT_NAME = LIBF REEBOB20 PROJECT_NAME = LIBFFADO 21 21 22 22 # The PROJECT_NUMBER tag can be used to enter a project or revision number. … … 366 366 @top_srcdir@/src/ \ 367 367 @top_srcdir@/src/debugmodule \ 368 @top_srcdir@/src/libavc \ 369 @top_srcdir@/src/libieee1394 \ 370 @top_srcdir@/src/libosc \ 368 371 @top_srcdir@/src/libstreaming \ 369 372 @top_srcdir@/src/libutil \ 370 @top_srcdir@/src/libfreebobavc \ 371 @top_srcdir@/libfreebob/ 373 @top_srcdir@/src/bebob \ 374 @top_srcdir@/src/bounce \ 375 @top_srcdir@/src/dice \ 376 @top_srcdir@/src/maudio \ 377 @top_srcdir@/src/metrichalo \ 378 @top_srcdir@/src/motu \ 379 @top_srcdir@/src/rme \ 380 @top_srcdir@/libffado/ 381 372 382 373 383 # If the value of the INPUT tag contains directories, you can use the trunk/libffado/doc/streaming.xmi
r403 r445 85 85 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="13397" isRoot="false" isAbstract="false" name="PortVectorIterator" elementReference="13396" /> 86 86 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="13401" isRoot="false" isAbstract="false" name="Port*" elementReference="12717" /> 87 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14009" isRoot="false" isAbstract="false" name="F reebobRunnableInterface*" elementReference="14008" />87 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14009" isRoot="false" isAbstract="false" name="FFADORunnableInterface*" elementReference="14008" /> 88 88 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14530" isRoot="false" isAbstract="false" name="unsigned char*" elementReference="14529" /> 89 89 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14540" isRoot="false" isAbstract="false" name="unsigned int*" elementReference="12734" /> … … 96 96 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="14665" isRoot="false" isAbstract="false" name="IsoHandlerManager*" elementReference="14659" /> 97 97 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15179" isRoot="false" isAbstract="false" name="quadlet_t*" elementReference="15178" /> 98 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15190" isRoot="false" isAbstract="false" name="f reebob_ringbuffer_t*" elementReference="15166" />98 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15190" isRoot="false" isAbstract="false" name="ffado_ringbuffer_t*" elementReference="15166" /> 99 99 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15236" isRoot="false" isAbstract="false" name="IsoHandler*" elementReference="15194" /> 100 100 <UML:DataType stereotype="12706" isSpecification="false" isLeaf="false" visibility="public" namespace="88018" xmi.id="15278" isRoot="false" isAbstract="false" name="PacketBuffer*" elementReference="15167" /> … … 109 109 </UML:Package> 110 110 <UML:Class comment="Id$ *//* 111 F reeBobStreaming API112 F reeBob= Firewire (pro-)audio for linux111 FFADO Streaming API 112 FFADO = Firewire (pro-)audio for linux 113 113 114 http://f reebob.sf.net114 http://ffado.sf.net 115 115 116 116 Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> … … 958 958 </UML:Class> 959 959 <UML:Class comment="Id$ *//* 960 F reeBobStreaming API961 F reeBob= Firewire (pro-)audio for linux960 FFADO Streaming API 961 FFADO = Firewire (pro-)audio for linux 962 962 963 http://f reebob.sf.net963 http://ffado.sf.net 964 964 965 965 Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> … … 1034 1034 <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13000" isRoot="false" isAbstract="false" name="enum E_Formats" /> 1035 1035 <UML:Class comment="Id$ *//* 1036 F reeBobStreaming API1037 F reeBob= Firewire (pro-)audio for linux1036 FFADO Streaming API 1037 FFADO = Firewire (pro-)audio for linux 1038 1038 1039 http://f reebob.sf.net1039 http://ffado.sf.net 1040 1040 1041 1041 Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> … … 1531 1531 <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13991" isRoot="false" isAbstract="false" name="SInt32" /> 1532 1532 <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13992" isRoot="false" isAbstract="false" name="UInt64" /> 1533 <UML:Class comment="Modifications for F reebob(C) 2006, Pieter Palmers1533 <UML:Class comment="Modifications for FFADO (C) 2006, Pieter Palmers 1534 1534 Copied from the jackd/jackdmp sources 1535 1535 function names changed in order to avoid naming problems when using this in … … 1549 1549 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 1550 1550 //*! 1551 \brief The POSIX thread base class." isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13993" isRoot="false" isAbstract="false" name="F reebobPosixThread" >1551 \brief The POSIX thread base class." isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13993" isRoot="false" isAbstract="false" name="FFADOPosixThread" > 1552 1552 <UML:GeneralizableElement.generalization> 1553 1553 <UML:Generalization xmi.idref="13995" /> … … 1660 1660 </UML:BehavioralFeature.parameter> 1661 1661 </UML:Operation> 1662 <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14007" isRoot="false" isAbstract="false" isQuery="false" name="F reebobPosixThread" >1662 <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14007" isRoot="false" isAbstract="false" isQuery="false" name="FFADOPosixThread" > 1663 1663 <UML:BehavioralFeature.parameter> 1664 1664 <UML:Parameter isSpecification="false" visibility="private" xmi.id="14010" value="" type="14009" name="runnable" /> … … 1668 1668 </UML:BehavioralFeature.parameter> 1669 1669 </UML:Operation> 1670 <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14014" isRoot="false" isAbstract="false" isQuery="false" name="F reebobPosixThread" >1670 <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14014" isRoot="false" isAbstract="false" isQuery="false" name="FFADOPosixThread" > 1671 1671 <UML:BehavioralFeature.parameter> 1672 1672 <UML:Parameter isSpecification="false" visibility="private" xmi.id="14015" value="" type="14009" name="runnable" /> 1673 1673 </UML:BehavioralFeature.parameter> 1674 1674 </UML:Operation> 1675 <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14016" isRoot="false" isAbstract="false" isQuery="false" name="F reebobPosixThread" >1675 <UML:Operation stereotype="12714" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14016" isRoot="false" isAbstract="false" isQuery="false" name="FFADOPosixThread" > 1676 1676 <UML:BehavioralFeature.parameter> 1677 1677 <UML:Parameter isSpecification="false" visibility="private" xmi.id="14017" value="" type="14009" name="runnable" /> … … 1679 1679 </UML:BehavioralFeature.parameter> 1680 1680 </UML:Operation> 1681 <UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="14019" isRoot="false" isAbstract="false" isQuery="false" name="~ F reebobPosixThread" />1681 <UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="14019" isRoot="false" isAbstract="false" isQuery="false" name="~ FFADOPosixThread" /> 1682 1682 <UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="14020" isRoot="false" isAbstract="false" isQuery="false" name="Start" > 1683 1683 <UML:BehavioralFeature.parameter> … … 1718 1718 </UML:Classifier.feature> 1719 1719 </UML:Class> 1720 <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13994" isRoot="false" isAbstract="false" name="F reebobThread" />1720 <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13994" isRoot="false" isAbstract="false" name="FFADOThread" /> 1721 1721 <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="13998" isRoot="false" isAbstract="false" name="pthread_t" /> 1722 1722 <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="14002" isRoot="false" isAbstract="false" name="volatile bool" /> 1723 <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="14008" isRoot="false" isAbstract="false" name="F reebobRunnableInterface" />1723 <UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="14008" isRoot="false" isAbstract="false" name="FFADORunnableInterface" /> 1724 1724 <UML:Class comment="Id$ *//* 1725 F reeBobStreaming API1726 F reeBob= Firewire (pro-)audio for linux1725 FFADO Streaming API 1726 FFADO = Firewire (pro-)audio for linux 1727 1727 1728 http://f reebob.sf.net1728 http://ffado.sf.net 1729 1729 1730 1730 Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> … … 2554 2554 </UML:Class> 2555 2555 <UML:Class comment="Id$ *//* 2556 F reeBobStreaming API2557 F reeBob= Firewire (pro-)audio for linux2556 FFADO Streaming API 2557 FFADO = Firewire (pro-)audio for linux 2558 2558 2559 http://f reebob.sf.net2559 http://ffado.sf.net 2560 2560 2561 2561 Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> … … 3556 3556 </UML:BehavioralFeature.parameter> 3557 3557 </UML:Operation> 3558 <UML:Operation comment="// F reebobRunnableInterface interface// note that this is called in we while(running) loop" isSpecification="false" isLeaf="false" visibility="protected" xmi.id="14649" isRoot="false" isAbstract="false" isQuery="false" name="Execute" >3558 <UML:Operation comment="// FFADORunnableInterface interface// note that this is called in we while(running) loop" isSpecification="false" isLeaf="false" visibility="protected" xmi.id="14649" isRoot="false" isAbstract="false" isQuery="false" name="Execute" > 3559 3559 <UML:BehavioralFeature.parameter> 3560 3560 <UML:Parameter kind="return" xmi.id="LlXy8i6aXj2o" type="12708" /> … … 3686 3686 </UML:Operation> 3687 3687 <UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="14668" isRoot="false" isAbstract="false" isQuery="false" name="~ StreamRunner" /> 3688 <UML:Operation comment="// F reebobRunnableInterface interface// note that this is called in we while(running) loop" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14669" isRoot="false" isAbstract="false" isQuery="false" name="Execute" >3688 <UML:Operation comment="// FFADORunnableInterface interface// note that this is called in we while(running) loop" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14669" isRoot="false" isAbstract="false" isQuery="false" name="Execute" > 3689 3689 <UML:BehavioralFeature.parameter> 3690 3690 <UML:Parameter kind="return" xmi.id="9wZVdbzyKUvQ" type="12708" /> … … 3698 3698 </UML:Classifier.feature> 3699 3699 </UML:Class> 3700 <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="15165" isRoot="false" isAbstract="false" name="f reebob_ringbuffer_data_t" />3701 <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="15166" isRoot="false" isAbstract="false" name="f reebob_ringbuffer_t" />3700 <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="15165" isRoot="false" isAbstract="false" name="ffado_ringbuffer_data_t" /> 3701 <UML:Class stereotype="13989" isSpecification="false" isLeaf="false" visibility="public" namespace="1" xmi.id="15166" isRoot="false" isAbstract="false" name="ffado_ringbuffer_t" /> 3702 3702 <UML:Class comment="Id$ *//* 3703 F reeBobStreaming API3704 F reeBob= Firewire (pro-)audio for linux3703 FFADO Streaming API 3704 FFADO = Firewire (pro-)audio for linux 3705 3705 3706 http://f reebob.sf.net3706 http://ffado.sf.net 3707 3707 3708 3708 Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> trunk/libffado/libffado.pc.in
r442 r445 4 4 includedir=@includedir@ 5 5 6 Name: libf reebob7 Description: F reeBoB6 Name: libffado 7 Description: FFADO 8 8 Version: @VERSION@ 9 Libs: -L${libdir} -lf reebob9 Libs: -L${libdir} -lffado 10 10 Cflags: -I${includedir} trunk/libffado/Makefile.am
r336 r445 1 # Makefile.am - Makefile template 2 # Copyright (C) 2005 by Daniel Wagner. 1 # Makefile.am - toplevel Makefile for FFADO 3 2 # 4 # This file is part of FreeBoB. 3 # Copyright (C) 2005-2007 by Daniel Wagner. 4 # Copyright (C) 2005-2007 by Pieter Palmers. 5 5 # 6 # FreeBoB is free software; you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; either version 2 of the License, or 9 # (at your option) any later version. 10 # FreeBoB is distributed in the hope that it will be useful, 6 # This file is part of FFADO. 7 # FFADO = Free Firewire (pro-)audio drivers for linux 8 # 9 # FFADO is based upon FreeBoB. 10 # 11 # FFADO is free software. 12 # 13 # you can redistribute and/or modify the library code 14 # under the terms of the GNU Lesser General Public License 15 # version 2.1, as published by the Free Software Foundation 16 # 17 # you can redistribute and/or modify the applications 18 # under the terms of the GNU General Public License 19 # version 2, as published by the Free Software Foundation 20 # 21 # FFADO is distributed in the hope that it will be useful, 11 22 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # You should have received a copy of the GNU General Public License 15 # along with FreeBoB; if not, write to the Free Software 24 # GNU (Lesser) General Public License for more details. 25 # 26 # You should have received a copy of the GNU (Lesser) General Public License 27 # along with FFADO; if not, write to the Free Software 16 28 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 29 18 SUBDIRS = libf reebobsrc tests doc30 SUBDIRS = libffado src tests doc 19 31 20 32 pkgconfigdir = $(libdir)/pkgconfig 21 pkgconfig_DATA = libf reebob.pc33 pkgconfig_DATA = libffado.pc 22 34 23 35 $(srcdir)/configure: configure.ac aclocal.m4 … … 39 51 config.status: configure 40 52 ./config.status --recheck 41 42 trunk/libffado/src/bebob-sync.cpp
r442 r445 1 /* freebob-sync.cpp 2 * Copyright (C) 2006 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB. 8 * 9 * This is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License version 2 11 * as published by the Free Software Foundation. 12 * 13 * FFADO is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 17 * 15 18 * You should have received a copy of the GNU General Public License 16 * along with F reeBoB; if not, write to the Free Software19 * along with FFADO; if not, write to the Free Software 17 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 21 * MA 02111-1307 USA. … … 30 33 // arg parsing 31 34 //////////////////////////////////////////////// 32 const char *argp_program_version = " freebob_sync 0.1";33 const char *argp_program_bug_address = "<f reebob-devel@lists.sf.net>";34 static char doc[] = " freebob_sync -- select sync mode\n\n"35 const char *argp_program_version = "bebob-sync 0.1"; 36 const char *argp_program_bug_address = "<ffado-devel@lists.sf.net>"; 37 static char doc[] = "bebob-sync -- select sync mode on a BeBoB device\n\n" 35 38 "OPERATION: set <nr>\n"; 36 39 static char args_doc[] = "NODE_ID OPERATION"; … … 41 44 }; 42 45 43 IMPL_GLOBAL_DEBUG_MODULE( freebob-sync, DebugModule::eDL_Normal ); 46 // IMPL_GLOBAL_DEBUG_MODULE( bebob-sync, DebugModule::eDL_Normal ); 47 DECLARE_GLOBAL_DEBUG_MODULE; 44 48 45 49 struct arguments … … 118 122 int node_id = strtol(arguments.args[0], &tail, 0); 119 123 if (errno) { 120 121 124 perror("argument parsng failed:"); 125 return -1; 122 126 } 123 127 trunk/libffado/src/bebob/bebob_avdevice.cpp
r436 r445 1 /* bebob_avdevice.cpp2 * Copyright (C) 2005 ,06,07 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 … … 42 45 { 43 46 {0x00000f, 0x00010065, "Mackie", "Onyx Firewire"}, 44 47 45 48 {0x0003db, 0x00010048, "Apogee Electronics", "Rosetta 200"}, 46 49 … … 105 108 106 109 void 107 AvDevice::setVerboseLevel(int l) 110 AvDevice::setVerboseLevel(int l) 108 111 { 109 112 // m_pPlugManager->setVerboseLevel(l); 110 113 111 114 IAvDevice::setVerboseLevel(l); 112 115 } … … 143 146 { 144 147 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 145 && ( supportedDeviceList[i].model_id == modelId ) 148 && ( supportedDeviceList[i].model_id == modelId ) 146 149 ) 147 150 { … … 155 158 m_model->vendor_name, m_model->model_name); 156 159 } else return false; 157 160 158 161 if ( !enumerateSubUnits() ) { 159 162 debugError( "Could not enumarate sub units\n" ); … … 709 712 debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 710 713 } 711 714 712 715 if(snoopMode) { 713 716 int current_sr=getSamplingFrequency(); … … 724 727 return false; 725 728 } 726 729 727 730 if ( !setSamplingFrequencyPlug( *plug, 728 731 AvPlug::eAPD_Input, … … 732 735 return false; 733 736 } 734 737 735 738 plug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Output, 0 ); 736 739 if ( !plug ) { … … 738 741 return false; 739 742 } 740 743 741 744 if ( !setSamplingFrequencyPlug( *plug, 742 745 AvPlug::eAPD_Output, … … 746 749 return false; 747 750 } 748 751 749 752 debugOutput( DEBUG_LEVEL_VERBOSE, 750 753 "setSampleRate: Set sample rate to %d\n", … … 886 889 "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 887 890 m_nodeId); 888 891 889 892 m_pPlugManager->showPlugs(); 890 893 } … … 946 949 // don't lock 947 950 } else { 948 951 949 952 } 950 953 … … 962 965 // don't unlock 963 966 } else { 964 967 965 968 } 966 969 return true; … … 973 976 debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 974 977 } 975 978 976 979 /////////// 977 980 // get plugs … … 989 992 990 993 int samplerate=outputPlug->getSampleRate(); 991 994 992 995 debugOutput( DEBUG_LEVEL_VERBOSE, "Initializing receive processor...\n"); 993 996 // create & add streamprocessors 994 997 Streaming::StreamProcessor *p; 995 998 996 999 p=new Streaming::AmdtpReceiveStreamProcessor( 997 1000 m_p1394Service->getPort(), … … 1011 1014 return false; 1012 1015 } 1013 1016 1014 1017 m_receiveProcessors.push_back(p); 1015 1018 … … 1029 1032 inputPlug->getNrOfChannels()); 1030 1033 } 1031 1034 1032 1035 if(!p->init()) { 1033 1036 debugFatal("Could not initialize transmit processor %s!\n", … … 1050 1053 } 1051 1054 } 1052 1055 1053 1056 // we put this SP into the transmit SP vector, 1054 1057 // no matter if we are in snoop mode or not … … 1065 1068 Streaming::StreamProcessor *processor, 1066 1069 Streaming::AmdtpAudioPort::E_Direction direction) { 1067 1070 1068 1071 std::string id=std::string("dev?"); 1069 1072 if(!getOption("id", id)) { 1070 1073 debugWarning("Could not retrieve id parameter, defauling to 'dev?'\n"); 1071 1074 } 1072 1075 1073 1076 AvPlug::ClusterInfoVector& clusterInfos = plug.getClusterInfos(); 1074 1077 for ( AvPlug::ClusterInfoVector::const_iterator it = clusterInfos.begin(); … … 1173 1176 int n=i; 1174 1177 Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 1175 1178 1176 1179 if(snoopMode) { // a stream from the device to another host 1177 1180 // FIXME: put this into a decent framework! … … 1179 1182 struct iec61883_oPCR opcr; 1180 1183 if (iec61883_get_oPCRX( 1181 m_p1394Service->getHandle(), 1184 m_p1394Service->getHandle(), 1182 1185 m_pConfigRom->getNodeId() | 0xffc0, 1183 1186 (quadlet_t *)&opcr, 1184 1187 n)) { 1185 1188 1186 1189 debugWarning("Error getting the channel for SP %d\n",i); 1187 1190 return false; 1188 1191 } 1189 1192 1190 1193 iso_channel=opcr.channel; 1191 1194 } else { 1192 1195 iso_channel=m_p1394Service->allocateIsoChannelCMP( 1193 m_pConfigRom->getNodeId() | 0xffc0, n, 1196 m_pConfigRom->getNodeId() | 0xffc0, n, 1194 1197 m_p1394Service->getLocalNodeId()| 0xffc0, -1); 1195 1198 } … … 1198 1201 return false; 1199 1202 } 1200 1203 1201 1204 debugOutput(DEBUG_LEVEL_VERBOSE, "Started SP %d on channel %d\n",i,iso_channel); 1202 1205 1203 1206 p->setChannel(iso_channel); 1204 1207 return true; 1205 1208 1206 1209 } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 1207 1210 int n=i-m_receiveProcessors.size(); 1208 1211 Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 1209 1210 if(snoopMode) { // a stream from another host to the device 1212 1213 if(snoopMode) { // a stream from another host to the device 1211 1214 // FIXME: put this into a decent framework! 1212 1215 // we should check the iPCR[n] on the device 1213 1216 struct iec61883_iPCR ipcr; 1214 1217 if (iec61883_get_iPCRX( 1215 m_p1394Service->getHandle(), 1218 m_p1394Service->getHandle(), 1216 1219 m_pConfigRom->getNodeId() | 0xffc0, 1217 1220 (quadlet_t *)&ipcr, 1218 1221 n)) { 1219 1222 1220 1223 debugWarning("Error getting the channel for SP %d\n",i); 1221 1224 return false; 1222 1225 } 1223 1226 1224 1227 iso_channel=ipcr.channel; 1225 1228 1226 1229 } else { 1227 1230 iso_channel=m_p1394Service->allocateIsoChannelCMP( … … 1229 1232 m_pConfigRom->getNodeId() | 0xffc0, n); 1230 1233 } 1231 1234 1232 1235 if (iso_channel<0) { 1233 1236 debugError("Could not allocate ISO channel for SP %d\n",i); 1234 1237 return false; 1235 1238 } 1236 1239 1237 1240 debugOutput(DEBUG_LEVEL_VERBOSE, "Started SP %d on channel %d\n",i,iso_channel); 1238 1241 1239 1242 p->setChannel(iso_channel); 1240 1243 return true; 1241 1244 } 1242 1245 1243 1246 debugError("SP index %d out of range!\n",i); 1244 1247 return false; … … 1266 1269 } 1267 1270 p->setChannel(-1); 1268 1271 1269 1272 return true; 1270 1273 1271 1274 } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 1272 1275 int n=i-m_receiveProcessors.size(); 1273 1276 Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 1274 1277 1275 1278 if(snoopMode) { 1276 1279 … … 1283 1286 } 1284 1287 p->setChannel(-1); 1285 1288 1286 1289 return true; 1287 1290 } 1288 1291 1289 1292 debugError("SP index %d out of range!\n",i); 1290 1293 return false; … … 1414 1417 Util::IOSerialize& ser ) const 1415 1418 { 1416 1419 1417 1420 bool result; 1418 1421 result = m_pConfigRom->serialize( basePath + "m_pConfigRom/", ser ); … … 1435 1438 i++; 1436 1439 } 1437 1440 1438 1441 result &= serializeOptions( basePath + "Options", ser ); 1439 1442 … … 1451 1454 ConfigRom *configRom = 1452 1455 ConfigRom::deserialize( basePath + "m_pConfigRom/", deser, ieee1394Service ); 1453 1456 1454 1457 if ( !configRom ) { 1455 1458 return NULL; … … 1457 1460 1458 1461 AvDevice* pDev = new AvDevice( 1459 std::auto_ptr<ConfigRom>(configRom), 1462 std::auto_ptr<ConfigRom>(configRom), 1460 1463 ieee1394Service, configRom->getNodeId()); 1461 1464 … … 1463 1466 bool result; 1464 1467 result = deser.read( basePath + "m_verboseLevel", pDev->m_verboseLevel ); 1465 1468 1466 1469 if (pDev->m_pPlugManager) delete pDev->m_pPlugManager; 1467 1470 pDev->m_pPlugManager = AvPlugManager::deserialize( basePath + "AvPlug", deser, *pDev ); … … 1484 1487 } 1485 1488 } 1486 1489 1487 1490 result &= deserializeOptions( basePath + "Options", deser, *pDev ); 1488 1491 } trunk/libffado/src/bebob/bebob_avdevice.h
r436 r445 1 /* bebob_avdevice.h2 * Copyright (C) 2005 ,06,07 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #ifndef BEBOB_AVDEVICE_H 21 25 #define BEBOB_AVDEVICE_H … … 51 55 unsigned int model_id; 52 56 char *vendor_name; 53 char *model_name; 57 char *model_name; 54 58 }; 55 59 … … 60 64 int nodeId ); 61 65 virtual ~AvDevice(); 62 66 63 67 void setVerboseLevel(int l); 64 68 … … 115 119 static AvDevice* deserialize( Glib::ustring basePath, 116 120 Util::IODeserialize& deser, 117 121 Ieee1394Service& ieee1394Service ); 118 122 protected: 119 123 trunk/libffado/src/bebob/bebob_avdevice_subunit.cpp
r420 r445 1 /* bebob_avdevice_subunit.cpp2 * Copyright (C) 2005 ,06,07 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 trunk/libffado/src/bebob/bebob_avdevice_subunit.h
r420 r445 1 /* bebob_avdevice_subunit.h2 * Copyright (C) 2005 ,06,07 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #ifndef BEBOB_AVDEVICESUBUNIT_H 21 25 #define BEBOB_AVDEVICESUBUNIT_H … … 38 42 public: 39 43 AvDeviceSubunit( AvDevice& avDevice, 40 41 42 44 AVCCommand::ESubunitType type, 45 subunit_t id, 46 int verboseLevel ); 43 47 virtual ~AvDeviceSubunit(); 44 48 … … 50 54 51 55 subunit_t getSubunitId() 52 56 { return m_sbId; } 53 57 AVCCommand::ESubunitType getSubunitType() 54 58 { return m_sbType; } 55 59 56 60 AvPlugVector& getPlugs() 57 61 { return m_plugs; } 58 62 AvPlug* getPlug(AvPlug::EAvPlugDirection direction, plug_id_t plugId); 59 63 … … 65 69 bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 66 70 static AvDeviceSubunit* deserialize( Glib::ustring basePath, 67 71 Util::IODeserialize& deser, 68 72 AvDevice& avDevice ); 69 73 protected: … … 98 102 public: 99 103 AvDeviceSubunitAudio( AvDevice& avDevice, 100 101 104 subunit_t id, 105 int verboseLevel ); 102 106 AvDeviceSubunitAudio(); 103 107 virtual ~AvDeviceSubunitAudio(); … … 135 139 public: 136 140 AvDeviceSubunitMusic( AvDevice& avDevice, 137 138 141 subunit_t id, 142 int verboseLevel ); 139 143 AvDeviceSubunitMusic(); 140 144 virtual ~AvDeviceSubunitMusic(); trunk/libffado/src/bebob/bebob_avplug.cpp
r420 r445 1 /* bebob_avplug.cpp2 * Copyright (C) 2005 ,06,07 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 trunk/libffado/src/bebob/bebob_avplug.h
r435 r445 1 /* bebob_avplug.h 2 * Copyright (C) 2005,06,07 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 … … 50 53 51 54 enum EAvPlugAddressType { 52 53 54 55 56 57 55 eAPA_PCR, 56 eAPA_ExternalPlug, 57 eAPA_AsynchronousPlug, 58 eAPA_SubunitPlug, 59 eAPA_FunctionBlockPlug, 60 eAPA_Undefined, 58 61 }; 59 62 … … 69 72 70 73 enum EAvPlugDirection { 71 72 73 74 eAPD_Input, 75 eAPD_Output, 76 eAPD_Unknown, 74 77 }; 75 78 76 79 // \todo This constructors sucks. too many parameters. fix it. 77 80 AvPlug( Ieee1394Service& ieee1394Service, 78 81 ConfigRom& configRom, 79 82 AvPlugManager& plugManager, 80 81 82 83 84 85 86 87 83 AVCCommand::ESubunitType subunitType, 84 subunit_id_t subunitId, 85 function_block_type_t functionBlockType, 86 function_block_type_t functionBlockId, 87 EAvPlugAddressType plugAddressType, 88 EAvPlugDirection plugDirection, 89 plug_id_t plugId, 90 int verboseLevel ); 88 91 AvPlug( const AvPlug& rhs ); 89 92 virtual ~AvPlug(); … … 96 99 97 100 int getGlobalId() const 98 101 { return m_globalId; } 99 102 plug_id_t getPlugId() const 100 103 { return m_id; } 101 104 AVCCommand::ESubunitType getSubunitType() const 102 105 { return m_subunitType; } 103 106 subunit_id_t getSubunitId() const 104 107 { return m_subunitId; } 105 108 const char* getName() const 106 109 { return m_name.c_str(); } 107 110 EAvPlugDirection getPlugDirection() const 108 111 { return m_direction; } 109 112 sampling_frequency_t getSamplingFrequency() const 110 113 { return m_samplingFrequency; } 111 114 int getSampleRate() const; // 22050, 24000, 32000, ... 112 115 int getNrOfChannels() const; … … 118 121 { return m_addressType; } 119 122 EAvPlugType getPlugType() const 120 123 { return m_infoPlugType; } 121 124 122 125 function_block_type_t getFunctionBlockType() const 123 126 { return m_functionBlockType; } 124 127 function_block_id_t getFunctionBlockId() const 125 128 { return m_functionBlockId; } … … 131 134 132 135 static PlugAddress::EPlugDirection convertPlugDirection( 133 136 EAvPlugDirection direction); 134 137 135 138 void showPlug() const; … … 148 151 stream_position_t m_streamPosition; 149 152 stream_position_location_t m_location; 150 153 Glib::ustring m_name; 151 154 }; 152 155 typedef std::vector<ChannelInfo> ChannelInfoVector; 153 156 154 157 struct ClusterInfo { 155 156 157 158 int m_index; 159 port_type_t m_portType; 160 Glib::ustring m_name; 158 161 159 162 nr_of_channels_t m_nrOfChannels; 160 163 ChannelInfoVector m_channelInfos; 161 164 stream_format_t m_streamFormat; 162 165 }; 163 166 typedef std::vector<ClusterInfo> ClusterInfoVector; … … 183 186 184 187 ExtendedStreamFormatCmd setPlugAddrToStreamFormatCmd( 185 188 ExtendedStreamFormatCmd::ESubFunction subFunction); 186 189 187 190 SignalSourceCmd setSrcPlugAddrToSignalCmd(); 188 191 189 192 void setDestPlugAddrToSignalCmd( 190 193 SignalSourceCmd& signalSourceCmd, AvPlug& plug ); 191 194 192 195 void debugOutputClusterInfos( int debugLevel ); … … 245 248 , m_index( 0xff ) 246 249 {} 247 248 249 250 251 250 sampling_frequency_t m_samplingFrequency; 251 bool m_isSyncStream; 252 number_of_channels_t m_audioChannels; 253 number_of_channels_t m_midiChannels; 254 byte_t m_index; 252 255 }; 253 256 typedef std::vector<FormatInfo> FormatInfoVector; … … 297 300 AvPlug* getPlug( AVCCommand::ESubunitType subunitType, 298 301 subunit_id_t subunitId, 299 300 302 function_block_type_t functionBlockType, 303 function_block_id_t functionBlockId, 301 304 AvPlug::EAvPlugAddressType plugAddressType, 302 305 AvPlug::EAvPlugDirection plugDirection, … … 304 307 AvPlug* getPlug( int iGlobalId ) const; 305 308 AvPlugVector getPlugsByType( AVCCommand::ESubunitType subunitType, 306 307 308 309 310 311 309 subunit_id_t subunitId, 310 function_block_type_t functionBlockType, 311 function_block_id_t functionBlockId, 312 AvPlug::EAvPlugAddressType plugAddressType, 313 AvPlug::EAvPlugDirection plugDirection, 314 AvPlug::EAvPlugType type) const; 312 315 313 316 bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; … … 351 354 } 352 355 353 #endif 356 #endif // BEBOB_AVPLUG_H trunk/libffado/src/bebob/bebob_dl_bcd.cpp
r407 r445 1 /* bebob_dl_bcd.cpp 2 * Copyright (C) 2006 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 trunk/libffado/src/bebob/bebob_dl_bcd.h
r407 r445 1 /* bebob_dl_bcd.h2 * Copyright (C) 200 6by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #ifndef BEBOB_DL_BCD_H 21 25 #define BEBOB_DL_BCD_H … … 45 49 fb_quadlet_t getSoftwareVersion() const 46 50 { return m_softwareVersion; } 47 48 49 50 51 51 fb_quadlet_t getHardwareId() const 52 { return m_hardwareId; } 53 fb_quadlet_t getVendorOUI() const 54 { return m_vendorOUI; } 55 52 56 fb_quadlet_t getImageBaseAddress() const 53 57 { return m_imageBaseAddress; } … … 59 63 { return m_imageCRC; } 60 64 61 62 65 fb_quadlet_t getCnEOffset() const 66 { return m_cneOffset; } 63 67 fb_quadlet_t getCnELength() const 64 68 { return m_cneLength; } 65 66 69 fb_quadlet_t getCnECRC() const 70 { return m_cneCRC; } 67 71 68 72 bool read( int addr, fb_quadlet_t* q ); 69 73 bool read( int addr, fb_octlet_t* o ); 70 74 bool read( int addr, unsigned char* b, size_t len ); 71 75 72 76 void displayInfo(); 73 77 74 78 protected: 75 79 unsigned long crc32_table[256]; 76 77 78 80 void initCRC32Table(); 81 unsigned long reflect(unsigned long ref, char ch); 82 unsigned int getCRC(unsigned char* text, size_t len); 79 83 bool checkHeaderCRC( unsigned int crcOffset, 80 84 unsigned int headerSize ); … … 89 93 fb_quadlet_t m_softwareId; 90 94 fb_quadlet_t m_softwareVersion; 91 92 93 95 fb_quadlet_t m_hardwareId; 96 fb_quadlet_t m_vendorOUI; 97 94 98 95 99 fb_quadlet_t m_imageBaseAddress; … … 99 103 100 104 fb_quadlet_t m_cneLength; 101 102 105 fb_quadlet_t m_cneOffset; 106 fb_quadlet_t m_cneCRC; 103 107 104 108 105 109 106 110 DECLARE_DEBUG_MODULE; 107 111 }; 108 112 trunk/libffado/src/bebob/bebob_dl_codes.cpp
r407 r445 1 /* bebob_dl_codes.cpp 2 * Copyright (C) 2006 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #include "bebob/bebob_dl_codes.h" 21 25 #include "bebob/bebob_dl_bcd.h" trunk/libffado/src/bebob/bebob_dl_codes.h
r420 r445 1 /* bebob_dl_codes.h 2 * Copyright (C) 2006 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 … … 64 67 fb_byte_t operandSizeRequestField, 65 68 fb_byte_t operandSizeResponseField ); 66 69 virtual ~CommandCodes(); 67 70 68 71 virtual bool serialize( IOSSerialize& se ); … … 74 77 { return static_cast<EBootloaderCommandCodes>( m_commandCode ); } 75 78 76 77 79 fb_byte_t getProtocolVersion() const 80 { return m_protocolVersion; } 78 81 size_t getMsgSize() const 79 82 { return m_msgSize; } … … 163 166 enum EObject { 164 167 eO_Application = 0, 165 166 168 eO_Config = 1, 169 eO_Debugger = 2, 167 170 eO_Bootloader = 3, 168 169 171 eO_WarpImage = 4, 172 eO_SerialBootCode = 5, 170 173 }; 171 174 172 175 CommandCodesDownloadStart( fb_quadlet_t protocolVersion, 173 176 EObject object ); 174 177 virtual ~CommandCodesDownloadStart(); 175 178 … … 218 221 virtual bool deserialize( IISDeserialize& de ); 219 222 220 221 222 223 bool setSeqNumber( fb_quadlet_t seqNumber ) 224 { m_seqNumber = seqNumber; return true; } 225 bool setAddress( fb_quadlet_t address ) 223 226 { m_address = address; return true; } 224 227 bool setNumberBytes( fb_quadlet_t numByte ) … … 233 236 fb_quadlet_t m_numBytes; 234 237 235 236 238 fb_quadlet_t m_resp_seqNumber; 239 fb_quadlet_t m_resp_errorCode; 237 240 }; 238 241 … … 287 290 enum EStartMode { 288 291 eSM_Application = 0, 289 292 eSM_Debugger = 2, 290 293 }; 291 294 … … 306 309 private: 307 310 fb_quadlet_t m_startMode; 308 311 fb_quadlet_t m_resp_validCRC; 309 312 }; 310 313 trunk/libffado/src/bebob/bebob_dl_mgr.cpp
r420 r445 1 /* bebob_dl_mgr.cpp2 * Copyright (C) 200 6by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #include "bebob_dl_mgr.h" 21 25 #include "bebob_dl_codes.h" trunk/libffado/src/bebob/bebob_dl_mgr.h
r407 r445 1 /* bebob_dl_mgr.h2 * Copyright (C) 200 6by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #ifndef BEBOB_DL_MGR_H 21 25 #define BEBOB_DL_MGR_H … … 51 55 bool programGUID( octlet_t guid ); 52 56 53 57 void busresetHandler(); 54 58 55 59 Ieee1394Service* get1394Serivce() const 56 60 { return m_ieee1394service; } 57 61 58 62 bool setForceOperations( bool enabled ) 59 63 { m_forceEnabled = enabled; return true; } 60 64 61 62 65 bool setStartBootloader( bool bStartBootloader ) 66 { m_bStartBootloader = bStartBootloader; return true; } 63 67 protected: 64 65 66 67 68 enum EObjectType { 69 eOT_Application, 70 eOT_CnE 71 }; 68 72 69 73 void waitForBusReset(); 70 74 bool writeRequest( CommandCodes& cmd ); 71 72 75 bool readResponse( CommandCodes& writeRequestCmd ); 76 bool downloadObject( BCD& bcd, EObjectType eObject ); 73 77 74 78 bool programGUIDCmd( octlet_t guid ); 75 79 bool startBootloaderCmd(); 76 80 bool startApplicationCmd(); 77 81 bool initializePersParamCmd(); … … 111 115 info_register_t m_cachedInfoRegs; 112 116 113 114 117 pthread_mutex_t m_mutex; 118 pthread_cond_t m_cond; 115 119 116 120 Functor* m_functor; 117 121 118 122 bool m_forceEnabled; 119 123 bool m_bStartBootloader; 120 124 121 125 DECLARE_DEBUG_MODULE; 122 126 }; 123 127 } trunk/libffado/src/bebob/bebob_functionblock.cpp
r413 r445 1 /* bebob_functionblock.cpp2 * Copyright (C) 200 6,07 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #include "bebob/bebob_functionblock.h" 21 25 #include "bebob/bebob_avdevice_subunit.h" trunk/libffado/src/bebob/bebob_functionblock.h
r420 r445 1 /* bebob_functionblock.h 2 * Copyright (C) 2006,07 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #ifndef BEBOB_FUNCTION_BLOCK_H 21 25 #define BEBOB_FUNCTION_BLOCK_H … … 47 51 48 52 FunctionBlock( AvDeviceSubunit& subunit, 49 53 function_block_type_t type, 50 54 function_block_type_t subtype, 51 55 function_block_id_t id, … … 65 69 bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 66 70 static FunctionBlock* deserialize( Glib::ustring basePath, 67 68 71 Util::IODeserialize& deser, 72 AvDevice& avDevice, 69 73 AvDeviceSubunit& subunit); 70 74 protected: trunk/libffado/src/bounce/bounce_avdevice.cpp
r436 r445 1 /* bounce_avdevice.cpp2 * Copyright (C) 200 6by Pieter Palmers3 * Copyright (C) 200 6by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Pieter Palmers 3 * Copyright (C) 2005-2007 by Daniel Wagner 4 4 * 5 * This file is part of FreeBoB. 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 6 7 * 7 * FreeBoB is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * FreeBoB is distributed in the hope that it will be useful, 8 * FFADO is based upon FreeBoB 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 12 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNUGeneral Public License for more details.16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 15 18 * 16 * You should have received a copy of the GNU General Public License17 * along with FreeBoB; if not, write to the Free Software18 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,19 * MA 0211 1-1307 USA.19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 20 23 */ 24 21 25 #include "bounce/bounce_avdevice.h" 22 26 … … 45 49 static VendorModelEntry supportedDeviceList[] = 46 50 { 47 {0x0B0001LU, 0x0B0001LU, 0x0B0001LU, "F reeBoB", "Bounce"},51 {0x0B0001LU, 0x0B0001LU, 0x0B0001LU, "FFADO", "Bounce"}, 48 52 }; 49 53 … … 80 84 ++i ) 81 85 { 82 if ( 86 if ( 83 87 // ( supportedDeviceList[i].vendor_id == vendorId ) 84 88 ( supportedDeviceList[i].model_id == modelId ) 85 && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 89 && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 86 90 ) 87 91 { … … 98 102 debugOutput( DEBUG_LEVEL_VERBOSE, "discovering BounceDevice (NodeID %d)\n", 99 103 m_nodeId ); 100 104 101 105 // unsigned int vendorId = m_pConfigRom->getNodeVendorId(); 102 106 unsigned int modelId = m_pConfigRom->getModelId(); … … 108 112 { 109 113 if ( //( supportedDeviceList[i].vendor_id == vendorId ) 110 ( supportedDeviceList[i].model_id == modelId ) 111 && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 114 ( supportedDeviceList[i].model_id == modelId ) 115 && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId ) 112 116 ) 113 117 { … … 168 172 169 173 debugOutput(DEBUG_LEVEL_VERBOSE,"Adding ports to processor\n"); 170 174 171 175 std::string id=std::string("dev?"); 172 176 if(!getOption("id", id)) { 173 177 debugWarning("Could not retrieve id parameter, defauling to 'dev?'\n"); 174 178 } 175 179 176 180 int i=0; 177 181 for (i=0;i<BOUNCE_NB_AUDIO_CHANNELS;i++) { … … 205 209 free(buff); 206 210 } 207 211 208 212 for (i=0;i<BOUNCE_NB_MIDI_CHANNELS;i++) { 209 213 char *buff; … … 237 241 } 238 242 239 243 return true; 240 244 } 241 245 … … 243 247 BounceDevice::prepare() { 244 248 debugOutput(DEBUG_LEVEL_NORMAL, "Preparing BounceDevice...\n" ); 245 249 246 250 bool snoopMode=false; 247 251 if(!getOption("snoopMode", snoopMode)) { … … 251 255 // create & add streamprocessors 252 256 Streaming::StreamProcessor *p; 253 257 254 258 p=new Streaming::AmdtpReceiveStreamProcessor( 255 259 m_p1394Service->getPort(), … … 285 289 BOUNCE_NB_AUDIO_CHANNELS+(BOUNCE_NB_MIDI_CHANNELS?1:0)); 286 290 } 287 291 288 292 if(!p->init()) { 289 293 debugFatal("Could not initialize transmit processor %s!\n", … … 335 339 int n=i; 336 340 Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 337 341 338 342 // allocate ISO channel 339 343 int isochannel=allocateIsoChannel(p->getMaxPacketSize()); … … 343 347 } 344 348 p->setChannel(isochannel); 345 349 346 350 fb_quadlet_t reg_isoch; 347 351 // check value of ISO_CHANNEL register … … 358 362 return false; 359 363 } 360 364 361 365 // write value of ISO_CHANNEL register 362 366 reg_isoch=isochannel; … … 367 371 return false; 368 372 } 369 373 370 374 return true; 371 375 372 376 } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 373 377 int n=i-m_receiveProcessors.size(); 374 378 Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 375 379 376 380 // allocate ISO channel 377 381 int isochannel=allocateIsoChannel(p->getMaxPacketSize()); … … 381 385 } 382 386 p->setChannel(isochannel); 383 387 384 388 fb_quadlet_t reg_isoch; 385 389 // check value of ISO_CHANNEL register … … 396 400 return false; 397 401 } 398 402 399 403 // write value of ISO_CHANNEL register 400 404 reg_isoch=isochannel; … … 405 409 return false; 406 410 } 407 411 408 412 return true; 409 413 } 410 414 411 415 debugError("SP index %d out of range!\n",i); 412 416 413 417 return false; 414 418 } … … 420 424 Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 421 425 unsigned int isochannel=p->getChannel(); 422 426 423 427 fb_quadlet_t reg_isoch; 424 428 // check value of ISO_CHANNEL register … … 431 435 return false; 432 436 } 433 437 434 438 // write value of ISO_CHANNEL register 435 439 reg_isoch=0xFFFFFFFFUL; … … 438 442 return false; 439 443 } 440 444 441 445 // deallocate ISO channel 442 446 if(!deallocateIsoChannel(isochannel)) { … … 444 448 return false; 445 449 } 446 450 447 451 p->setChannel(-1); 448 452 return true; 449 453 450 454 } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 451 455 int n=i-m_receiveProcessors.size(); 452 456 Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 453 457 454 458 unsigned int isochannel=p->getChannel(); 455 459 456 460 fb_quadlet_t reg_isoch; 457 461 // check value of ISO_CHANNEL register … … 464 468 return false; 465 469 } 466 470 467 471 // write value of ISO_CHANNEL register 468 472 reg_isoch=0xFFFFFFFFUL; … … 471 475 return false; 472 476 } 473 477 474 478 // deallocate ISO channel 475 479 if(!deallocateIsoChannel(isochannel)) { … … 477 481 return false; 478 482 } 479 483 480 484 p->setChannel(-1); 481 485 return true; 482 486 } 483 487 484 488 debugError("SP index %d out of range!\n",i); 485 489 return false; … … 491 495 int BounceDevice::allocateIsoChannel(unsigned int packet_size) { 492 496 unsigned int bandwidth=8+packet_size; 493 497 494 498 int ch=m_p1394Service->allocateIsoChannelGeneric(bandwidth); 495 499 496 500 debugOutput(DEBUG_LEVEL_VERBOSE, "allocated channel %d, bandwidth %d\n", 497 501 ch, bandwidth); 498 502 499 503 return ch; 500 504 } … … 510 514 BounceDevice::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 511 515 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 512 516 513 517 if(offset >= BOUNCE_INVALID_OFFSET) { 514 518 debugError("invalid offset: 0x%016llX\n", offset); 515 519 return false; 516 520 } 517 521 518 522 fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 519 523 fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 520 524 521 525 if(!m_p1394Service->read_quadlet( nodeId, addr, result ) ) { 522 526 debugError("Could not read from node 0x%04X addr 0x%012X\n", nodeId, addr); … … 524 528 } 525 529 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08X\n", *result); 526 530 527 531 return true; 528 532 } … … 530 534 bool 531 535 BounceDevice::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 532 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 536 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 533 537 offset, data); 534 538 535 539 if(offset >= BOUNCE_INVALID_OFFSET) { 536 540 debugError("invalid offset: 0x%016llX\n", offset); 537 541 return false; 538 542 } 539 543 540 544 fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 541 545 fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 542 546 543 547 if(!m_p1394Service->write_quadlet( nodeId, addr, data ) ) { 544 548 debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); … … 548 552 } 549 553 550 bool 554 bool 551 555 BounceDevice::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 552 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 556 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 553 557 offset, length); 554 558 555 559 if(offset >= BOUNCE_INVALID_OFFSET) { 556 560 debugError("invalid offset: 0x%016llX\n", offset); 557 561 return false; 558 562 } 559 563 560 564 fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 561 565 fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 562 566 563 567 if(!m_p1394Service->read( nodeId, addr, length, data ) ) { 564 568 debugError("Could not read from node 0x%04X addr 0x%012llX\n", nodeId, addr); … … 568 572 } 569 573 570 bool 574 bool 571 575 BounceDevice::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 572 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 576 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 573 577 offset, length); 574 578 575 579 if(offset >= BOUNCE_INVALID_OFFSET) { 576 580 debugError("invalid offset: 0x%016llX\n", offset); 577 581 return false; 578 582 } 579 583 580 584 fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 581 585 fb_nodeid_t nodeId=m_nodeId | 0xFFC0; trunk/libffado/src/bounce/bounce_avdevice.h
r436 r445 1 /* bounce_avdevice.h2 * Copyright (C) 200 6by Pieter Palmers3 * Copyright (C) 200 6by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Pieter Palmers 3 * Copyright (C) 2005-2007 by Daniel Wagner 4 4 * 5 * This file is part of FreeBoB. 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 6 7 * 7 * FreeBoB is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * FreeBoB is distributed in the hope that it will be useful, 8 * FFADO is based upon FreeBoB 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 12 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNUGeneral Public License for more details.16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 15 18 * 16 * You should have received a copy of the GNU General Public License17 * along with FreeBoB; if not, write to the Free Software18 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,19 * MA 0211 1-1307 USA.19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 20 23 */ 24 21 25 #ifndef BOUNCEDEVICE_H 22 26 #define BOUNCEDEVICE_H … … 66 70 public: 67 71 BounceDevice( std::auto_ptr<ConfigRom>( configRom ), 68 69 72 Ieee1394Service& ieee1394Service, 73 int nodeId ); 70 74 virtual ~BounceDevice(); 71 75 72 76 static bool probe( ConfigRom& configRom ); 73 77 bool discover(); 74 78 75 79 bool setSamplingFrequency( ESamplingFrequency samplingFrequency ); 76 80 int getSamplingFrequency( ); 77 81 78 82 bool prepare(); 79 83 bool lock(); … … 86 90 bool startStreamByIndex(int i); 87 91 bool stopStreamByIndex(int i); 88 92 89 93 void showDevice(); 90 94 … … 99 103 100 104 bool addPortsToProcessor( 101 Streaming::StreamProcessor *processor, 105 Streaming::StreamProcessor *processor, 102 106 Streaming::Port::E_Direction direction); 103 107 104 108 private: // generic helpers 105 109 int allocateIsoChannel(unsigned int packet_size); … … 112 116 bool readRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 113 117 bool writeRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 114 118 115 119 private: 116 120 BounceNotifier *m_Notifier; 117 121 /** 118 * this class reacts on the other side writing to the 122 * this class reacts on the other side writing to the 119 123 * hosts address space 120 124 */ … … 126 130 BounceNotifier(BounceDevice *, nodeaddr_t start); 127 131 virtual ~BounceNotifier(); 128 132 129 133 private: 130 134 BounceDevice *m_bouncedevice; trunk/libffado/src/bounce/bounce_slave_avdevice.cpp
r435 r445 1 /* $Id$ */2 3 1 /* 4 * FreeBob Streaming API5 * FreeBob = Firewire (pro-)audio for linux2 * Copyright (C) 2005-2007 by Pieter Palmers 3 * Copyright (C) 2005-2007 by Daniel Wagner 6 4 * 7 * http://freebob.sf.net 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 8 7 * 9 * Copyright (C) 2007 Pieter Palmers <pieterpalmers@users.sourceforge.net>8 * FFADO is based upon FreeBoB 10 9 * 11 * This program is free software {} you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation {} either version 2 of the License, or 14 * (at your option) any later version. 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 15 13 * 16 * This programis distributed in the hope that it will be useful,17 * but WITHOUT ANY WARRANTY {}without even the implied warranty of18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the19 * GNUGeneral Public License for more details.14 * This library is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 20 18 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program {} if not, write to the Free Software 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * 25 * 26 * 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 27 23 */ 28 24 … … 42 38 { 43 39 //{vendor_id, model_id, unit_specifier_id, vendor_name, model_name}, 44 {0x0B0001, 0x0B0001, 0x0B0001, "F reeBoB", "Bounce Slave"},40 {0x0B0001, 0x0B0001, 0x0B0001, "FFADO", "Bounce Slave"}, 45 41 }; 46 42 … … 80 76 debugOutput(DEBUG_LEVEL_VERBOSE, "Initializing memory space...\n"); 81 77 fb_quadlet_t result=0xFFFFFFFFLU; 82 78 83 79 // initialize the ISO channel registers 84 80 // this will write to our own registers … … 91 87 return false; 92 88 } 93 89 94 90 // set everything such that we can be discovered 95 91 m_original_config_rom=save_config_rom( m_p1394Service->getHandle() ); 96 92 97 93 if ( init_config_rom( m_p1394Service->getHandle() ) < 0 ) { 98 94 debugError("Could not initalize local config rom\n"); 99 95 return false; 100 96 } 101 97 102 98 // refresh our config rom cache 103 99 if ( !m_pConfigRom->initialize() ) { … … 122 118 bool 123 119 BounceSlaveDevice::lock() { 124 debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 120 debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 125 121 m_model->vendor_name, m_model->model_name, m_nodeId); 126 122 127 123 // get a notifier to handle device notifications 128 124 nodeaddr_t notify_address; … … 131 127 BOUNCE_REGISTER_LENGTH, 132 128 BOUNCE_REGISTER_LENGTH); 133 129 134 130 if (notify_address == 0xFFFFFFFFFFFFFFFFLLU) { 135 131 debugError("Could not find free ARM block for notification\n"); 136 132 return false; 137 133 } 138 134 139 135 m_Notifier=new BounceSlaveDevice::BounceSlaveNotifier(this, notify_address); 140 136 141 137 if(!m_Notifier) { 142 138 debugError("Could not allocate notifier\n"); 143 139 return false; 144 140 } 145 141 146 142 if (!m_p1394Service->registerARMHandler(m_Notifier)) { 147 143 debugError("Could not register notifier\n"); … … 150 146 return false; 151 147 } 152 148 153 149 // (re)initialize the memory space 154 150 if (!initMemSpace()) { … … 156 152 return false; 157 153 } 158 154 159 155 return true; 160 156 } … … 177 173 BounceSlaveDevice::prepare() { 178 174 debugOutput(DEBUG_LEVEL_NORMAL, "Preparing BounceSlaveDevice...\n" ); 179 175 180 176 // create & add streamprocessors 181 177 Streaming::StreamProcessor *p; 182 178 183 179 p=new Streaming::AmdtpSlaveReceiveStreamProcessor( 184 180 m_p1394Service->getPort(), … … 206 202 m_samplerate, 207 203 BOUNCE_NB_AUDIO_CHANNELS); 208 204 209 205 if(!p->init()) { 210 206 debugFatal("Could not initialize transmit processor!\n"); … … 227 223 bool 228 224 BounceSlaveDevice::startStreamByIndex(int i) { 229 225 230 226 if (i<(int)m_receiveProcessors.size()) { 231 227 int n=i; 232 228 Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 233 229 234 230 // the other side sends on this channel 235 231 nodeaddr_t iso_channel_offset = BOUNCE_REGISTER_RX_ISOCHANNEL; 236 232 iso_channel_offset += ((unsigned)n)*4; 237 233 238 234 if (!waitForRegisterNotEqualTo(iso_channel_offset, 0xFFFFFFFFLU)) { 239 235 debugError("Timeout waiting for stream %d to get an ISO channel\n",i); 240 236 return false; 241 237 } 242 238 243 239 fb_quadlet_t result; 244 240 // this will read from our own registers … … 247 243 return false; 248 244 } 249 245 250 246 // set ISO channel 251 247 p->setChannel(result); 252 248 253 249 return true; 254 250 255 251 } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 256 252 int n=i-m_receiveProcessors.size(); 257 253 Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 258 254 259 255 // the other side sends on this channel 260 256 nodeaddr_t iso_channel_offset = BOUNCE_REGISTER_TX_ISOCHANNEL; 261 257 iso_channel_offset += ((unsigned)n)*4; 262 258 263 259 if (!waitForRegisterNotEqualTo(iso_channel_offset, 0xFFFFFFFF)) { 264 260 debugError("Timeout waiting for stream %d to get an ISO channel\n",i); 265 261 return false; 266 262 } 267 263 268 264 fb_quadlet_t result; 269 265 // this will read from our own registers … … 272 268 return false; 273 269 } 274 270 275 271 // set ISO channel 276 272 p->setChannel(result); … … 279 275 280 276 } 281 277 282 278 debugError("SP index %d out of range!\n",i); 283 279 284 280 return false; 285 281 } … … 301 297 debugWarning("Could not retrieve isoTimeoutSecs parameter, defauling to 120secs\n"); 302 298 } 303 299 304 300 int wait_cycles=timeoutSecs*10; // two seconds 305 301 306 302 fb_quadlet_t reg=v; 307 303 308 304 while ((v == reg) && wait_cycles) { 309 305 wait_cycles--; … … 318 314 return false; 319 315 } 320 316 321 317 return true; 322 318 } … … 326 322 327 323 328 struct BounceSlaveDevice::configrom_backup 324 struct BounceSlaveDevice::configrom_backup 329 325 BounceSlaveDevice::save_config_rom(raw1394handle_t handle) 330 326 { … … 333 329 /* get the current rom image */ 334 330 retval=raw1394_get_config_rom(handle, tmp.rom, 0x100, &tmp.rom_size, &tmp.rom_version); 335 // 331 // tmp.rom_size=rom1394_get_size(tmp.rom); 336 332 // printf("save_config_rom get_config_rom returned %d, romsize %d, rom_version %d:\n",retval,tmp.rom_size,tmp.rom_version); 337 333 … … 339 335 } 340 336 341 int 337 int 342 338 BounceSlaveDevice::restore_config_rom(raw1394handle_t handle, struct BounceSlaveDevice::configrom_backup old) 343 339 { 344 340 int retval; 345 341 // int i; 346 342 347 343 quadlet_t current_rom[0x100]; 348 344 size_t current_rom_size; … … 371 367 } 372 368 373 int 369 int 374 370 BounceSlaveDevice::init_config_rom(raw1394handle_t handle) 375 371 { … … 380 376 rom1394_directory dir; 381 377 char *leaf; 382 378 383 379 /* get the current rom image */ 384 380 retval=raw1394_get_config_rom(handle, rom, 0x100, &rom_size, &rom_version); … … 391 387 // } 392 388 // printf("\n"); 393 389 394 390 /* get the local directory */ 395 391 rom1394_get_directory( handle, raw1394_get_local_id(handle) & 0x3f, &dir); 396 392 397 393 /* change the vendor description for kicks */ 398 394 i = strlen(dir.textual_leafs[0]); 399 strncpy(dir.textual_leafs[0], F REEBOB_BOUNCE_SERVER_VENDORNAME " ", i);400 401 dir.vendor_id=F REEBOB_BOUNCE_SERVER_VENDORID;402 dir.model_id=F REEBOB_BOUNCE_SERVER_MODELID;403 395 strncpy(dir.textual_leafs[0], FFADO_BOUNCE_SERVER_VENDORNAME " ", i); 396 397 dir.vendor_id=FFADO_BOUNCE_SERVER_VENDORID; 398 dir.model_id=FFADO_BOUNCE_SERVER_MODELID; 399 404 400 /* update the rom */ 405 401 retval = rom1394_set_directory(rom, &dir); … … 411 407 // } 412 408 // printf("\n"); 413 409 414 410 /* free the allocated mem for the textual leaves */ 415 411 rom1394_free_directory( &dir); 416 412 417 413 /* add an AV/C unit directory */ 418 dir.unit_spec_id = F REEBOB_BOUNCE_SERVER_SPECID;414 dir.unit_spec_id = FFADO_BOUNCE_SERVER_SPECID; 419 415 dir.unit_sw_version = 0x00010001; 420 leaf = F REEBOB_BOUNCE_SERVER_MODELNAME;416 leaf = FFADO_BOUNCE_SERVER_MODELNAME; 421 417 dir.nr_textual_leafs = 1; 422 418 dir.textual_leafs = &leaf; 423 419 424 420 /* manipulate the rom */ 425 421 retval = rom1394_add_unit( rom, &dir); 426 422 427 423 /* get the computed size of the rom image */ 428 424 rom_size = rom1394_get_size(rom); 429 425 430 426 // printf("rom1394_add_unit_directory returned %d, romsize %d:",retval,rom_size); 431 427 // for (i = 0; i < rom_size; i++) … … 435 431 // } 436 432 // printf("\n"); 437 // 433 // 438 434 /* convert computed rom size from quadlets to bytes before update */ 439 435 rom_size *= sizeof(quadlet_t); 440 436 retval = raw1394_update_config_rom(handle, rom, rom_size, rom_version); 441 437 // printf("update_config_rom returned %d\n",retval); 442 438 443 439 retval=raw1394_get_config_rom(handle, rom, 0x100, &rom_size, &rom_version); 444 440 // printf("get_config_rom returned %d, romsize %d, rom_version %d:",retval,rom_size,rom_version); … … 449 445 // } 450 446 // printf("\n"); 451 452 // 453 447 448 // printf("You need to reload your ieee1394 modules to reset the rom.\n"); 449 454 450 return 0; 455 451 } … … 459 455 460 456 BounceSlaveDevice::BounceSlaveNotifier::BounceSlaveNotifier(BounceSlaveDevice *d, nodeaddr_t start) 461 : ARMHandler(start, BOUNCE_REGISTER_LENGTH, 457 : ARMHandler(start, BOUNCE_REGISTER_LENGTH, 462 458 RAW1394_ARM_READ | RAW1394_ARM_WRITE, // allowed operations 463 459 0, //RAW1394_ARM_READ | RAW1394_ARM_WRITE, // operations to be notified of … … 468 464 } 469 465 470 BounceSlaveDevice::BounceSlaveNotifier::~BounceSlaveNotifier() 466 BounceSlaveDevice::BounceSlaveNotifier::~BounceSlaveNotifier() 471 467 { 472 468 trunk/libffado/src/bounce/bounce_slave_avdevice.h
r435 r445 1 /* $Id$ */ 1 /* 2 * Copyright (C) 2005-2007 by Pieter Palmers 3 * Copyright (C) 2005-2007 by Daniel Wagner 4 * 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 7 * 8 * FFADO is based upon FreeBoB 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 23 */ 2 24 3 /* 4 * FreeBob Streaming API 5 * FreeBob = Firewire (pro-)audio for linux 6 * 7 * http://freebob.sf.net 8 * 9 * Copyright (C) 2007 Pieter Palmers <pieterpalmers@users.sourceforge.net> 10 * 11 * This program is free software {} you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation {} either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY {} without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program {} if not, write to the Free Software 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * 25 * 26 * 27 */ 28 #ifndef __FREEBOB_BOUNCESLAVEDEVICE__ 29 #define __FREEBOB_BOUNCESLAVEDEVICE__ 25 #ifndef __FFADO_BOUNCESLAVEDEVICE__ 26 #define __FFADO_BOUNCESLAVEDEVICE__ 30 27 31 28 #include "debugmodule/debugmodule.h" 32 29 #include "bounce_avdevice.h" 33 30 34 #define F REEBOB_MAX_NAME_LEN 25631 #define FFADO_MAX_NAME_LEN 256 35 32 36 #define F REEBOB_BOUNCE_SERVER_VENDORNAME "FreeBoBServer"37 #define F REEBOB_BOUNCE_SERVER_MODELNAME "freebob-server"33 #define FFADO_BOUNCE_SERVER_VENDORNAME "FFADO Server" 34 #define FFADO_BOUNCE_SERVER_MODELNAME "ffado-server" 38 35 39 36 // NOTE: this is currently free, but it is not really allowed to use 40 #define F REEBOB_BOUNCE_SERVER_VENDORID 0x000B000141 #define F REEBOB_BOUNCE_SERVER_MODELID 0x000B000142 #define F REEBOB_BOUNCE_SERVER_SPECID 0x000B000137 #define FFADO_BOUNCE_SERVER_VENDORID 0x000B0001 38 #define FFADO_BOUNCE_SERVER_MODELID 0x000B0001 39 #define FFADO_BOUNCE_SERVER_SPECID 0x000B0001 43 40 44 41 namespace Bounce { … … 51 48 Ieee1394Service& ieee1394Service ); 52 49 virtual ~BounceSlaveDevice(); 53 50 54 51 static bool probe( ConfigRom& configRom ); 55 52 bool discover(); … … 57 54 bool lock(); 58 55 bool unlock(); 59 56 60 57 bool startStreamByIndex(int i); 61 58 bool stopStreamByIndex(int i); … … 65 62 bool initMemSpace(); 66 63 bool restoreMemSpace(); 67 64 68 65 private: // configrom shit 69 66 … … 74 71 }; 75 72 struct configrom_backup m_original_config_rom; 76 77 struct configrom_backup 73 74 struct configrom_backup 78 75 save_config_rom(raw1394handle_t handle); 79 76 int restore_config_rom(raw1394handle_t handle, struct configrom_backup old); 80 77 int init_config_rom(raw1394handle_t handle); 81 78 82 79 private: 83 80 BounceSlaveNotifier *m_Notifier; 84 81 /** 85 * this class reacts on the ohter side writing to the 82 * this class reacts on the ohter side writing to the 86 83 * hosts address space 87 84 */ … … 91 88 BounceSlaveNotifier(BounceSlaveDevice *, nodeaddr_t start); 92 89 virtual ~BounceSlaveNotifier(); 93 90 94 91 private: 95 92 BounceSlaveDevice *m_bounceslavedevice; … … 99 96 } // end of namespace Bounce 100 97 101 #endif /* __F REEBOB_BOUNCESLAVEDEVICE__ */98 #endif /* __FFADO_BOUNCESLAVEDEVICE__ */ 102 99 103 100 trunk/libffado/src/bridgeco-downloader.cpp
r442 r445 1 /* freebob-downloader.cpp 2 * Copyright (C) 2006 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB. 8 * 9 * This is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License version 2 11 * as published by the Free Software Foundation. 12 * 13 * FFADO is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 14 17 * 15 18 * You should have received a copy of the GNU General Public License 16 * along with F reeBoB; if not, write to the Free Software19 * along with FFADO; if not, write to the Free Software 17 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 21 * MA 02111-1307 USA. … … 32 35 // arg parsing 33 36 //////////////////////////////////////////////// 34 const char *argp_program_version = " freebob_downloader 0.1";35 const char *argp_program_bug_address = "<f reebob-devel@lists.sf.net>";36 static char doc[] = " freebob_downloader -- firmware downloader application\n\n"37 const char *argp_program_version = "bridgeco-downloader 0.1"; 38 const char *argp_program_bug_address = "<ffado-devel@lists.sf.net>"; 39 static char doc[] = "bridgeco-downloader -- firmware downloader application for BridgeCo devices\n\n" 37 40 "OPERATION: display\n" 38 41 " setguid GUID\n" … … 135 138 int node_id = strtol(arguments.args[0], &tail, 0); 136 139 if (errno) { 137 138 140 perror("argument parsing failed:"); 141 return -1; 139 142 } 140 143 … … 220 223 return 0; 221 224 } 222 223 trunk/libffado/src/debugmodule/debugmodule.cpp
r406 r445 1 /* debugmodule.cpp 2 * Copyright (C) 2005 by Daniel Wagner 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * Copyright (C) 2005-2007 by Pieter Palmers 3 4 * 4 * This file is part of FreeBoB. 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 5 7 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 8 * FFADO is based upon FreeBoB 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 11 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 14 18 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 19 23 */ 20 24 … … 54 58 DebugModule::~DebugModule() 55 59 { 56 if ( m_level >= eDL_VeryVerbose ) {57 cout << "Unregistering "58 << this->getName()59 << " at DebugModuleManager"60 << endl;61 }60 // if ( m_level >= eDL_VeryVerbose ) { 61 // cout << "Unregistering " 62 // << this->getName() 63 // << " at DebugModuleManager" 64 // << endl; 65 // } 62 66 if ( !DebugModuleManager::instance()->unregisterModule( *this ) ) { 63 67 cerr << "Could not unregister DebugModule at DebugModuleManager" … … 99 103 va_list arg; 100 104 va_start( arg, format ); 101 105 102 106 // remove the path info from the filename 103 107 const char *f = file; … … 107 111 fname=f; 108 112 } 109 113 110 114 DebugModuleManager::instance()->print( "%s (%s)[%4d] %s: ", getPreSequence( level ), 111 115 fname, line, function ); … … 149 153 DebugModuleManager::~DebugModuleManager() 150 154 { 151 155 // cleanin up leftover modules 152 156 for ( DebugModuleVectorIterator it = m_debugModules.begin(); 153 157 it != m_debugModules.end(); … … 159 163 } 160 164 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 165 if (!mb_initialized) 166 return; 167 168 pthread_mutex_lock(&mb_write_lock); 169 mb_initialized = 0; 170 pthread_cond_signal(&mb_ready_cond); 171 pthread_mutex_unlock(&mb_write_lock); 172 173 pthread_join(mb_writer_thread, NULL); 174 mb_flush(); 175 176 if (mb_overruns) 177 fprintf(stderr, "WARNING: %d message buffer overruns!\n", 178 mb_overruns); 179 else 180 fprintf(stderr, "no message buffer overruns\n"); 181 182 pthread_mutex_destroy(&mb_write_lock); 183 pthread_cond_destroy(&mb_ready_cond); 180 184 181 185 } … … 184 188 DebugModuleManager::init() 185 189 { 186 187 190 if (mb_initialized) 191 return true; 188 192 189 193 // if ( m_level >= eDL_VeryVerbose ) 190 194 // cout << "DebugModuleManager init..." << endl; 191 195 192 193 194 195 196 197 198 199 196 pthread_mutex_init(&mb_write_lock, NULL); 197 pthread_cond_init(&mb_ready_cond, NULL); 198 199 mb_overruns = 0; 200 mb_initialized = 1; 201 202 if (pthread_create(&mb_writer_thread, NULL, &mb_thread_func, (void *)this) != 0) 203 mb_initialized = 0; 200 204 201 205 return true; … … 223 227 { 224 228 bool already_present=false; 225 229 226 230 for ( DebugModuleVectorIterator it = m_debugModules.begin(); 227 231 it != m_debugModules.end(); … … 233 237 } 234 238 } 235 239 236 240 if (already_present) { 237 241 cerr << "DebugModuleManager::registerModule: Module already registered: " … … 246 250 DebugModuleManager::unregisterModule( DebugModule& debugModule ) 247 251 { 248 252 249 253 for ( DebugModuleVectorIterator it = m_debugModules.begin(); 250 254 it != m_debugModules.end(); … … 256 260 } 257 261 } 258 262 259 263 cerr << "DebugModuleManager::unregisterModule: Could not unregister " 260 264 << "DebugModule (" << debugModule.getName() << ")" << endl; … … 288 292 DebugModuleManager::mb_flush() 289 293 { 290 291 292 293 294 294 /* called WITHOUT the mb_write_lock */ 295 while (mb_outbuffer != mb_inbuffer) { 296 fputs(mb_buffers[mb_outbuffer], stderr); 297 mb_outbuffer = MB_NEXT(mb_outbuffer); 298 } 295 299 } 296 300 … … 301 305 DebugModuleManager *m=static_cast<DebugModuleManager *>(arg); 302 306 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 307 /* The mutex is only to eliminate collisions between multiple 308 * writer threads and protect the condition variable. */ 309 pthread_mutex_lock(&m->mb_write_lock); 310 311 while (m->mb_initialized) { 312 pthread_cond_wait(&m->mb_ready_cond, &m->mb_write_lock); 313 314 /* releasing the mutex reduces contention */ 315 pthread_mutex_unlock(&m->mb_write_lock); 316 m->mb_flush(); 317 pthread_mutex_lock(&m->mb_write_lock); 318 } 319 320 pthread_mutex_unlock(&m->mb_write_lock); 321 322 return NULL; 319 323 } 320 324 … … 322 326 DebugModuleManager::print(const char *fmt, ...) 323 327 { 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 } else {/* lock collision */345 // 346 347 348 328 char msg[MB_BUFFERSIZE]; 329 va_list ap; 330 331 /* format the message first, to reduce lock contention */ 332 va_start(ap, fmt); 333 vsnprintf(msg, MB_BUFFERSIZE, fmt, ap); 334 va_end(ap); 335 336 if (!mb_initialized) { 337 /* Unable to print message with realtime safety. 338 * Complain and print it anyway. */ 339 fprintf(stderr, "ERROR: messagebuffer not initialized: %s", 340 msg); 341 return; 342 } 343 if (pthread_mutex_trylock(&mb_write_lock) == 0) { 344 strncpy(mb_buffers[mb_inbuffer], msg, MB_BUFFERSIZE); 345 mb_inbuffer = MB_NEXT(mb_inbuffer); 346 pthread_cond_signal(&mb_ready_cond); 347 pthread_mutex_unlock(&mb_write_lock); 348 } else { /* lock collision */ 349 // atomic_add(&mb_overruns, 1); 350 // FIXME: atomicity 351 mb_overruns++; // skip the atomicness for now 352 } 349 353 } 350 354 … … 353 357 DebugModuleManager::va_print (const char *fmt, va_list ap) 354 358 { 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 } else {/* lock collision */374 // 375 376 377 359 char msg[MB_BUFFERSIZE]; 360 361 /* format the message first, to reduce lock contention */ 362 vsnprintf(msg, MB_BUFFERSIZE, fmt, ap); 363 364 if (!mb_initialized) { 365 /* Unable to print message with realtime safety. 366 * Complain and print it anyway. */ 367 fprintf(stderr, "ERROR: messagebuffer not initialized: %s", 368 msg); 369 return; 370 } 371 372 if (pthread_mutex_trylock(&mb_write_lock) == 0) { 373 strncpy(mb_buffers[mb_inbuffer], msg, MB_BUFFERSIZE); 374 mb_inbuffer = MB_NEXT(mb_inbuffer); 375 pthread_cond_signal(&mb_ready_cond); 376 pthread_mutex_unlock(&mb_write_lock); 377 } else { /* lock collision */ 378 // atomic_add(&mb_overruns, 1); 379 // FIXME: atomicity 380 mb_overruns++; // skip the atomicness for now 381 } 378 382 } 379 383 trunk/libffado/src/debugmodule/debugmodule.h
r392 r445 1 /* debugmodule.h 2 * Copyright (C) 2005 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * Copyright (C) 2005-2007 by Pieter Palmers 4 * 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 7 * 8 * FFADO is based upon FreeBoB 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 11 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 19 23 */ 20 24 … … 31 35 32 36 /* MB_NEXT() relies on the fact that MB_BUFFERS is a power of two */ 33 #define MB_BUFFERS 37 #define MB_BUFFERS 8192 34 38 #define MB_NEXT(index) ((index+1) & (MB_BUFFERS-1)) 35 #define MB_BUFFERSIZE 256/* message length limit */39 #define MB_BUFFERSIZE 256 /* message length limit */ 36 40 37 41 #define debugFatal( format, args... ) \ … … 78 82 #define IMPL_GLOBAL_DEBUG_MODULE( RegisterName, Level ) \ 79 83 DebugModule m_debugModule = \ 80 84 DebugModule( #RegisterName, Level ) 81 85 82 86 #define setDebugLevel( Level ) { \ 83 87 m_debugModule.setLevel( Level ); \ 84 88 } 85 89 86 90 /* m_debugModule.print( eDL_Normal, \ … … 90 94 "Setting debug level to %d\n", \ 91 95 Level ); \ 92 96 }*/ 93 97 94 98 #define getDebugLevel( ) \ … … 97 101 98 102 #ifdef DEBUG 99 103 100 104 #define debugOutput( level, format, args... ) \ 101 105 m_debugModule.print( level, \ … … 129 133 130 134 #include <sys/time.h> 131 135 132 136 #ifdef DO_PREEMPTION_CHECKING 133 137 #define CHECK_PREEMPTION(onoff) \ 134 138 gettimeofday((struct timeval *)1, (struct timezone *)onoff) 135 139 #else 136 140 #define CHECK_PREEMPTION(onoff) … … 196 200 static DebugModuleManager* instance(); 197 201 ~DebugModuleManager(); 198 202 199 203 bool setMgrDebugLevel( std::string name, debug_level_t level ); 200 204 … … 206 210 207 211 bool init(); 208 212 209 213 void print(const char *fmt, ...); 210 214 void va_print(const char *fmt, va_list); 211 215 212 216 private: 213 217 DebugModuleManager(); … … 227 231 static void *mb_thread_func(void *arg); 228 232 void mb_flush(); 229 233 230 234 static DebugModuleManager* m_instance; 231 235 DebugModuleVector m_debugModules; trunk/libffado/src/debugmodule/test_debugmodule.cpp
r168 r445 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * Copyright (C) 2005-2007 by Pieter Palmers 4 * 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 7 * 8 * FFADO is based upon FreeBoB. 9 * 10 * This is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License version 2 12 * as published by the Free Software Foundation. 13 * 14 * FFADO is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with FFADO; if not, write to the Free Software 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22 * MA 02111-1307 USA. 23 */ 24 1 25 #include "debugmodule.h" 2 26 trunk/libffado/src/devicemanager.cpp
r436 r445 1 /* devicemanager.cpp 2 * Copyright (C) 2005,06,07 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * Copyright (C) 2005-2007 by Pieter Palmers 4 * 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 7 * 8 * FFADO is based upon FreeBoB. 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 11 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 19 23 */ 20 24 … … 94 98 95 99 void 96 DeviceManager::setVerboseLevel(int l) 100 DeviceManager::setVerboseLevel(int l) 97 101 { 98 102 m_verboseLevel=l; 99 103 setDebugLevel(l); 100 104 101 105 if (m_1394Service) m_1394Service->setVerboseLevel(l); 102 106 if (m_oscServer) m_oscServer->setVerboseLevel(l); 103 107 OscNode::setVerboseLevel(l); 104 108 105 109 for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 106 110 it != m_avDevices.end(); … … 126 130 return false; 127 131 } 128 132 129 133 m_oscServer = new OSC::OscServer("17820"); 130 134 131 135 if (!m_oscServer) { 132 136 debugFatal("failed to create osc server\n"); … … 135 139 return false; 136 140 } 137 141 138 142 if (!m_oscServer->init()) { 139 143 debugFatal("failed to init osc server\n"); … … 144 148 return false; 145 149 } 146 150 147 151 if (!m_oscServer->registerAtRootNode(this)) { 148 152 debugFatal("failed to register devicemanager at server\n"); … … 153 157 return false; 154 158 } 155 159 156 160 if (!m_oscServer->start()) { 157 161 debugFatal("failed to start osc server\n"); … … 162 166 return false; 163 167 } 164 168 165 169 setVerboseLevel(m_verboseLevel); 166 170 return true; … … 198 202 { 199 203 debugOutput( DEBUG_LEVEL_VERBOSE, "Probing node %d...\n", nodeId ); 200 204 201 205 if (nodeId == m_1394Service->getLocalNodeId()) { 202 206 debugOutput( DEBUG_LEVEL_VERBOSE, "Skipping local node (%d)...\n", nodeId ); 203 207 continue; 204 208 } 205 209 206 210 std::auto_ptr<ConfigRom> configRom = 207 211 std::auto_ptr<ConfigRom>( new ConfigRom( *m_1394Service, … … 219 223 continue; 220 224 } 221 225 222 226 IAvDevice* avDevice = getDriverForDevice( configRom, 223 227 nodeId ); … … 228 232 229 233 avDevice->setVerboseLevel( m_verboseLevel ); 230 234 231 235 if ( !avDevice->discover() ) { 232 236 debugError( "discover: could not discover device\n" ); … … 238 242 debugError( "setting Id failed\n" ); 239 243 } 240 244 241 245 if (snoopMode) { 242 246 debugOutput( DEBUG_LEVEL_VERBOSE, … … 249 253 } 250 254 } 251 255 252 256 if ( m_verboseLevel >= DEBUG_LEVEL_VERBOSE ) { 253 257 avDevice->showDevice(); … … 255 259 256 260 m_avDevices.push_back( avDevice ); 257 261 258 262 if (!addChildOscNode(avDevice)) { 259 263 debugWarning("failed to register AvDevice at OSC server\n"); … … 263 267 } 264 268 return true; 265 269 266 270 } else { // slave mode 267 271 fb_nodeid_t nodeId = m_1394Service->getLocalNodeId(); … … 289 293 "discover: driver found for device %d\n", 290 294 nodeId ); 291 295 292 296 avDevice->setVerboseLevel( m_verboseLevel ); 293 297 … … 307 311 m_avDevices.push_back( avDevice ); 308 312 } 309 313 310 314 return true; 311 315 } … … 392 396 393 397 if (avDevice->getConfigRom().getNodeId() == node) { 394 395 398 return true; 399 } 396 400 } 397 401 return false; … … 440 444 DeviceManager::getAvDeviceByIndex( int idx ) 441 445 { 442 446 return m_avDevices.at(idx); 443 447 } 444 448 … … 446 450 DeviceManager::getAvDeviceCount( ) 447 451 { 448 452 return m_avDevices.size(); 449 453 } 450 454 … … 465 469 debugWarning("Could not retrieve slaveMode parameter, defauling to false\n"); 466 470 } 467 471 468 472 #warning TEST CODE FOR BOUNCE DEVICE !! 469 473 // this makes the bounce slave use the xmit SP as sync source … … 473 477 return device->getStreamProcessorByIndex(0); 474 478 } 475 476 479 } 477 480 … … 487 490 int i; 488 491 i=0; // avoids unused warning 489 492 490 493 for ( IAvDeviceVectorIterator it = m_avDevices.begin(); 491 494 it != m_avDevices.end(); … … 494 497 IAvDevice* pAvDevice; 495 498 pAvDevice = *it; // avoids unused warning 496 499 497 500 #ifdef ENABLE_BEBOB 498 501 BeBoB::AvDevice* pBeBoBDevice = reinterpret_cast< BeBoB::AvDevice* >( pAvDevice ); … … 577 580 } while ( pBeBoBDevice ); 578 581 #endif 579 582 580 583 return true; 581 584 } trunk/libffado/src/devicemanager.h
r436 r445 1 /* devicemanager.h 2 * Copyright (C) 2005 by Daniel Wagner 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * Copyright (C) 2005-2007 by Pieter Palmers 3 4 * 4 * This file is part of FreeBoB. 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 5 7 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 8 * FFADO is based upon FreeBoB. 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 11 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 14 18 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 19 23 */ 20 24 21 #ifndef F REEBOBDEVICEMANAGER_H22 #define F REEBOBDEVICEMANAGER_H25 #ifndef FFADODEVICEMANAGER_H 26 #define FFADODEVICEMANAGER_H 23 27 24 28 #include "debugmodule/debugmodule.h" … … 44 48 typedef std::vector< IAvDevice* >::iterator IAvDeviceVectorIterator; 45 49 46 class DeviceManager 50 class DeviceManager 47 51 : public Util::OptionContainer, 48 52 public OSC::OscNode … … 78 82 Ieee1394Service* m_1394Service; 79 83 IAvDeviceVector m_avDevices; 80 84 81 85 OSC::OscServer* m_oscServer; 82 86 83 87 // debug stuff 84 88 public: trunk/libffado/src/dice/dice_avdevice.cpp
r436 r445 1 /* dice_avdevice.cpp2 * Copyright (C) 200 7 by Pieter Palmers1 /* 2 * Copyright (C) 2005-2007 by Pieter Palmers 3 3 * 4 * This file is part of FreeBob. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBob is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBob is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBob; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 … … 94 97 { 95 98 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 96 && ( supportedDeviceList[i].model_id == modelId ) 99 && ( supportedDeviceList[i].model_id == modelId ) 97 100 ) 98 101 { … … 115 118 { 116 119 if ( ( supportedDeviceList[i].vendor_id == vendorId ) 117 && ( supportedDeviceList[i].model_id == modelId ) 120 && ( supportedDeviceList[i].model_id == modelId ) 118 121 ) 119 122 { … … 126 129 return false; 127 130 } 128 131 129 132 if ( !initIoFunctions() ) { 130 133 debugError("Could not initialize I/O functions\n"); … … 138 141 } 139 142 140 int 143 int 141 144 DiceAvDevice::getSamplingFrequency( ) { 142 145 ESamplingFrequency samplingFrequency; 143 146 144 147 fb_quadlet_t clockreg; 145 148 if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg)) { … … 147 150 return false; 148 151 } 149 152 150 153 clockreg = DICE_GET_RATE(clockreg); 151 154 … … 164 167 default: samplingFrequency = eSF_DontCare; break; 165 168 } 166 169 167 170 return convertESamplingFrequency(samplingFrequency); 168 171 } … … 171 174 DiceAvDevice::setSamplingFrequency( ESamplingFrequency samplingFrequency ) 172 175 { 173 debugOutput(DEBUG_LEVEL_VERBOSE, "Setting sample rate: %d\n", 176 debugOutput(DEBUG_LEVEL_VERBOSE, "Setting sample rate: %d\n", 174 177 convertESamplingFrequency(samplingFrequency)); 175 178 176 179 bool supported=false; 177 180 fb_quadlet_t select=0x0; 178 181 179 182 switch ( samplingFrequency ) { 180 183 default: … … 236 239 return false; 237 240 } 238 241 239 242 fb_quadlet_t clockreg; 240 243 if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg)) { … … 256 259 return false; 257 260 } 258 261 259 262 if(clockreg != clockreg_verify) { 260 263 debugError("Samplerate register write failed\n"); 261 264 return false; 262 265 } 263 266 264 267 return true; 265 268 } … … 270 273 fb_quadlet_t tmp_quadlet; 271 274 fb_octlet_t tmp_octlet; 272 275 273 276 debugOutput(DEBUG_LEVEL_VERBOSE, 274 277 "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, … … 285 288 286 289 debugOutput(DEBUG_LEVEL_VERBOSE," Global param space:\n"); 287 290 288 291 readGlobalRegBlock(DICE_REGISTER_GLOBAL_OWNER, (fb_quadlet_t *)&tmp_octlet,sizeof(fb_octlet_t)); 289 292 debugOutput(DEBUG_LEVEL_VERBOSE," Owner : 0x%016X\n",tmp_octlet); 290 293 291 294 readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 292 295 debugOutput(DEBUG_LEVEL_VERBOSE," Notification : 0x%08X\n",tmp_quadlet); 293 296 294 297 readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 295 298 debugOutput(DEBUG_LEVEL_VERBOSE," Nick name : %s\n",getDeviceNickName().c_str()); 296 299 297 300 readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &tmp_quadlet); 298 301 debugOutput(DEBUG_LEVEL_VERBOSE," Clock Select : 0x%02X 0x%02X\n", 299 302 (tmp_quadlet>>8) & 0xFF, tmp_quadlet & 0xFF); 300 303 301 304 readGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, &tmp_quadlet); 302 305 debugOutput(DEBUG_LEVEL_VERBOSE," Enable : %s\n", 303 306 (tmp_quadlet&0x1?"true":"false")); 304 307 305 308 readGlobalReg(DICE_REGISTER_GLOBAL_STATUS, &tmp_quadlet); 306 309 debugOutput(DEBUG_LEVEL_VERBOSE," Clock Status : %s 0x%02X\n", 307 310 (tmp_quadlet&0x1?"locked":"not locked"), (tmp_quadlet>>8) & 0xFF); 308 311 309 312 readGlobalReg(DICE_REGISTER_GLOBAL_EXTENDED_STATUS, &tmp_quadlet); 310 313 debugOutput(DEBUG_LEVEL_VERBOSE," Extended Status : 0x%08X\n",tmp_quadlet); 311 314 312 315 readGlobalReg(DICE_REGISTER_GLOBAL_SAMPLE_RATE, &tmp_quadlet); 313 316 debugOutput(DEBUG_LEVEL_VERBOSE," Samplerate : 0x%08X (%lu)\n",tmp_quadlet,tmp_quadlet); 314 317 315 318 readGlobalReg(DICE_REGISTER_GLOBAL_VERSION, &tmp_quadlet); 316 319 debugOutput(DEBUG_LEVEL_VERBOSE," Version : 0x%08X (%u.%u.%u.%u)\n", … … 321 324 DICE_DRIVER_SPEC_VERSION_NUMBER_GET_D(tmp_quadlet) 322 325 ); 323 326 324 327 readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &tmp_quadlet); 325 328 debugOutput(DEBUG_LEVEL_VERBOSE," Clock caps : 0x%08X\n",tmp_quadlet & 0x1FFF007F); … … 327 330 diceNameVector names=getClockSourceNameString(); 328 331 debugOutput(DEBUG_LEVEL_VERBOSE," Clock sources :\n"); 329 332 330 333 for ( diceNameVectorIterator it = names.begin(); 331 334 it != names.end(); … … 334 337 debugOutput(DEBUG_LEVEL_VERBOSE," %s\n", (*it).c_str()); 335 338 } 336 339 337 340 debugOutput(DEBUG_LEVEL_VERBOSE," TX param space:\n"); 338 341 debugOutput(DEBUG_LEVEL_VERBOSE," Nb of xmit : %1d\n", m_nb_tx); 339 342 for (unsigned int i=0;i<m_nb_tx;i++) { 340 343 debugOutput(DEBUG_LEVEL_VERBOSE," Transmitter %d:\n",i); 341 344 342 345 readTxReg(i, DICE_REGISTER_TX_ISOC_BASE, &tmp_quadlet); 343 346 debugOutput(DEBUG_LEVEL_VERBOSE," ISO channel : %3d\n", tmp_quadlet); 344 347 readTxReg(i, DICE_REGISTER_TX_SPEED_BASE, &tmp_quadlet); 345 348 debugOutput(DEBUG_LEVEL_VERBOSE," ISO speed : %3d\n", tmp_quadlet); 346 349 347 350 readTxReg(i, DICE_REGISTER_TX_NB_AUDIO_BASE, &tmp_quadlet); 348 351 debugOutput(DEBUG_LEVEL_VERBOSE," Nb audio channels : %3d\n", tmp_quadlet); 349 352 readTxReg(i, DICE_REGISTER_TX_MIDI_BASE, &tmp_quadlet); 350 353 debugOutput(DEBUG_LEVEL_VERBOSE," Nb midi channels : %3d\n", tmp_quadlet); 351 354 352 355 readTxReg(i, DICE_REGISTER_TX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 353 356 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 caps : 0x%08X\n", tmp_quadlet); 354 357 readTxReg(i, DICE_REGISTER_TX_AC3_ENABLE_BASE, &tmp_quadlet); 355 358 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 enable : 0x%08X\n", tmp_quadlet); 356 359 357 360 diceNameVector channel_names=getTxNameString(i); 358 361 debugOutput(DEBUG_LEVEL_VERBOSE," Channel names :\n"); … … 364 367 } 365 368 } 366 369 367 370 debugOutput(DEBUG_LEVEL_VERBOSE," RX param space:\n"); 368 371 debugOutput(DEBUG_LEVEL_VERBOSE," Nb of recv : %1d\n", m_nb_tx); 369 372 for (unsigned int i=0;i<m_nb_rx;i++) { 370 373 debugOutput(DEBUG_LEVEL_VERBOSE," Receiver %d:\n",i); 371 374 372 375 readTxReg(i, DICE_REGISTER_RX_ISOC_BASE, &tmp_quadlet); 373 376 debugOutput(DEBUG_LEVEL_VERBOSE," ISO channel : %3d\n", tmp_quadlet); 374 377 readTxReg(i, DICE_REGISTER_RX_SEQ_START_BASE, &tmp_quadlet); 375 378 debugOutput(DEBUG_LEVEL_VERBOSE," Sequence start : %3d\n", tmp_quadlet); 376 379 377 380 readTxReg(i, DICE_REGISTER_RX_NB_AUDIO_BASE, &tmp_quadlet); 378 381 debugOutput(DEBUG_LEVEL_VERBOSE," Nb audio channels : %3d\n", tmp_quadlet); 379 382 readTxReg(i, DICE_REGISTER_RX_MIDI_BASE, &tmp_quadlet); 380 383 debugOutput(DEBUG_LEVEL_VERBOSE," Nb midi channels : %3d\n", tmp_quadlet); 381 384 382 385 readTxReg(i, DICE_REGISTER_RX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 383 386 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 caps : 0x%08X\n", tmp_quadlet); 384 387 readTxReg(i, DICE_REGISTER_RX_AC3_ENABLE_BASE, &tmp_quadlet); 385 388 debugOutput(DEBUG_LEVEL_VERBOSE," AC3 enable : 0x%08X\n", tmp_quadlet); 386 389 387 390 diceNameVector channel_names=getRxNameString(i); 388 391 debugOutput(DEBUG_LEVEL_VERBOSE," Channel names :\n"); … … 421 424 fb_quadlet_t nb_midi; 422 425 unsigned int nb_channels=0; 423 426 424 427 if(!readTxReg(i, DICE_REGISTER_TX_NB_AUDIO_BASE, &nb_audio)) { 425 428 debugError("Could not read DICE_REGISTER_TX_NB_AUDIO_BASE register for ATX%u",i); … … 430 433 continue; 431 434 } 432 435 433 436 // request the channel names 434 437 diceNameVector names_audio=getTxNameString(i); 435 438 436 439 if (names_audio.size() != nb_audio) { 437 440 debugWarning("The audio channel name vector is incorrect, using default names\n"); 438 441 names_audio.clear(); 439 442 440 443 for (unsigned int j=0;j<nb_audio;j++) { 441 444 std::ostringstream newname; … … 444 447 } 445 448 } 446 449 447 450 nb_channels=nb_audio; 448 451 if(nb_midi) nb_channels += 1; // midi-muxed counts as one 449 452 450 453 // construct the MIDI names 451 454 diceNameVector names_midi; … … 455 458 names_midi.push_back(newname.str()); 456 459 } 457 460 458 461 // construct the streamprocessor 459 462 Streaming::AmdtpReceiveStreamProcessor *p; … … 478 481 479 482 if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Capture)) { 480 debugError("Could not add channel %s to StreamProcessor\n", 483 debugError("Could not add channel %s to StreamProcessor\n", 481 484 channelInfo.name.c_str()); 482 485 continue; 483 486 } 484 487 } 485 488 486 489 // add midi ports to the processor 487 490 for (unsigned int j=0;j<nb_midi;j++) { … … 493 496 494 497 if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Capture)) { 495 debugError("Could not add channel %s to StreamProcessor\n", 498 debugError("Could not add channel %s to StreamProcessor\n", 496 499 channelInfo.name.c_str()); 497 500 continue; 498 501 } 499 502 } 500 503 501 504 // add the SP to the vector 502 505 m_receiveProcessors.push_back(p); 503 506 } 504 507 505 508 // prepare transmit SP's 506 509 for (unsigned int i=0;i<m_nb_rx;i++) { … … 508 511 fb_quadlet_t nb_midi; 509 512 unsigned int nb_channels=0; 510 513 511 514 if(!readTxReg(i, DICE_REGISTER_RX_NB_AUDIO_BASE, &nb_audio)) { 512 515 debugError("Could not read DICE_REGISTER_RX_NB_AUDIO_BASE register for ARX%u",i); … … 517 520 continue; 518 521 } 519 522 520 523 // request the channel names 521 524 diceNameVector names_audio=getRxNameString(i); 522 525 523 526 if (names_audio.size() != nb_audio) { 524 527 debugWarning("The audio channel name vector is incorrect, using default names\n"); 525 528 names_audio.clear(); 526 529 527 530 for (unsigned int j=0;j<nb_audio;j++) { 528 531 std::ostringstream newname; … … 531 534 } 532 535 } 533 536 534 537 nb_channels=nb_audio; 535 538 if(nb_midi) nb_channels += 1; // midi-muxed counts as one 536 539 537 540 // construct the MIDI names 538 541 diceNameVector names_midi; … … 542 545 names_midi.push_back(newname.str()); 543 546 } 544 547 545 548 // construct the streamprocessor 546 549 Streaming::AmdtpTransmitStreamProcessor *p; … … 565 568 566 569 if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Playback)) { 567 debugError("Could not add channel %s to StreamProcessor\n", 570 debugError("Could not add channel %s to StreamProcessor\n", 568 571 channelInfo.name.c_str()); 569 572 continue; 570 573 } 571 574 } 572 575 573 576 // add midi ports to the processor 574 577 for (unsigned int j=0;j<nb_midi;j++) { … … 580 583 581 584 if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Playback)) { 582 debugError("Could not add channel %s to StreamProcessor\n", 585 debugError("Could not add channel %s to StreamProcessor\n", 583 586 channelInfo.name.c_str()); 584 587 continue; 585 588 } 586 589 } 587 590 588 591 m_transmitProcessors.push_back(p); 589 592 } … … 596 599 Streaming::StreamProcessor *processor, 597 600 Streaming::Port::E_Direction direction) { 598 601 599 602 std::string id=std::string("dev?"); 600 603 if(!getOption("id", id)) { … … 609 612 portname << "c"; 610 613 } 611 614 612 615 portname << "_" << channelInfo->name; 613 616 … … 655 658 DiceAvDevice::lock() { 656 659 fb_octlet_t result; 657 658 debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 660 661 debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 659 662 m_model->vendor_name, m_model->model_name, m_nodeId); 660 663 661 664 // get a notifier to handle device notifications 662 665 nodeaddr_t notify_address; … … 665 668 DICE_NOTIFIER_BLOCK_LENGTH, 666 669 DICE_NOTIFIER_BLOCK_LENGTH); 667 670 668 671 if (notify_address == 0xFFFFFFFFFFFFFFFFLLU) { 669 672 debugError("Could not find free ARM block for notification\n"); 670 673 return false; 671 674 } 672 675 673 676 m_notifier=new DiceAvDevice::DiceNotifier(this, notify_address); 674 677 675 678 if(!m_notifier) { 676 679 debugError("Could not allocate notifier\n"); 677 680 return false; 678 681 } 679 682 680 683 if (!m_p1394Service->registerARMHandler(m_notifier)) { 681 684 debugError("Could not register notifier\n"); … … 686 689 687 690 // register this notifier 688 fb_nodeaddr_t addr = DICE_REGISTER_BASE 691 fb_nodeaddr_t addr = DICE_REGISTER_BASE 689 692 + m_global_reg_offset 690 693 + DICE_REGISTER_GLOBAL_OWNER; … … 696 699 return false; 697 700 } 698 701 699 702 fb_nodeaddr_t swap_value = ((0xFFC0) | m_p1394Service->getLocalNodeId()); 700 703 swap_value = swap_value << 48; 701 704 swap_value |= m_notifier->getStart(); 702 703 if (!m_p1394Service->lockCompareSwap64( m_nodeId | 0xFFC0, addr, DICE_OWNER_NO_OWNER, 705 706 if (!m_p1394Service->lockCompareSwap64( m_nodeId | 0xFFC0, addr, DICE_OWNER_NO_OWNER, 704 707 swap_value, &result )) { 705 708 debugWarning("Could not register ourselves as device owner\n"); 706 709 } 707 710 708 711 if (result != DICE_OWNER_NO_OWNER) { 709 712 debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016llX\n", result); … … 717 720 DiceAvDevice::unlock() { 718 721 fb_octlet_t result; 719 722 720 723 if(!m_notifier) { 721 724 debugWarning("Request to unlock, but no notifier present!\n"); 722 725 return false; 723 726 } 724 725 fb_nodeaddr_t addr = DICE_REGISTER_BASE 727 728 fb_nodeaddr_t addr = DICE_REGISTER_BASE 726 729 + m_global_reg_offset 727 730 + DICE_REGISTER_GLOBAL_OWNER; … … 733 736 return false; 734 737 } 735 738 736 739 fb_nodeaddr_t compare_value = ((0xFFC0) | m_p1394Service->getLocalNodeId()); 737 compare_value <<= 48; 740 compare_value <<= 48; 738 741 compare_value |= m_notifier->getStart(); 739 740 if (!m_p1394Service->lockCompareSwap64( m_nodeId | 0xFFC0, addr, compare_value, 742 743 if (!m_p1394Service->lockCompareSwap64( m_nodeId | 0xFFC0, addr, compare_value, 741 744 DICE_OWNER_NO_OWNER, &result )) { 742 745 debugWarning("Could not unregister ourselves as device owner\n"); 743 746 } 744 747 745 748 m_p1394Service->unregisterARMHandler(m_notifier); 746 749 delete m_notifier; … … 788 791 int n=i; 789 792 Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 790 793 791 794 // allocate ISO channel 792 795 int isochannel=allocateIsoChannel(p->getMaxPacketSize()); … … 796 799 } 797 800 p->setChannel(isochannel); 798 801 799 802 fb_quadlet_t reg_isoch; 800 803 // check value of ISO_CHANNEL register … … 811 814 return false; 812 815 } 813 816 814 817 // write value of ISO_CHANNEL register 815 818 reg_isoch=isochannel; … … 820 823 return false; 821 824 } 822 825 823 826 return true; 824 827 825 828 } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 826 829 int n=i-m_receiveProcessors.size(); 827 830 Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 828 831 829 832 // allocate ISO channel 830 833 int isochannel=allocateIsoChannel(p->getMaxPacketSize()); … … 834 837 } 835 838 p->setChannel(isochannel); 836 839 837 840 fb_quadlet_t reg_isoch; 838 841 // check value of ISO_CHANNEL register … … 849 852 return false; 850 853 } 851 854 852 855 // write value of ISO_CHANNEL register 853 856 reg_isoch=isochannel; … … 858 861 return false; 859 862 } 860 863 861 864 return true; 862 865 } 863 866 864 867 debugError("SP index %d out of range!\n",i); 865 868 866 869 return false; 867 870 } … … 879 882 Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 880 883 unsigned int isochannel=p->getChannel(); 881 884 882 885 fb_quadlet_t reg_isoch; 883 886 // check value of ISO_CHANNEL register … … 890 893 return false; 891 894 } 892 895 893 896 // write value of ISO_CHANNEL register 894 897 reg_isoch=0xFFFFFFFFUL; … … 897 900 return false; 898 901 } 899 902 900 903 // deallocate ISO channel 901 904 if(!deallocateIsoChannel(isochannel)) { … … 903 906 return false; 904 907 } 905 908 906 909 p->setChannel(-1); 907 910 return true; 908 911 909 912 } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 910 913 int n=i-m_receiveProcessors.size(); 911 914 Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 912 915 913 916 unsigned int isochannel=p->getChannel(); 914 917 915 918 fb_quadlet_t reg_isoch; 916 919 // check value of ISO_CHANNEL register … … 923 926 return false; 924 927 } 925 928 926 929 // write value of ISO_CHANNEL register 927 930 reg_isoch=0xFFFFFFFFUL; … … 930 933 return false; 931 934 } 932 935 933 936 // deallocate ISO channel 934 937 if(!deallocateIsoChannel(isochannel)) { … … 936 939 return false; 937 940 } 938 941 939 942 p->setChannel(-1); 940 943 return true; 941 944 } 942 945 943 946 debugError("SP index %d out of range!\n",i); 944 947 945 948 return false; 946 949 } … … 951 954 int DiceAvDevice::allocateIsoChannel(unsigned int packet_size) { 952 955 unsigned int bandwidth=8+packet_size; 953 956 954 957 int ch=m_p1394Service->allocateIsoChannelGeneric(bandwidth); 955 958 956 959 debugOutput(DEBUG_LEVEL_VERBOSE, "allocated channel %d, bandwidth %d\n", 957 960 ch, bandwidth); 958 961 959 962 return ch; 960 963 } … … 979 982 fb_quadlet_t result; 980 983 readGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, &result); 981 // I don't know what exactly is 'enable', 984 // I don't know what exactly is 'enable', 982 985 // but disable is definately == 0 983 986 return (result != DICE_ISOSTREAMING_DISABLE); … … 1007 1010 diceNameVector names; 1008 1011 char namestring[DICE_TX_NAMES_SIZE+1]; 1009 1010 if (!readTxRegBlock(i, DICE_REGISTER_TX_NAMES_BASE, 1012 1013 if (!readTxRegBlock(i, DICE_REGISTER_TX_NAMES_BASE, 1011 1014 (fb_quadlet_t *)namestring, DICE_TX_NAMES_SIZE)) { 1012 1015 debugError("Could not read TX name string \n"); 1013 1016 return names; 1014 1017 } 1015 1018 1016 1019 namestring[DICE_TX_NAMES_SIZE]='\0'; 1017 1020 return splitNameString(std::string(namestring)); … … 1022 1025 diceNameVector names; 1023 1026 char namestring[DICE_RX_NAMES_SIZE+1]; 1024 1025 if (!readRxRegBlock(i, DICE_REGISTER_RX_NAMES_BASE, 1027 1028 if (!readRxRegBlock(i, DICE_REGISTER_RX_NAMES_BASE, 1026 1029 (fb_quadlet_t *)namestring, DICE_RX_NAMES_SIZE)) { 1027 1030 debugError("Could not read RX name string \n"); 1028 1031 return names; 1029 1032 } 1030 1033 1031 1034 namestring[DICE_RX_NAMES_SIZE]='\0'; 1032 1035 return splitNameString(std::string(namestring)); … … 1037 1040 diceNameVector names; 1038 1041 char namestring[DICE_CLOCKSOURCENAMES_SIZE+1]; 1039 1040 if (!readGlobalRegBlock(DICE_REGISTER_GLOBAL_CLOCKSOURCENAMES, 1042 1043 if (!readGlobalRegBlock(DICE_REGISTER_GLOBAL_CLOCKSOURCENAMES, 1041 1044 (fb_quadlet_t *)namestring, DICE_CLOCKSOURCENAMES_SIZE)) { 1042 1045 debugError("Could not read CLOCKSOURCE name string \n"); 1043 1046 return names; 1044 1047 } 1045 1048 1046 1049 namestring[DICE_CLOCKSOURCENAMES_SIZE]='\0'; 1047 1050 return splitNameString(std::string(namestring)); … … 1051 1054 DiceAvDevice::getDeviceNickName() { 1052 1055 char namestring[DICE_NICK_NAME_SIZE+1]; 1053 1054 if (!readGlobalRegBlock(DICE_REGISTER_GLOBAL_NICK_NAME, 1056 1057 if (!readGlobalRegBlock(DICE_REGISTER_GLOBAL_NICK_NAME, 1055 1058 (fb_quadlet_t *)namestring, DICE_NICK_NAME_SIZE)) { 1056 1059 debugError("Could not read nickname string \n"); 1057 1060 return std::string("(unknown)"); 1058 1061 } 1059 1062 1060 1063 namestring[DICE_NICK_NAME_SIZE]='\0'; 1061 1064 return std::string(namestring); … … 1096 1099 } 1097 1100 m_global_reg_offset*=4; 1098 1101 1099 1102 if(!readReg(DICE_REGISTER_GLOBAL_PAR_SPACE_SZ, &m_global_reg_size)) { 1100 1103 debugError("Could not initialize m_global_reg_size\n"); … … 1102 1105 } 1103 1106 m_global_reg_size*=4; 1104 1107 1105 1108 if(!readReg(DICE_REGISTER_TX_PAR_SPACE_OFF, &m_tx_reg_offset)) { 1106 1109 debugError("Could not initialize m_tx_reg_offset\n"); … … 1108 1111 } 1109 1112 m_tx_reg_offset*=4; 1110 1113 1111 1114 if(!readReg(DICE_REGISTER_TX_PAR_SPACE_SZ, &m_tx_reg_size)) { 1112 1115 debugError("Could not initialize m_tx_reg_size\n"); … … 1114 1117 } 1115 1118 m_tx_reg_size*=4; 1116 1119 1117 1120 if(!readReg(DICE_REGISTER_RX_PAR_SPACE_OFF, &m_rx_reg_offset)) { 1118 1121 debugError("Could not initialize m_rx_reg_offset\n"); … … 1120 1123 } 1121 1124 m_rx_reg_offset*=4; 1122 1125 1123 1126 if(!readReg(DICE_REGISTER_RX_PAR_SPACE_SZ, &m_rx_reg_size)) { 1124 1127 debugError("Could not initialize m_rx_reg_size\n"); … … 1126 1129 } 1127 1130 m_rx_reg_size*=4; 1128 1131 1129 1132 if(!readReg(DICE_REGISTER_UNUSED1_SPACE_OFF, &m_unused1_reg_offset)) { 1130 1133 debugError("Could not initialize m_unused1_reg_offset\n"); … … 1132 1135 } 1133 1136 m_unused1_reg_offset*=4; 1134 1137 1135 1138 if(!readReg(DICE_REGISTER_UNUSED1_SPACE_SZ, &m_unused1_reg_size)) { 1136 1139 debugError("Could not initialize m_unused1_reg_size\n"); … … 1138 1141 } 1139 1142 m_unused1_reg_size*=4; 1140 1143 1141 1144 if(!readReg(DICE_REGISTER_UNUSED2_SPACE_OFF, &m_unused2_reg_offset)) { 1142 1145 debugError("Could not initialize m_unused2_reg_offset\n"); … … 1144 1147 } 1145 1148 m_unused2_reg_offset*=4; 1146 1149 1147 1150 if(!readReg(DICE_REGISTER_UNUSED2_SPACE_SZ, &m_unused2_reg_size)) { 1148 1151 debugError("Could not initialize m_unused2_reg_size\n"); … … 1160 1163 } 1161 1164 m_tx_size*=4; 1162 1165 1163 1166 if(!readReg(m_tx_reg_offset + DICE_REGISTER_RX_NB_RX, &m_nb_rx)) { 1164 1167 debugError("Could not initialize m_nb_rx\n"); … … 1170 1173 } 1171 1174 m_rx_size*=4; 1172 1175 1173 1176 debugOutput(DEBUG_LEVEL_VERBOSE,"DICE Parameter Space info:\n"); 1174 1177 debugOutput(DEBUG_LEVEL_VERBOSE," Global : offset=%04X size=%04d\n", m_global_reg_offset, m_global_reg_size); … … 1179 1182 debugOutput(DEBUG_LEVEL_VERBOSE," UNUSED1 : offset=%04X size=%04d\n", m_unused1_reg_offset, m_unused1_reg_size); 1180 1183 debugOutput(DEBUG_LEVEL_VERBOSE," UNUSED2 : offset=%04X size=%04d\n", m_unused2_reg_offset, m_unused2_reg_size); 1181 1184 1182 1185 return true; 1183 1186 } … … 1186 1189 DiceAvDevice::readReg(fb_nodeaddr_t offset, fb_quadlet_t *result) { 1187 1190 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX\n", offset); 1188 1191 1189 1192 if(offset >= DICE_INVALID_OFFSET) { 1190 1193 debugError("invalid offset: 0x%016llX\n", offset); 1191 1194 return false; 1192 1195 } 1193 1196 1194 1197 fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 1195 1198 fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 1196 1199 1197 1200 if(!m_p1394Service->read_quadlet( nodeId, addr, result ) ) { 1198 1201 debugError("Could not read from node 0x%04X addr 0x%012X\n", nodeId, addr); 1199 1202 return false; 1200 1203 } 1201 1204 1202 1205 *result=ntohl(*result); 1203 1206 1204 1207 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Read result: 0x%08X\n", *result); 1205 1208 1206 1209 return true; 1207 1210 } … … 1209 1212 bool 1210 1213 DiceAvDevice::writeReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 1211 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 1214 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, data: 0x%08X\n", 1212 1215 offset, data); 1213 1216 1214 1217 if(offset >= DICE_INVALID_OFFSET) { 1215 1218 debugError("invalid offset: 0x%016llX\n", offset); 1216 1219 return false; 1217 1220 } 1218 1221 1219 1222 fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 1220 1223 fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 1221 1224 1222 1225 if(!m_p1394Service->write_quadlet( nodeId, addr, htonl(data) ) ) { 1223 1226 debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); … … 1227 1230 } 1228 1231 1229 bool 1232 bool 1230 1233 DiceAvDevice::readRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1231 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 1234 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading base register offset 0x%08llX, length %u\n", 1232 1235 offset, length); 1233 1236 1234 1237 if(offset >= DICE_INVALID_OFFSET) { 1235 1238 debugError("invalid offset: 0x%016llX\n", offset); 1236 1239 return false; 1237 1240 } 1238 1241 1239 1242 fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 1240 1243 fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 1241 1244 1242 1245 if(!m_p1394Service->read( nodeId, addr, length/4, data ) ) { 1243 1246 debugError("Could not read from node 0x%04X addr 0x%012llX\n", nodeId, addr); 1244 1247 return false; 1245 1248 } 1246 1249 1247 1250 for(unsigned int i=0;i<length/4;i++) { 1248 1251 *(data+i)=ntohl(*(data+i)); 1249 1252 } 1250 1253 1251 1254 return true; 1252 1255 } 1253 1256 1254 bool 1257 bool 1255 1258 DiceAvDevice::writeRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1256 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 1259 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing base register offset 0x%08llX, length: %u\n", 1257 1260 offset, length); 1258 1261 1259 1262 if(offset >= DICE_INVALID_OFFSET) { 1260 1263 debugError("invalid offset: 0x%016llX\n", offset); 1261 1264 return false; 1262 1265 } 1263 1266 1264 1267 fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 1265 1268 fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 1266 1269 1267 1270 fb_quadlet_t data_out[length/4]; 1268 1271 1269 1272 for(unsigned int i=0;i<length/4;i++) { 1270 1273 data_out[i]=ntohl(*(data+i)); 1271 1274 } 1272 1275 1273 1276 if(!m_p1394Service->write( nodeId, addr, length/4, data_out ) ) { 1274 1277 debugError("Could not write to node 0x%04X addr 0x%012llX\n", nodeId, addr); 1275 1278 return false; 1276 1279 } 1277 1280 1278 1281 return true; 1279 1282 } … … 1289 1292 bool 1290 1293 DiceAvDevice::writeGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t data) { 1291 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08llX, data: 0x%08X\n", 1294 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register offset 0x%08llX, data: 0x%08X\n", 1292 1295 offset, data); 1293 1296 … … 1296 1299 } 1297 1300 1298 bool 1301 bool 1299 1302 DiceAvDevice::readGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1300 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n", 1303 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading global register block offset 0x%04llX, length %u bytes\n", 1301 1304 offset, length); 1302 1305 … … 1305 1308 } 1306 1309 1307 bool 1310 bool 1308 1311 DiceAvDevice::writeGlobalRegBlock(fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1309 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n", 1312 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing global register block offset 0x%04llX, length %u bytes\n", 1310 1313 offset, length); 1311 1314 … … 1314 1317 } 1315 1318 1316 fb_nodeaddr_t 1319 fb_nodeaddr_t 1317 1320 DiceAvDevice::globalOffsetGen(fb_nodeaddr_t offset, size_t length) { 1318 1321 … … 1328 1331 return DICE_INVALID_OFFSET; 1329 1332 } 1330 1333 1331 1334 return offset; 1332 1335 } … … 1335 1338 DiceAvDevice::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 1336 1339 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading tx %d register offset 0x%04llX\n", i, offset); 1337 1340 1338 1341 fb_nodeaddr_t offset_tx=txOffsetGen(i, offset, sizeof(fb_quadlet_t)); 1339 1342 return readReg(m_tx_reg_offset + offset_tx, result); … … 1349 1352 } 1350 1353 1351 bool 1354 bool 1352 1355 DiceAvDevice::readTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1353 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 1356 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 1354 1357 offset, length); 1355 1358 1356 1359 fb_nodeaddr_t offset_tx=txOffsetGen(i, offset, length); 1357 1360 return readRegBlock(m_tx_reg_offset + offset_tx, data, length); 1358 1361 } 1359 1362 1360 bool 1363 bool 1361 1364 DiceAvDevice::writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1362 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 1365 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 1363 1366 offset, length); 1364 1367 … … 1367 1370 } 1368 1371 1369 fb_nodeaddr_t 1372 fb_nodeaddr_t 1370 1373 DiceAvDevice::txOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 1371 1374 // registry offsets should always be smaller than 0x7FFFFFFF … … 1402 1405 DiceAvDevice::readRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 1403 1406 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx %d register offset 0x%04llX\n", i, offset); 1404 1407 1405 1408 fb_nodeaddr_t offset_rx=rxOffsetGen(i, offset, sizeof(fb_quadlet_t)); 1406 1409 return readReg(m_rx_reg_offset + offset_rx, result); … … 1409 1412 bool 1410 1413 DiceAvDevice::writeRxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t data) { 1411 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08llX, data: 0x%08X\n", 1414 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register offset 0x%08llX, data: 0x%08X\n", 1412 1415 offset, data); 1413 1416 1414 1417 fb_nodeaddr_t offset_rx=rxOffsetGen(i, offset, sizeof(fb_quadlet_t)); 1415 1418 return writeReg(m_rx_reg_offset + offset_rx, data); 1416 1419 } 1417 1420 1418 bool 1421 bool 1419 1422 DiceAvDevice::readRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1420 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 1423 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading rx register block offset 0x%04llX, length %u bytes\n", 1421 1424 offset, length); 1422 1425 1423 1426 fb_nodeaddr_t offset_rx=rxOffsetGen(i, offset, length); 1424 1427 return readRegBlock(m_rx_reg_offset + offset_rx, data, length); 1425 1428 } 1426 1429 1427 bool 1430 bool 1428 1431 DiceAvDevice::writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length) { 1429 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 1432 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Writing rx register block offset 0x%04llX, length %u bytes\n", 1430 1433 offset, length); 1431 1434 … … 1434 1437 } 1435 1438 1436 fb_nodeaddr_t 1439 fb_nodeaddr_t 1437 1440 DiceAvDevice::rxOffsetGen(unsigned int i, fb_nodeaddr_t offset, size_t length) { 1438 1441 // registry offsets should always be smaller than 0x7FFFFFFF … … 1469 1472 1470 1473 DiceAvDevice::DiceNotifier::DiceNotifier(DiceAvDevice *d, nodeaddr_t start) 1471 : ARMHandler(start, DICE_NOTIFIER_BLOCK_LENGTH, 1474 : ARMHandler(start, DICE_NOTIFIER_BLOCK_LENGTH, 1472 1475 RAW1394_ARM_READ | RAW1394_ARM_WRITE | RAW1394_ARM_LOCK, 1473 1476 RAW1394_ARM_WRITE, 0) … … 1477 1480 } 1478 1481 1479 DiceAvDevice::DiceNotifier::~DiceNotifier() 1482 DiceAvDevice::DiceNotifier::~DiceNotifier() 1480 1483 { 1481 1484 trunk/libffado/src/dice/dice_avdevice.h
r436 r445 1 /* dice_avdevice.h2 * Copyright (C) 200 7 by Pieter Palmers1 /* 2 * Copyright (C) 2005-2007 by Pieter Palmers 3 3 * 4 * This file is part of FreeBob. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBob is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBob is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBob; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #ifndef DICEDEVICE_H 21 25 #define DICEDEVICE_H … … 69 73 70 74 bool prepare(); 71 75 72 76 bool lock(); 73 77 bool unlock(); 74 78 75 79 bool startStreamByIndex(int i); 76 80 bool stopStreamByIndex(int i); 77 81 78 82 bool enableStreaming(); 79 83 bool disableStreaming(); 80 84 81 85 protected: 82 86 struct VendorModelEntry *m_model; 83 87 84 88 // streaming stuff 85 89 typedef std::vector< Streaming::StreamProcessor * > StreamProcessorVector; 86 90 StreamProcessorVector m_receiveProcessors; 87 91 StreamProcessorVector m_transmitProcessors; 88 92 89 93 private: // streaming & port helpers 90 94 enum EPortTypes { … … 92 96 ePT_MIDI, 93 97 }; 94 98 95 99 typedef struct { 96 100 std::string name; … … 98 102 unsigned int streamPosition; 99 103 unsigned int streamLocation; 100 } diceChannelInfo; 101 102 bool addChannelToProcessor( diceChannelInfo *, 103 Streaming::StreamProcessor *, 104 } diceChannelInfo; 105 106 bool addChannelToProcessor( diceChannelInfo *, 107 Streaming::StreamProcessor *, 104 108 Streaming::Port::E_Direction direction); 105 109 106 110 int allocateIsoChannel(unsigned int packet_size); 107 111 bool deallocateIsoChannel(int channel); 108 112 109 113 private: // helper functions 110 114 bool enableIsoStreaming(); 111 115 bool disableIsoStreaming(); 112 116 bool isIsoStreamingEnabled(); 113 117 114 118 bool maskedCheckZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask); 115 119 bool maskedCheckNotZeroGlobalReg(fb_nodeaddr_t offset, fb_quadlet_t mask); 116 120 117 121 typedef std::vector< std::string > diceNameVector; 118 122 typedef std::vector< std::string >::iterator diceNameVectorIterator; … … 122 126 diceNameVector getClockSourceNameString(); 123 127 std::string getDeviceNickName(); 124 128 125 129 private: // register I/O routines 126 130 bool initIoFunctions(); … … 130 134 bool readRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 131 135 bool writeRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 132 136 133 137 bool readGlobalReg(fb_nodeaddr_t, fb_quadlet_t *); 134 138 bool writeGlobalReg(fb_nodeaddr_t, fb_quadlet_t); … … 136 140 bool writeGlobalRegBlock(fb_nodeaddr_t, fb_quadlet_t *, size_t); 137 141 fb_nodeaddr_t globalOffsetGen(fb_nodeaddr_t, size_t); 138 142 139 143 bool readTxReg(unsigned int i, fb_nodeaddr_t, fb_quadlet_t *); 140 144 bool writeTxReg(unsigned int i, fb_nodeaddr_t, fb_quadlet_t); … … 142 146 bool writeTxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length); 143 147 fb_nodeaddr_t txOffsetGen(unsigned int, fb_nodeaddr_t, size_t); 144 148 145 149 bool readRxReg(unsigned int i, fb_nodeaddr_t, fb_quadlet_t *); 146 150 bool writeRxReg(unsigned int i, fb_nodeaddr_t, fb_quadlet_t); … … 148 152 bool writeRxRegBlock(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *data, size_t length); 149 153 fb_nodeaddr_t rxOffsetGen(unsigned int, fb_nodeaddr_t, size_t); 150 154 151 155 fb_quadlet_t m_global_reg_offset; 152 156 fb_quadlet_t m_global_reg_size; … … 159 163 fb_quadlet_t m_unused2_reg_offset; 160 164 fb_quadlet_t m_unused2_reg_size; 161 165 162 166 fb_quadlet_t m_nb_tx; 163 167 fb_quadlet_t m_tx_size; 164 168 fb_quadlet_t m_nb_rx; 165 169 fb_quadlet_t m_rx_size; 166 170 167 171 private: 168 172 // notification 169 173 DiceNotifier *m_notifier; 170 174 171 175 /** 172 * this class reacts on the DICE device writing to the 176 * this class reacts on the DICE device writing to the 173 177 * hosts notify address 174 178 */ … … 180 184 DiceNotifier(DiceAvDevice *, nodeaddr_t start); 181 185 virtual ~DiceNotifier(); 182 186 183 187 private: 184 188 DiceAvDevice *m_dicedevice; trunk/libffado/src/dice/dice_defines.h
r436 r445 1 /* dice_defines.h 2 * Copyright (C) 2007 by Pieter Palmers 3 * 4 * This file is part of FreeBob. 5 * 6 * FreeBob is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBob is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Pieter Palmers 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBob; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 23 20 24 #ifndef DICEDEFINES_H 21 25 #define DICEDEFINES_H … … 23 27 #define DICE_VER_1_0_4_0 24 28 // #define DICE_VER_1_0_7_0 25 26 29 27 30 #define DICE_INVALID_OFFSET 0xFFFFF00000000000ULL … … 138 141 // the format of the user messages 139 142 // however diceDriverInterface.h indicates: 140 // "When DD_NOTIFY_MESSAGE is set DD_NOTIFY_USER4 through 141 // DD_NOTIFY_USER11 are defined as an 8 bit message so 142 // you can have 256 seperate messages (like gray encoder 143 // "When DD_NOTIFY_MESSAGE is set DD_NOTIFY_USER4 through 144 // DD_NOTIFY_USER11 are defined as an 8 bit message so 145 // you can have 256 seperate messages (like gray encoder 143 146 // movements)." 144 147 … … 161 164 #define DICE_NOTIFY_USER_GET_MESSAGE(x) \ 162 165 ( ((x) >> 24 ) & 0xFF ) 163 166 164 167 // NICK_NAME register 165 168 trunk/libffado/src/fbtypes.h
r336 r445 1 1 /* fbtypes.h 2 * Copyright (C) 2005 by Daniel Wagner2 * Copyright (C) 2005-2007 by by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB. 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 21 24 #ifndef FBTYPES_H 22 25 #define FBTYPES_H 23 26 24 27 #include <libraw1394/raw1394.h> 25 28 26 29 typedef quadlet_t fb_quadlet_t; 27 30 typedef byte_t fb_byte_t; … … 32 35 class DeviceManager; 33 36 34 struct f reebob_handle {37 struct ffado_handle { 35 38 DeviceManager* m_deviceManager; 36 39 }; trunk/libffado/src/ffado.cpp
r442 r445 1 /* freebob.cpp 2 * Copyright (C) 2005 Pieter Palmers, Daniel Wagner 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * Copyright (C) 2005-2007 by Pieter Palmers 3 4 * 4 * This file is part of FreeBoB 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 7 * 8 * FFADO is based upon FreeBoB 5 9 * 6 10 * This library is free software; you can redistribute it and/or 7 11 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 12 * License version 2.1, as published by the Free Software Foundation; 10 13 * 11 14 * This library is distributed in the hope that it will be useful, … … 22 25 #include "config.h" 23 26 24 #include "libf reebob/freebob.h"27 #include "libffado/ffado.h" 25 28 26 29 #include "debugmodule/debugmodule.h" … … 36 39 37 40 DECLARE_GLOBAL_DEBUG_MODULE; 38 IMPL_GLOBAL_DEBUG_MODULE( F reeBoB, DEBUG_LEVEL_VERBOSE );41 IMPL_GLOBAL_DEBUG_MODULE( FFADO, DEBUG_LEVEL_VERBOSE ); 39 42 40 43 #ifdef __cplusplus … … 42 45 #endif 43 46 44 // this is very much nescessary, as otherwise the 45 // message buffer thread doesn't get killed when the 46 // library is dlclose()'d 47 // this is very much nescessary, as otherwise the 48 // message buffer thread doesn't get killed when the 49 // library is dlclose()'d 47 50 48 51 static void exitfunc(void) __attribute__((destructor)); … … 58 61 59 62 const char* 60 f reebob_get_version() {63 ffado_get_version() { 61 64 return PACKAGE_STRING; 62 65 } … … 64 67 65 68 int 66 f reebob_get_api_version() {67 return F REEBOB_API_VERSION;69 ffado_get_api_version() { 70 return FFADO_API_VERSION; 68 71 } 69 72 70 f reebob_handle_t71 f reebob_new_handle( int port )73 ffado_handle_t 74 ffado_new_handle( int port ) 72 75 { 73 f reebob_handle_t handle = new struct freebob_handle;76 ffado_handle_t handle = new struct ffado_handle; 74 77 if (! handle ) { 75 78 debugFatal( "Could not allocate memory for new handle\n" ); … … 93 96 94 97 int 95 f reebob_destroy_handle( freebob_handle_t freebob_handle )98 ffado_destroy_handle( ffado_handle_t ffado_handle ) 96 99 { 97 delete f reebob_handle->m_deviceManager;98 delete f reebob_handle;100 delete ffado_handle->m_deviceManager; 101 delete ffado_handle; 99 102 return 0; 100 103 } 101 104 102 105 int 103 f reebob_discover_devices( freebob_handle_t freebob_handle, int verbose )106 ffado_discover_devices( ffado_handle_t ffado_handle, int verbose ) 104 107 { 105 108 if (verbose) { 106 f reebob_handle->m_deviceManager->setVerboseLevel(DEBUG_LEVEL_VERBOSE);109 ffado_handle->m_deviceManager->setVerboseLevel(DEBUG_LEVEL_VERBOSE); 107 110 } 108 return f reebob_handle->m_deviceManager->discover()? 0 : -1;111 return ffado_handle->m_deviceManager->discover()? 0 : -1; 109 112 } 110 113 111 114 int 112 f reebob_node_is_valid_freebob_device( freebob_handle_t freebob_handle, int node_id )115 ffado_node_is_valid_ffado_device( ffado_handle_t ffado_handle, int node_id ) 113 116 { 114 return f reebob_handle->m_deviceManager->isValidNode( node_id );117 return ffado_handle->m_deviceManager->isValidNode( node_id ); 115 118 } 116 119 117 120 int 118 f reebob_get_nb_devices_on_bus( freebob_handle_t freebob_handle )121 ffado_get_nb_devices_on_bus( ffado_handle_t ffado_handle ) 119 122 { 120 return f reebob_handle->m_deviceManager->getNbDevices();123 return ffado_handle->m_deviceManager->getNbDevices(); 121 124 } 122 125 123 126 int 124 f reebob_get_device_node_id( freebob_handle_t freebob_handle, int device_nr )127 ffado_get_device_node_id( ffado_handle_t ffado_handle, int device_nr ) 125 128 { 126 return f reebob_handle->m_deviceManager->getDeviceNodeId(device_nr);129 return ffado_handle->m_deviceManager->getDeviceNodeId(device_nr); 127 130 } 128 131 129 132 int 130 f reebob_set_samplerate( freebob_handle_t freebob_handle, int node_id, int samplerate )133 ffado_set_samplerate( ffado_handle_t ffado_handle, int node_id, int samplerate ) 131 134 { 132 IAvDevice* avDevice = f reebob_handle->m_deviceManager->getAvDevice( node_id );135 IAvDevice* avDevice = ffado_handle->m_deviceManager->getAvDevice( node_id ); 133 136 if ( avDevice ) { 134 137 if ( avDevice->setSamplingFrequency( parseSampleRate( samplerate ) ) ) { 135 return f reebob_handle->m_deviceManager->discover()? 0 : -1;138 return ffado_handle->m_deviceManager->discover()? 0 : -1; 136 139 } 137 140 } … … 139 142 } 140 143 141 void f reebob_sleep_after_avc_command( int time )144 void ffado_sleep_after_avc_command( int time ) 142 145 { 143 146 AVCCommand::setSleepAfterAVCCommand( time ); trunk/libffado/src/ffado_streaming.cpp
r442 r445 1 /* $Id$ */2 3 1 /* 4 * FreeBob Streaming API 5 * FreeBob = Firewire (pro-)audio for linux 6 * 7 * http://freebob.sf.net 8 * 9 * Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> 10 * 11 * This program is free software {} you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation {} either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY {} without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program {} if not, write to the Free Software 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * 25 * 26 * 27 */ 28 29 /* freebob_streaming.c 30 * 31 * Implementation of the FreeBob Streaming API 32 * 33 */ 34 35 #include "libfreebob/freebob.h" 36 #include "libfreebob/freebob_streaming.h" 2 * Copyright (C) 2005-2007 by Pieter Palmers 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 22 */ 23 24 /* 25 * Implementation of the FFADO Streaming API 26 */ 27 28 #include "libffado/ffado.h" 37 29 #include "devicemanager.h" 38 30 #include "iavdevice.h" … … 53 45 using namespace Streaming; 54 46 55 struct _f reebob_device47 struct _ffado_device 56 48 { 57 49 DeviceManager * m_deviceManager; 58 50 StreamProcessorManager *processorManager; 59 51 60 f reebob_options_t options;61 f reebob_device_info_t device_info;62 }; 63 64 f reebob_device_t *freebob_streaming_init (freebob_device_info_t *device_info, freebob_options_t options) {52 ffado_options_t options; 53 ffado_device_info_t device_info; 54 }; 55 56 ffado_device_t *ffado_streaming_init (ffado_device_info_t *device_info, ffado_options_t options) { 65 57 unsigned int i=0; 66 58 67 struct _f reebob_device *dev = new struct _freebob_device;68 69 debugFatal("%s built %s %s\n", f reebob_get_version(), __DATE__, __TIME__);59 struct _ffado_device *dev = new struct _ffado_device; 60 61 debugFatal("%s built %s %s\n", ffado_get_version(), __DATE__, __TIME__); 70 62 71 63 if(!dev) { … … 83 75 return 0; 84 76 } 85 77 86 78 dev->m_deviceManager->setVerboseLevel(DEBUG_LEVEL_VERBOSE); 87 79 if ( !dev->m_deviceManager->initialize( dev->options.port ) ) { … … 93 85 94 86 // create a processor manager to manage the actual stream 95 // processors 87 // processors 96 88 dev->processorManager = new StreamProcessorManager(dev->options.period_size,dev->options.nb_buffers); 97 89 if(!dev->processorManager) { … … 101 93 return 0; 102 94 } 103 95 104 96 dev->processorManager->setThreadParameters(dev->options.realtime, dev->options.packetizer_priority); 105 97 106 98 dev->processorManager->setVerboseLevel(DEBUG_LEVEL_VERBOSE); 107 99 if(!dev->processorManager->init()) { … … 112 104 return 0; 113 105 } 114 106 115 107 // set slave mode option 116 108 bool slaveMode=(dev->options.slave_mode != 0); … … 125 117 debugWarning("Failed to set snoop mode option\n"); 126 118 } 127 119 128 120 // discover the devices on the bus 129 121 if(!dev->m_deviceManager->discover()) { … … 134 126 return 0; 135 127 } 136 128 137 129 // are there devices on the bus? 138 130 if(dev->m_deviceManager->getAvDeviceCount()==0) { … … 143 135 return 0; 144 136 } 145 137 146 138 // iterate over the found devices 147 139 // add the stream processors of the devices to the managers … … 151 143 152 144 debugOutput(DEBUG_LEVEL_VERBOSE, "Locking device (%p)\n", device); 153 145 154 146 if (!device->lock()) { 155 147 debugWarning("Could not lock device, skipping device (%p)!\n", device); 156 148 continue; 157 149 } 158 159 debugOutput(DEBUG_LEVEL_VERBOSE, "Setting samplerate to %d for (%p)\n", 150 151 debugOutput(DEBUG_LEVEL_VERBOSE, "Setting samplerate to %d for (%p)\n", 160 152 dev->options.sample_rate, device); 161 153 162 154 // Set the device's sampling rate to that requested 163 155 // FIXME: does this really belong here? If so we need to handle errors. 164 156 if (!device->setSamplingFrequency(parseSampleRate(dev->options.sample_rate))) { 165 debugOutput(DEBUG_LEVEL_VERBOSE, " => Retry setting samplerate to %d for (%p)\n", 157 debugOutput(DEBUG_LEVEL_VERBOSE, " => Retry setting samplerate to %d for (%p)\n", 166 158 dev->options.sample_rate, device); 167 159 168 160 // try again: 169 161 if (!device->setSamplingFrequency(parseSampleRate(dev->options.sample_rate))) { … … 188 180 } 189 181 } 190 182 191 183 // set the sync source 192 184 if (!dev->processorManager->setSyncSource(dev->m_deviceManager->getSyncSource())) { … … 201 193 } 202 194 203 int f reebob_streaming_prepare(freebob_device_t *dev) {195 int ffado_streaming_prepare(ffado_device_t *dev) { 204 196 debugOutput(DEBUG_LEVEL_VERBOSE, "Preparing...\n"); 205 197 206 198 if (!dev->processorManager->prepare()) { 207 199 debugFatal("Could not prepare streaming...\n"); … … 212 204 } 213 205 214 void f reebob_streaming_finish(freebob_device_t *dev) {206 void ffado_streaming_finish(ffado_device_t *dev) { 215 207 unsigned int i=0; 216 208 217 209 assert(dev); 218 210 219 211 // iterate over the found devices 220 212 for(i=0;i<dev->m_deviceManager->getAvDeviceCount();i++) { … … 228 220 } 229 221 } 230 222 231 223 delete dev->processorManager; 232 224 delete dev->m_deviceManager; … … 236 228 } 237 229 238 int f reebob_streaming_start(freebob_device_t *dev) {230 int ffado_streaming_start(ffado_device_t *dev) { 239 231 unsigned int i=0; 240 232 debugOutput(DEBUG_LEVEL_VERBOSE,"------------- Start -------------\n"); 241 233 242 234 // create the connections for all devices 243 235 // iterate over the found devices … … 246 238 IAvDevice *device=dev->m_deviceManager->getAvDeviceByIndex(i); 247 239 assert(device); 248 240 249 241 int j=0; 250 242 for(j=0; j<device->getStreamCount();j++) { … … 265 257 return 0; 266 258 } else { 267 f reebob_streaming_stop(dev);268 return -1; 269 } 270 } 271 272 int f reebob_streaming_stop(freebob_device_t *dev) {259 ffado_streaming_stop(dev); 260 return -1; 261 } 262 } 263 264 int ffado_streaming_stop(ffado_device_t *dev) { 273 265 unsigned int i; 274 266 debugOutput(DEBUG_LEVEL_VERBOSE,"------------- Stop -------------\n"); … … 286 278 debugWarning("Could not disable streaming on device %d!\n",i); 287 279 } 288 280 289 281 int j=0; 290 282 for(j=0; j<device->getStreamCount();j++) { … … 302 294 } 303 295 304 int f reebob_streaming_reset(freebob_device_t *dev) {296 int ffado_streaming_reset(ffado_device_t *dev) { 305 297 debugOutput(DEBUG_LEVEL_VERBOSE,"------------- Reset -------------\n"); 306 298 … … 310 302 } 311 303 312 int f reebob_streaming_wait(freebob_device_t *dev) {304 int ffado_streaming_wait(ffado_device_t *dev) { 313 305 static int periods=0; 314 306 static int periods_print=0; 315 307 static int xruns=0; 316 308 317 309 periods++; 318 310 if(periods>periods_print) { 319 debugOutputShort(DEBUG_LEVEL_VERBOSE, "\nf reebob_streaming_wait\n");311 debugOutputShort(DEBUG_LEVEL_VERBOSE, "\nffado_streaming_wait\n"); 320 312 debugOutputShort(DEBUG_LEVEL_VERBOSE, "============================================\n"); 321 313 debugOutputShort(DEBUG_LEVEL_VERBOSE, "Xruns: %d\n",xruns); … … 325 317 periods_print+=100; 326 318 } 327 319 328 320 if(dev->processorManager->waitForPeriod()) { 329 321 return dev->options.period_size; 330 322 } else { 331 323 debugWarning("XRUN detected\n"); 332 324 333 325 // do xrun recovery 334 326 dev->processorManager->handleXrun(); … … 338 330 } 339 331 340 int f reebob_streaming_transfer_capture_buffers(freebob_device_t *dev) {332 int ffado_streaming_transfer_capture_buffers(ffado_device_t *dev) { 341 333 return dev->processorManager->transfer(StreamProcessor::E_Receive); 342 334 } 343 335 344 int f reebob_streaming_transfer_playback_buffers(freebob_device_t *dev) {336 int ffado_streaming_transfer_playback_buffers(ffado_device_t *dev) { 345 337 return dev->processorManager->transfer(StreamProcessor::E_Transmit); 346 338 } 347 339 348 int f reebob_streaming_transfer_buffers(freebob_device_t *dev) {340 int ffado_streaming_transfer_buffers(ffado_device_t *dev) { 349 341 return dev->processorManager->transfer(); 350 342 } 351 343 352 344 353 int f reebob_streaming_write(freebob_device_t *dev, int i, freebob_sample_t *buffer, int nsamples) {345 int ffado_streaming_write(ffado_device_t *dev, int i, ffado_sample_t *buffer, int nsamples) { 354 346 Port *p=dev->processorManager->getPortByIndex(i, Port::E_Playback); 355 // use an assert here performancewise, 347 // use an assert here performancewise, 356 348 // it should already have failed before, if not correct 357 assert(p); 358 349 assert(p); 350 359 351 return p->writeEvents((void *)buffer, nsamples); 360 352 } 361 353 362 int f reebob_streaming_read(freebob_device_t *dev, int i, freebob_sample_t *buffer, int nsamples) {354 int ffado_streaming_read(ffado_device_t *dev, int i, ffado_sample_t *buffer, int nsamples) { 363 355 Port *p=dev->processorManager->getPortByIndex(i, Port::E_Capture); 364 // use an assert here performancewise, 356 // use an assert here performancewise, 365 357 // it should already have failed before, if not correct 366 assert(p); 367 358 assert(p); 359 368 360 return p->readEvents((void *)buffer, nsamples); 369 361 } 370 362 371 int f reebob_streaming_get_nb_capture_streams(freebob_device_t *dev) {363 int ffado_streaming_get_nb_capture_streams(ffado_device_t *dev) { 372 364 return dev->processorManager->getPortCount(Port::E_Capture); 373 365 } 374 366 375 int f reebob_streaming_get_nb_playback_streams(freebob_device_t *dev) {367 int ffado_streaming_get_nb_playback_streams(ffado_device_t *dev) { 376 368 return dev->processorManager->getPortCount(Port::E_Playback); 377 369 } 378 370 379 int f reebob_streaming_get_capture_stream_name(freebob_device_t *dev, int i, char* buffer, size_t buffersize) {371 int ffado_streaming_get_capture_stream_name(ffado_device_t *dev, int i, char* buffer, size_t buffersize) { 380 372 Port *p=dev->processorManager->getPortByIndex(i, Port::E_Capture); 381 373 if(!p) { … … 391 383 } 392 384 393 int f reebob_streaming_get_playback_stream_name(freebob_device_t *dev, int i, char* buffer, size_t buffersize) {385 int ffado_streaming_get_playback_stream_name(ffado_device_t *dev, int i, char* buffer, size_t buffersize) { 394 386 Port *p=dev->processorManager->getPortByIndex(i, Port::E_Playback); 395 387 if(!p) { … … 405 397 } 406 398 407 f reebob_streaming_stream_type freebob_streaming_get_capture_stream_type(freebob_device_t *dev, int i) {399 ffado_streaming_stream_type ffado_streaming_get_capture_stream_type(ffado_device_t *dev, int i) { 408 400 Port *p=dev->processorManager->getPortByIndex(i, Port::E_Capture); 409 401 if(!p) { 410 402 debugWarning("Could not get capture port at index %d\n",i); 411 return f reebob_stream_type_invalid;403 return ffado_stream_type_invalid; 412 404 } 413 405 switch(p->getPortType()) { 414 406 case Port::E_Audio: 415 return f reebob_stream_type_audio;407 return ffado_stream_type_audio; 416 408 case Port::E_Midi: 417 return f reebob_stream_type_midi;409 return ffado_stream_type_midi; 418 410 case Port::E_Control: 419 return f reebob_stream_type_control;411 return ffado_stream_type_control; 420 412 default: 421 return f reebob_stream_type_unknown;422 } 423 } 424 425 f reebob_streaming_stream_type freebob_streaming_get_playback_stream_type(freebob_device_t *dev, int i) {413 return ffado_stream_type_unknown; 414 } 415 } 416 417 ffado_streaming_stream_type ffado_streaming_get_playback_stream_type(ffado_device_t *dev, int i) { 426 418 Port *p=dev->processorManager->getPortByIndex(i, Port::E_Playback); 427 419 if(!p) { 428 420 debugWarning("Could not get playback port at index %d\n",i); 429 return f reebob_stream_type_invalid;421 return ffado_stream_type_invalid; 430 422 } 431 423 switch(p->getPortType()) { 432 424 case Port::E_Audio: 433 return f reebob_stream_type_audio;425 return ffado_stream_type_audio; 434 426 case Port::E_Midi: 435 return f reebob_stream_type_midi;427 return ffado_stream_type_midi; 436 428 case Port::E_Control: 437 return f reebob_stream_type_control;429 return ffado_stream_type_control; 438 430 default: 439 return f reebob_stream_type_unknown;440 } 441 } 442 443 int f reebob_streaming_set_stream_buffer_type(freebob_device_t *dev, int i,444 f reebob_streaming_buffer_type t, enum Port::E_Direction direction) {431 return ffado_stream_type_unknown; 432 } 433 } 434 435 int ffado_streaming_set_stream_buffer_type(ffado_device_t *dev, int i, 436 ffado_streaming_buffer_type t, enum Port::E_Direction direction) { 445 437 446 438 Port *p=dev->processorManager->getPortByIndex(i, direction); … … 450 442 return -1; 451 443 } 452 444 453 445 switch(t) { 454 case f reebob_buffer_type_int24:446 case ffado_buffer_type_int24: 455 447 if (!p->setDataType(Port::E_Int24)) { 456 448 debugWarning("%s: Could not set data type to Int24\n",p->getName().c_str()); … … 462 454 } 463 455 break; 464 case f reebob_buffer_type_float:456 case ffado_buffer_type_float: 465 457 if (!p->setDataType(Port::E_Float)) { 466 458 debugWarning("%s: Could not set data type to Float\n",p->getName().c_str()); … … 472 464 } 473 465 break; 474 case f reebob_buffer_type_midi:466 case ffado_buffer_type_midi: 475 467 if (!p->setDataType(Port::E_MidiEvent)) { 476 468 debugWarning("%s: Could not set data type to MidiEvent\n",p->getName().c_str()); … … 490 482 } 491 483 492 int f reebob_streaming_set_playback_buffer_type(freebob_device_t *dev, int i, freebob_streaming_buffer_type t) {493 return f reebob_streaming_set_stream_buffer_type(dev, i, t, Port::E_Playback);494 } 495 496 int f reebob_streaming_set_capture_buffer_type(freebob_device_t *dev, int i, freebob_streaming_buffer_type t) {497 return f reebob_streaming_set_stream_buffer_type(dev, i, t, Port::E_Capture);498 } 499 500 int f reebob_streaming_stream_onoff(freebob_device_t *dev, int i,484 int ffado_streaming_set_playback_buffer_type(ffado_device_t *dev, int i, ffado_streaming_buffer_type t) { 485 return ffado_streaming_set_stream_buffer_type(dev, i, t, Port::E_Playback); 486 } 487 488 int ffado_streaming_set_capture_buffer_type(ffado_device_t *dev, int i, ffado_streaming_buffer_type t) { 489 return ffado_streaming_set_stream_buffer_type(dev, i, t, Port::E_Capture); 490 } 491 492 int ffado_streaming_stream_onoff(ffado_device_t *dev, int i, 501 493 int on, enum Port::E_Direction direction) { 502 494 Port *p=dev->processorManager->getPortByIndex(i, direction); … … 514 506 } 515 507 516 int f reebob_streaming_playback_stream_onoff(freebob_device_t *dev, int number, int on) {517 return f reebob_streaming_stream_onoff(dev, number, on, Port::E_Playback);518 } 519 520 int f reebob_streaming_capture_stream_onoff(freebob_device_t *dev, int number, int on) {521 return f reebob_streaming_stream_onoff(dev, number, on, Port::E_Capture);508 int ffado_streaming_playback_stream_onoff(ffado_device_t *dev, int number, int on) { 509 return ffado_streaming_stream_onoff(dev, number, on, Port::E_Playback); 510 } 511 512 int ffado_streaming_capture_stream_onoff(ffado_device_t *dev, int number, int on) { 513 return ffado_streaming_stream_onoff(dev, number, on, Port::E_Capture); 522 514 } 523 515 524 516 // TODO: the way port buffers are set in the C api doesn't satisfy me 525 int f reebob_streaming_set_capture_stream_buffer(freebob_device_t *dev, int i, char *buff) {517 int ffado_streaming_set_capture_stream_buffer(ffado_device_t *dev, int i, char *buff) { 526 518 Port *p=dev->processorManager->getPortByIndex(i, Port::E_Capture); 527 528 // use an assert here performancewise, 519 520 // use an assert here performancewise, 529 521 // it should already have failed before, if not correct 530 assert(p); 531 522 assert(p); 523 532 524 p->useExternalBuffer(true); 533 525 p->setExternalBufferAddress((void *)buff); … … 537 529 } 538 530 539 int f reebob_streaming_set_playback_stream_buffer(freebob_device_t *dev, int i, char *buff) {531 int ffado_streaming_set_playback_stream_buffer(ffado_device_t *dev, int i, char *buff) { 540 532 Port *p=dev->processorManager->getPortByIndex(i, Port::E_Playback); 541 // use an assert here performancewise, 533 // use an assert here performancewise, 542 534 // it should already have failed before, if not correct 543 assert(p); 544 535 assert(p); 536 545 537 p->useExternalBuffer(true); 546 538 p->setExternalBufferAddress((void *)buff); trunk/libffado/src/iavdevice.cpp
r436 r445 1 /* iavdevice.h2 * Copyright (C) 200 6by Daniel Wagner3 * Copyright (C) 200 7 by Pieter Palmers1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * Copyright (C) 2005-2007 by Pieter Palmers 4 4 * 5 * This file is part of FreeBoB. 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 6 7 * 7 * FreeBoB is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * FreeBoB is distributed in the hope that it will be useful, 8 * FFADO is based upon FreeBoB 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 12 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNUGeneral Public License for more details.16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 15 18 * 16 * You should have received a copy of the GNU General Public License17 * along with FreeBoB; if not, write to the Free Software18 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,19 * MA 0211 1-1307 USA.19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 20 23 */ 21 24 … … 40 43 { 41 44 addOption(Util::OptionContainer::Option("id",std::string("dev?"))); 42 45 43 46 std::ostringstream nodestr; 44 47 nodestr << "node" << nodeId; 45 48 setOscBase(nodestr.str()); 46 49 ConfigRom& c = getConfigRom(); 47 50 48 51 addChildOscNode(&c); 49 52 } … … 68 71 69 72 void 70 IAvDevice::setVerboseLevel(int l) 73 IAvDevice::setVerboseLevel(int l) 71 74 { 72 75 m_verboseLevel=l; trunk/libffado/src/iavdevice.h
r436 r445 1 /* iavdevice.h 2 * Copyright (C) 2006 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * Copyright (C) 2005-2007 by Pieter Palmers 4 * 5 * This file is part of FFADO 6 * FFADO = Free Firewire (pro-)audio drivers for linux 7 * 8 * FFADO is based upon FreeBoB 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License version 2.1, as published by the Free Software Foundation; 13 * 14 * This library is distributed in the hope that it will be useful, 11 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 * MA 02110-1301 USA 19 23 */ 20 24 … … 35 39 @brief Base class for device support 36 40 37 This class should be subclassed to implement f reebob support41 This class should be subclassed to implement ffado support 38 42 for a specific device. 39 43 40 44 */ 41 class IAvDevice 45 class IAvDevice 42 46 : public Util::OptionContainer, 43 47 public OSC::OscNode 44 48 { 45 49 public: 46 50 IAvDevice( std::auto_ptr< ConfigRom >( configRom ), 47 51 Ieee1394Service& ieee1394service, 48 52 int nodeId ); 49 50 51 52 53 54 55 56 57 * 58 59 60 61 62 63 64 * @param samplingFrequency 65 66 67 68 69 70 71 72 73 53 54 virtual ~IAvDevice() {}; 55 56 /// Returns the ConfigRom object of the device node. 57 ConfigRom& getConfigRom() const; 58 59 /** 60 * @brief This is called by the DeviceManager to discover & configure the device 61 * 62 * @return true if the device was discovered successfuly 63 */ 64 virtual bool discover() = 0; 65 66 /** 67 * @brief Set the samping frequency 68 * @param samplingFrequency 69 * @return true if successful 70 */ 71 virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency ) = 0; 72 /** 73 * @brief get the samplingfrequency as an integer 74 * @return the sampling frequency as integer 75 */ 76 virtual int getSamplingFrequency( ) = 0; 77 74 78 /** 75 79 * @brief This is called by the device manager to give the device a unique ID. … … 87 91 * 88 92 * @note Currently this is a simple integer that is equal to 89 * the position of the device in the devicemanager's 93 * the position of the device in the devicemanager's 90 94 * device list. Therefore it is dependant on the order 91 95 * in which the devices are detected. The side-effect … … 93 97 * and history (e.g. busresets etc). This makes that 94 98 * these ID's are not fixed to a specific physical device. 95 * At some point, we will replaced this with a GUID based 99 * At some point, we will replaced this with a GUID based 96 100 * approach, which is tied to a physiscal device and is 97 * bus & time independant. 98 * 99 * @param id 101 * bus & time independant. 102 * 103 * @param id 100 104 * @return true if successful 101 105 */ 102 106 bool setId(unsigned int id); 103 104 105 106 107 * This function prints out a (detailed) description of the 108 109 110 111 112 /** 113 114 115 116 117 118 * It should implement the mechanisms provided by the device to 119 120 121 122 123 124 125 /** 126 127 128 129 130 131 * It should implement the mechanisms provided by the device to 132 133 134 135 136 137 138 /** 107 108 /** 109 * @brief Outputs the device configuration to stderr/stdout [debug helper] 110 * 111 * This function prints out a (detailed) description of the 112 * device detected, and its configuration. 113 */ 114 virtual void showDevice() = 0; 115 116 /** 117 * @brief Lock the device 118 * 119 * This is called by the streaming layer before we start manipulating 120 * and/or using the device. 121 * 122 * It should implement the mechanisms provided by the device to 123 * make sure that no other controller claims control of the device. 124 * 125 * @return true if successful, false if not 126 */ 127 virtual bool lock() = 0; 128 129 /** 130 * @brief Unlock the device 131 * 132 * This is called by the streaming layer after we finish manipulating 133 * and/or using the device. 134 * 135 * It should implement the mechanisms provided by the device to 136 * give up exclusive control of the device. 137 * 138 * @return true if successful, false if not 139 */ 140 virtual bool unlock() = 0; 141 142 /** 139 143 * @brief Enable streaming on all 'started' streams 140 144 * … … 146 150 */ 147 151 virtual bool enableStreaming(); 148 149 /** 152 153 /** 150 154 * @brief Disable streaming on all streams 151 155 * … … 158 162 virtual bool disableStreaming(); 159 163 160 /** 161 162 163 * This is called by the streaming layer after the configuration 164 * parameters (e.g. sample rate) are set, and before 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 * receive stream. However there are devices that implement more, for 181 * example BeBoB's implement 4 streams: 182 183 184 185 186 187 188 189 190 191 192 193 194 /** 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 /** 210 211 212 213 * be started, i.e. the device should start sending data or should be prepared to 214 215 216 217 218 219 220 221 222 223 224 225 226 /** 227 228 229 230 231 232 233 164 /** 165 * @brief Prepare the device 166 * 167 * This is called by the streaming layer after the configuration 168 * parameters (e.g. sample rate) are set, and before 169 * getStreamProcessor[*] functions are called. 170 * 171 * It should be used to prepare the device's streamprocessors 172 * based upon the device's current configuration. Normally 173 * the streaming layer will not change the device's configuration 174 * after calling this function. 175 * 176 * @return true if successful, false if not 177 */ 178 virtual bool prepare() = 0; 179 180 /** 181 * @brief Returns the number of ISO streams implemented/used by this device 182 * 183 * Most likely this is 2 streams, i.e. one transmit stream and one 184 * receive stream. However there are devices that implement more, for 185 * example BeBoB's implement 4 streams: 186 * - 2 audio streams (1 xmit/1 recv) 187 * - 2 sync streams (1 xmit/1 recv), which are an optional sync source 188 * for the device. 189 * 190 * @note you have to have a StreamProcessor for every stream. I.e. 191 * getStreamProcessorByIndex(i) should return a valid StreamProcessor 192 * for i=0 to i=getStreamCount()-1 193 * 194 * @return number of streams available (both transmit and receive) 195 */ 196 virtual int getStreamCount() = 0; 197 198 /** 199 * @brief Returns the StreamProcessor object for the stream with index i 200 * 201 * @note a streamprocessor returned by getStreamProcessorByIndex(i) 202 * cannot be the same object as one returned by 203 * getStreamProcessorByIndex(j) if i isn't equal to j 204 * @note you cannot have two streamprocessors handling the same ISO 205 * channel (on the same port) 206 * 207 * @param i : Stream index 208 * @pre @ref i smaller than getStreamCount() 209 * @return a StreamProcessor object if successful, NULL otherwise 210 */ 211 virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i) = 0; 212 213 /** 214 * @brief starts the stream with index i 215 * 216 * This function is called by the streaming layer when this stream should 217 * be started, i.e. the device should start sending data or should be prepared to 218 * be ready to receive data. 219 * 220 * It returns the channel number that was assigned for this stream. 221 * Channel allocation should be done using the allocation functions provided by the 222 * Ieee1394Service object that is passed in the constructor. 223 * 224 * @param i : Stream index 225 * @pre @ref i smaller than getStreamCount() 226 * @return true if successful, false if not 227 */ 228 virtual bool startStreamByIndex(int i) = 0; 229 230 /** 231 * @brief stops the stream with index @ref i 232 * 233 * @param i : Stream index 234 * @pre @ref i smaller than getStreamCount() 235 * @return true if successful, false if not 236 */ 237 virtual bool stopStreamByIndex(int i) = 0; 234 238 235 239 /** trunk/libffado/src/libavc/avc_connect.cpp
r413 r445 1 /* avc_connect.cpp2 * Copyright (C) 2005 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 trunk/libffado/src/libavc/avc_connect.h
r375 r445 1 /* avc_connect.h2 * Copyright (C) 2005 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 21 #ifndef AVCC onnect_h22 #define AVCC onnect_h24 #ifndef AVCCONNECT_H 25 #define AVCCONNECT_H 23 26 24 27 #include "avc_generic.h" … … 36 39 37 40 virtual const char* getCmdName() const 38 41 { return "ConnectCmd"; } 39 42 }; 40 43 41 44 42 #endif // AVCC onnect_h45 #endif // AVCCONNECT_H trunk/libffado/src/libavc/avc_definitions.cpp
r415 r445 1 /* avc_defintions.cpp2 * Copyright (C) 2005 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 trunk/libffado/src/libavc/avc_definitions.h
r415 r445 1 /* avc_definitions.h2 * Copyright (C) 2005 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 21 #ifndef AV CDefinitions_h22 #define AV CDefinitions_h24 #ifndef AVDDEFINITIONS_H 25 #define AVDDEFINITIONS_H 23 26 24 27 #include <libavc1394/avc1394.h> … … 70 73 typedef byte_t control_selector_t; 71 74 typedef byte_t control_data_length_t; 75 typedef uint16_t control_data_ext_length_t; 76 typedef uint16_t mixer_level_t; 77 typedef byte_t mixer_programmable_state_t; 72 78 typedef byte_t input_fb_plug_number_t; 73 79 typedef byte_t input_audio_channel_number_t; … … 99 105 /** 100 106 * \brief Convert from ESamplingFrequency to an integer 101 * @param freq 102 * @return 107 * @param freq 108 * @return 103 109 */ 104 110 int convertESamplingFrequency(ESamplingFrequency freq); 105 111 /** 106 112 * \brief Convert from integer to ESamplingFrequency 107 * @param sampleRate 108 * @return 113 * @param sampleRate 114 * @return 109 115 */ 110 116 ESamplingFrequency parseSampleRate( int sampleRate ); … … 123 129 #define AVC1394_SUBUNIT_ID_RESERVED 0x06 124 130 125 #endif // AV CDefinitions_h131 #endif // AVDDEFINITIONS_H trunk/libffado/src/libavc/avc_extended_cmd_generic.cpp
r413 r445 1 /* avc_extended_cmd_generic.cpp2 * Copyright (C) 2005 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 … … 461 464 462 465 PlugAddressSpecificData::PlugAddressSpecificData( EPlugDirection plugDirection, 463 464 466 EPlugAddressMode plugAddressMode, 467 UnitPlugSpecificDataPlugAddress& unitPlugAddress ) 465 468 : m_plugDirection( plugDirection ) 466 469 , m_addressMode( plugAddressMode ) … … 470 473 471 474 PlugAddressSpecificData::PlugAddressSpecificData( EPlugDirection plugDirection, 472 473 475 EPlugAddressMode plugAddressMode, 476 SubunitPlugSpecificDataPlugAddress& subUnitPlugAddress ) 474 477 : m_plugDirection( plugDirection ) 475 478 , m_addressMode( plugAddressMode ) … … 479 482 480 483 PlugAddressSpecificData::PlugAddressSpecificData( EPlugDirection plugDirection, 481 482 484 EPlugAddressMode plugAddressMode, 485 FunctionBlockPlugSpecificDataPlugAddress& functionBlockPlugAddress ) 483 486 : m_plugDirection( plugDirection ) 484 487 , m_addressMode( plugAddressMode ) trunk/libffado/src/libavc/avc_extended_cmd_generic.h
r336 r445 1 /* avc_extended_cmd_generic.h 2 * Copyright (C) 2005 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 … … 38 41 ePT_ExternalPlug = 0x01, 39 42 ePT_AsynchronousPlug = 0x02, 40 43 ePT_Unknown = 0xff, 41 44 }; 42 45 … … 205 208 ePD_Input = 0x00, 206 209 ePD_Output = 0x01, 207 210 ePD_Undefined = 0xff, 208 211 }; 209 212 … … 212 215 ePAM_Subunit = 0x01, 213 216 ePAM_FunctionBlock = 0x02, 214 217 ePAM_Undefined = 0xff, 215 218 }; 216 219 … … 259 262 260 263 PlugAddressSpecificData( EPlugDirection plugDirection, 261 262 263 PlugAddressSpecificData( EPlugDirection plugDirection, 264 265 266 PlugAddressSpecificData( EPlugDirection plugDirection, 267 268 269 PlugAddressSpecificData( EPlugDirection plugDirection, 270 264 EPlugAddressMode plugAddressMode, 265 UnitPlugSpecificDataPlugAddress& unitPlugAddress ); 266 PlugAddressSpecificData( EPlugDirection plugDirection, 267 EPlugAddressMode plugAddressMode, 268 SubunitPlugSpecificDataPlugAddress& subUnitPlugAddress ); 269 PlugAddressSpecificData( EPlugDirection plugDirection, 270 EPlugAddressMode plugAddressMode, 271 FunctionBlockPlugSpecificDataPlugAddress& functionBlockPlugAddress ); 272 PlugAddressSpecificData( EPlugDirection plugDirection, 273 EPlugAddressMode plugAddressMode ); 271 274 PlugAddressSpecificData( const PlugAddressSpecificData& pa ); 272 275 trunk/libffado/src/libavc/avc_extended_plug_info.cpp
r413 r445 1 /* avc_extended_plug_info.cpp2 * Copyright (C) 2005 by Daniel Wagner1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 3 * 4 * This file is part of FreeBoB. 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 5 6 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 14 17 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 trunk/libffado/src/libavc/avc_extended_plug_info.h
r375 r445 1 /* avc_extended_plug_info.h 2 * Copyright (C) 2005 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 … … 285 288 public: 286 289 enum ESubFunction { 287 290 eSF_ExtendedPlugInfoCmd = AVC1394_PLUG_INFO_SUBFUNCTION_EXTENDED_PLUG_INFO_CMD, 288 291 eSF_NotUsed = AVC1394_PLUG_INFO_SUBFUNCTION_SERIAL_BUS_NOT_USED, 289 292 }; … … 301 304 bool setInfoType( const ExtendedPlugInfoInfoType& infoType ); 302 305 ExtendedPlugInfoInfoType* getInfoType() 303 306 { return m_infoType; } 304 307 305 308 virtual const char* getCmdName() const 306 309 { return "ExtendedPlugInfoCmd"; } 307 310 308 311 protected: trunk/libffado/src/libavc/avc_extended_stream_format.cpp
r413 r445 1 /* avc_extended_stream_format.cpp 2 * Copyright (C) 2005 by Daniel Wagner 3 * 4 * This file is part of FreeBoB. 5 * 6 * FreeBoB is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * FreeBoB is distributed in the hope that it will be useful, 1 /* 2 * Copyright (C) 2005-2007 by Daniel Wagner 3 * 4 * This file is part of FFADO 5 * FFADO = Free Firewire (pro-)audio drivers for linux 6 * 7 * FFADO is based upon FreeBoB 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License version 2.1, as published by the Free Software Foundation; 12 * 13 * This library is distributed in the hope that it will be useful, 11 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNUGeneral Public License for more details.14 * 15 * You should have received a copy of the GNU General Public License16 * along with FreeBoB; if not, write to the Free Software17 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston,18 * MA 0211 1-1307 USA.15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 * MA 02110-1301 USA 19 22 */ 20 23 … … 38 41 << ", midi channels: " << info.m_midiChannels << ")"; 39 42 */ 40 43 stream << " NbChannels " << (int)info.m_numberOfChannels << ", Format " << (int)info.m_streamFormat; 41 44 return stream; 42 45 } … … 120 123 { 121 124 stream << (int)info.m_samplingFrequency << " Hz (rate control: "; 122 123 124 125 126 127 128 129 130 125 stream << (int)info.m_rateControl << ")" << std::endl; 126 127 for ( FormatInformationStreamsCompound::StreamF