Re: [linux-audio-dev] Total latency measurement tool

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Total latency measurement tool
From: Paul Barton-Davis (pbd_AT_Op.Net)
Date: su marras 07 1999 - 14:27:55 EST


1) Diffs enclosed below to allow use with something other than /dev/dsp.
   A pet peeve of mine - too many programs assume that you only have
   one soundcard :)

2) the README should probably make it clearer that to use it
   out, you'll need a physical loopback cable. Neither my Tropez+ nor
   my Hoontech card can be set to record PCM output (I think).

*** al.c~ Sun Nov 7 11:17:45 1999
--- al.c Sun Nov 7 14:22:22 1999
***************
*** 241,247 ****
          int a, err = 0;
          int timeout = 200000;
  
! audiodev_init(&adev);
          adev.fragmentsize = 256;
          adev.fragments = 4;
  
--- 241,249 ----
          int a, err = 0;
          int timeout = 200000;
  
! audiodev_init(argv[1], &adev);
! argv++;
! argc--;
          adev.fragmentsize = 256;
          adev.fragments = 4;
  
*** include/audiodev.h~ Tue Nov 2 20:50:04 1999
--- include/audiodev.h Sun Nov 7 14:21:13 1999
***************
*** 13,25 ****
  
  struct audiodev_t
  {
          int outfd, infd;
          int mode;
          int rate;
          int fragmentsize;
          int fragments;
  };
! void audiodev_init(struct audiodev_t *ad);
  int audiodev_open(struct audiodev_t *ad);
  void audiodev_close(struct audiodev_t *ad);
  
--- 13,26 ----
  
  struct audiodev_t
  {
+ const char *devicename;
          int outfd, infd;
          int mode;
          int rate;
          int fragmentsize;
          int fragments;
  };
! void audiodev_init(const char *name, struct audiodev_t *ad);
  int audiodev_open(struct audiodev_t *ad);
  void audiodev_close(struct audiodev_t *ad);
  
*** audiodev.c~ Sun Nov 7 00:50:50 1999
--- audiodev.c Sun Nov 7 14:22:59 1999
***************
*** 17,25 ****
  #include <sys/types.h>
  #include "audiodev.h"
  
! void audiodev_init(struct audiodev_t *ad)
  {
! ad->mode = O_WRONLY;
          ad->rate = 44100;
          ad->fragmentsize = 256;
          ad->fragments = 4;
--- 17,26 ----
  #include <sys/types.h>
  #include "audiodev.h"
  
! void audiodev_init(const char *name, struct audiodev_t *ad)
  {
! ad->devicename = name;
! ad->mode = O_WRONLY;
          ad->rate = 44100;
          ad->fragmentsize = 256;
          ad->fragments = 4;
***************
*** 38,47 ****
                  fragmentshift = 4;
          printf(" Fragment size: %d bytes\n", 1<<fragmentshift);
  
! ad->outfd = ad->infd = open("/dev/dsp", ad->mode);
          if(ad->outfd < 0)
          {
! fprintf(stderr, "ERROR: Failed to open audio device!\n");
                  return -1;
          }
  
--- 39,49 ----
                  fragmentshift = 4;
          printf(" Fragment size: %d bytes\n", 1<<fragmentshift);
  
! ad->outfd = ad->infd = open(ad->devicename, ad->mode);
          if(ad->outfd < 0)
          {
! fprintf(stderr, "ERROR: Failed to open audio device %s!\n",
! ad->devicename);
                  return -1;
          }
  


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:28:00 EST