Exemplo n.º 1
0
void K3bAudioMaxSpeedJob::WorkThread::run()
{
  kdDebug() << k_funcinfo << endl;
  m_canceled = false;

  emitStarted();

  K3bAudioDataSourceIterator it( m_doc );

  // count sources for minimal progress info
  int numSources = 0;
  int sourcesDone = 0;
  while( it.current() ) {
    ++numSources;
    it.next();
  }

  bool success = true;
  maxSpeed = 175*1000;
  it.first();

  while( it.current() && !m_canceled ) {
    if( !it.current()->seek(0) ) {
      kdDebug() << "(K3bAudioMaxSpeedJob) seek failed." << endl;
      success = false;
      break;
    }
      
    // read some data
    int speed = speedTest( it.current() );

    ++sourcesDone;
    emitPercent( 100*numSources/sourcesDone );

    if( speed < 0 ) {
      success = false;
      break;
    }
    else if( speed > 0 ) {
      // update the max speed
      maxSpeed = QMIN( maxSpeed, speed );
    }
      
    it.next();
  }

  if( m_canceled ) {
    emitCanceled();
    success = false;
  }

  if( success )
    kdDebug() << "(K3bAudioMaxSpeedJob) max speed: " << maxSpeed << endl;

  emitFinished( success );
}
Exemplo n.º 2
0
int main()
{
     
	//return 123;
	
	#ifdef SPEEDTEST
		return speedTest();
	#else 
		return selfTest();
	#endif
	
}
Exemplo n.º 3
0
int main(int argc, char *argv[])
{
    int randomReps = RANDOM_ACCESS_MAX_REPS;

    srand(time(NULL));

    output = fopen("results.csv", "w");
    cdrom_init(&cd);

    cdrom_open(&cd, "/dev/sr0");

    if(strcmp(argv[1], "speed") == 0)
    {
        speedTest(NULL);
    }
    else if(strcmp(argv[1], "random") == 0)
    {
        randomReps = atoi(argv[2]);

        if(randomReps <= RANDOM_ACCESS_MAX_REPS)
        {
            if(randomReps > 20)
            {
                randomAccessTest(randomReps, FALSE);
            }
            else
            {
                randomAccessTest(randomReps, TRUE);
            }
        }
        else
        {
            g_print("Too Many Reps\n");
        }
    }
    else if(strcmp(argv[1], "seek") == 0)
    {
        seekTest();
    }
    else
    {
        g_print("Usage: eaa (speed|random count)\n");
    }

    fclose(output);
    cdrom_close(&cd);

    return 0;
}
Exemplo n.º 4
0
int main(int argc, char* argv[])
{
    int testsignal = 0;
    bool runSpeedTest = false;
    bool connectAudio = false;
    std::vector<std::string> midiConnections;
    std::map<unsigned, unsigned> patchFromCmdline;

    struct option longopts[] = {
            { "testsignal", 1, 0, 't' },
            { "speedtest", 0, 0, 's' },
            { "connect-audio", 0, 0, 'C' },
            { "connect-midi", 1, 0, 'M' },
            { "patch", 1, 0, 'p' },
            { "help", no_argument, 0, 'h' },
            { 0, 0, 0, 0 } };
    int opt;
    while ((opt = getopt_long(argc, argv, "st:CM:p:h", longopts, 0)) != -1) {
        switch (opt) {
        case 't':
            testsignal = atoi(optarg);
            break;
        case 's':
            runSpeedTest = true;
            break;
        case 'C':
            connectAudio = true;
            break;
        case 'M':
            midiConnections.push_back(optarg);
            break;
        case 'p':
            unsigned channel, program;
            sscanf(optarg, "%u:%u", &channel, &program);
            patchFromCmdline[channel] = program;
            break;
        default:
        case 'h':
            printHelp();
            return 0;
        }
    }

    if (testsignal) {
        TGlobal::SampleRate = 44100;
        TGlobal::NyquistFrequency = TGlobal::SampleRate / 2;

        TAudioFileWriter fileWriter("testsignal.wav", 2, TGlobal::SampleRate);

        TFileAudioPort inputPortL("", TFileAudioPort::INPUT);
        TFileAudioPort inputPortR("", TFileAudioPort::INPUT);
        TAudioPortCollection inputPorts( { &inputPortL, &inputPortR });
        TFileAudioPort intOutPort1("/dev/null", TFileAudioPort::OUTPUT);
        TFileAudioPort intOutPort2("/dev/null", TFileAudioPort::OUTPUT);
        TFileAudioPort intOutPort3("/dev/null", TFileAudioPort::OUTPUT);
        TFileAudioPort intOutPort4("/dev/null", TFileAudioPort::OUTPUT);
        TAudioPortCollection intOutPorts( { &intOutPort1, &intOutPort2,
                &intOutPort3, &intOutPort4 });
        TAudioPortCollection outputPorts = fileWriter.GetPorts();

        TJackSynth synth(inputPorts, outputPorts, intOutPorts);

        switch (testsignal) {
        case 1:
            testSignalSawSweep(synth);
            break;
        case 2:
            testSignalFilterSweep(synth);
            break;
        case 3:
            testSignalDelay(synth);
            break;
        case 4:
            testSignalReverb(synth);
            break;
        }
    }
    else if (runSpeedTest) {
        speedTest();
    }
    else {
        signal(SIGINT, sigterm);
        signal(SIGTERM, sigterm);
        runInJack(connectAudio, midiConnections, patchFromCmdline);
    }
    return 0;
}
Exemplo n.º 5
0
int main(int argc, char* argv[]) {
    /* XXX add support for command line test type specification */
    speedTest(); 
    return 0; 
}
int main(int argc, char* argv[])
{
    if(argc >= 2)
        speedTest(argv[1]);
    return 0;
}
Exemplo n.º 7
-1
int main (void)
{
  printf ("Raspberry Pi wiringPi GPIO speed test program\n") ;
  printf ("=============================================\n") ;

// Start the standard way

  printf ("\nNative wiringPi method: (%8d iterations)\n", FAST_COUNT) ;
  wiringPiSetup () ;
  pinMode (7, OUTPUT) ;
  speedTest (7, FAST_COUNT) ;

// GPIO

  printf ("\nNative GPIO method: (%8d iterations)\n", FAST_COUNT) ;
  wiringPiSetupGpio () ;
  pinMode (7, OUTPUT) ;
  speedTest (7, FAST_COUNT) ;

// Phys

  printf ("\nPhysical pin GPIO method: (%8d iterations)\n", FAST_COUNT) ;
  wiringPiSetupPhys () ;
  pinMode (7, OUTPUT) ;
  speedTest (7, FAST_COUNT) ;

// Switch to SYS mode:

  system ("/usr/bin/gpio export 7 out") ;
  printf ("\n/sys/class/gpio method: (%8d iterations)\n", SLOW_COUNT) ;
  wiringPiSetupSys () ;
  speedTest (7, SLOW_COUNT) ;

  return 0 ;
}