root/trunk/libffado/src/libstreaming/IsoHandler.cpp

Revision 445, 20.4 kB (checked in by pieterpalmers, 15 years ago)

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

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

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

Line 
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,
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 #include "IsoHandler.h"
25 #include "IsoStream.h"
26 #include "cycletimer.h"
27
28 #include "libutil/TimeSource.h"
29 #include "libutil/SystemTimeSource.h"
30
31 #include <errno.h>
32 #include <netinet/in.h>
33 #include <assert.h>
34 #include <unistd.h>
35 #include <string.h>
36
37 #include <iostream>
38 using namespace std;
39
40 #define CC_SLEEP_TIME_AFTER_UPDATE    1000
41 #define CC_SLEEP_TIME_AFTER_FAILURE     10
42 #define CC_DLL_COEFF     ((0.001)*((float)(CC_SLEEP_TIME_AFTER_UPDATE/1000.0)))
43
44 #define CC_MAX_RATE_ERROR           (2.0/100.0)
45 #define CC_INIT_MAX_TRIES 10
46
47
48 namespace Streaming
49 {
50
51 IMPL_DEBUG_MODULE( IsoHandler, IsoHandler, DEBUG_LEVEL_NORMAL );
52
53 /* the C callbacks */
54 enum raw1394_iso_disposition
55 IsoXmitHandler::iso_transmit_handler(raw1394handle_t handle,
56         unsigned char *data, unsigned int *length,
57         unsigned char *tag, unsigned char *sy,
58         int cycle, unsigned int dropped) {
59
60     IsoXmitHandler *xmitHandler=static_cast<IsoXmitHandler *>(raw1394_get_userdata(handle));
61     assert(xmitHandler);
62
63     return xmitHandler->getPacket(data, length, tag, sy, cycle, dropped);
64 }
65
66 enum raw1394_iso_disposition
67 IsoRecvHandler::iso_receive_handler(raw1394handle_t handle, unsigned char *data,
68                         unsigned int length, unsigned char channel,
69                         unsigned char tag, unsigned char sy, unsigned int cycle,
70                         unsigned int dropped) {
71
72     IsoRecvHandler *recvHandler=static_cast<IsoRecvHandler *>(raw1394_get_userdata(handle));
73     assert(recvHandler);
74
75     return recvHandler->putPacket(data, length, channel, tag, sy, cycle, dropped);
76 }
77
78 int IsoHandler::busreset_handler(raw1394handle_t handle, unsigned int generation)
79 {
80     debugOutput( DEBUG_LEVEL_VERBOSE, "Busreset happened, generation %d...\n", generation);
81
82     IsoHandler *handler=static_cast<IsoHandler *>(raw1394_get_userdata(handle));
83     assert(handler);
84     return handler->handleBusReset(generation);
85 }
86
87
88 /* Base class implementation */
89 IsoHandler::IsoHandler(int port)
90    :  m_handle(0), m_handle_util(0), m_port(port),
91    m_buf_packets(400), m_max_packet_size(1024), m_irq_interval(-1),
92    m_packetcount(0), m_dropped(0), m_Client(0),
93    m_State(E_Created)
94 {
95 }
96
97 IsoHandler::IsoHandler(int port, unsigned int buf_packets, unsigned int max_packet_size, int irq)
98    : m_handle(0), m_port(port),
99    m_buf_packets(buf_packets), m_max_packet_size( max_packet_size),
100    m_irq_interval(irq),
101    m_packetcount(0), m_dropped(0), m_Client(0),
102    m_State(E_Created)
103 {
104 }
105
106 IsoHandler::~IsoHandler() {
107
108 // Don't call until libraw1394's raw1394_new_handle() function has been
109 // fixed to correctly initialise the iso_packet_infos field.  Bug is
110 // confirmed present in libraw1394 1.2.1.  In any case,
111 // raw1394_destroy_handle() will do any iso system shutdown required.
112 //     raw1394_iso_shutdown(m_handle);
113
114     if(m_handle) {
115         if (m_State == E_Running) {
116             stop();
117         }
118
119         raw1394_destroy_handle(m_handle);
120     }
121
122     if(m_handle_util) raw1394_destroy_handle(m_handle_util);
123
124 }
125
126 bool IsoHandler::iterate() {
127     debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "IsoHandler (%p) iterate...\n",this);
128
129     if(m_handle) {
130         if(raw1394_loop_iterate(m_handle)) {
131             debugOutput( DEBUG_LEVEL_VERBOSE,
132                  "IsoHandler (%p): Failed to iterate handler: %s\n",
133                  this,strerror(errno));
134             return false;
135         } else {
136             return true;
137         }
138     } else {
139         return false;
140     }
141 }
142
143 bool
144 IsoHandler::init()
145 {
146     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoHandler (%p) enter...\n",this);
147
148     // check the state
149     if(m_State != E_Created) {
150         debugError("Incorrect state, expected E_Created, got %d\n",(int)m_State);
151         return false;
152     }
153
154     // the main handle for the ISO traffic
155     m_handle = raw1394_new_handle_on_port( m_port );
156     if ( !m_handle ) {
157         if ( !errno ) {
158             debugError("libraw1394 not compatible\n");
159         } else {
160             debugError("Could not get 1394 handle: %s\n", strerror(errno) );
161             debugError("Are ieee1394 and raw1394 drivers loaded?\n");
162         }
163         return false;
164     }
165     raw1394_set_userdata(m_handle, static_cast<void *>(this));
166
167     // a second handle for utility stuff
168     m_handle_util = raw1394_new_handle_on_port( m_port );
169     if ( !m_handle_util ) {
170         if ( !errno ) {
171             debugError("libraw1394 not compatible\n");
172         } else {
173             debugError("Could not get 1394 handle: %s\n", strerror(errno) );
174             debugError("Are ieee1394 and raw1394 drivers loaded?\n");
175         }
176
177         raw1394_destroy_handle(m_handle);
178         return false;
179     }
180     raw1394_set_userdata(m_handle_util, static_cast<void *>(this));
181
182     // bus reset handling
183     if(raw1394_busreset_notify (m_handle, RAW1394_NOTIFY_ON)) {
184         debugWarning("Could not enable busreset notification.\n");
185         debugWarning(" Error message: %s\n",strerror(errno));
186         debugWarning("Continuing without bus reset support.\n");
187     } else {
188         // apparently this cannot fail
189         raw1394_set_bus_reset_handler(m_handle, busreset_handler);
190     }
191
192     // test the cycle timer read function
193     int err;
194     uint32_t cycle_timer;
195     uint64_t local_time;
196     err=raw1394_read_cycle_timer(m_handle_util, &cycle_timer, &local_time);
197     if(err) {
198         debugError("raw1394_read_cycle_timer failed.\n");
199         debugError(" Error: %s\n", strerror(err));
200         debugError(" Your system doesn't seem to support the raw1394_read_cycle_timer call\n");
201         return false;
202     }
203
204     // update the internal state
205     m_State=E_Initialized;
206
207     return true;
208 }
209
210 bool IsoHandler::prepare()
211 {
212     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoHandler (%p) enter...\n",this);
213
214     // check the state
215     if(m_State != E_Initialized) {
216         debugError("Incorrect state, expected E_Initialized, got %d\n",(int)m_State);
217         return false;
218     }
219
220     // Don't call until libraw1394's raw1394_new_handle() function has been
221     // fixed to correctly initialise the iso_packet_infos field.  Bug is
222     // confirmed present in libraw1394 1.2.1.
223
224 //     raw1394_iso_shutdown(m_handle);
225
226     m_State = E_Prepared;
227
228     return true;
229 }
230
231 bool IsoHandler::start(int cycle)
232 {
233     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
234
235     // check the state
236     if(m_State != E_Prepared) {
237         debugError("Incorrect state, expected E_Prepared, got %d\n",(int)m_State);
238         return false;
239     }
240
241     m_State=E_Running;
242
243     return true;
244 }
245
246 bool IsoHandler::stop()
247 {
248     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
249
250     // check state
251     if(m_State != E_Running) {
252         debugError("Incorrect state, expected E_Running, got %d\n",(int)m_State);
253         return false;
254     }
255
256     // this is put here to try and avoid the
257     // Runaway context problem
258     // don't know if it will help though.
259     raw1394_iso_xmit_sync(m_handle);
260
261     raw1394_iso_stop(m_handle);
262
263     m_State=E_Prepared;
264
265     return true;
266 }
267
268 /**
269  * Bus reset handler
270  *
271  * @return ?
272  */
273
274 int IsoHandler::handleBusReset(unsigned int generation) {
275     debugOutput( DEBUG_LEVEL_VERBOSE, "bus reset...\n");
276
277
278     return 0;
279 }
280
281 /**
282  * Returns the current value of the cycle timer (in ticks)
283  *
284  * @return the current value of the cycle timer (in ticks)
285  */
286
287 unsigned int IsoHandler::getCycleTimerTicks() {
288     // the new api should be realtime safe.
289     // it might cause a reschedule when turning preemption,
290     // back on but that won't hurt us if we have sufficient
291     // priority
292     int err;
293     uint32_t cycle_timer;
294     uint64_t local_time;
295     err=raw1394_read_cycle_timer(m_handle_util, &cycle_timer, &local_time);
296     if(err) {
297         debugWarning("raw1394_read_cycle_timer: %s\n", strerror(err));
298     }
299     return CYCLE_TIMER_TO_TICKS(cycle_timer);
300 }
301
302 /**
303  * Returns the current value of the cycle timer (as is)
304  *
305  * @return the current value of the cycle timer (as is)
306  */
307
308 unsigned int IsoHandler::getCycleTimer() {
309     // the new api should be realtime safe.
310     // it might cause a reschedule when turning preemption,
311     // back on but that won't hurt us if we have sufficient
312     // priority
313     int err;
314     uint32_t cycle_timer;
315     uint64_t local_time;
316     err=raw1394_read_cycle_timer(m_handle_util, &cycle_timer, &local_time);
317     if(err) {
318         debugWarning("raw1394_read_cycle_timer: %s\n", strerror(err));
319     }
320     return cycle_timer;
321 }
322
323 void IsoHandler::dumpInfo()
324 {
325
326     int channel=-1;
327     if (m_Client) channel=m_Client->getChannel();
328
329     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Handler type    : %s\n",
330             (this->getType()==EHT_Receive ? "Receive" : "Transmit"));
331     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Port, Channel   : %2d, %2d\n",
332             m_port, channel);
333     debugOutputShort( DEBUG_LEVEL_NORMAL, "  Packet count    : %10d (%5d dropped)\n",
334             this->getPacketCount(), this->getDroppedCount());
335 }
336
337 void IsoHandler::setVerboseLevel(int l)
338 {
339     setDebugLevel(l);
340 }
341
342 bool IsoHandler::registerStream(IsoStream *stream)
343 {
344     assert(stream);
345     debugOutput( DEBUG_LEVEL_VERBOSE, "registering stream (%p)\n", stream);
346
347     if (m_Client) {
348             debugFatal( "Generic IsoHandlers can have only one client\n");
349             return false;
350     }
351
352     m_Client=stream;
353
354     m_Client->setHandler(this);
355
356     return true;
357
358 }
359
360 bool IsoHandler::unregisterStream(IsoStream *stream)
361 {
362     assert(stream);
363     debugOutput( DEBUG_LEVEL_VERBOSE, "unregistering stream (%p)\n", stream);
364
365     if(stream != m_Client) {
366             debugFatal( "no client registered\n");
367             return false;
368     }
369
370     m_Client->clearHandler();
371
372     m_Client=0;
373     return true;
374
375 }
376
377 /* Child class implementations */
378
379 IsoRecvHandler::IsoRecvHandler(int port)
380                 : IsoHandler(port)
381 {
382     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
383 }
384 IsoRecvHandler::IsoRecvHandler(int port, unsigned int buf_packets,
385                                unsigned int max_packet_size, int irq)
386                 : IsoHandler(port, buf_packets,max_packet_size,irq)
387 {
388     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
389
390 }
391 IsoRecvHandler::~IsoRecvHandler()
392 {
393
394 }
395
396 bool
397 IsoRecvHandler::init() {
398     debugOutput( DEBUG_LEVEL_VERBOSE, "init recv handler %p\n",this);
399
400     if(!(IsoHandler::init())) {
401         return false;
402     }
403     return true;
404
405 }
406
407 enum raw1394_iso_disposition IsoRecvHandler::putPacket(
408                     unsigned char *data, unsigned int length,
409                     unsigned char channel, unsigned char tag, unsigned char sy,
410                     unsigned int cycle, unsigned int dropped) {
411
412     debugOutput( DEBUG_LEVEL_VERY_VERBOSE,
413                  "received packet: length=%d, channel=%d, cycle=%d\n",
414                  length, channel, cycle );
415     m_packetcount++;
416     m_dropped+=dropped;
417
418     if(m_Client) {
419         return m_Client->putPacket(data, length, channel, tag, sy, cycle, dropped);
420     }
421
422     return RAW1394_ISO_OK;
423 }
424
425 bool IsoRecvHandler::prepare()
426 {
427
428     // prepare the generic IsoHandler
429     if(!IsoHandler::prepare()) {
430         return false;
431     }
432
433     debugOutput( DEBUG_LEVEL_VERBOSE, "Preparing iso receive handler (%p)\n",this);
434     debugOutput( DEBUG_LEVEL_VERBOSE, " Buffers         : %d \n",m_buf_packets);
435     debugOutput( DEBUG_LEVEL_VERBOSE, " Max Packet size : %d \n",m_max_packet_size);
436     debugOutput( DEBUG_LEVEL_VERBOSE, " Channel         : %d \n",m_Client->getChannel());
437     debugOutput( DEBUG_LEVEL_VERBOSE, " Irq interval    : %d \n",m_irq_interval);
438
439     if(m_irq_interval > 1) {
440         if(raw1394_iso_recv_init(m_handle,
441                                 iso_receive_handler,
442                                 m_buf_packets,
443                                 m_max_packet_size,
444                                 m_Client->getChannel(),
445                                 RAW1394_DMA_BUFFERFILL,
446                                 m_irq_interval)) {
447             debugFatal("Could not do receive initialisation!\n" );
448             debugFatal("  %s\n",strerror(errno));
449
450             return false;
451         }
452     } else {
453         if(raw1394_iso_recv_init(m_handle,
454                                 iso_receive_handler,
455                                 m_buf_packets,
456                                 m_max_packet_size,
457                                 m_Client->getChannel(),
458                                 RAW1394_DMA_PACKET_PER_BUFFER,
459                                 m_irq_interval)) {
460             debugFatal("Could not do receive initialisation!\n" );
461             debugFatal("  %s\n",strerror(errno));
462
463             return false;
464         }
465     }
466     return true;
467 }
468
469 bool IsoRecvHandler::start(int cycle)
470 {
471     debugOutput( DEBUG_LEVEL_VERBOSE, "start on cycle %d\n", cycle);
472
473     // start the generic IsoHandler
474     if(!IsoHandler::start(cycle)) {
475         return false;
476     }
477
478     if(raw1394_iso_recv_start(m_handle, cycle, -1, 0)) {
479         debugFatal("Could not start receive handler (%s)\n",strerror(errno));
480         return false;
481     }
482     return true;
483 }
484
485 int IsoRecvHandler::handleBusReset(unsigned int generation) {
486     debugOutput( DEBUG_LEVEL_VERBOSE, "handle bus reset...\n");
487
488     //TODO: implement busreset
489
490     // pass on the busreset signal
491     if(IsoHandler::handleBusReset(generation)) {
492         return -1;
493     }
494     return 0;
495 }
496
497 /* ----------------- XMIT --------------- */
498
499 IsoXmitHandler::IsoXmitHandler(int port)
500                 : IsoHandler(port), m_prebuffers(0)
501 {
502     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoXmitHandler enter...\n");
503
504 }
505 IsoXmitHandler::IsoXmitHandler(int port, unsigned int buf_packets,
506                                unsigned int max_packet_size, int irq)
507                 : IsoHandler(port, buf_packets, max_packet_size,irq),
508                   m_speed(RAW1394_ISO_SPEED_400), m_prebuffers(0)
509 {
510     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoXmitHandler enter...\n");
511
512 }
513 IsoXmitHandler::IsoXmitHandler(int port, unsigned int buf_packets,
514                                unsigned int max_packet_size, int irq,
515                                enum raw1394_iso_speed speed)
516                 : IsoHandler(port, buf_packets,max_packet_size,irq),
517                   m_speed(speed), m_prebuffers(0)
518 {
519     debugOutput( DEBUG_LEVEL_VERBOSE, "IsoXmitHandler enter...\n");
520
521 }
522
523 IsoXmitHandler::~IsoXmitHandler()
524 {
525     // handle cleanup is done in the IsoHanlder destructor
526 }
527
528 bool
529 IsoXmitHandler::init() {
530
531     debugOutput( DEBUG_LEVEL_VERBOSE, "init xmit handler %p\n",this);
532
533     if(!(IsoHandler::init())) {
534         return false;
535     }
536
537     return true;
538 }
539
540 bool IsoXmitHandler::prepare()
541 {
542     debugOutput( DEBUG_LEVEL_VERBOSE, "Preparing iso transmit handler (%p, client=%p)\n",this,m_Client);
543
544     if(!(IsoHandler::prepare())) {
545         return false;
546     }
547
548     debugOutput( DEBUG_LEVEL_VERBOSE, " Buffers         : %d \n",m_buf_packets);
549     debugOutput( DEBUG_LEVEL_VERBOSE, " Max Packet size : %d \n",m_max_packet_size);
550     debugOutput( DEBUG_LEVEL_VERBOSE, " Channel         : %d \n",m_Client->getChannel());
551     debugOutput( DEBUG_LEVEL_VERBOSE, " Speed           : %d \n",m_speed);
552     debugOutput( DEBUG_LEVEL_VERBOSE, " Irq interval    : %d \n",m_irq_interval);
553
554     if(raw1394_iso_xmit_init(m_handle,
555                              iso_transmit_handler,
556                              m_buf_packets,
557                              m_max_packet_size,
558                              m_Client->getChannel(),
559                              m_speed,
560                              m_irq_interval)) {
561         debugFatal("Could not do xmit initialisation!\n" );
562
563         return false;
564     }
565
566     return true;
567 }
568
569 bool IsoXmitHandler::start(int cycle)
570 {
571     debugOutput( DEBUG_LEVEL_VERBOSE, "start on cycle %d\n", cycle);
572
573     if(!(IsoHandler::start(cycle))) {
574         return false;
575     }
576
577     if(raw1394_iso_xmit_start(m_handle, cycle, m_prebuffers)) {
578         debugFatal("Could not start xmit handler (%s)\n",strerror(errno));
579         return false;
580     }
581     return true;
582 }
583
584 enum raw1394_iso_disposition IsoXmitHandler::getPacket(
585                     unsigned char *data, unsigned int *length,
586                     unsigned char *tag, unsigned char *sy,
587                     int cycle, unsigned int dropped) {
588
589     debugOutput( DEBUG_LEVEL_VERY_VERBOSE,
590                     "sending packet: length=%d, cycle=%d\n",
591                     *length, cycle );
592     m_packetcount++;
593     m_dropped+=dropped;
594
595     if(m_Client) {
596         return m_Client->getPacket(data, length, tag, sy, cycle, dropped, m_max_packet_size);
597     }
598
599     return RAW1394_ISO_OK;
600 }
601
602 int IsoXmitHandler::handleBusReset(unsigned int generation) {
603     debugOutput( DEBUG_LEVEL_VERBOSE, "bus reset...\n");
604     //TODO: implement busreset
605
606     // pass on the busreset signal
607     if(IsoHandler::handleBusReset(generation)) {
608             return -1;
609     }
610
611     return 0;
612 }
613
614 }
615
616 /* multichannel receive  */
617 #if 0
618 IsoRecvHandler::IsoRecvHandler(int port)
619         : IsoHandler(port)
620 {
621     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
622 }
623 IsoRecvHandler::IsoRecvHandler(int port, unsigned int buf_packets,
624                                unsigned int max_packet_size, int irq)
625         : IsoHandler(port, buf_packets,max_packet_size,irq)
626 {
627     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
628
629 }
630 IsoRecvHandler::~IsoRecvHandler()
631 {
632 // Don't call until libraw1394's raw1394_new_handle() function has been
633 // fixed to correctly initialise the iso_packet_infos field.  Bug is
634 // confirmed present in libraw1394 1.2.1.  In any case,
635 // raw1394_destroy_handle() (in the base class destructor) will do any iso
636 // system shutdown required.
637     raw1394_iso_shutdown(m_handle);
638
639 }
640
641 bool
642 IsoRecvHandler::initialize() {
643     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
644
645     IsoHandler *base=static_cast<IsoHandler *>(this);
646
647     if(!(base->initialize())) {
648         return false;
649     }
650
651     raw1394_set_userdata(m_handle, static_cast<void *>(this));
652
653     if(raw1394_iso_multichannel_recv_init(m_handle,
654                                          iso_receive_handler,
655                                          m_buf_packets,
656                                          m_max_packet_size,
657                                          m_irq_interval)) {
658         debugFatal("Could not do multichannel receive initialisation!\n" );
659
660         return false;
661     }
662
663     return true;
664
665 }
666
667 enum raw1394_iso_disposition IsoRecvHandler::putPacket(unsigned char *data, unsigned int length,
668                       unsigned char channel, unsigned char tag, unsigned char sy,
669                       unsigned int cycle, unsigned int dropped) {
670
671     debugOutput( DEBUG_LEVEL_VERY_VERBOSE,
672                  "received packet: length=%d, channel=%d, cycle=%d\n",
673                  length, channel, cycle );
674
675     return RAW1394_ISO_OK;
676 }
677
678 // an recv handler can have multiple destination IsoStreams
679 // NOTE: this implementation even allows for already registered
680 // streams to be registered again.
681 int IsoRecvHandler::registerStream(IsoRecvStream *stream)
682 {
683     assert(stream);
684     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
685
686     m_Clients.push_back(stream);
687
688     listen(stream->getChannel());
689     return 0;
690
691 }
692
693 int IsoRecvHandler::unregisterStream(IsoRecvStream *stream)
694 {
695     assert(stream);
696     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
697
698     for ( IsoRecvStreamVectorIterator it = m_Clients.begin();
699           it != m_Clients.end();
700           ++it )
701     {
702         IsoRecvStream* s = *it;
703         if ( s == stream ) {
704             unListen(s->getChannel());
705             m_Clients.erase(it);
706             return 0;
707         }
708     }
709
710     return -1; //not found
711
712 }
713
714 void IsoRecvHandler::listen(int channel) {
715     int retval;
716     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
717
718     retval=raw1394_iso_recv_listen_channel(m_handle, channel);
719
720 }
721
722 void IsoRecvHandler::unListen(int channel) {
723     int retval;
724     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
725
726     retval=raw1394_iso_recv_unlisten_channel(m_handle, channel);
727
728 }
729
730 int IsoRecvHandler::start(int cycle)
731 {
732     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
733     return raw1394_iso_recv_start(m_handle, cycle, -1, 0);
734 }
735 #endif
Note: See TracBrowser for help on using the browser.