Changeset 930
- Timestamp:
- 03/11/08 01:37:08 (14 years ago)
- Files:
-
- trunk/libffado/config.h.in (modified) (2 diffs)
- trunk/libffado/src/libieee1394/IsoHandler.cpp (modified) (5 diffs)
- trunk/libffado/src/libieee1394/IsoHandler.h (modified) (1 diff)
- trunk/libffado/src/libieee1394/IsoHandlerManager.cpp (modified) (3 diffs)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp (modified) (1 diff)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.h (modified) (1 diff)
- trunk/libffado/src/libutil/SystemTimeSource.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/config.h.in
r918 r930 43 43 #define IEEE1394SERVICE_MAX_FIREWIRE_PORTS 16 44 44 45 #define IEEE1394SERVICE_CYCLETIMER_HELPER_RUN_REALTIME 046 #define IEEE1394SERVICE_CYCLETIMER_HELPER_PRIO_INCREASE - 545 #define IEEE1394SERVICE_CYCLETIMER_HELPER_RUN_REALTIME 1 46 #define IEEE1394SERVICE_CYCLETIMER_HELPER_PRIO_INCREASE -10 47 47 48 48 #define THREAD_MAX_RTPRIO 98 49 #define THREAD_MIN_RTPRIO 049 #define THREAD_MIN_RTPRIO 1 50 50 51 51 #define MINIMUM_INTERRUPTS_PER_PERIOD 4U … … 62 62 #define ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT 16 63 63 #define ISOHANDLERMANAGER_MAX_STREAMS_PER_ISOTHREAD 16 64 // the transmit thread should run at elevated priority since it 65 // should push packets into the kernel ASAP 64 66 #define ISOHANDLERMANAGER_TRANSMIT_PRIO_INCREASE 1 65 #define ISOHANDLERMANAGER_RECEIVE_PRIO_INCREASE 0 67 // the receive thread should have lower priority than the transmit one, since 68 // it should be interrupted once it has flagged the semaphore that indicates 69 // one period of frames. 70 #define ISOHANDLERMANAGER_RECEIVE_PRIO_INCREASE -6 66 71 67 72 // allows to add some processing margin. This shifts the time trunk/libffado/src/libieee1394/IsoHandler.cpp
r906 r930 92 92 , m_prebuffers( 0 ) 93 93 , m_State( E_Created ) 94 #ifdef DEBUG 95 , m_packets ( 0 ) 96 #endif 94 97 { 95 98 } … … 107 110 , m_prebuffers( 0 ) 108 111 , m_State( E_Created ) 112 #ifdef DEBUG 113 , m_packets ( 0 ) 114 #endif 109 115 { 110 116 } … … 123 129 , m_prebuffers( 0 ) 124 130 , m_State( E_Created ) 131 #ifdef DEBUG 132 , m_packets ( 0 ) 133 #endif 125 134 { 126 135 } … … 414 423 length, channel, cycle); 415 424 #ifdef DEBUG 425 m_packets++; 416 426 if (length > m_max_packet_size) { 417 427 debugWarning("(%p, %s) packet too large: len=%u max=%u\n", … … 435 445 "sending packet: length=%d, cycle=%d\n", 436 446 *length, cycle); 447 #ifdef DEBUG 448 m_packets++; 449 #endif 437 450 if(m_Client) { 438 451 enum raw1394_iso_disposition retval; trunk/libffado/src/libieee1394/IsoHandler.h
r906 r930 150 150 }; 151 151 enum EHandlerStates m_State; 152 153 #ifdef DEBUG 154 int m_packets; 155 #endif 156 152 157 DECLARE_DEBUG_MODULE; 153 158 }; trunk/libffado/src/libieee1394/IsoHandlerManager.cpp
r918 r930 126 126 if (m_poll_nfds_shadow == 0) { 127 127 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 128 "(%p, % s) bypass iterate since no handlers to poll\n",128 "(%p, %8s) bypass iterate since no handlers to poll\n", 129 129 this, m_type==eTT_Transmit?"Transmit":"Receive"); 130 130 usleep(m_poll_timeout * 1000); … … 136 136 137 137 // setup the poll here 138 if (m_type==eTT_Transmit) { 139 // if we are a transmit thread, we should only poll on 140 // those handlers that have a client that is ready to send 141 // something. poll'ing the others will only cause busy-wait 142 // looping. 143 for (i = 0; i < m_poll_nfds_shadow; i++) { 144 short events = 0; 145 if (m_IsoHandler_map_shadow[i]->tryWaitForClient()) { 146 events = POLLIN | POLLPRI; 138 // we should prevent a poll() where no events are specified, since that will only time-out 139 bool no_one_to_poll = true; 140 while(no_one_to_poll) { 141 if (m_type==eTT_Transmit) { 142 // if we are a transmit thread, we should only poll on 143 // those handlers that have a client that is ready to send 144 // something. poll'ing the others will only cause busy-wait 145 // looping. 146 for (i = 0; i < m_poll_nfds_shadow; i++) { 147 short events = 0; 148 if (m_IsoHandler_map_shadow[i]->tryWaitForClient()) { 149 events = POLLIN | POLLPRI; 150 no_one_to_poll = false; 151 } 152 m_poll_fds_shadow[i].events = events; 147 153 } 148 m_poll_fds_shadow[i].events = events; 149 } 150 } else { 151 // for receive handlers, we can do the same. we might not have to though 152 // FIXME: check whether this is necessary 153 for (i = 0; i < m_poll_nfds_shadow; i++) { 154 short events = 0; 155 // if (m_IsoHandler_map_shadow[i]->tryWaitForClient()) { 156 // events = POLLIN | POLLERR | POLLHUP; 157 // } 158 events = POLLIN | POLLPRI; 159 m_poll_fds_shadow[i].events = events; 154 } else { 155 // for receive handlers, we can do the same. we might not have to though 156 for (i = 0; i < m_poll_nfds_shadow; i++) { 157 short events = 0; 158 if (m_IsoHandler_map_shadow[i]->tryWaitForClient()) { 159 events = POLLIN | POLLERR | POLLHUP; 160 no_one_to_poll = false; 161 } 162 m_poll_fds_shadow[i].events = events; 163 } 164 } 165 if(no_one_to_poll) { 166 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 167 "(%p, %8s) No one to poll, waiting on the first handler to become ready\n", 168 this, m_type==eTT_Transmit?"Transmit":"Receive"); 169 170 m_IsoHandler_map_shadow[0]->waitForClient(); 171 172 debugOutputExtreme(DEBUG_LEVEL_VERY_VERBOSE, 173 "(%p, %8s) handler ready\n", 174 this, m_type==eTT_Transmit?"Transmit":"Receive"); 160 175 } 161 176 } … … 210 225 211 226 } 212 213 227 return true; 214 228 trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp
r907 r930 1905 1905 1906 1906 void 1907 StreamProcessor::printBufferInfo() 1908 { 1909 debugOutput(DEBUG_LEVEL_NORMAL, 1910 "(%p, %8s) fc: %d fill: %u\n", 1911 this, getTypeString(), m_data_buffer->getFrameCounter(), m_data_buffer->getBufferFill() ); 1912 } 1913 1914 void 1907 1915 StreamProcessor::setVerboseLevel(int l) { 1908 1916 setDebugLevel(l); trunk/libffado/src/libstreaming/generic/StreamProcessor.h
r906 r930 484 484 // debug stuff 485 485 virtual void dumpInfo(); 486 virtual void printBufferInfo(); 486 487 virtual void setVerboseLevel(int l); 487 488 const char *getStateString() trunk/libffado/src/libutil/SystemTimeSource.cpp
r864 r930 59 59 } 60 60 61 ffado_microsecs_t SystemTimeSource::getCurrentTime() { 61 ffado_microsecs_t 62 SystemTimeSource::getCurrentTime() { 62 63 // struct timeval tv; 63 64 // gettimeofday(&tv, NULL); … … 68 69 } 69 70 70 ffado_microsecs_t SystemTimeSource::getCurrentTimeAsUsecs() { 71 ffado_microsecs_t 72 SystemTimeSource::getCurrentTimeAsUsecs() { 71 73 return getCurrentTime(); 72 74 }