Changeset 492
- Timestamp:
- 07/15/07 17:04:05 (16 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/libstreaming/MotuStreamProcessor.cpp
r491 r492 193 193 // These are just copied from AmdtpStreamProcessor. At some point we should 194 194 // verify that they make sense for the MOTU. 195 ts_head = substractTicks(ts_head, TICKS_PER_CYCLE);195 // ts_head = substractTicks(ts_head, TICKS_PER_CYCLE); 196 196 // account for the number of cycles we are too late to enable 197 197 ts_head = addTicks(ts_head, cycles_past_enable * TICKS_PER_CYCLE); 198 198 // account for one extra packet of frames 199 ts_head = substractTicks(ts_head,200 (uint32_t)((float)n_events * m_SyncSource->m_data_buffer->getRate()));199 // ts_head = substractTicks(ts_head, 200 // (uint32_t)((float)n_events * m_SyncSource->m_data_buffer->getRate())); 201 201 202 202 m_data_buffer->setBufferTailTimestamp(ts_head); … … 269 269 int32_t until_next=diffTicks(timestamp, cycle_timer + ticks_to_advance); 270 270 271 until_next = (cycle >= TICKS_TO_CYCLES( (uint32_t)timestamp))?-1:1;271 until_next = (cycle >= TICKS_TO_CYCLES(timestamp))?-1:1; 272 272 273 273 // Size of a single data frame in quadlets … … 335 335 336 336 *length = n_events*m_event_size + 8; 337 338 // convert the timestamp to Motu format339 // I assume that it is in ticks, and wraps as the cycle timer340 #warning syt conversion to be done341 337 342 338 // FIXME: if we choose to read the buffer even during closedown, … … 511 507 // allocate the internal buffer 512 508 m_ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_framerate); 513 unsigned int events_per_frame = m_framerate<=48000?8:(m_framerate<=96000?16:32);514 509 515 510 assert(m_data_buffer); 511 // Note: terminology is slightly confused here. From the point of view 512 // of the buffer the event size is the size of a single complete "event" 513 // in the MOTU datastream, which consists of one sample from each audio 514 // channel plus a timestamp and other control data. Almost by 515 // definition then, the buffer's "events per frame" must be 1. With 516 // these values, data copies to/from the MOTU data stream can be handled 517 // by the generic copying functions. 516 518 m_data_buffer->setBufferSize(ringbuffer_size_frames); 517 519 m_data_buffer->setEventSize(m_event_size);