root/trunk/libffado/src/libieee1394/IsoHandlerManager.cpp

Revision 868, 21.9 kB (checked in by ppalmers, 16 years ago)

detect when a handler has died on us

Line 
1 /*
2  * Copyright (C) 2005-2008 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 program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 2 of the License, or
12  * (at your option) version 3 of the License.
13  *
14  * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #include "config.h"
25 #include "IsoHandlerManager.h"
26 #include "ieee1394service.h"
27 #include "IsoHandler.h"
28 #include "libstreaming/generic/StreamProcessor.h"
29
30 #include "libutil/Atomic.h"
31
32 #include "libutil/PosixThread.h"
33
34 #include <assert.h>
35
36 IMPL_DEBUG_MODULE( IsoHandlerManager, IsoHandlerManager, DEBUG_LEVEL_NORMAL );
37
38 using namespace Streaming;
39
40 IsoHandlerManager::IsoHandlerManager(Ieee1394Service& service)
41    : m_State(E_Created)
42    , m_service( service )
43    , m_realtime(false), m_priority(0)
44    , m_Thread ( NULL )
45 {}
46
47 IsoHandlerManager::IsoHandlerManager(Ieee1394Service& service, bool run_rt, int rt_prio)
48    : m_State(E_Created)
49    , m_service( service )
50    , m_realtime(run_rt), m_priority(rt_prio)
51    , m_Thread ( NULL )
52 {}
53
54 IsoHandlerManager::~IsoHandlerManager()
55 {
56     stopHandlers();
57     pruneHandlers();
58     if(m_IsoHandlers.size() > 0) {
59         debugError("Still some handlers in use\n");
60     }
61     if (m_Thread) {
62         m_Thread->Stop();
63         delete m_Thread;
64     }
65 }
66
67 bool
68 IsoHandlerManager::setThreadParameters(bool rt, int priority) {
69     debugOutput( DEBUG_LEVEL_VERBOSE, "(%p) switch to: (rt=%d, prio=%d)...\n", this, rt, priority);
70     if (priority > THREAD_MAX_RTPRIO) priority = THREAD_MAX_RTPRIO; // cap the priority
71     m_realtime = rt;
72     m_priority = priority;
73     bool result = true;
74     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
75         it != m_IsoHandlers.end();
76         ++it )
77     {
78         result &= (*it)->setThreadParameters(m_realtime, m_priority);
79     }
80
81     if (m_Thread) {
82         if (m_realtime) {
83             m_Thread->AcquireRealTime(m_priority);
84         } else {
85             m_Thread->DropRealTime();
86         }
87     }
88
89     return result;
90 }
91
92 /**
93  * Update the shadow variables. Should only be called from
94  * the iso handler iteration thread
95  */
96 void
97 IsoHandlerManager::updateShadowVars()
98 {
99     debugOutput( DEBUG_LEVEL_VERY_VERBOSE, "updating shadow vars...\n");
100     unsigned int i, cnt, max;
101     max = m_IsoHandlers.size();
102     for (i = 0, cnt = 0; i < max; i++) {
103         IsoHandler *h = m_IsoHandlers.at(i);
104         assert(h);
105         if (h->isEnabled()) {
106             // receive handlers are always poll'ed
107             // transmit handlers only when the client is ready
108             if (h->tryWaitForClient()) {
109                 m_IsoHandler_map_shadow[cnt] = h;
110                 m_poll_fds_shadow[cnt].fd = h->getFileDescriptor();
111                 m_poll_fds_shadow[cnt].revents = 0;
112                 m_poll_fds_shadow[cnt].events = POLLIN;
113                 cnt++;
114             } else {
115                 debugOutput(DEBUG_LEVEL_VERBOSE, "skipped handler %p\n", h);
116             }
117         }
118         if(cnt > ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT) {
119             debugWarning("Too much ISO Handlers in manager...\n");
120             break;
121         }
122     }
123     m_poll_nfds_shadow = cnt;
124     debugOutput( DEBUG_LEVEL_VERY_VERBOSE, " updated shadow vars...\n");
125 }
126
127 bool
128 IsoHandlerManager::Init() {
129     debugOutput( DEBUG_LEVEL_VERBOSE, "%p: Init thread...\n", this);
130     bool result = true;
131     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
132         it != m_IsoHandlers.end();
133         ++it )
134     {
135         result &= (*it)->Init();
136     }
137     return result;
138 }
139
140 bool
141 IsoHandlerManager::Execute() {
142     int err;
143     unsigned int i;
144
145     unsigned int m_poll_timeout = 100;
146
147     updateShadowVars();
148     // bypass if no handlers are registered
149     if (m_poll_nfds_shadow == 0) {
150         debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "bypass iterate since no handlers to poll\n");
151         usleep(m_poll_timeout * 1000);
152         return true;
153     }
154
155     // Use a shadow map of the fd's such that the poll call is not in a critical section
156     DEBUG_EXTREME( uint64_t poll_enter = m_service.getCurrentTimeAsUsecs() );
157     err = poll (m_poll_fds_shadow, m_poll_nfds_shadow, m_poll_timeout);
158     DEBUG_EXTREME( uint64_t poll_exit = m_service.getCurrentTimeAsUsecs() );
159
160     if (err == -1) {
161         if (errno == EINTR) {
162             return true;
163         }
164         debugFatal("poll error: %s\n", strerror (errno));
165         return false;
166     }
167
168     int nb_rcv = 0;
169     int nb_xmit = 0;
170     DEBUG_EXTREME( uint64_t iter_enter = m_service.getCurrentTimeAsUsecs() );
171     for (i = 0; i < m_poll_nfds_shadow; i++) {
172         if(m_poll_fds_shadow[i].revents) {
173             debugOutput(DEBUG_LEVEL_VERBOSE,
174                         "received events: %08X for (%d/%d, %p, %s)\n",
175                         m_poll_fds_shadow[i].revents,
176                         i, m_poll_nfds_shadow,
177                         m_IsoHandler_map_shadow[i],
178                         m_IsoHandler_map_shadow[i]->getTypeString());
179         }
180         if (m_poll_fds_shadow[i].revents & POLLERR) {
181             debugWarning("error on fd for %d\n",i);
182         }
183
184         if (m_poll_fds_shadow[i].revents & POLLHUP) {
185             debugWarning("hangup on fd for %d\n",i);
186         }
187
188         if(m_poll_fds_shadow[i].revents & (POLLIN)) {
189             if (m_IsoHandler_map_shadow[i]->getType() == IsoHandler::eHT_Receive) {
190                 m_IsoHandler_map_shadow[i]->iterate();
191                 nb_rcv++;
192             } else {
193                 // only iterate the xmit handler if it makes sense
194                 if(m_IsoHandler_map_shadow[i]->tryWaitForClient()) {
195                     m_IsoHandler_map_shadow[i]->iterate();
196                     nb_xmit++;
197                 }
198             }
199         }
200
201         #ifdef DEBUG
202         // check if the handler is still alive
203         if(m_IsoHandler_map_shadow[i]->isDead()) {
204             debugError("Iso handler %p (%s) is dead!\n",
205                        m_IsoHandler_map_shadow[i],
206                        m_IsoHandler_map_shadow[i]->getTypeString());
207             return false; // shutdown the system
208         }
209         #endif
210        
211     }
212     DEBUG_EXTREME( uint64_t iter_exit = m_service.getCurrentTimeAsUsecs() );
213
214     debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, " poll took %6lldus, iterate took %6lldus, iterated (R: %2d, X: %2d) handlers\n",
215                        poll_exit-poll_enter, iter_exit-iter_enter,
216                        nb_rcv, nb_xmit);
217
218     return true;
219 }
220
221 bool IsoHandlerManager::init()
222 {
223     debugOutput( DEBUG_LEVEL_VERBOSE, "Initializing ISO manager %p...\n", this);
224     // check state
225     if(m_State != E_Created) {
226         debugError("Manager already initialized...\n");
227         return false;
228     }
229
230 #if ISOHANDLER_PER_HANDLER_THREAD
231     // the IsoHandlers will create their own thread.
232 #else
233     // create a thread to iterate our handlers
234     debugOutput( DEBUG_LEVEL_VERBOSE, "Start thread for %p...\n", this);
235     m_Thread = new Util::PosixThread(this, m_realtime, m_priority,
236                                      PTHREAD_CANCEL_DEFERRED);
237     if(!m_Thread) {
238         debugFatal("No thread\n");
239         return false;
240     }
241     if (m_Thread->Start() != 0) {
242         debugFatal("Could not start update thread\n");
243         return false;
244     }
245 #endif
246
247     m_State=E_Running;
248     return true;
249 }
250
251 bool
252 IsoHandlerManager::disable(IsoHandler *h) {
253     bool result;
254     int i=0;
255     debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Disable on IsoHandler %p\n", h);
256     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
257         it != m_IsoHandlers.end();
258         ++it )
259     {
260         if ((*it) == h) {
261             result = h->disable();
262             debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " disabled\n");
263             return result;
264         }
265         i++;
266     }
267     debugError("Handler not found\n");
268     return false;
269 }
270
271 bool
272 IsoHandlerManager::enable(IsoHandler *h) {
273     bool result;
274     int i=0;
275     debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Enable on IsoHandler %p\n", h);
276     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
277         it != m_IsoHandlers.end();
278         ++it )
279     {
280         if ((*it) == h) {
281             result = h->enable();
282             debugOutput(DEBUG_LEVEL_VERY_VERBOSE, " enabled\n");
283             return result;
284         }
285         i++;
286     }
287     debugError("Handler not found\n");
288     return false;
289 }
290
291 bool IsoHandlerManager::registerHandler(IsoHandler *handler)
292 {
293     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
294     assert(handler);
295     handler->setVerboseLevel(getDebugLevel());
296     m_IsoHandlers.push_back(handler);
297     updateShadowVars();
298     return true;
299 }
300
301 bool IsoHandlerManager::unregisterHandler(IsoHandler *handler)
302 {
303     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
304     assert(handler);
305
306     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
307       it != m_IsoHandlers.end();
308       ++it )
309     {
310         if ( *it == handler ) {
311             m_IsoHandlers.erase(it);
312             updateShadowVars();
313             return true;
314         }
315     }
316     debugFatal("Could not find handler (%p)\n", handler);
317     return false; //not found
318 }
319
320 /**
321  * Registers an StreamProcessor with the IsoHandlerManager.
322  *
323  * If nescessary, an IsoHandler is created to handle this stream.
324  * Once an StreamProcessor is registered to the handler, it will be included
325  * in the ISO streaming cycle (i.e. receive/transmit of it will occur).
326  *
327  * @param stream the stream to register
328  * @return true if registration succeeds
329  *
330  * \todo : currently there is a one-to-one mapping
331  *        between streams and handlers, this is not ok for
332  *        multichannel receive
333  */
334 bool IsoHandlerManager::registerStream(StreamProcessor *stream)
335 {
336     debugOutput( DEBUG_LEVEL_VERBOSE, "Registering stream %p\n",stream);
337     assert(stream);
338
339     IsoHandler* h = NULL;
340
341     // make sure the stream isn't already attached to a handler
342     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
343       it != m_IsoHandlers.end();
344       ++it )
345     {
346         if((*it)->isStreamRegistered(stream)) {
347             debugError( "stream already registered!\n");
348             return false;
349         }
350     }
351
352     // clean up all handlers that aren't used
353     pruneHandlers();
354
355     // allocate a handler for this stream
356     if (stream->getType()==StreamProcessor::ePT_Receive) {
357         // setup the optimal parameters for the raw1394 ISO buffering
358         unsigned int packets_per_period = stream->getPacketsPerPeriod();
359         unsigned int max_packet_size = stream->getMaxPacketSize();
360         unsigned int page_size = getpagesize() - 2; // for one reason or another this is necessary
361
362         // Ensure we don't request a packet size bigger than the
363         // kernel-enforced maximum which is currently 1 page.
364         if (max_packet_size > page_size) {
365             debugError("max packet size (%u) > page size (%u)\n", max_packet_size, page_size);
366             return false;
367         }
368
369         unsigned int irq_interval = packets_per_period / MINIMUM_INTERRUPTS_PER_PERIOD;
370         if(irq_interval <= 0) irq_interval=1;
371        
372         // the receive buffer size doesn't matter for the latency,
373         // but it has a minimal value in order for libraw to operate correctly (300)
374         int buffers=400;
375
376         // create the actual handler
377         h = new IsoHandler(*this, IsoHandler::eHT_Receive,
378                            buffers, max_packet_size, irq_interval);
379
380         debugOutput( DEBUG_LEVEL_VERBOSE, " creating IsoRecvHandler\n");
381
382         if(!h) {
383             debugFatal("Could not create IsoRecvHandler\n");
384             return false;
385         }
386
387     } else if (stream->getType()==StreamProcessor::ePT_Transmit) {
388         // setup the optimal parameters for the raw1394 ISO buffering
389         unsigned int packets_per_period = stream->getPacketsPerPeriod();
390         unsigned int max_packet_size = stream->getMaxPacketSize();
391         unsigned int page_size = getpagesize();
392
393         // Ensure we don't request a packet size bigger than the
394         // kernel-enforced maximum which is currently 1 page.
395         if (max_packet_size > page_size) {
396             debugError("max packet size (%u) > page size (%u)\n", max_packet_size, page_size);
397             return false;
398         }
399
400         //max_packet_size = page_size; // HACK
401         unsigned int irq_interval = packets_per_period / MINIMUM_INTERRUPTS_PER_PERIOD;
402         if(irq_interval <= 0) irq_interval=1;
403
404         // the SP specifies how many packets to ISO-buffer
405         int buffers = stream->getNbPacketsIsoXmitBuffer();
406
407         debugOutput( DEBUG_LEVEL_VERBOSE, " creating IsoXmitHandler\n");
408
409         // create the actual handler
410         h = new IsoHandler(*this, IsoHandler::eHT_Transmit,
411                            buffers, max_packet_size, irq_interval);
412
413         if(!h) {
414             debugFatal("Could not create IsoXmitHandler\n");
415             return false;
416         }
417
418     } else {
419         debugFatal("Bad stream type\n");
420         return false;
421     }
422
423     h->setVerboseLevel(getDebugLevel());
424
425     // init the handler
426     if(!h->init()) {
427         debugFatal("Could not initialize receive handler\n");
428         return false;
429     }
430
431     // set the handler's thread parameters
432     // receive handlers have lower priority than the client thread
433     // since they have ISO side buffering
434     // xmit handlers have higher priority since we want client side
435     // frames to be put into the ISO buffers ASAP
436     int thread_prio;
437     if (stream->getType()==StreamProcessor::ePT_Receive) {
438         thread_prio = m_priority - 1;
439         if (thread_prio < THREAD_MIN_RTPRIO) thread_prio = THREAD_MIN_RTPRIO;
440     } else {
441         thread_prio = m_priority + 1;
442         if (thread_prio > THREAD_MAX_RTPRIO) thread_prio = THREAD_MAX_RTPRIO;
443     }
444
445     if(!h->setThreadParameters(m_realtime, thread_prio)) {
446         debugFatal("Could not set handler thread parameters\n");
447         return false;
448     }
449
450     // register the stream with the handler
451     if(!h->registerStream(stream)) {
452         debugFatal("Could not register receive stream with handler\n");
453         return false;
454     }
455
456     // register the handler with the manager
457     if(!registerHandler(h)) {
458         debugFatal("Could not register receive handler with manager\n");
459         return false;
460     }
461     debugOutput( DEBUG_LEVEL_VERBOSE, " registered stream (%p) with handler (%p)\n", stream, h);
462
463     m_StreamProcessors.push_back(stream);
464     debugOutput( DEBUG_LEVEL_VERBOSE, " %d streams, %d handlers registered\n",
465                                       m_StreamProcessors.size(), m_IsoHandlers.size());
466     return true;
467 }
468
469 bool IsoHandlerManager::unregisterStream(StreamProcessor *stream)
470 {
471     debugOutput( DEBUG_LEVEL_VERBOSE, "Unregistering stream %p\n",stream);
472     assert(stream);
473
474     // make sure the stream isn't attached to a handler anymore
475     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
476       it != m_IsoHandlers.end();
477       ++it )
478     {
479         if((*it)->isStreamRegistered(stream)) {
480             if(!(*it)->unregisterStream(stream)) {
481                 debugOutput( DEBUG_LEVEL_VERBOSE, " could not unregister stream (%p) from handler (%p)...\n",stream,*it);
482                 return false;
483             }
484             debugOutput( DEBUG_LEVEL_VERBOSE, " unregistered stream (%p) from handler (%p)...\n",stream,*it);
485         }
486     }
487
488     // clean up all handlers that aren't used
489     pruneHandlers();
490
491     // remove the stream from the registered streams list
492     for ( StreamProcessorVectorIterator it = m_StreamProcessors.begin();
493       it != m_StreamProcessors.end();
494       ++it )
495     {
496         if ( *it == stream ) {
497             m_StreamProcessors.erase(it);
498             debugOutput( DEBUG_LEVEL_VERBOSE, " deleted stream (%p) from list...\n", *it);
499             return true;
500         }
501     }
502     return false; //not found
503 }
504
505 /**
506  * @brief unregister a handler from the manager
507  * @note called without the lock held.
508  */
509 void IsoHandlerManager::pruneHandlers() {
510     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
511     IsoHandlerVector toUnregister;
512
513     // find all handlers that are not in use
514     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
515           it != m_IsoHandlers.end();
516           ++it )
517     {
518         if(!((*it)->inUse())) {
519             debugOutput( DEBUG_LEVEL_VERBOSE, " handler (%p) not in use\n",*it);
520             toUnregister.push_back(*it);
521         }
522     }
523     // delete them
524     for ( IsoHandlerVectorIterator it = toUnregister.begin();
525           it != toUnregister.end();
526           ++it )
527     {
528         unregisterHandler(*it);
529
530         debugOutput( DEBUG_LEVEL_VERBOSE, " deleting handler (%p)\n",*it);
531
532         // Now the handler's been unregistered it won't be reused
533         // again.  Therefore it really needs to be formally deleted
534         // to free up the raw1394 handle.  Otherwise things fall
535         // apart after several xrun recoveries as the system runs
536         // out of resources to support all the disused but still
537         // allocated raw1394 handles.  At least this is the current
538         // theory as to why we end up with "memory allocation"
539         // failures after several Xrun recoveries.
540         delete *it;
541     }
542 }
543
544 bool
545 IsoHandlerManager::stopHandlerForStream(Streaming::StreamProcessor *stream) {
546     // check state
547     if(m_State != E_Running) {
548         debugError("Incorrect state, expected E_Running, got %s\n", eHSToString(m_State));
549         return false;
550     }
551     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
552       it != m_IsoHandlers.end();
553       ++it )
554     {
555         if((*it)->isStreamRegistered(stream)) {
556             bool result;
557             debugOutput( DEBUG_LEVEL_VERBOSE, " stopping handler %p for stream %p\n", *it, stream);
558             result = (*it)->disable();
559             if(!result) {
560                 debugOutput( DEBUG_LEVEL_VERBOSE, " could not disable handler (%p)\n",*it);
561                 return false;
562             }
563             return true;
564         }
565     }
566     debugError("Stream %p has no attached handler\n", stream);
567     return false;
568 }
569
570 int
571 IsoHandlerManager::getPacketLatencyForStream(Streaming::StreamProcessor *stream) {
572     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
573       it != m_IsoHandlers.end();
574       ++it )
575     {
576         if((*it)->isStreamRegistered(stream)) {
577             return (*it)->getPacketLatency();
578         }
579     }
580     debugError("Stream %p has no attached handler\n", stream);
581     return 0;
582 }
583
584 void
585 IsoHandlerManager::flushHandlerForStream(Streaming::StreamProcessor *stream) {
586     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
587       it != m_IsoHandlers.end();
588       ++it )
589     {
590         if((*it)->isStreamRegistered(stream)) {
591             return (*it)->flush();
592         }
593     }
594     debugError("Stream %p has no attached handler\n", stream);
595     return;
596 }
597
598 bool
599 IsoHandlerManager::startHandlerForStream(Streaming::StreamProcessor *stream) {
600     return startHandlerForStream(stream, -1);
601 }
602
603 bool
604 IsoHandlerManager::startHandlerForStream(Streaming::StreamProcessor *stream, int cycle) {
605     // check state
606     if(m_State != E_Running) {
607         debugError("Incorrect state, expected E_Running, got %s\n", eHSToString(m_State));
608         return false;
609     }
610     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
611       it != m_IsoHandlers.end();
612       ++it )
613     {
614         if((*it)->isStreamRegistered(stream)) {
615             bool result;
616             debugOutput( DEBUG_LEVEL_VERBOSE, " starting handler %p for stream %p\n", *it, stream);
617             result = (*it)->enable(cycle);
618             if(!result) {
619                 debugOutput( DEBUG_LEVEL_VERBOSE, " could not enable handler (%p)\n",*it);
620                 return false;
621             }
622             return true;
623         }
624     }
625     debugError("Stream %p has no attached handler\n", stream);
626     return false;
627 }
628
629 bool IsoHandlerManager::stopHandlers() {
630     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
631
632     // check state
633     if(m_State != E_Running) {
634         debugError("Incorrect state, expected E_Running, got %s\n", eHSToString(m_State));
635         return false;
636     }
637
638     bool retval=true;
639
640     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
641         it != m_IsoHandlers.end();
642         ++it )
643     {
644         debugOutput( DEBUG_LEVEL_VERBOSE, "Stopping handler (%p)\n",*it);
645         if(!(*it)->disable()){
646             debugOutput( DEBUG_LEVEL_VERBOSE, " could not stop handler (%p)\n",*it);
647             retval=false;
648         }
649     }
650
651     if (retval) {
652         m_State=E_Prepared;
653     } else {
654         m_State=E_Error;
655     }
656     return retval;
657 }
658
659 bool IsoHandlerManager::reset() {
660     debugOutput( DEBUG_LEVEL_VERBOSE, "enter...\n");
661     // check state
662     if(m_State == E_Error) {
663         debugFatal("Resetting from error condition not yet supported...\n");
664         return false;
665     }
666     // if not in an error condition, reset means stop the handlers
667     return stopHandlers();
668 }
669
670 void IsoHandlerManager::setVerboseLevel(int i) {
671     setDebugLevel(i);
672     // propagate the debug level
673     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
674           it != m_IsoHandlers.end();
675           ++it )
676     {
677         (*it)->setVerboseLevel(i);
678     }
679 }
680
681 void IsoHandlerManager::dumpInfo() {
682     int i=0;
683     debugOutputShort( DEBUG_LEVEL_NORMAL, "Dumping IsoHandlerManager Stream handler information...\n");
684     debugOutputShort( DEBUG_LEVEL_NORMAL, " State: %d\n",(int)m_State);
685
686     for ( IsoHandlerVectorIterator it = m_IsoHandlers.begin();
687           it != m_IsoHandlers.end();
688           ++it )
689     {
690         debugOutputShort( DEBUG_LEVEL_NORMAL, " IsoHandler %d (%p)\n",i++,*it);
691         (*it)->dumpInfo();
692     }
693 }
694
695 const char *
696 IsoHandlerManager::eHSToString(enum eHandlerStates s) {
697     switch (s) {
698         default: return "Invalid";
699         case E_Created: return "Created";
700         case E_Prepared: return "Prepared";
701         case E_Running: return "Running";
702         case E_Error: return "Error";
703     }
704 }
Note: See TracBrowser for help on using the browser.