- Timestamp:
- 05/19/08 23:54:16 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/src/libstreaming/motu/MotuReceiveStreamProcessor.cpp
r1136 r1194 102 102 MotuReceiveStreamProcessor::prepareChild() { 103 103 debugOutput( DEBUG_LEVEL_VERBOSE, "Preparing (%p)...\n", this); 104 105 // prepare the framerate estimate106 // FIXME: not needed anymore?107 //m_ticks_per_frame = (TICKS_PER_SECOND*1.0) / ((float)m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate());108 109 104 return true; 110 105 } branches/libffado-2.0/src/libstreaming/motu/MotuTransmitStreamProcessor.cpp
r1168 r1194 38 38 #include <assert.h> 39 39 40 // Set to 1 to enable the generation of a 1 kHz test tone in analog output 1. Even with41 // this defined to 1 the test tone will now only be produced if run with a non-zero42 // debug level.43 #define TESTTONE 144 45 #if TESTTONE46 #include <math.h>47 #endif48 49 40 /* Provide more intuitive access to GCC's branch predition built-ins */ 50 41 #define likely(x) __builtin_expect((x),1) … … 279 270 float ticks_per_frame = m_Parent.getDeviceManager().getStreamProcessorManager().getSyncSource().getTicksPerFrame(); 280 271 281 #if TESTTONE282 /* Now things are beginning to stabilise, make things easier for others by only playing283 * the test tone when run with a non-zero debug level.284 */285 if (getDebugLevel() > 0) {286 // FIXME: remove this hacked in 1 kHz test signal to287 // analog-1 when testing is complete.288 signed int i, int_tpf = lrintf(ticks_per_frame);289 unsigned char *sample = data+8+16;290 for (i=0; i<n_events; i++, sample+=m_event_size) {291 static signed int a_cx = 0;292 // Each sample is 3 bytes with MSB in lowest address (ie:293 // network byte order). After byte order swap, the 24-bit294 // MSB is in the second byte of val.295 signed int val = CondSwapToBus32(lrintf(0x7fffff*sin((1000.0*2.0*M_PI/24576000.0)*a_cx)));296 memcpy(sample,((char *)&val)+1,3);297 if ((a_cx+=int_tpf) >= 24576000) {298 a_cx -= 24576000;299 }300 }301 }302 #endif303 304 //fprintf(stderr,"tx: %d/%d\n",305 // TICKS_TO_CYCLES(fullTicksToSph(m_last_timestamp)),306 // TICKS_TO_OFFSET(fullTicksToSph(m_last_timestamp)));307 // Set up each frames's SPH.308 //fprintf(stderr,"tpf=%f\n", ticks_per_frame);309 272 for (int i=0; i < n_events; i++, quadlet += dbs) { 310 273 int64_t ts_frame = addTicks(m_last_timestamp, (unsigned int)lrintf(i * ticks_per_frame)); 311 274 *quadlet = CondSwapToBus32(fullTicksToSph(ts_frame)); 312 //fprintf(stderr,"tx: %d/%d\n",313 // CYCLE_TIMER_GET_CYCLES(fullTicksToSph(ts_frame)),314 // CYCLE_TIMER_GET_OFFSET(fullTicksToSph(ts_frame)));315 275 } 316 276